/spwf:retrospectivefrom spwf
Post-ship orchestrator — Seven-part retrospective after completing a change. (1) Extract learnings from commits via learn-from-mistakes. (2) Audit the current change's OpenSpec artefacts against what was actually built. (3) Broad doc-lint pass. (4) workflow-lint sweep. (5) Recap — teaching summary for the human (default on, one-key skip). (6) Understand — comprehension interview so you know where to look when it breaks later (default on, one-key skip). (7) Changelog — release notes (default off, opt-in for releases). Called as a step by /spwf:close, which is why Claude may invoke it. Do not start it unprompted: run it standalone only when the user asks.
Ships in spwf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three-part post-ship retrospective for the completed change.
Part 1 → learn-from-mistakes (extract learnings from recent commits)
Part 2 → change spec audit (align OpenSpec artefacts with what was built)
Part 3 → doc-lint (broad project docs drift check)
Part 4 → workflow-lint (full golden path coherence sweep)
Part 5 → recap (teaching summary for the user; default on, one-key skip)
Part 6 → understand (comprehension interview; default on, one-key skip)
Part 7 → changelog (release notes; default off, opt-in for releases)
Not all work goes through OpenSpec. A direct fix against a ticket, or a hotfix, still deserves a retrospective. Never halt just because there is no OpenSpec change. Work out the mode first:
| Situation | Mode |
|---|---|
$ARGUMENTS is a change-id, or one resolves from the branch or recent work | Change mode: all parts, as written below |
| No OpenSpec change (direct fix, ticket key, hotfix branch) | Commit-range mode |
In commit-range mode, resolve the range in this order: an explicit range or
branch in $ARGUMENTS; the current branch against base; commits matching a
ticket key (git log --grep '{KEY}'); otherwise ask. Then:
| Part | Commit-range mode |
|---|---|
| 1 learn-from-mistakes | Run, with the range |
| 2 change spec audit | Skip. Say: No OpenSpec change — spec audit skipped. |
| 3 doc-lint, 4 workflow-lint | Run as normal |
| 5 recap | Skip. recap needs a change-id. Say so in one line |
| 6 understand | Offer as normal, passing the branch or commit range (understand accepts either) |
| 7 changelog | Offer as normal |
Head the report ## Retrospective: {ticket or branch} (no OpenSpec change).
Invoke spwf:learn-from-mistakes:
Check whether the OpenSpec artefacts for the just-completed change still accurately describe what was built. Implementation always diverges from spec in small ways; this step closes the gap.
If $ARGUMENTS contains a change-id, use it. Otherwise detect from context (most recently completed change) or ask.
Confirm all tasks in tasks.md are [x] before proceeding.
Read in order:
openspec/changes/{change-id}/proposal.md — Why and What Changesopenspec/changes/{change-id}/design.md — decisions and rationale (if exists)openspec/changes/{change-id}/tasks.md — the full task historyopenspec/changes/{change-id}/specs/*/spec.md — requirements and scenariosRead the test files written during the build phase. The tests are the ground truth for what was actually built — compare what they assert against what the specs require.
| Drift type | Description |
|---|---|
| Undocumented decision | Implementation made a choice not captured in design.md |
| Scope drift | What was built differs from what proposal.md describes (expanded or contracted) |
| Orphaned requirement | A spec scenario has no corresponding test |
| Stale task | A task description no longer describes what was actually implemented |
| Evolved rationale | A design decision's rationale changed during implementation but wasn't updated |
For each drift item, propose a minimal surgical update to bring the artefact back into alignment. Do not rewrite — one sentence changes preferred. Present for approval before applying.
Invoke spwf:doc-lint:
docs/ for naming, metadata, staleness, and structural issuesIf docs/documentation-rules.md does not exist, note this and skip rather than failing.
Invoke spwf:workflow-lint:
This is a full sweep. Do not scope it to the current change only — the point is to catch drift that accumulated across multiple changes.
Default on, one-key skip. Ask:
Generate recap? [Y/n]
Pressing enter accepts. If the user says "n" / "no", skip and note "Part 5 skipped (recap declined)" in the retrospective report.
If yes, invoke spwf:recap with the change-id passed explicitly and a marker
indicating Part-5 invocation (so the skill renders at #### heading depth
nested under ### Part 5 — Recap). The recap mines five sources (todo file,
proposal, design, specs, git log) and produces 5 sections: What changed,
Concepts touched, Decisions, What surprised us, Read next. Anti-padding rules
ensure empty sections are skipped rather than filled.
After the recap is printed, the skill offers to save it to
openspec/changes/{change-id}/recap.md (default no). If saved, the file
travels with the change into the OpenSpec archive automatically when close
runs opsx:archive later.
This is distinct from learn-from-mistakes in Part 1: that captures rules
for the project (added to docs/); this captures takeaways for the user
(printed in-session, optionally saved).
Default on, one-key skip. Where Part 5 explains the change, this asks you about it — so that when the change misbehaves months from now, you have an instinct for where to look.
Name something specific about this change in the prompt. A generic offer gets reflexively declined; one that says what is actually at stake does not. Draw the specifics from the structural picture (areas new to this change, new dependencies, changed interfaces):
Part 6 — Understand what you just shipped
This change touched 3 areas you haven't worked in before (the export queue,
the retry wrapper, the new S3 client). Ten minutes now means knowing where
to look when one of them misbehaves later.
Run it? [Y/n] (or later: /spwf:understand {change-id})
Pressing enter accepts. If the user says "n" / "no", skip and note
"Part 6 skipped (understand declined)" in the retrospective report — then
continue to Part 7, and surface that /spwf:understand {change-id} still
works later. Declining is not a failure state.
If yes, invoke spwf:understand with the change-id passed explicitly and a
marker indicating Part-6 invocation (so the skill renders at #### heading
depth nested under ### Part 6 — Understand). The skill reads the change's
structure, triages 3–5 changes worth interviewing on, asks one question at a
time at orientation depth, and produces an orientation note. It then offers to
save to openspec/changes/{change-id}/understanding.md and updates
.spwf/learner.md.
This is distinct from Part 5. recap covers what changed and why;
understand covers consequence and navigation. The skill is required not to
re-ask what recap just explained — asking about material read ninety seconds
ago tests short-term memory, not understanding.
Standalone-later is the stronger mode, and the prompt should not pretend otherwise: spaced retrieval beats immediate retrieval. This hook exists so the option is visible while the change is on the user's mind, not because close is the pedagogically optimal moment.
Only run this part if the user is preparing a release. Ask explicitly before proceeding:
Preparing a release? Run /spwf:changelog to generate a changelog section from these commits? (yes / no)
If yes, invoke spwf:changelog. The skill will:
CHANGELOG.mdIf no, skip silently — the retrospective report notes "Part 7 skipped (no release)".
## Retrospective: {change-id}
### Part 1 — Learnings
{summary from learn-from-mistakes}
### Part 2 — Spec alignment
{✓ No drift | list of drift items with proposed fix for each}
### Part 3 — Doc quality
{✓ Clean | summary of doc-lint findings}
### Part 4 — workflow-lint
{✓ Coherent | P1/P2/P3 findings from workflow-lint}
### Part 5 — Recap
{skipped (declined) | full recap inline as #### sub-sections; "✓ Saved to {path}" or "— Not saved" footer}
### Part 6 — Understand
{skipped (declined) | full orientation note inline as #### sub-sections; "✓ Saved to {path}" or "— Not saved" footer; "✓ Ledger updated" line}
### Part 7 — Changelog
{skipped (no release) | ✓ CHANGELOG.md updated — v{version}, {N} entries}
### Recommended actions
- [ ] {update design.md: undocumented decision — X}
- [ ] {update spec scenario Y: test asserts Z, spec says W}
- [ ] {docs/path/to/file.md: staleness warning — last reviewed N months ago}
- [ ] {workflow-lint P1: stale name in skill body — X}
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub simon-potter/spwf --plugin spwf38 skills in this plugin
/address-reviewPhase 6.5 — Address Review. Turn review feedback into action. Sources feedback from either a local report file (e.g. {branch}-review.md from /spwf:pr-review or {branch}-self-review.md from /spwf:simplify) or fetched human comments on an open PR/MR. For each item runs READ → VERIFY → EVALUATE → implement-or-push-back, in priority order (blocking → important → nit). Forbids performative agreement ("you're absolutely right"). Use after pr-review, or whenever a reviewer leaves comments./agent-optimiseCross-cutting — Audit both the project .claude/ and personal ~/.claude/ for quality issues. Covers CLAUDE.md scope and length, agent descriptions, skill frontmatter, and settings.json conflicts. Always audits both scopes. Produces a prioritised P1/P2/P3 fix list./approve-planPhase 2 — Approve plan. Reviews the task list from spec for quality (atomicity, testability, clarity), then applies four adversarial lenses (Skeptic, Architect, Minimalist, Security) as advisory input for the human reviewer. Quality issues are blocking; adversarial findings are advisory. Security lens identifies tasks touching auth, billing, user input, or secrets so the builder has explicit awareness before writing those tasks. Presents everything for explicit human go/no-go before building starts./branch-rescueRecovery skill — moves commits that landed on the base branch onto a proper feature branch and resets local base, without touching origin. Resolves the active OpenSpec change, detects the pre-spec base commit (subject-line grep with manual-confirm fallback), performs three local-only safe git operations, and surfaces the force-push command for the user to run manually. Run standalone; pr-create's rescue offer runs the same procedure inline (_shared/branch-management.md §4), because this skill is user-only./briefPhase 1.5 — Explain a planned change before it is built. Runs between spec and approve-plan, so a mismatch costs a conversation rather than a change. Five sections, expanding then summarising — what will be built, why this way, the choices you didn't make, what it touches, and a short summary. Never blocks: it prints, offers one skippable prompt, and returns. Calibrated via .spwf/learner.md. Companion to recap and understand, which teach after the fact; this teaches before. Runs on changes, not bug fixes./buildPhase 3 orchestrator — Full Red-Green-Refactor cycle. For each pending task: invokes write-tests (Red: write failing tests), then opsx:apply (Green: implement via OpenSpec), then run-tests (Verify: confirm green before moving on). Loops until all tasks complete. After all tasks complete, runs opsx:verify (spec sign-off), then recommends simplify (Refactor).