Break epic into INVEST-compliant stories
Breaks down epics into INVEST-compliant user stories and creates them as GitHub issues. Use this after identifying epics to prepare work for development sprints.
/plugin marketplace add sjnims/requirements-expert/plugin install requirements-expert@requirements-expert-marketplaceBreak down a selected epic into user stories following INVEST criteria and create story issues in GitHub Projects as children of the epic issue. This command is idempotent—safe to run multiple times without creating duplicates.
Load the user-story-creation skill for methodology and templates. Load shared-patterns skill for error handling and idempotency patterns.
gh project item-list [project-number] --format json/re:identify-epics first, then exitAsk Select Epic: "Which epic would you like to break down into user stories?" (options: one per epic)
Read selected epic: gh issue view [epic-issue-number] --repo [repo] --json body,title
Query existing stories under this epic (Type = "Story" with "Parent: #[epic-number]" in body) for duplicate checking.
Apply story discovery from user-story-creation skill:
As a [user type], I want [goal], so that [benefit].
Present suggested stories organized by category (Core Functionality, Supporting Features, Edge Cases). Number stories for easy reference.
Handle "Add more" by prompting for story details. Handle "Review selection" by displaying current selection before re-asking.
Validate each story against INVEST criteria from user-story-creation skill (references/invest-criteria.md):
If violations found, suggest refinements per skill guidance (splitting, reframing, adding acceptance criteria).
For each story, define acceptance criteria using Given-When-Then or checklist format from user-story-creation skill. Present suggested criteria and confirm with user.
Initialize batch tracking per shared-patterns skill: created[], skipped[], updated[], failed[]
For each finalized story:
Apply shared-patterns Idempotency Check pattern:
gh issue list --repo [repo] --label "type:story" --json number,titleRead template: plugins/requirements-expert/skills/user-story-creation/references/story-template.md
Compile story description following template structure. Create issue:
gh issue create --repo [repo] --title "[Story title]" --body "[description]" --label "type:story"
On failure: Apply shared-patterns Recovery Flow (Retry/Skip/Check permissions/Stop).
gh project item-add [project-number] --owner [owner] --url [issue-url]
Apply shared-patterns Two-Layer Metadata pattern:
Add comment: "Parent: #[epic-issue-number]"
Check total stories for epic:
20: May be too many, epic might be too large
Ask Continue: "Create stories for another epic?" (options: Select another epic, Done)
Handle "Select another epic" by restarting from Step 1. Handle "Done" by showing summary.
Display batch summary per shared-patterns format:
**Story creation complete for Epic #[epic-num]!**
**Created:** [N] new stories
- #[num] - [Story title]
**Updated:** [N] existing stories (if > 0)
**Skipped:** [N] duplicates (if > 0)
**Failed:** [N] stories (if > 0)
All stories linked to Epic (#[epic-num])
**Next steps:**
- Run `/re:prioritize` to rank stories by importance
- Run `/re:create-tasks` to break down highest-priority story
- Use `/re:status` for project overview