From sdd-workflow
Post-mortem / retrospective for a multi-agent run. Run it AFTER a workflow finishes (/run-plan, the spec → plan → implement chain, a Workflow() fan-out, or any batch of sub-agents) to collect how the run actually went and turn it into actionable change. Gathers cost & resource metrics (tokens, cache efficiency, tool calls, durations, agent count, launch order, parallelism), reconstructs qualitative insights (what was hard, what was easy, what context was duplicated, what was missed), and ends with concrete recommendations (improve an agent's brief, pre-fetch a shared file once, merge or split agents, change concurrency). Outputs a full report to chat and appends one trend row to docs/retros/ledger.md. TRIGGER only when explicitly asked: "/workflow-retro", "retro this run", "workflow retrospective", "analyze that multi-agent run", "how did that workflow go". Does NOT cover: running the workflow itself, editing product code, pushing/merging.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd-workflow:workflow-retroThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Hand me a finished multi-agent run and I tell you what it cost, where it struggled, what
Hand me a finished multi-agent run and I tell you what it cost, where it struggled, what it wasted, and exactly what to change next time — then log a trend row so runs can be compared.
You are the analyst, running in the main session. The workflow already ran; your job is to look back at it. You read metrics and reports, reason about them, and produce a report plus recommendations. You do not re-run the workflow and you do not edit agent/skill definitions or product code — you recommend changes and, if the user says yes, that application is a separate follow-up step.
This skill is invoked by hand, on demand, after a run the user wants to review. There is no
hook and there must never be one: do not wire it to a Stop/SubagentStop/PreToolUse event,
do not chain it at the end of another skill or workflow, and do not register it in settings.json.
The user runs it explicitly when a run is worth reviewing. If you ever see it auto-triggering, that
is a bug — stop and tell the user.
A sub-agent can spawn its own sub-agents (e.g. spec-creator and implementation-planner hold
the Agent tool and fan out researchers; a Workflow() fans out many). These nested agents
consume real tokens and tool calls and must be included in the per-agent breakdown and in every
total.
<usage> block reports only the parent's
own tokens — it does not include its children's. So the in-context view of a run that used a
spawning agent undercounts the real cost (one observed run looked like "1 agent / ~75k" but
was really 5 agents — a spec-creator plus 4 nested researchers — at a far higher true total).subagents/, so a plain
agent-*.jsonl glob already includes every nesting level. Each journal has a sibling
<journal>.meta.json with agentType, description, and spawnDepth (1 = spawned by the
main session, > 1 = nested). The helper reads these, indents nested agents under their depth, and
sums all depths into the total.deep, or at minimum state in the report that the in-context totals exclude nested agents.| Token | Meaning | Default |
|---|---|---|
label:<slug> | Name for this retro (the run under review). | derived from the run / date |
deep | Parse the on-disk JSONL journals for exact token / cache / tool / timing data. | off (in-context metrics only) |
session:<id> | Which session transcript to analyse in deep mode. | the current session |
scope:last / scope:session | Review just the most recent agent batch, or every agent in the session. | last |
no-ledger | Print the report only; do not append a trend row. | off (ledger row is written) |
If it is ambiguous which run to review (several distinct batches in one session), ask before analysing — do not silently pick.
In-context (default). As orchestrator you saw every Agent result's <usage> block
(subagent_tokens, tool_uses, duration_ms), every <task-notification>, the launch order,
which agents were dispatched in the same message (parallel), and each agent's final report. This
is enough for a solid retro with zero file reads.
Deep (the deep flag). Parse the JSONL journals for exact, per-turn numbers
(input / output / cache-read / cache-creation tokens, tool-call counts, timestamps):
~/.claude/projects/<project-slug>/<session-id>/subagents/agent-*.jsonl~/.claude/projects/<project-slug>/<session-id>.jsonlpython3 .claude/skills/workflow-retro/scripts/analyze_journals.py \
"~/.claude/projects/<project-slug>/<session-id>/subagents/agent-*.jsonl" --json
nested= and
max_depth=). For a cost estimate pass --prices prices.json; do not hard-code prices —
confirm current per-model rates via the claude-api skill first, since they drift.Find the project slug / session id from the symlink targets under the session's tasks/
directory, or by matching the most recently modified *.jsonl under
~/.claude/projects/<project-slug>/.
Collect what you can; mark anything unavailable as n/a rather than guessing.
Cost & resources (quantitative)
Process & effectiveness
Qualitative insights
scope, or ask if
ambiguous). List them with their roles.deep, locate the journals and run the helper.
Build the per-agent table + totals.no-ledger, append one trend row to
docs/retros/ledger.md (create the file with a header if missing). Writing that ledger row —
and an optional full per-run file under docs/retros/ — is the only file write this skill
makes.Each recommendation names a target, a change, and the expected payoff. Examples of the shape:
implementer for T-3 needed 2 clarifying round-trips on owned paths — add the sibling
tasks' owned-paths to its dispatch brief." → fewer round-trips, less token churn.docs/architecture.md (~4k tokens ×3) — have the
orchestrator read it once and pass the relevant excerpt." → ~8k tokens saved per run.## Workflow Retro — <label>
**Run:** <what ran> · <N> agents · mode <multi|single> · data: <in-context | deep>
### Metrics
| agent | role | in | out | cache-read | hit% | tools | span | cost |
|-------|------|----|----|-----------|------|-------|------|------|
| … | … | … | … | … | … | … | … | … |
**Totals:** in <…> · out <…> · cache hit <…>% · tools <…> · wall <…>s · parallelism <…>x · cost <…>
**Launch order:** A → (B ‖ C) → D **Critical path:** <agent> (<…>s)
### What went well
- <…>
### What was hard / wasteful
- <difficulty / stall> — <evidence>
- <duplicated context> — <which agents, ~tokens>
- <what was missed> — <caught when / by whom>
### Recommendations (actionable)
1. <target> — <change> → <expected effect>
2. …
### Ledger
Appended to `docs/retros/ledger.md` (row: <date> · <label> · agents · tokens · cost · parallelism).
docs/retros/ledger.md)A single Markdown table; one row per retro so runs can be compared over time:
| date | label | agents | in→out tok | cache hit | wall | parallelism | cost | top recommendation |
|------|-------|--------|-----------|-----------|------|-------------|------|--------------------|
If no multi-agent run is identifiable in scope (e.g. invoked with nothing to review), or deep is
requested but the journals cannot be located, say so plainly and offer the in-context retro instead.
A clear "nothing to retro / journals not found, here's the in-context view" is a valid result — a
fabricated metric is not.
npx claudepluginhub burnjohn/ai-demo-marketplace --plugin sdd-workflowCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.