{"slug":"productivity-score","title":"productivity-score","summary":"Calculate a productivity score using actual Agent Monitor metrics — session completion rates, cache efficiency (cache_read vs input), compaction pressure (baseline tokens), turn velocity (turn_count / total_turn_duration_ms), tool success ratio (PreToolUse vs PostToolUse), and th","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-07T18:38:57.259846Z","repo":{"url":"https://github.com/hoangsonww/Claude-Code-Agent-Monitor","stars":1014,"forks":238,"license":"MIT","updatedAt":"2026-09-24T18:17:15Z"},"bodyHtml":"<hr>\n<h2>name: productivity-score\ndescription: &gt;\nCalculate a productivity score using actual Agent Monitor metrics —\nsession completion rates, cache efficiency (cache_read vs input),\ncompaction pressure (baseline tokens), turn velocity (turn_count /\ntotal_turn_duration_ms), tool success ratio (PreToolUse vs PostToolUse),\nand the workflow intelligence API's complexity and effectiveness scores.</h2>\n<h1>Productivity Score</h1>\n<p>Calculate a productivity scorecard from the Agent Monitor's real data.</p>\n<h2>Input</h2>\n<p>The user provides: <strong>$ARGUMENTS</strong></p>\n<p>Options: \"today\", \"this week\", \"last 30 days\", a session ID, or \"compare\" for period comparison.</p>\n<h2>Data Sources</h2>\n<table>\n<thead>\n<tr>\n<th>Endpoint</th>\n<th>Returns</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>GET /api/analytics</code></td>\n<td>Token totals (<code>total_input</code>, <code>total_output</code>, <code>total_cache_read</code>, <code>total_cache_write</code> — baselines pre-summed), tool_usage top 20, daily_events/sessions, event_types, sessions_by_status, agents_by_status, avg_events_per_session, total_subagents</td>\n</tr>\n<tr>\n<td><code>GET /api/sessions?limit=100</code></td>\n<td>Sessions with metadata JSON: <code>thinking_blocks</code>, <code>turn_count</code>, <code>total_turn_duration_ms</code>, <code>usage_extras</code> (service_tier, speed, inference_geo)</td>\n</tr>\n<tr>\n<td><code>GET /api/pricing/cost</code></td>\n<td>Total cost with per-model breakdown</td>\n</tr>\n<tr>\n<td><code>GET /api/workflows/{sessionId}</code></td>\n<td>11 workflow datasets: stats, orchestration, toolFlow, effectiveness, patterns, modelDelegation, errorPropagation, concurrency, complexity, compaction, cooccurrence</td>\n</tr>\n</tbody>\n</table>\n<h2>Score Components (each 0–100)</h2>\n<h3>1. Completion Rate (20% weight)</h3>\n<p>From <code>sessions_by_status</code>:</p>\n<ul>\n<li><code>completed / (completed + error + abandoned) × 100</code></li>\n<li>Bonus for high completed-to-active ratio</li>\n<li>Penalty for abandoned sessions (wasted work)</li>\n</ul>\n<h3>2. Token Efficiency (20% weight)</h3>\n<p>From analytics <code>tokens</code> (baselines are pre-summed into totals):</p>\n<ul>\n<li><strong>Cache hit rate</strong>: <code>total_cache_read / (total_cache_read + total_input) × 100</code>\n<ul>\n<li>Above 60% = excellent, below 30% = poor</li>\n</ul>\n</li>\n<li><strong>Output concentration</strong>: <code>total_output / total_input</code> — 0.3–0.8 is balanced</li>\n</ul>\n<h3>3. Tool Effectiveness (20% weight)</h3>\n<p>From <code>event_types</code>:</p>\n<ul>\n<li><strong>Success ratio</strong>: Count <code>PostToolUse</code> / Count <code>PreToolUse</code> — should be ~1.0; gap = tool failures</li>\n<li><strong>API error rate</strong>: Count <code>APIError</code> / total events — should be near 0</li>\n<li>From workflow <code>effectiveness</code> data: subagent completion rates, task success per type</li>\n</ul>\n<h3>4. Velocity (20% weight)</h3>\n<p>From session metadata:</p>\n<ul>\n<li><strong>Turns per session</strong>: average <code>turn_count</code> across sessions</li>\n<li><strong>Turn speed</strong>: average <code>total_turn_duration_ms / turn_count</code> — lower = faster</li>\n<li><strong>Events per session</strong>: from <code>avg_events_per_session</code> in analytics overview</li>\n<li><strong>Thinking depth</strong>: average <code>thinking_blocks</code> — more thinking = more thorough (neutral metric)</li>\n</ul>\n<h3>5. Cost Efficiency (20% weight)</h3>\n<p>From pricing:</p>\n<ul>\n<li><strong>Cost per completed session</strong>: <code>total_cost / completed_sessions</code></li>\n<li><strong>Cost trend</strong>: comparing current period to previous (decreasing = improving)</li>\n<li><strong>Model optimization</strong>: sessions using expensive models (Opus) for tasks subagents handle with Haiku/Sonnet</li>\n</ul>\n<h2>Overall Score</h2>\n<p>Weighted sum → letter grade:</p>\n<ul>\n<li><strong>A+</strong> (95-100), <strong>A</strong> (90-94), <strong>B+</strong> (85-89), <strong>B</strong> (80-84), <strong>C+</strong> (75-79), <strong>C</strong> (70-74), <strong>D</strong> (60-69), <strong>F</strong> (&lt;60)</li>\n</ul>\n<h2>Output Format</h2>\n<pre><code>═══════════════════════════════════════\n  PRODUCTIVITY SCORE: 87/100 (B+)\n═══════════════════════════════════════\n  Completion Rate   ████████░░  80/100\n  Token Efficiency  █████████░  92/100\n  Tool Effectiveness████████░░  85/100\n  Velocity          █████████░  88/100\n  Cost Efficiency   █████████░  90/100\n═══════════════════════════════════════\n</code></pre>\n<p>Then: top 3 strengths, top 3 improvement areas with actionable steps, and period comparison if available.</p>\n","files":[{"path":"agents/openai.yaml","sizeBytes":274,"isText":true},{"path":"SKILL.md","sizeBytes":3980,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-07T18:40:43.568447Z","sha256":"285FC4FD0E4565A3993AF65D2214AE9DC0ACAB98C5C772588C31A3C86955CA2F","sizeBytes":2081},"review":null,"source":{"repositoryUrl":"https://github.com/hoangsonww/Claude-Code-Agent-Monitor","path":"plugins/ccam-analytics/skills/productivity-score","license":"MIT","commit":"d130ebb498786c2b985a57e5c920ca781060b709","subtreeSha":"E9C1B10CBFFE7C4ABE3B71ABEE6D2BACF61E6D036C31DA8546540EB16BA6C339","lastSyncedAt":"2026-09-25T06:49:18.541012Z"},"reviewedAt":"2026-09-07T18:44:22.813974Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/master/plugins/ccam-analytics/skills/productivity-score"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install hoangsonww-claude-code-agent-monitor@llmmart"},{"target":"git","command":"git clone https://github.com/hoangsonww/Claude-Code-Agent-Monitor.git"}]}