Index of every page on this site: llms.txt
All skills
aj-geddes avatar

/bmad-epics-and-stories

@27dca0e
Run it yourself

Solutioning flagship — shards a PRD + architecture into epics.md and individual {epic}.{story}.{slug}.story.md context objects, the LAST planning artifact before external dev handoff. Each story is a self-contained ~8K-token compiled context object: Dev Notes with SOURCE CITATIONS back to prd.md/architecture.md, Acceptance Criteria, Tasks/Subtasks mapped to ACs, Testing strategy, Dependency Maps, an explicit Owned File/Module Scope list (the lever for parallel-conflict-free scheduling), and Learnings from Previous Stories. Sized to one dev-day; split if larger; NO story points. Use when the user says "shard the PRD", "create epics", "break the PRD into epics", "break this epic into stories", "create stories", "create a story", "draft story files", "generate the story for X", "prepare stories for dev", "mark the story ready for dev", "validate this story", or "what stories are in this epic". Three intents: Create new epics/stories, Update an existing story, or Validate a draft against the contract.

Use this Skill: https://skilld.dev/gh/aj-geddes/claude-code-bmad-skills/bmad-epics-and-stories

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

REFERENCE.md

≈2.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

BMAD Epics & Stories — Reference

Detailed mechanics for sharding planning docs into an executable, parallel-safe backlog. The SKILL.md body is the operational summary; this file is the depth.


1. The Sharding Method

Sharding = decomposing approved planning prose (prd.md + architecture.md) into self-contained, executable units. Two levels of output:

  1. epics.md — the map. Each epic is a coherent, shippable slice of value with an ordered list of its stories and cross-epic dependencies. It is an index, not a context object — keep it thin.
  2. {epic}.{story}.{slug}.story.md — the leaf. Each is a compiled context object: a dev agent reading only this file must have everything needed. ~8K tokens is the working target; if you can't fit it, the story is probably too big — split it.

Sharding procedure

  1. Inventory requirements. Pull every functional requirement (FR) and relevant non-functional requirement (NFR) from prd.md. Note the architecture component each maps to.
  2. Cluster into epics. Group requirements that deliver one user-visible capability or one cohesive system slice. An epic should be independently demoable. Aim for the track: Quick Flow may have 1-3 epics; BMad Method 3-8; Enterprise more, including Security and DevOps streams.
  3. Order epics by dependency and value — foundational/enabling epics first.
  4. Within each epic, enumerate stories. Walk the epic's requirements and slice them along natural seams (a single endpoint, a single screen, one migration, one integration). Each slice becomes a story sized to one dev-day (Section 2).
  5. Compile each story into a context object (Section 3), pulling exact citations from the source docs rather than paraphrasing from memory.
  6. Declare Owned Scope per story (Section 4) and run the shared conflict checker.

Citation discipline (Dev Notes)

