agent-stats
Skill3 starsChanged 9 days agoMITView on GitHub
Aggregate metrics.jsonl from all projects into a system-level summary of agent pipeline health: first-pass success rate, classification distribution, swarm outcomes, and health flags. Use when the user types /agent-stats, asks 'how is the agent pipeline doing', 'show me agent metrics', 'is Cyrus first-passing?', or wants to evaluate the system rather than a single ticket.
In this repository36 other files it gives its agents.
- aristotle-deconstructorSkill
- babysit-prsSkill
- briefingSkill
- code-auditorSkill
- core-editSkill
- create-jira-ticketSkill
- create-tech-specSkill
- cyrus-tdd-engineerSkill
- doctorSkill
- dotfiles-syncSkill
- forgeSkill
- google-docsSkill
- google-driveSkill
- grill-meSkill
- handoffSkill
- lessons-reviewSkill
- mermaid-diagramsSkill
- metrics-emitSkill
- obligationsSkill
- optimus-plannerSkill
- overlay-initSkill
- performance-reviewSkill
- pr-create-from-commitsSkill
- ranger-reviewerSkill
- record-demoSkill
- review-contextSkill
- review-respondSkill
- scout-reviewerSkill
- self-evaluateSkill
- smart-compactSkill
- smart-statuslineSkill
- swarm-retroSkill
- team-leadSkill
- ticket-pickupSkill
- ticket-swarmSkill
- to-prdSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Not a per-ticket view (use /swarm-retro for run-level analysis).
- Very specific: line 27
Not a real-time monitor — it reads the on-disk metrics.jsonl, which is updated by emitters at pipeline completion.
- Distinctive: line 28
Not a writer — it never modifies metrics, never promotes lessons, never opens PRs.
- Very specific: line 44
If the user names a project that does not match a directory under ~/.claude/tasks/, run anyway — the script will report "no events in …
- Distinctive: line 60
After the raw output, add a short interpretation only when there is something the numbers don't say outright:
- Distinctive: line 66
If the numbers speak for themselves, do not add interpretation.
- Distinctive: line 70
Only if a flag is actionable, suggest exactly one next command:
- Distinctive: line 78
Never suggest more than one.
- Very specific: line 99
All five are read by scripts/agent-stats.sh.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Stats — System-Level Pipeline Health
Render a summary of agent pipeline health from ~/.claude/tasks/<project>/metrics.jsonl files. The aggregation is read-only — no metrics are modified, no events are emitted.
This skill answers questions a staff/principal engineer asks about the system, not about a single run:
- What is Cyrus's first-pass success rate?
- How often does Optimus's plan need a CI-fix retry?
- What does the classification distribution look like — am I escalating too often?
- Are swarm runs converging or stalling?
When to Use
- The user types
/agent-stats. - The user asks "how is the agent pipeline doing?", "show me agent metrics", "is Cyrus first-passing?", "what's our first-pass rate?", or any system-level question that single-ticket views cannot answer.
- A briefing or scheduled job wants to surface a weekly health snapshot.
What It Is Not
- Not a per-ticket view (use
/swarm-retrofor run-level analysis). - Not a real-time monitor — it reads the on-disk
metrics.jsonl, which is updated by emitters at pipeline completion. - Not a writer — it never modifies metrics, never promotes lessons, never opens PRs.
Workflow
Step 1: Resolve scope
Parse the user's invocation for filters:
| User says | Args |
/agent-stats (no args) | All projects, last 30 days |
/agent-stats --project <name> | One project, last 30 days |
/agent-stats --days 7 | All projects, last 7 days |
| "agent stats for the last week" | All projects, --days 7 |
| "how is dotfiles doing" | --project dotfiles, default 30 days |
If the user names a project that does not match a directory under ~/.claude/tasks/, run anyway — the script will report "no events in window" cleanly.
Step 2: Run the aggregator
Invoke the script:
bash "$(readlink ~/.claude/skills/agent-stats)/../../../scripts/agent-stats.sh" [--project <name>] [--days <N>]The script lives at scripts/agent-stats.sh in the dotfiles-core repo, which is not itself symlinked into ~/.claude/ — resolving through this skill's own symlink locates it regardless of where the repo is checked out.
The script's output is plain text designed to be copy-pasted as-is. Do not reformat it. Do not summarize it. Display the raw output.
Step 3: Add interpretation, only if signal warrants it
After the raw output, add a short interpretation only when there is something the numbers don't say outright:
- If the script raised health flags: name the most likely cause based on what the user has been working on recently. Example: "First-pass rate dropped — your last 3 swarm runs were on the auth-rewrite branch, which is the most architecturally novel work this month."
- If sample size is small: say it once, then stop. Don't editorialize on noisy data.
- If first-pass rate is high (≥85%) and stable: a one-liner acknowledging it. Healthy systems deserve a sentence too.
If the numbers speak for themselves, do not add interpretation. The script's output is sufficient.
Step 4: Suggest one next step (optional)
Only if a flag is actionable, suggest exactly one next command:
| Flag | Suggested next step |
| First-pass rate <60% on Medium tickets | "Type: Retro, analyze my last swarm" — find which classifications are misrouting |
| CI fix attempts > pipeline count | "Type: Cyrus, audit the last 3 failed CI runs" — surface the recurring failure |
| No events in window | "Type: Pickup PROJ-NNNN" — start a pipeline to populate metrics |
Never suggest more than one. The user is reading a dashboard, not running a triage.
Failure Modes
| Scenario | Behavior |
jq not installed | Script exits 0 with a one-line warning. Surface the warning verbatim. |
~/.claude/tasks/ does not exist | Script prints onboarding text. Surface verbatim. |
| Metrics file exists but is empty | Treated as "no events in window". Surface verbatim. |
| Schema drift (events missing required fields) | jq filters skip them silently. The dashboard shows fewer events than were on disk; this is acceptable for a dashboard, not for the schema validator (which is emit-metric.sh's job, not this skill's). |
Schema Reference
This skill consumes events defined in ~/.claude/evals/schemas/metrics-event.schema.json. The five event types it reads:
pipeline_complete— emitted bycyrus-tdd-engineerandticket-pickup. Contributes to first-pass and CI-fix metrics. Events withoutcome: advisory(a correct no-code answer) are counted on their own line and excluded from the first-pass denominator.ticket_classified— emitted byticket-pickupafter the classification gate. Contributes to classification distribution.swarm_complete— emitted byticket-swarmat run end. Contributes to swarm outcomes.multi_repo_split— emitted byticket-pickupon multi-repo detection. Contributes to the Multi-Repo Splits section: counts split bymodeandgate_choice, plus the notice-vs-gate ratio — the detection false-positive denominator.review_round_posted— emitted byreview-respondonce per posted or updated review-round summary. Contributes to the Review Rounds section: the total and the split byaction(postvsupdate).
All five are read by scripts/agent-stats.sh. If a new event type beyond these is added to the schema, this skill will silently ignore it until the script is updated. That is intentional — the dashboard prefers stability over completeness.
Responsibility Boundaries
<!-- BEGIN RESPONSIBILITY BOUNDARIES --><!-- EXTRA_ROWS: agent-stats -->| Agent | Sole responsibility | NEVER does |
| Agent Stats | Aggregate metrics.jsonl files into a read-only summary; surface health flags | Modify metrics, emit events, promote lessons, open PRs, run pipelines |
| Aristotle | Strategic analysis — assumptions, first principles, highest-leverage direction | Name file paths, produce code, plan execution, review PRs |
| Optimus | Execution planning — file paths, step sequencing, risk assessment, architecture | Write code, make file edits, run commands, re-litigate upstream strategic decisions, review PRs |
| Cyrus | TDD implementation — write tests first, then code, hit 80%+ coverage | Redesign architecture, question strategic direction, skip tests, review PRs |
| Ranger | Staff-level PR review — analyze diffs, score issues, report findings | Write code, make edits, implement fixes, plan architecture, perform strategic analysis |
| Scout | PR review — analyze diffs, score issues, report findings | Write code, make edits, implement fixes, plan architecture, perform strategic analysis |
| Auditor | Code complexity analysis, reviewer routing | Write code, review code, post to GitHub, implement fixes |
<!-- END RESPONSIBILITY BOUNDARIES -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

