Agent health
Skill tranhieutt/software_development_department/.claude/skills/agent-health
Reads production/traces/agent-metrics.jsonl and displays a per-agent performance summary table for the current or a specified session. Highlights agents with high error rates or OPEN circuit breaker state.From its SKILL.md
npx -y skills add tranhieutt/software_development_department --skill agent-healthAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- runs commandsInstructs the agent to run 1 command, including `git branch --show-current`.
SKILL.md
5.5 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
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 session
Circuit 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 resolved
How 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-09
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.