---
name: epics-and-stories
description: "Decompose a PRD into Epics and INVEST-shaped User Stories with acceptance criteria and priority. Invoke when the team has a baselined PRD and needs an actionable story backlog before sprint planning or WBS construction."
---

> Adapted from bmad-method:bmad-create-epics-and-stories (MIT, © 2025 BMad Code, LLC). See THIRD_PARTY_NOTICES.md.

## When to use

Use this skill after the PRD has been reviewed and baselined. The skill is the bridge between a requirements document and an executable sprint backlog. Typical triggers include:

- The PRD is approved and the team is ready to begin sprint planning.
- A scope change or approved change request adds new functional requirements that must be decomposed.
- An existing backlog needs to be restructured to align with INVEST story principles before a new development phase begins.
- A retrospective identified that acceptance criteria were missing or too vague, and the stories must be revised.

Do not invoke this skill to produce the PRD itself (use the `prd` skill). Do not use it in place of the WBS — epics and stories decompose scope by feature value; the WBS decomposes scope by deliverable. Both views are complementary, not substitutes.

## Summon the SME

Before facilitating story decomposition, load the canonical User Story reference to ground acceptance criteria and the INVEST framework in established practice.

**Reading the config.** Check `.pm-kit.config.json` for the `sourcesMode` field:

- If `sourcesMode` is `"online"` (opt-in): fetch the URL stored at key `sources.epicsAndStories` in `vendor/pm-kit/sources-index.json` using your available web-fetch capability. Do not name a specific tool — use whatever your runtime provides. Ground the facilitation in what you read. Do not fabricate quotations or page numbers.
- If `sourcesMode` is `"offline"` or the field is absent (the default): rely on your general knowledge of the Agile user story format (As a / I want / So that), the INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable), and Gherkin-style acceptance criteria (Given / When / Then) as described by the Agile Alliance and widely adopted Scrum practice. Cite the canonical URL from `vendor/pm-kit/sources-index.json` at key `sources.epicsAndStories` in the output. Do not fabricate quotations or page numbers.

In both cases, the URL to cite is `https://www.agilealliance.org/glossary/user-story`.

## Facilitation script

Walk the user through these steps in sequence. Do not skip steps or combine them.

**Step 1 — Ingest inputs.** Ask the user to supply (or confirm the location of) the baselined PRD. Identify the list of functional requirements (FR-xx items). Confirm the inputs are present before proceeding.

**Step 2 — Group requirements into Epics.** For each cluster of closely related functional requirements, propose an Epic: a large, coherent feature grouping that delivers visible value to a user type. Present a draft Epic list to the user. Revise until the user confirms the groupings.

**Step 3 — Write User Stories per Epic.** For each Epic, decompose it into atomic User Stories. Each story must follow the format: "As a `<user type>`, I want `<action or capability>`, so that `<outcome or value>`." Stories must satisfy INVEST — if a story is not independently deliverable or not estimable, split or merge it before proceeding.

**Step 4 — Write acceptance criteria.** For each story, elicit at least two acceptance criteria using Given / When / Then notation. Each criterion must be independently testable by the acceptance team without additional clarification.

**Step 5 — Assign priority.** For each story, assign a priority of Must (delivers core value; release is not viable without it), Should (high value; include if possible), or Could (nice to have; defer if constrained). Confirm the priority distribution with the user.

**Step 6 — Tag dependencies.** Identify any story that depends on another story being completed first. Record the dependency by story ID.

**Step 7 — Summarize the backlog.** Produce the Backlog Summary section: total epics, total stories, aggregate story-point placeholder (to be populated by the cost-estimation skill), and priority distribution.

**Step 8 — Save the artifact.** Save the filled artifact to `docs/pm-kit/outputs/epics-and-stories/<short-slug>.md`. `<short-slug>` is a kebab-case ASCII slug (max 40 chars) derived from the project name (e.g., `bookswap-campus`). Confirm the final path with the user before writing. If the file exists, ask: overwrite, append a date suffix (e.g., `-2026-04-20`), or pick a new slug. The artifact begins with the three-line provenance header below (HTML comments, do not render):

```
<!-- Generated by agentic-pm-kit:epics-and-stories on YYYY-MM-DD -->
<!-- Languages: communication=<value>, output=<value> -->
<!-- Source mode: offline | online -->
```

## Languages

The kit separates the language used for live agent–user dialogue from the language used in the saved artifact. Both values live in `.pm-kit.config.json` and are free-form strings — read each value verbatim, never infer a language from the conversation, and never select from a hardcoded list.

**Facilitation dialogue.** Speak to the user during facilitation in the language at `language.communication`. Use the string verbatim.

**Filled artifact (saved TEMPLATE.md output).** Produce the written artifact in the language at `language.output`. If `language.output` is absent or empty, fall back to `language.communication`.

Example values either field might contain: `"en-US"`, `"es-MX"`, `"Português brasileiro"`, `"Mandarin Chinese"`. Accept any string as given.

## Acceptance gate

When the backlog is complete, point the user to `CHECKLIST.md` (sibling file) and ask them to verify each item. Remind them that the output must be marked **PASS** or **FAIL**. On **FAIL**, invite the user to return with specific notes so the facilitation can be resumed or corrected.
