From forge
Decompose an implementation plan into br beads with dependency wiring, epic grouping, and provenance labels. Use this after spec-plan-handoff when the user accepts the beads generation prompt.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge:spec-beads-generateThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this only after `spec-plan-handoff` has emitted `implementation-plan.md`
Use this only after spec-plan-handoff has emitted implementation-plan.md
and the user has accepted the beads generation prompt.
Decompose implementation-plan.md into a set of beads with full provenance
back to the spec. This skill is the advocate — it makes the best decomposition
it can and hands it to the adversarial team (spec-beads-review).
planning_status = PLANNING_READYhandoff_status = ELIGIBLEadversarial_status = convergedimplementation-plan.md exists in specs/_artifacts/<subject>/git rev-parse --show-toplevel.beads exists at the git root, use it — do not re-init.beads does not exist, run br init at the git rootbr create --type epic --title "<subject>" --labels "forge:<subject-slug>"implementation-plan.md and create beads:
br create --title "..." --type task --parent <epic-id> --labels "forge:<subject-slug>" --description "..."br dep add <bead-id> <depends-on-id>beads-manifest.json to specs/_artifacts/<subject>/Every spec claim and acceptance criterion must appear in at least one implementation bead's description. The manifest tracks this mapping explicitly so the review phase can verify coverage.
Epilogue beads are exempt from the provenance contract — they do not map to spec claims or acceptance criteria. They exist for post-implementation quality and learning, not spec coverage.
beads-manifest.json schema{
"subject": "<subject-slug>",
"epic_id": "<br epic ID>",
"workspace_path": "<git root>/.beads",
"beads": [
{
"bead_id": "<br issue ID>",
"title": "<bead title>",
"workstream": "<workstream name from implementation plan>",
"spec_claims": ["<claim IDs from claim-ledger.jsonl>"],
"acceptance_criteria": ["<AC IDs from spec>"],
"dependencies": ["<bead IDs this depends on>"],
"test_first": "yes | no | n/a",
"walking_skeleton": "true | false",
"test_sketches": [
{
"type": "unit | property | integration | contract | e2e",
"description": "<pseudocode test scenario>"
}
]
}
],
"unmapped_claims": ["<claim IDs not yet traced to any bead>"],
"unmapped_acceptance_criteria": ["<AC IDs not yet traced to any bead>"],
"epilogue_beads": [
{
"bead_id": "<br issue ID>",
"title": "Epilogue: <name>",
"kind": "epilogue",
"spec_claims": [],
"acceptance_criteria": [],
"dependencies": ["<all implementation bead IDs>"],
"test_first": "n/a",
"test_sketches": []
}
],
"followup_beads": [
{
"bead_id": "<br issue ID>",
"title": "<fix description>",
"kind": "epilogue-followup",
"created_by": "<epilogue bead ID that created this>",
"source_finding": "<finding description>",
"dependencies": ["<bead whose code needs fixing>"],
"test_first": "yes | no | n/a",
"test_sketches": []
}
]
}
unmapped_claims and unmapped_acceptance_criteria start populated after
generation and must be empty after spec-beads-review converges. The coverage
agent uses these arrays as its primary attack surface.
Emit as structured input to the orchestrator:
beads-manifest.jsonmanifest.json:
beads_generated = truebeads_epic_idbeads_totalbeads_epilogue_countbeads_followup_countbeads_workspace_pathBead descriptions should encode methodology guidance so the implementing agent follows disciplined engineering practices.
Rationale (Kent Beck, Test-Driven Development: By Example, 2002; Robert C. Martin): TDD is about managing fear and building confidence, not just catching bugs. Beck: "Tests are the Programmer's Stone, transmuting fear into boredom." The three steps must be distinct because "our limited minds are not capable of pursuing two simultaneous goals" (Martin) — correct behavior and correct structure at the same time. Red = focus on WHAT (behavior specification). Green = focus on making it WORK (minimum code). Refactor = focus on STRUCTURE (with green tests as safety net). Beck warns that TDD provides design feedback, not design itself: "Your design will only be as good as your design decisions." The most commonly neglected step is refactor (Fowler): "without refactoring you just end up with a messy aggregation of code fragments."
Every bead with test_first: yes must follow the TDD cycle:
Bead descriptions should make the red-green-refactor steps explicit. The acceptance criteria should be phrased as observable, testable outcomes.
Rationale (Alistair Cockburn, Crystal Clear, 2004; Hunt & Thomas, The Pragmatic Programmer, 1999): The tracer bullet metaphor (Hunt & Thomas) comes from military tracer rounds — phosphorus rounds that leave a visible trail, letting soldiers adjust aim in real-time under actual conditions. The software equivalent: produce something early that users can see, rather than specifying everything upfront and hoping it hits the target. Key insight: software has a "Heisenberg effect, where delivering the software changes the user's perception of the requirements." Requirements are inherently a moving target. Tracer code is production-quality — it is kept and built upon, unlike prototypes which are thrown away. The walking skeleton (Cockburn) is "a tiny implementation of the system that performs a small end-to-end function." Teams typically defer integration and deployment until late in a project — exactly when it is most expensive to discover problems. The walking skeleton frontloads this risk, flushing out boundary-level issues (external systems, infrastructure, deployment) at the beginning when they are cheapest to fix. "The bigger the system, the more important it is to use this strategy."
The first beads in the dependency chain should build a thin end-to-end path through the system before filling in depth. Get something working across all layers first, then iterate on each layer. The implementation plan's workstream ordering should reflect this.
When the implementation plan has a clear walking skeleton path, annotate the
first-pass beads with walking_skeleton: true in the manifest so the
execution engine prioritizes them.
Rationale (John Ousterhout, A Philosophy of Software Design, 2018):
The cost of a module is its interface (what you must learn to use it). The benefit is its functionality (what it hides). Deep modules maximize benefit relative to cost. Ousterhout's visual: modules should be like icebergs — small visible tips (interfaces) with large submerged bases (implementations). "It's more important for a module to have a simple interface than a simple implementation." His canonical example: Unix file I/O — five functions (open, read, write, lseek, close) hiding tens of thousands of lines dealing with disk formats, permissions, caching, and concurrency. The interface has remained stable for decades while the implementation has been rewritten multiple times. The "classitis" warning: over-decomposing into many small, shallow classes increases system complexity because each boundary adds interface cost. If the functionality behind an interface is trivial, the system pays more in interface complexity than it gains in hidden implementation.
Favor modules with simple interfaces and deep functionality. Hide complexity behind clean abstractions rather than spreading it across many shallow modules with wide interfaces. When a bead creates a new module, its acceptance criteria should specify:
Rationale (Eric Evans, Domain-Driven Design, 2003): The problem: "On a project without a common language, developers have to translate for domain experts. Translation muddles model concepts, which leads to destructive refactoring of code." Translation is not just inconvenient — it actively corrupts the model. The solution: one language everywhere — in code (class names, method names), in conversation, and in documentation. The language is rooted in the domain model and co-evolves with it. Evans' feedback loop: "Domain experts should object to terms or structures that are awkward or inadequate to convey domain understanding; developers should watch for ambiguity or inconsistency that will trip up design." When a term feels wrong, that signals a problem in the model.
Bead titles and descriptions must use terms from the project's
UBIQUITOUS-LANGUAGE.md glossary (at the project root). If the glossary does
not yet exist, the intake phase creates it. Consistent domain terminology
across all beads prevents ambiguity during implementation.
Do not create standalone beads for cross-cutting concerns like quality gates, CI configuration, env var documentation, or linting setup. These are not discrete work units — they apply across the entire epic.
Instead:
The review phase's granularity agent will flag any bead that is just a collection of unrelated cross-cutting checks.
Every epic gets three epilogue beads created after all implementation beads. These are meta-beads for post-implementation quality and continuous improvement. They do not map to spec claims.
Create each with:
br create --title "Epilogue: <name>" --type task --parent <epic-id> --labels "forge:<subject-slug>,epilogue" --description "..."
Wire each epilogue bead as depending on ALL implementation beads:
br dep add <epilogue-id> <impl-bead-id> for every implementation bead.
Scan .ralph-tui/progress.md (the cross-iteration learning log agents append
to after each bead), git history for the epic's commits, and the original spec.
Synthesize scattered per-bead learnings into a structured retrospective:
After synthesizing learnings, create follow-up beads in the same epic for any process improvements that require code or config changes. Use the follow-up bead creation contract below.
Acceptance criteria: learnings document exists with categorized findings; every bead's progress.md entry has been reviewed; findings are actionable, not just observations; follow-up beads created for all actionable items.
Dependencies: all implementation beads.
Audit existing agent rules for conflicts and gaps, then actively create or update project-specific guidance. Depends on the Learnings Retrospective bead (consumes its output to inform guidance updates).
Inputs to audit:
.ralph-tui/progress.md Codebase Patterns section.claude/skills/Actions:
.claude/skills/ that auto-load
for future agent runs.ralph-tui/progress.md Codebase Patterns section with reusable
patternsUBIQUITOUS-LANGUAGE.md at the project root with any new
domain terms discovered during implementation; ensure AGENTS.md references
the glossary so agents use consistent terminology across all workAfter auditing and updating guidance, create follow-up beads in the same epic for any guidance changes that require code changes. Use the follow-up bead creation contract below.
Acceptance criteria: all rule sources audited for conflicts; at least one guidance artifact updated with implementation learnings; no contradictory rules remain across guidance sources; UBIQUITOUS-LANGUAGE.md updated with new terms; follow-up beads created for all actionable items.
Dependencies: all implementation beads + Epilogue: Learnings Retrospective.
Spawn a full agent team (via TeamCreate) to comprehensively review all code
changed during the epic. Agent roles:
Uses a convergence model: multiple rounds until all agents report zero material findings, max 3 rounds. Findings categorized by severity (critical, high, resolvable). Critical findings block epic closure.
After each convergence round, create follow-up beads in the same epic for every material finding. Use the follow-up bead creation contract below. Each finding becomes a bead with:
Acceptance criteria: every file changed during the epic has been reviewed; all findings categorized by severity; critical findings have remediation steps; follow-up beads created for all material findings.
Dependencies: all implementation beads.
Every follow-up bead created by an epilogue MUST be parented to the epic and use this exact command template:
br create --title "<fix description>" --type task --parent <epic-id> --labels "forge:<subject-slug>,epilogue-followup" --description "<finding details and remediation steps>"
Hard requirements:
--parent <epic-id> is mandatory — omitting it creates an orphan invisible
to br ready in the epic context--labels must include both forge:<subject-slug> and epilogue-followupbr dep add <followup-id> <source-bead-id>beads-manifest.json followup_beads array with the new beadAfter all follow-up beads from an epilogue round are implemented, a new epilogue cycle begins:
Cycle scoping rules:
A bead must be completable in a single focused agent session. Use these heuristics to decide when to split:
br CLI commands for all bead operations. Do not write to the .beads
directory directly..beads workspace.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mwarger/forge --plugin forge