agent-health
Skill72 starsChanged 7 months agoMITView on GitHub
Display a performance summary table from production/traces/agent-metrics.jsonl, cross-referenced with production/session-state/circuit-state.json for live circuit breaker states. Get current branch: git branch --show-current. Read both files in parallel: If agent-metrics.jsonl contains only the schema header line (no actual entries): For each agent, compute across the filtered entries: Circuit state icons: - 🟢 CLOSED — healthy - 🟡 HALF-OPEN — recovering, monitor closely - 🔴 OPEN — bypassed, routed to fallback Flag agents as needing attention if: - circuit_state is OPEN or HALF-OPEN…
In this repository117 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-styleSkill
- angular-best-practicesSkill
- annotateSkill
- api-designSkill
- architecture-decision-recordsSkill
- aws-serverlessSkill
- backend-architectSkill
- backend-patternsSkill
- brainstormSkill
- bug-reportSkill
- changelogSkill
- claude-apiSkill
- cloud-architectSkill
- cloud-run-puppeteerSkill
- code-review-checklistSkill
- code-reviewSkill
- code-simplificationSkill
- codex-sddSkill
- commitSkill
- context-engineeringSkill
- database-architectSkill
- db-reviewSkill
- deep-interviewSkill
- design-reviewSkill
- design-systemSkill
- devops-deploySkill
- diagnoseSkill
- django-patternsSkill
- docker-patternsSkill
- dotnet-backend-patternsSkill
- dreamSkill
- drizzle-orm-expertSkill
- estimateSkill
- event-sourcing-architectSkill
- fastapi-proSkill
- fork-joinSkill
- freezeSkill
- frontend-designSkill
- frontend-patternsSkill
- frontend-ui-dark-tsSkill
- gate-checkSkill
- gemini-api-integrationSkill
- gitlab-ci-patternsSkill
- guardSkill
- handoffSkill
- hotfixSkill
- hybrid-cloud-architectSkill
- kubernetes-architectSkill
- laravel-patternsSkill
- launch-checklistSkill
- learnerSkill
- llm-app-patternsSkill
- localizeSkill
- map-systemsSkill
- map-workflowSkill
- markdown-injection-scannerSkill
- microservices-patternsSkill
- milestone-reviewSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Distinctive: line 33
Read both files in parallel:
- Very specific: line 38
If agent-metrics.jsonl contains only the schema header line (no actual entries):
- Very specific: line 91
If --log flag was passed, append one entry per active agent to production/traces/agent-metrics.jsonl:
- Distinctive: line 111
After the table, if any agents need attention:
- Very specific: line 126
Manual: Run /agent-health --log at end of session
- Very specific: line 127
Via
/save-state: When saving state with a task_id, metrics for the active agent are appended automatically
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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 Health
Display a performance summary table from production/traces/agent-metrics.jsonl,
cross-referenced with production/session-state/circuit-state.json for live
circuit breaker states.
Steps
1. Parse arguments
| Flag | Default | Description |
--session <branch> | current branch | Filter entries by session field |
--agent <name> | all | Show only this agent |
--since <date> | no limit | Only entries with date >= YYYY-MM-DD |
--log | false | If set, append a fresh metrics snapshot to agent-metrics.jsonl |
Get current branch: git branch --show-current.
2. Read data sources
Read both files in parallel:
production/traces/agent-metrics.jsonl— historical metrics per agent per sessionproduction/session-state/circuit-state.json— live circuit breaker states
If agent-metrics.jsonl contains only the schema header line (no actual entries):
📭 No agent metrics recorded yet for this session.
Metrics are written when agents use /agent-health --log
or at the end of a session via /save-state.
Circuit breaker states (live):
[show table from circuit-state.json only]3. Aggregate metrics
For each agent, compute across the filtered entries:
total_tasks=tasks_completed+tasks_failed+tasks_blockedsuccess_rate=tasks_completed / total_tasks * 100(0 if no tasks)error_rate= latesterror_ratefield valuecircuit_state= fromcircuit-state.json(live, not from log)
4. Render health table
🏥 Agent Health Report — session: <branch> · <date range>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Agent Tasks ✅ Done ❌ Failed ⛔ Blocked Success% Circuit
──────────────────────────────────────────────────────────────────────────────
backend-developer 8 7 1 0 87.5% 🟢 CLOSED
frontend-developer 5 5 0 0 100.0% 🟢 CLOSED
qa-engineer 6 4 2 0 66.7% 🟡 HALF-OPEN
data-engineer 2 2 0 0 100.0% 🟢 CLOSED
diagnostics 1 0 1 0 0.0% 🔴 OPEN
──────────────────────────────────────────────────────────────────────────────
TOTAL 22 18 4 0 81.8%
⚠️ Agents needing attention:
🔴 diagnostics — Circuit OPEN · fallback: surface to user
🟡 qa-engineer — Circuit HALF-OPEN · 2 failures this sessionCircuit state icons:
🟢 CLOSED— healthy🟡 HALF-OPEN— recovering, monitor closely🔴 OPEN— bypassed, routed to fallback
Flag agents as needing attention if:
circuit_stateisOPENorHALF-OPENsuccess_rate< 70%tasks_failed>= 2
5. Log snapshot (if --log)
If --log flag was passed, append one entry per active agent to
production/traces/agent-metrics.jsonl:
{"date":"<YYYY-MM-DD>","session":"<branch>","agent":"<agent>","tasks_completed":<N>,"tasks_failed":<N>,"tasks_blocked":<N>,"avg_tokens_est":<N>,"error_rate":<0.0-1.0>,"circuit_state":"CLOSED|OPEN|HALF-OPEN","notes":"<optional>"}Get circuit_state from circuit-state.json. Estimate avg_tokens_est from
decision ledger entry count × 800 tokens (rough estimate per entry) if no exact
token data is available. Note this is an estimate and mark with _est suffix.
Print after logging:
✅ Metrics snapshot logged → production/traces/agent-metrics.jsonl
[N] agents recorded · <date>6. Suggest actions
After the table, if any agents need attention:
💡 Suggested actions:
• /resume-from <task_id> — recover failed task checkpoint
• /trace-history --risk High — audit high-risk decisions
• Check circuit-state.json — update OPEN agents once issue resolvedHow metrics get into the file
Agents append entries in two ways:
- Manual: Run
/agent-health --logat end of session - Via
/save-state: When saving state with atask_id, metrics for the active agent are appended automatically
The file grows one JSON line per agent per session. Use --since to filter
to recent sessions and avoid reading stale data from weeks ago.
Quick examples
# Summary for current session
/agent-health
# Check one agent across all time
/agent-health --agent qa-engineer
# Log a fresh snapshot and view it
/agent-health --log
# Review last 7 days
/agent-health --since 2026-04-09Does 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.

