/spwf:learn-from-mistakesfrom spwf
Post-ship — Extract learnings from recent commit history and transfer them to project documentation. Based on the "strike while it's hot" principle — knowledge in commit messages should be preserved before context fades. Use after shipping or completing a significant branch. Called as a step by /spwf:retrospective (Part 1), 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.
Extract learnings from commit history and transfer them to project documentation. Knowledge captured in commit messages should be preserved in long-term docs before context fades.
/spwf:learn-from-mistakes [base-branch]
base-branch — the branch to compare against (default: main)
MERGE_BASE=$(git merge-base HEAD main)
git log --oneline $MERGE_BASE..HEAD
git log --stat $MERGE_BASE..HEAD
If on the base branch, compare against the last 10 commits or ask for a range.
git log --format="=== COMMIT %h ===\n%B\n" $MERGE_BASE..HEAD
git log --name-status $MERGE_BASE..HEAD
For each commit, extract:
Issue patterns — problems discovered and fixed:
Root causes — why the issue existed
Solutions — what fixed it (specific commands, config changes, code patterns)
Operational learnings — things that help run the system
Standards identified — patterns that should be applied broadly
Skip trivial changes: "fix typo", "update version", formatting.
Group extracted knowledge by where it belongs:
| Category | Target |
|---|---|
| Operational procedures | docs/operations/runbook.md |
| Troubleshooting patterns | docs/operations/troubleshooting/{topic}-gotchas.md |
| Deployment issues | docs/deployment/guide.md |
| Architecture decisions | docs/architecture/overview.md |
| Coding standards | docs/engineering/standards.md |
Create a {topic}-gotchas.md file when multiple commits address the same non-obvious area.
Before writing, read the relevant existing docs to:
Updating: Use Edit tool to add new sections. Maintain existing structure.
Creating: Only create if there is substantial content that doesn't fit elsewhere. Include a clear purpose statement at the top.
## Knowledge Extracted from Commits
### Commits Analysed
- {hash}: {subject}
...
### Knowledge Transferred
**Updated: {file}**
- Added: "{section name}"
**Created: {file}**
- New file covering: {topic}
### Not Documented (manual review needed)
- {commit}: {reason — e.g., trivial change, no extractable knowledge}
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).