/wiki-sdd:tddfrom wiki-sdd
Implements a single ready-for-agent slice from a wiki user story using disciplined red-green-refactor with vertical tracer bullets. Reads Gherkin scenarios as test specs, glossary.md, and ADRs. Refuses horizontal slicing.
Ships in wiki-sdd. 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.
Take ONE ready-for-agent slice from a wiki story and implement it with the red-green-refactor loop. The story's Gherkin scenarios ARE the test specification — translate them directly into integration tests.
WIKI_SCOPE: <scope> declared in the project instructions.projects/<scope>/plan/<plan-name>/story-N-<slug>.md.triage_state is ready-for-agent. If needs-info or needs-triage, suggest /triage first.Test behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
A story's Gherkin scenarios are your test specification. Each Scenario block translates to one integration test. Given/When/Then maps to setup/action/assertion.
DO NOT write all tests first, then all implementation. This is "horizontal slicing" — treating RED as "write all tests" and GREEN as "write all code."
WRONG (horizontal):
RED: test1, test2, test3, test4, test5
GREEN: impl1, impl2, impl3, impl4, impl5
RIGHT (vertical):
RED→GREEN: test1→impl1
RED→GREEN: test2→impl2
RED→GREEN: test3→impl3
Why horizontal produces crap tests:
If you find yourself writing test #2 before test #1's implementation passes, stop. Finish the green for #1 first.
glossary.md for vocabulary — test names, variable names, interface vocabulary should match the project's domain language.[[spec-X]] and [[adr-Y]] for technical constraints.adr/ for testing strategy decisions (look for adr-testing-strategy.md or similar).Before writing code:
/triage.State your plan briefly. Don't burn turns enumerating implementation steps — the loop will reveal them.
Pick the simplest scenario from the slice. Translate it to ONE test:
RED: Write test for scenario 1 → test fails (compilation or assertion)
GREEN: Write minimal code to pass → test passes
This is your tracer bullet — it proves the path works end-to-end through every layer.
For each remaining scenario in this slice:
RED: Write next test → fails
GREEN: Minimal code to pass → passes
Rules:
After all scenarios for this slice pass:
Never refactor while RED. Get to GREEN first.
Once the slice is green and refactored:
## Slices checkbox: - [ ] → - [x].updated: in the story's frontmatter.status: archived with updated from the clock and say so in the report — the story is done, and the plan's Story Index row follows at handoff. A story whose slices are ticked but whose acceptance still waits on a witness or a release stays active, with the waiting condition in its Decisions.kmd config's synced line did not advance, run kmd validate then kmd sync."<What the slice delivers, in plain words> is green (slice of
[[story-N-<slug>]]). tests added. Remaining in this story: <each unchecked slice by what it delivers, its number in parentheses>. Next: pick another slice or move to a different story."
[ ] Test describes behavior, not implementation
[ ] Test uses public interface only
[ ] Test would survive an internal refactor
[ ] Code is minimal for the current test
[ ] No speculative features added
[ ] No mocks of internal collaborators
[ ] All prior tests still pass
adr-testing-strategy.md or similar, follow its guidance.A deep module has a small interface and a substantial implementation. A shallow module has a large interface relative to its implementation (often a thin wrapper).
When refactoring:
If during implementation you discover the spec is wrong (code reality differs from spec-{topic}.md):
/intent.kmd config's synced line did not advance, run kmd validate then kmd sync.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tdd, red-green-refactor, vertical-slice, gherkin, wiki-story
Other plugins' skills for the same job
npx claudepluginhub bartolli/kmd --plugin wiki-sdd10 skills in this plugin
/handoffThis skill should be used to close a session so the next one starts cold from corrected truth. Operator-invoked, gated on a retro note newer than the scope's last edit. Rewrites the primer within its budget first, then runs the status sweep (fully-resolved stories proposed for archiving, flipped only on approval) and reconciles every plan's Story Index — Focus, Next, Open, Read order, about 300 words, nothing another surface derives — confirms the index synced, and prints the one line the next session starts with. Use when the user says "/handoff", "hand off", "close the session", "wrap up the session", "prep the primer", "get the primer ready", "cold session prep", or "what does the next session start with"./intentInterview-style grilling that captures intent, sharpens vocabulary, and scaffolds wiki structure for a project scope. Use when the user wants to start a new workstream, refine an existing scope's intent, stress-test a plan against the project's domain language, or write a `glossary.md` (terms + relationships). Walks one question at a time, recommends an answer for each, and creates artifacts (`index.md`, `primer.md`, `glossary.md`, lazy ADRs) inline as decisions crystallize. Auto-detects greenfield (scope folder missing → scaffold) vs brownfield (scope exists → refine + cross-reference code). Triggers on phrases like "grill me", "grill the plan", "let's nail down what we're building", "set up a new scope", "refine the intent", "capture the intent", "write an intent", or `/intent`./retroThis skill should be used for a session retrospective at any point in a session — mid-session when drift is suspected, after a bug-hunting detour, after compaction, before a release cut, and always before /handoff. Asks three questions — 'What are you least confident about?', 'What's the biggest thing we're missing? What don't I realize?', and 'Where are we relative to the slice we started, and what were the detours?' — then works each finding while the context is hot — fixes it, prepares it up to the operator's approval, or asks — and files an intent only for what is blocked, with the blocker named — never a new story and never the primer. Use when the user says "/retro", "run the retro", "lightweight retro", "mid-session retro", "session retro", "retro protocol", "check for drift", "what are we least confident about", "what are we missing", or "what don't you realize"./signal-denseCanonical-vocabulary mode for agentic threads where assistant output re-enters context. Composable register predicates (technical, affect, safety, beginner) bind rule application; canonical handles, typed entities, and direct predicates extend an implicit KG across turns. Trigger on "signal-dense", "dense mode", "canonical mode", /dense, /signal-dense. Activate proactively in long technical threads, architecture reviews, ontology and KG work, and extended implementation sessions.
/to-issuesBreak a wiki user story into vertical-slice tracer-bullet checkboxes (or refine existing slices), and in `github`/`gitlab` mode mirror `ready-for-agent` slices to the remote issue tracker with wikilinks back to the story file. Operates on `kind: story` files in the wiki. Quizzes the user on slice granularity, AFK vs HITL, and blocked-by dependencies. Use when the user says "break this story into slices", "refine the slicing", "/to-issues", "post these to GitHub", "publish issues from this story", or wants to validate vertical-slice rules on an existing story./to-storiesThis skill should be used to write wiki stories — Gherkin scenarios plus a first slice list — from either input: the current conversation, synthesized into a thin `plan/plan-{name}.md` with one `plan/{name}/story-N-{slug}.md` per story; or a promoted intent, elaborated into one story under the active plan with the intent linked and `promoted_to` reported back. Default `triage_state: needs-triage`. Does NOT interview — if intent is unclear it suggests `/intent` and stops. Use when the user says "turn this into a plan", "draft a PRD", "/to-stories", "write up what we discussed", "synthesize this into stories", "write the story for intent X", or "elaborate intent X". Reads `glossary.md` and existing ADRs to use the project's vocabulary correctly.