Every claim in Dev Notes that originates from a planning doc MUST carry a source tag so the dev agent can trust it without re-deriving:

  • [Source: prd.md#FR-12]
  • [Source: architecture.md#payment-service]
  • [Source: ux-design.md#checkout-flow]
  • [Source: epics.md#epic-2]

If a Dev Note is your own inference (not in any doc), label it [Inference] so it is distinguishable from cited fact. Never invent an architecture detail and present it as cited.


2. Sizing Rule — Count-Based, No Points

A story must be small enough for one agent session: ~2-8 hours, one dev-day maximum.

There are NO story points, NO Fibonacci, NO velocity, NO burndown. Those concepts are deliberately removed. Progress is tracked purely by COUNT:

remaining = stories with status in {backlog, ready-for-dev, in-progress, review}
done      = stories with status: done
completion rate = done / total   (a simple ratio, reported as needed)

Split heuristics — split a story when ANY of these is true

  • It would touch more than ~3-5 files/modules of genuinely new logic.
  • It spans two layers that could ship independently (e.g. API endpoint AND its UI screen).
  • It has more than ~7 acceptance criteria.
  • It bundles a schema migration with feature logic — split the migration out first.
  • It mixes "happy path" with a large error/edge-case surface — split the hardening out.
  • You cannot write its Dev Notes in roughly 8K tokens without hand-waving.

How to split

  • By layer: data model → API → UI as separate stories with explicit Blocked-by links.
  • By capability: create vs. read vs. update vs. delete as separate stories.
  • By path: happy path first, then a follow-up story for validation/edge cases.
  • By integration: stub/contract first, real integration second.

When you split, renumber within the epic and update Dependency Maps and epics.md.


3. The Context Object Contract

Required sections, in order (see templates/story.template.md):

Section Content Locked?
Status one of the lifecycle values no
Story as-a / I-want / so-that no
Acceptance Criteria numbered, testable outcomes LOCKED
Tasks / Subtasks checkboxes, each (AC: #N) no
Dev Notes cited implementation guidance LOCKED
Testing strategy only — types, fixtures, what to verify LOCKED
Dependency Maps Blocked-by / Blocks story IDs no
Owned File/Module Scope explicit path list (Section 4) no
Learnings from Previous Stories carried-forward notes no
Dev Agent Record EMPTY at handoff no

LOCKED means the external dev tool must not edit AC, Dev Notes, or Testing. They are the compiled, cited contract. If planning genuinely needs to change one, that is an Update intent in this skill: confirm with the user and log it in decision-log.md.

Testing is strategy, not execution. Describe what to test (unit/integration/e2e targets, key scenarios, fixtures/mocks, the acceptance check per AC). Never run a suite, never quote coverage numbers — that belongs to the external dev tool.

Tasks map to ACs. Every task or subtask ends with (AC: #N) (or several) so the dev agent can trace work to acceptance. A task with no AC mapping is a smell — either add the AC or drop the task.


4. Scope-Declaration Discipline (the parallel-safety lever)

Owned File/Module Scope is the single most important field for orchestration. It is the explicit list of paths a story is permitted to create or modify. Two stories whose Owned Scope do not intersect can be scheduled to run in parallel without merge conflicts; two that overlap must be serialized (linked via Dependency Maps) or re-sliced.

Rules for declaring scope

  1. Be explicit and path-based. List files or tight directory globs, e.g. src/payments/stripe_client.py, src/payments/__init__.py, tests/payments/**.
  2. Prefer files over broad directories. src/api/routes/checkout.ts beats src/api/**. Broad globs manufacture false conflicts and kill parallelism.
  3. Include test paths the story owns — they are real files that can collide.
  4. Call out shared/contended files (e.g. a central routes.ts, schema.prisma, a DI container). If two stories must both edit a shared file, that is a conflict: either make one Blocked-by the other, or extract the shared edit into its own tiny enabling story.
  5. No wildcards over the whole repo. A story that claims src/** owns everything and can never run in parallel — re-slice it.

Running the shared checker

The overlap checker is authored once for the whole plugin and lives at ${CLAUDE_PLUGIN_ROOT}/scripts/scope-conflict-check.sh. Do not copy or reimplement it.

bash ${CLAUDE_PLUGIN_ROOT}/scripts/scope-conflict-check.sh bmad-output/stories/

It reads the Owned Scope block from each *.story.md, computes pairwise path intersections, and reports any pair that shares a path. Workflow:

  • Clean report → the stories are parallel-safe; they may be marked ready-for-dev.
  • Conflicts reported → for each conflicting pair, either (a) add a Dependency Map Blocked-by link so they serialize, or (b) re-slice so scopes are disjoint, or (c) extract the shared file into a small enabling story everything depends on. Re-run until clean (or until every remaining overlap is intentionally serialized).

A story is only truly ready-for-dev once its scope is declared and the checker is satisfied.


5. Learnings from Previous Stories

When compiling story N in an epic, scan completed sibling stories (status: done, and the Dev Agent Record the external tool filled in on returned stories) for reusable facts: chosen patterns, gotchas, helper modules created, naming conventions settled. Summarize the relevant ones into the new story's Learnings section so each story compounds context rather than rediscovering it. Keep it to what is actionable for THIS story.


6. epics.md Structure

A thin index, not a context object. Per epic: ID + title, goal, in-scope requirement IDs (cited to prd.md), ordered story list ({epic}.{story} + slug + one-line intent), and cross-epic Blocked-by/Blocks links. Update it whenever stories are added, split, or reordered so it stays the authoritative map. See templates/epic.template.md.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill is a requirements sharding and planning tool designed to decompose PRDs into epics and stories. It uses local helper scripts for ID generation and scope validation, and while it processes untrusted documentation, its operations are consistent with its documented purpose.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW · No issues

Signed by skilld at 27dca0e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
What it can do
Reads files Edits files Runs commands
All 7 allowed tools
ReadWriteEditBashGlobGrepTodoWrite

README badge

README badge for aj-geddes/claude-code-bmad-skills/bmad-epics-and-stories