audit-agents
Audit or rewrite AGENTS.md so it holds only lasting principles. Run it only when the user…
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for
$ npx -y skills add dzhng/skills --skill close-spec --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/close-specContext preview
The summary Claude sees to decide when to auto-load this skill.
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for
name: close-spec description: When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
A spec is a **build plan** while you're building and a **rationale record** once you've shipped. Closing flips it from one to the other. The plan was a ladder of slices and predictions; the record is the layer of meaning the code can't hold — why this exists, what it must never break, what you tried that failed. The code is the single source of truth for *how*; the closed spec is the source of truth for *why*, and a map into the code.
Do not summarize the implementation. Anyone can read the code. If a paragraph restates what a function does, cut it and point at the function instead.
1. **Confirm it shipped.** The feature is merged or working in-tree and its tests/screenshot gates are green. If slices remain unverified, it isn't done — finish or [review](../review/SKILL.md) first.
2. **Diff plan against reality.** Read the spec's README and slices, then read what actually landed. Note every place the build diverged from the plan: dropped slices, renamed seams, a mechanic that turned out different, an assumption that broke. The divergences are the most valuable thing to record — they're exactly what a future reader would otherwise re-derive.
3. **Move it.** `specs/<feature>/` → `specs/done/<feature>/` (use `git mv`). Single-file specs: `specs/<feature>.md` → `specs/done/<feature>.md`.
4. **Rewrite the README as a record**, not a plan. Keep:
present tense ("the economy settles monthly"), not future ("will add").
the constraints and trade-offs that forced the shape. This is the part the code cannot tell you.
honoring. What must stay true; what would silently break if violated.
paths, and the tests that pin the behavior. Send the reader to the code for mechanics; name the entry points so they can find it in one grep.
re-walks them.
match, a comparison target, or inspiration for the look. These *are* the requirement: they say what "done" had to resemble and why the result took the shape it did. Keep them in-tree and reference them from the README, naming where each came from (a real screenshot, a mood board, a reference game) and what it was driving. Without them a reader sees the outcome but not the standard it was held to.
Cut: slice-by-slice build order, "next we will…", scaffolding instructions, per-slice verification checklists, and any prose that re-narrates code.
5. **Collapse the slices, preserve the imagery.** The slices were the build ladder; once shipped they're sediment. Fold anything durable (a divergence, a dead end, an invariant a slice established) into the README, then delete `slices/`. But **keep the baseline, comparison, and inspiration images** — the references the work was measured against — and the `visualizations/` or `assets/` that still help a reader judge the result. These are provenance, not scaffolding: discard a build instruction, never the picture that defined what the build was aiming at. Wire each one into the README's visual-provenance trail so the story of where the requirement came from survives the close.
6. **Fix references.** Update links that pointed at the old path. If `[[memory]]` notes or other skills referenced the spec, repoint them.
7. **Audit every statement, unbiased.** Spawn sub-agents that did not write the spec and lack the conversation, and have them check the final document claim by claim against the actual code and tests. Fan out — one agent per section, or split the claim list across agents — so no single biased pass waves it through. Each agent returns a verdict per statement:
say what the spec says? Flag stale names and wrong paths.
asserted? Flag claims the code contradicts or doesn't back.
no leftover "will"/"next"/slice numbers?
still exist in-tree, and does the README say where each came from and what it drove? Flag a result shown with no standard it was held to.
Treat unsupported, contradicted, or stale statements as defects: fix the spec (or the pointer) and re-audit the changed claims. The spec is not closed while any statement is unverified.
leave a pointer.
one thing worth keeping; add it.
it and say what it drove; the result is meaningless without the standard.
The spec lives u
AI skills for building software factories. My personal library of domain-agnostic agent skills, reused across every project.
Repo: dzhng/skills
Audit or rewrite AGENTS.md so it holds only lasting principles. Run it only when the user…
Eval and improve a skill against golden cases — run the target skill blind in a fresh,…
Create or revise agent skills. Use when adding a new skill file, renaming a skill,…
Audit the choices an implementing agent made, not its diff — a pure decision audit that…
Audit and prioritize performance work through bounded-work and forward-progress checks. Use…
Audit whether tests earn their maintenance cost and which suite owns each contract. Use when…