hoangsonww/productivity-score
> 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 the workflow intelligence API's complexity and effectiveness scores.
npx skills add https://github.com/hoangsonww/Claude-Code-Agent-Monitor --skill productivity-score
Calculate a productivity scorecard from the Agent Monitor's real data.
The user provides: $ARGUMENTS
Options: "today", "this week", "last 30 days", a session ID, or "compare" for period comparison.
| Endpoint | Returns |
|----------|---------|
| GET /api/analytics | Token totals (total_input, total_output, total_cache_read, total_cache_write — baselines pre-summed), tool_usage top 20, daily_events/sessions, event_types, sessions_by_status, agents_by_status, avg_events_per_session, total_subagents |
| GET /api/sessions?limit=100 | Sessions with metadata JSON: thinking_blocks, turn_count, total_turn_duration_ms, usage_extras (service_tier, speed, inference_geo) |
| GET /api/pricing/cost | Total cost with per-model breakdown |
| GET /api/workflows/{sessionId} | 11 workflow datasets: stats, orchestration, toolFlow, effectiveness, patterns, modelDelegation, errorPropagation, concurrency, complexity, compaction, cooccurrence |
From sessions_by_status:
completed / (completed + error + abandoned) × 100From analytics tokens (baselines are pre-summed into totals):
total_cache_read / (total_cache_read + total_input) × 100total_output / total_input — 0.3–0.8 is balancedFrom event_types:
PostToolUse / Count PreToolUse — should be ~1.0; gap = tool failuresAPIError / total events — should be near 0effectiveness data: subagent completion rates, task success per typeFrom session metadata:
turn_count across sessionstotal_turn_duration_ms / turn_count — lower = fasteravg_events_per_session in analytics overviewthinking_blocks — more thinking = more thorough (neutral metric)From pricing:
total_cost / completed_sessionsWeighted sum → letter grade:
═══════════════════════════════════════
PRODUCTIVITY SCORE: 87/100 (B+)
═══════════════════════════════════════
Completion Rate ████████░░ 80/100
Token Efficiency █████████░ 92/100
Tool Effectiveness████████░░ 85/100
Velocity █████████░ 88/100
Cost Efficiency █████████░ 90/100
═══════════════════════════════════════
Then: top 3 strengths, top 3 improvement areas with actionable steps, and period comparison if available.
Take hoangsonww/productivity-score from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.