plugins/spec-plugin/skills/build-stories/SKILL.md
Break down a single version into executable story files. Reads the version spec, architecture, and roadmap, then creates ordered stories. Adapts to project type — code stories for engineers, deliverable stories for any project type. Use after /architect-version.
npx skillsauth add jaisonerick/spec-plugin build-storiesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Your task: break a version into ordered story files, each sized for a single AI agent session.
specs/ in CWD.specs/<version>.mdspecs/<version>/architecture.mdspecs/architecture.mdspecs/roadmap.mdspecs/<version>/Pay special attention to the version architecture's Definition of Done (specs/<version>/architecture.md) — the sharpened, auditor-gated DoD, not the higher-level one in the version spec. The final story or stories must directly satisfy it.
Break the version into stories following these principles. Read the codebase before decomposing, and use AskUserQuestion for the sizing/grouping/ordering calls that genuinely have alternatives — don't guess where the user can decide.
Budget each story to one agent context window — no mid-execution compaction. A story that forces the engineer to compact mid-flight was too big: it will cost multiples of its fair share (a late, bloated session ran ~5x the turns of an early one). Concretely: if a story would require authoring a very large single file (hundreds of lines), touch many modules, or span multiple output repos, SPLIT it into cohesive sub-stories. Prefer more small stories over one large one — fresh-per-story spawning makes the extra stories cheap, and a story that fits in one context never compacts.
Every story must specify its agent — the agent type that will execute it:
For code projects:
engineer — Backend, data layer, API endpoints, integrations, tests, wiring UI. Runs /execute-task.designer — Visual UI creation: new pages, components, layouts, design system. Runs /interface-design.For non-code projects:
engineer — The default executor. Runs /execute-task for any deliverable type (documents, analyses, research outputs). Despite the name, this agent handles all execution work.The orchestrator uses this field directly as subagent_type when spawning agents.
For features with UI, use paired stories:
agent: designer) — Creates visual components/layoutsagent: engineer) — Wires design into codebaseNot every UI story needs pairing. Use judgment.
Each engineer story must include testing acceptance criteria proportional to complexity:
Include a ## Testing Guidance section in each code story.
Each story should include clear acceptance criteria that can be verified by reading/reviewing the output:
Validate build/packaging order against the REAL toolchain. Start from the architecture's Build & Packaging Order section, then confirm it: for each story, probe whether its build/install steps actually succeed given only the artifacts present at that story's boundary. A DoD item whose build/install needs an artifact a later story produces belongs in that later story — move it. This is confirmation of architect-version's stated constraints, not first-principles discovery; running it against the real toolchain also catches environment drift the architecture couldn't foresee.
context.md + lessons.md, nothing morecontext.md, not repeated in every storyCreate each story as specs/<version>/NNN-story-slug.md:
# NNN: Story Title
**Agent**: `engineer` | `designer`
## Summary
One paragraph describing what this story delivers.
## Prerequisites
- What must exist before starting (prior stories, inputs, access)
## Deliverables
- What exists after completion (new files, endpoints, documents, analyses)
## Acceptance Criteria
- [ ] Concrete, verifiable condition 1
- [ ] Concrete, verifiable condition 2
## Implementation Guidance
Specific guidance on how to produce the deliverable. For code: files to create/modify, patterns to follow. For non-code: sources to use, structure to follow, quality standards.
## Testing Guidance (code projects)
What to test, at what level, and any fixtures needed.
## Architecture Context
Inline the relevant decisions so the executor doesn't need to cross-reference.
Acceptance criteria must reference the integration checkout. When an acceptance criterion names a path or branch to verify against, point it at the integration checkout / code_branch — never a per-story worktree path. Per-story worktrees are deleted after merge, so anything that names one is stale by the time QA checks it.
Write specs/<version>/stories.md:
# <Version> — Stories
## Status
| # | Story | Agent | Status |
|---|-------|-------|--------|
| 001 | Story title | engineer | pending |
| 002 | Design: Page X | designer | pending |
| 003 | Integrate: Page X | engineer | pending |
## Dependency Graph
(mermaid diagram showing story dependencies if non-linear)
Engineers read only their story + context.md + lessons.md during execution — never the full architecture. Write the shared context now so it exists before any engineer spawns.
Write specs/<version>/context.md — keep it tight; it's read once per story:
# <Version> — Shared Context
## Conventions
Naming, structure, imports, formatting, test layout that every story follows.
## File / Component Manifest
Where things live and what each part is responsible for.
## Key Decisions (cross-cutting)
The architecture decisions that touch multiple stories — inlined so engineers don't open architecture.md.
## Setup
Pointer to `setup-playbook.md` (how to spin up a code worktree for this repo).
## Pointers
Links to the deeper sections of architecture.md for the rare case an engineer needs them.
Do not scaffold the session log surface here — the lead creates lessons.md and logs/ during PREP (orchestrate Phase 3). You (the PO) own and curate the content of lessons.md through the session, consolidating each engineer's logs/engineer-N.md into it; you don't create the files.
tools
Assess how the LATEST spec-plugin version is performing across every previous session that invoked it — aggregate run efficiency (thinking%, compactions, exploration-vs-skills, preload firing, fresh-per-story), process adherence, and recurring spec-quality issues — then propose concrete, evidence-backed improvements for the NEXT version (plugin skills/agents/hooks, and spec/process patterns). Read-only: proposes, never self-modifies. Not tied to a single run.
development
Confirm whether a code symbol (method/class/field/endpoint/flag) actually exists and return its REAL signature + definition location — or the nearest match. Uses LSP/introspection, never grep-spelunking. Cheap and fast.
development
Walk one value or action end-to-end across every layer/hop — go-to-definition by go-to-definition, or with a debugger breakpoint — and report the real state transitions and where the contract/shape diverges. The workhorse for architecture sketches and cross-layer debugging.
testing
Bring a fresh worktree/checkout to a runnable state — verify base HEAD, copy gitignored files (.env), allocate per-agent DB/test env, install deps, run the smoke gate. Deterministic, mechanical. Reports a single ready/blocked verdict.