From sdd-engineering
Post-run retrospective of the multi-agent SDD pipeline (spec-creator → implementation-planner → implementer / test-writer → architecture-reviewer / plan-verifier, plus nested researcher/Explore agents). Manually invoked after a run to produce TRUE token/tool/duration/parallelism metrics — deep mode parses session + subagent journals from disk because parent-visible usage EXCLUDES subagent tokens — plus insights with concrete optimization actions, a trend row appended to the retro ledger (default docs/retros/ledger.md), and an audit verdict. Trigger terms: workflow retro, retro, ретро, retrospective, pipeline metrics, agent token usage, cache hit, parallelism, як пройшов конвеєр.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd-engineering:workflow-retroThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Retrospective of how a multi-agent pipeline run ACTUALLY went: metrics → insights →
Retrospective of how a multi-agent pipeline run ACTUALLY went: metrics → insights → concrete actions → trend ledger → audit verdict. Manual invocation only (no hook).
Output locations are default conventions the caller may override: reports and the
ledger go to docs/retros/ unless the invocation names another retro directory.
<usage> does NOT include its subagents' tokens, so anything
measured in-context undercounts the run (often by 5–10×).~/.claude/projects/<slug>/ where <slug> = absolute repo path with
every non-alphanumeric char replaced by -. The CURRENT session id is the UUID segment
of your scratchpad path. Journals live on the HOST filesystem — run the script with the
host machine's Python, not from inside a container/VM shell that cannot see the host home
directory.python ${CLAUDE_SKILL_DIR}/scripts/retro_metrics.py --session <uuid-or-prefix>
--list first (newest first, shows each session's agent types),
pick the session whose agent_types match the pipeline, confirm with the user if ambiguous.--session → latest session that has subagent journals.message.id), cache_hit_pct, api_turns,
tool_calls_by_tool, tool_errors, skills_loaded, writes_paths, start/end/duration,
parent + spawn_depth (nesting tree); plus totals, parallelism (wall-clock,
Σ agent time, parallel factor, max concurrent, timeline) and duplicate_reads
(same file Read by several journals — context-duplication leads).The script gives leads; verify them by opening journals selectively (Grep/offset reads of
<project-dir>/<session>/subagents/agent-<id>.jsonl) — never read whole journals into context.
duplicate_reads → files several agents each re-read = context-pack candidates: pre-fetch
them into the spawn prompt's shared context pack instead of letting every agent re-read them.tool_errors > 0 → grep that journal for is_error neighborhoods; classify: environment
quirk / brief gap / permission wall / model flailing.cache_hit_pct (< ~60 %) on a long agent → prompt churn; consider a stable shared prefix.parallel_factor ≈ 1 while plan slices were disjoint → orchestrator ran them serially;
overlapping writes_paths between concurrent agents → slices were NOT disjoint.output_tokens on a read-only agent → report bloat; tighten its output contract.<retro dir>/<YYYY-MM-DD>-<short-slug>.md (default
docs/retros/):
.claude/agents/<agent>.md or the owning plugin's
agent definition), pre-fetch a shared file into the spawn-prompt context pack,
merge/split agents, change concurrency, or change a model/effort/skills:
frontmatter setting.docs/retros/ledger.md; create it with the header
below if missing — check-before-create). Tokens = totals.orchestrator_plus_agents;
wall/Σ/∥ from parallelism.sdd-engineering:engineering-insights skill to append it to the host project's
docs/engineering-insights.md.Ledger header (first line of a fresh ledger file):
# Pipeline run ledger
> One row per retro'd run; append-only. Tokens include orchestrator + ALL subagents.
| date | session | run | agents | in | out | cache-read | hit% | tools | err | wall | Σ agents | ∥max | factor | top action | report |
|------|---------|-----|--------|----|-----|------------|------|-------|-----|------|----------|------|--------|------------|--------|
Row example: | 2026-07-04 | 9e4e3df5 | spec: PDF export | 3 (spec-creator+2×Explore) | 29.1k | 67.1k | 3.40M | 88% | 115 | 3 | 8m42s | 11m39s | 3 | 1.34 | pre-fetch shared UI files | [retro](2026-07-04-spec-pdf-export.md) |
message.id with CUMULATIVE
usage; the script dedupes (per-field max per id). Never sum raw lines yourself.Agent toolUseResult records only agentId/status/resolvedModel —
no token totals. Subagent journals are the only usage source.subagents/agent-<id>.meta.json = {agentType, description, name?, toolUseId, spawnDepth};
nested agents (depth ≥ 2) sit FLAT in the same session's subagents/, parented by finding
which journal contains the tool_use block with that toolUseId (the script does this).Get-Content default encoding mangles non-ASCII text — use
the script or explicit UTF-8 reads.duration_s = first→last journal line. An agent resumed via SendMessage keeps ONE
journal, so its duration INCLUDES the idle gap between passes (a "146m" implementer was
≈25m of work + ~2h idle) — treat sum_agent_duration_s and parallel_factor as skewed
bounds whenever any agent was resumed, and say so in the report.Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
npx claudepluginhub syukpublic/dev-digest-ai-marketplace --plugin sdd-engineering