Backlog Story Generator
Version: 5.3.1
Generate a reviewable backlog pack from messy or incomplete source material without pretending unknown details are known.
Use this skill to turn requirements into:
- epic folders
- one markdown file per user story
- optional import-ready CSV exports
- a short delivery summary with assumptions, gaps, and validation results
Responsibility
This skill is responsible for:
- shaping epics around business capabilities or workflow boundaries
- writing implementable user stories with observable Gherkin scenarios
- generating technical contracts including Data Models, API specifications, UI flows, and selectively useful diagrams
- preserving traceability to the provided source material
- extending an existing numbered story pack safely
- validating the generated pack before claiming it is ready
- exporting validated story packs into supported backlog-tool CSV formats
This skill is not responsible for:
- inventing product decisions the source material does not support
- silently filling in architecture, APIs, vendors, or frameworks without evidence
- creating implementation plans disguised as user stories
- managing cross-agent shared memory inside this repository
Supported Inputs
Accept any combination of:
- PRDs, feature briefs, workshop notes, discovery notes, SOPs, or markdown requirements
- existing backlog folders that already contain numbered story files
- a local codebase path when the backlog should be grounded in observed implementation evidence
- export target preferences such as
jira, ado, github, or tulip
Treat scattered or conflicting inputs as a reason to surface assumptions and open questions, not as permission to fabricate certainty.
Core Workflow
Follow this sequence unless the user explicitly asks for a narrower task.
Ingest the source material.
Distinguish confirmed requirements, inferred structure, unresolved gaps, and implementation evidence.
Ground the work.
If a codebase path is provided, run:
node scripts/inspect-codebase-context.js <path-to-codebase>
Use only observed files and dependencies as evidence.
Inspect any existing pack before adding new stories.
Find the highest existing story ID and continue numbering from there.
Never renumber existing stories unless the task is explicitly a migration or normalization.
Shape epics.
Group stories by business capability, workflow boundary, or operational concern.
Prefer stable business language over team-specific implementation jargon.
Draft stories.
Use references/user-story-template.md as the canonical structure.
Use references/naming-convention.md for epic folders, IDs, and filenames.
Use references/story-drafting-playbook.md when the source material is broad, messy, or likely to produce generic prose.
Use references/acceptance-criteria-patterns.md when scenarios start sounding reusable across unrelated stories.
Preserve evidence and scope.
Put business rules, dependencies, non-functional needs, and traceability into the appropriate sections instead of hiding them inside the story statement.
Validate before delivery.
node scripts/validate-stories.js <story-pack-directory>
Fix validation failures before presenting the output as ready.
If the pack is large or the prose quality is uneven, also run:
node scripts/story-quality-report.js <story-pack-directory>
Use the summary to identify repeated weak fields before doing a refinement pass.
When the pack is structurally valid but still generic, run:
node scripts/refine-generic-story-pack.js <story-pack-directory>
Then rerun validation and the quality checks before calling the pack ready.
If you want the repository to handle that whole quality-improvement loop in one command, run:
node scripts/improve-story-pack.js <story-pack-directory> --refine
Use --force-refine when you intentionally want to reapply deterministic refinements to an already clean pack.
Export only from validated markdown source when requested.
node scripts/export-stories.js <story-pack-directory> <output.csv> <format>
Deliver a concise closeout.
Report what was created or changed, what was validated, any exports produced, the assumptions made, and any open questions that still need human decisions.
Gotchas
- A structurally valid pack can still be low quality. Validation catches contract problems; use the quality lint and quality report to catch generic prose.
- Blind runs from messy source material often preserve source noise unless you deliberately normalize duplicated sections, malformed actor phrasing, or mixed-language lines.
- Blind runs and curated benchmark packs may legitimately differ in story count when trailing notes, duplicated sections, or field wishlists are classified differently. Make that decision explicit instead of treating every count change as an error.
- Do not mistake the sandbox output for the skill contract. The markdown pack is a benchmark surface; the real capability is the generation, validation, refinement, and export workflow.
- If acceptance criteria start sounding reusable across unrelated stories, stop and rewrite them before continuing. Generic success-path scaffolding is one of the easiest ways to produce weak backlog output.
Context should explain the capability, the AS-IS state, the TO-BE state, the user gain, and the story's relationship to the rest of the epic and product. It should never describe the prompt, template, reconstruction process, or repository mechanics.
- When the source contains trailing notes, field wishlists, or partial ideas, decide explicitly whether they belong in stories, epic notes, or open questions. Do not let them drift into the pack by accident.
Story Authoring Rules
- Write one markdown file per story.
- Use globally sequential
US-### identifiers unless the repository already establishes a different convention.
- Keep story titles action-oriented and specific.
- Use concrete actors in the
As a clause whenever possible.
- Make the
So that clause express business value or operational outcome.
- Do not restate the epic name or say the capability is merely "available in the platform" as the value statement.
- Write
Context as a short explanation of what the story is, what it changes from AS-IS to TO-BE, what users gain, and how it fits with the rest of the epic and product. Do not describe the prompt, repository, template, or reconstruction process there.
- Write acceptance criteria as observable
Given / When / Then scenarios.
- Cover Happy Path, Alternative Flow, and Error/Edge cases in every story.
- Include technical contracts (Data Model, API, UI, and Diagrams) when the source material supports them.
- Treat
Diagrams as an optional section. Decide whether a diagram materially clarifies the story before adding one, choose a fitting notation such as Mermaid, UML, or BPMN, and include a short explanation of what each diagram shows and why it matters.
- Define a comprehensive testing strategy (Unit, Integration, E2E) and a clear Definition of Done.
- Make each acceptance-criteria scenario specific to the story behavior. Do not use generic fallbacks such as "the platform completes the requested action successfully."
- Draft the story in this order: actor, capability, value, main success path, important failure path, then optional supporting sections.
- Capture negative paths, permission boundaries, and important edge cases when the source material implies them.
- Keep optional sections meaningful. If a section adds no value, mark it
N/A rather than leaving template residue.
- Prefer
N/A over generic filler for optional sections like UX, Testing Notes, or Implementation Notes.
- Keep
Source Traceability explicit. Point to the requirement note, source file, workshop note, or observed code area that justified the story.
Guardrails
- Do not invent requirements, integrations, frameworks, test tools, or architecture decisions that were not supplied or observed.
- Do not collapse unrelated work into giant placeholder stories just to reduce story count.
- Do not create filler-heavy optional sections.
- Do not use boilerplate prose that could fit any story, especially in
So that, Context, and Acceptance Criteria.
- Do not claim a story pack is ready without running validation or clearly stating that validation was not run.
- Do not patch exported CSV by hand and treat it as authoritative. The markdown stories are the source of truth.
- When evidence is thin, label the gap in
Open Questions, Scope Notes, or the delivery summary.
Output Contract
Default output shape:
stories/
|-- epic-01-example-capability/
| |-- US-001-first-story.md
| `-- US-002-second-story.md
`-- epic-02-next-capability/
`-- US-003-third-story.md
Each story must follow the canonical structure in references/user-story-template.md.
When useful, also provide:
- an epic overview based on references/epic-overview-template.md
- a validation report from
scripts/validate-stories.js
- a story-pack summary from
scripts/story-pack-report.js
- a CSV export for the user-requested backlog platform
Memory Model
Use memory deliberately and keep the boundaries explicit.
Runtime memory
Use runtime memory for the current task only:
- extracted actors
- provisional epic candidates
- unresolved requirement gaps
- observed numbering continuity
- temporary export or validation results
Do not assume runtime notes become persistent.
Project or skill memory
Use project-local persistent memory only when it materially helps repeated work inside one repository or one backlog pack.
Examples:
- local naming preferences that are stable for this repository
- confirmed export defaults for this project
- a vetted assumptions ledger that the user wants preserved locally
If you persist project-local memory, keep it auditable and scoped to this repository. Do not silently promote temporary notes.
Shared memory
Do not implement shared cross-agent memory inside this skill.
If the task truly requires reusable cross-repository conventions, treat shared memory as an external dependency and integrate through a dedicated shared-memory skill or equivalent boundary.
References To Load As Needed
- references/user-story-template.md: canonical story file structure
- references/naming-convention.md: epic folder, story ID, and filename rules
- references/story-pack-structure.md: expected directory layout and derived artifacts
- references/backlog-quality-checklist.md: ready-for-review checklist
- references/story-drafting-playbook.md: field-by-field drafting guidance for stronger story prose
- references/acceptance-criteria-patterns.md: scenario selection patterns for story-specific Gherkin
- references/export-guide.md: export behavior and field mappings
- docs/adapt-for-your-org.md: safe customization guidance
- docs/story-pack-quality-workflow.md: repeatable validation and refinement loop
- docs/memory-model.md: repository memory policy and promotion rules
Tooling
Useful commands:
node scripts/validate-stories.js <dir>
node scripts/validate-stories.js <dir> --json
node scripts/lint-story-quality.js <dir>
node scripts/story-quality-report.js <dir>
node scripts/refine-generic-story-pack.js <dir>
node scripts/improve-story-pack.js <dir> --refine
node scripts/export-stories.js <dir> <out.csv> jira
node scripts/story-pack-report.js <dir>
node scripts/inspect-codebase-context.js <path>
Run validation before export whenever feasible.
Run the story-quality lint when you need confidence that the pack is not merely structurally valid but also free of obvious boilerplate.
Run the story-quality report when the pack is large and you need a concise hotspot summary before refining weak stories.
Run the generic-story refiner when a pack clearly contains reusable boilerplate that should be replaced with story-specific value, context, and scenarios.
Run the improvement workflow when you want validation, reporting, optional refinement, and post-checks in one repeatable step.
1---2name: backlog-story-generator3description: Generate structured epics, backlog-ready user stories, and ticket-import packs from requirements, discovery notes, workshops, SOPs, existing backlog folders, or an observed codebase. Use to decompose scope into epics, write user stories with Gherkin acceptance criteria, preserve numbering, validate, or export to Jira, Azure DevOps, GitHub Issues, or Tulip.4---56# Backlog Story Generator78> **Version:** 5.3.191011Generate a reviewable backlog pack from messy or incomplete source material without pretending unknown details are known.1213Use this skill to turn requirements into:14- epic folders15- one markdown file per user story16- optional import-ready CSV exports17- a short delivery summary with assumptions, gaps, and validation results1819## Responsibility2021This skill is responsible for:22- shaping epics around business capabilities or workflow boundaries23- writing implementable user stories with observable Gherkin scenarios24- generating technical contracts including Data Models, API specifications, UI flows, and selectively useful diagrams25- preserving traceability to the provided source material26- extending an existing numbered story pack safely27- validating the generated pack before claiming it is ready28- exporting validated story packs into supported backlog-tool CSV formats2930This skill is not responsible for:31- inventing product decisions the source material does not support32- silently filling in architecture, APIs, vendors, or frameworks without evidence33- creating implementation plans disguised as user stories34- managing cross-agent shared memory inside this repository3536## Supported Inputs3738Accept any combination of:39- PRDs, feature briefs, workshop notes, discovery notes, SOPs, or markdown requirements40- existing backlog folders that already contain numbered story files41- a local codebase path when the backlog should be grounded in observed implementation evidence42- export target preferences such as `jira`, `ado`, `github`, or `tulip`4344Treat scattered or conflicting inputs as a reason to surface assumptions and open questions, not as permission to fabricate certainty.4546## Core Workflow4748Follow this sequence unless the user explicitly asks for a narrower task.49501. Ingest the source material.51 Distinguish confirmed requirements, inferred structure, unresolved gaps, and implementation evidence.522. Ground the work.53 If a codebase path is provided, run:5455 ```bash56 node scripts/inspect-codebase-context.js <path-to-codebase>57 ```5859 Use only observed files and dependencies as evidence.603. Inspect any existing pack before adding new stories.61 Find the highest existing story ID and continue numbering from there.62 Never renumber existing stories unless the task is explicitly a migration or normalization.634. Shape epics.64 Group stories by business capability, workflow boundary, or operational concern.65 Prefer stable business language over team-specific implementation jargon.665. Draft stories.67 Use [references/user-story-template.md](references/user-story-template.md) as the canonical structure.68 Use [references/naming-convention.md](references/naming-convention.md) for epic folders, IDs, and filenames.69 Use [references/story-drafting-playbook.md](references/story-drafting-playbook.md) when the source material is broad, messy, or likely to produce generic prose.70 Use [references/acceptance-criteria-patterns.md](references/acceptance-criteria-patterns.md) when scenarios start sounding reusable across unrelated stories.716. Preserve evidence and scope.72 Put business rules, dependencies, non-functional needs, and traceability into the appropriate sections instead of hiding them inside the story statement.737. Validate before delivery.7475 ```bash76 node scripts/validate-stories.js <story-pack-directory>77 ```7879 Fix validation failures before presenting the output as ready.80 If the pack is large or the prose quality is uneven, also run:8182 ```bash83 node scripts/story-quality-report.js <story-pack-directory>84 ```8586 Use the summary to identify repeated weak fields before doing a refinement pass.87 When the pack is structurally valid but still generic, run:8889 ```bash90 node scripts/refine-generic-story-pack.js <story-pack-directory>91 ```9293 Then rerun validation and the quality checks before calling the pack ready.94 If you want the repository to handle that whole quality-improvement loop in one command, run:9596 ```bash97 node scripts/improve-story-pack.js <story-pack-directory> --refine98 ```99100 Use `--force-refine` when you intentionally want to reapply deterministic refinements to an already clean pack.1018. Export only from validated markdown source when requested.102103 ```bash104 node scripts/export-stories.js <story-pack-directory> <output.csv> <format>105 ```1061079. Deliver a concise closeout.108 Report what was created or changed, what was validated, any exports produced, the assumptions made, and any open questions that still need human decisions.109110## Gotchas111112- A structurally valid pack can still be low quality. Validation catches contract problems; use the quality lint and quality report to catch generic prose.113- Blind runs from messy source material often preserve source noise unless you deliberately normalize duplicated sections, malformed actor phrasing, or mixed-language lines.114- Blind runs and curated benchmark packs may legitimately differ in story count when trailing notes, duplicated sections, or field wishlists are classified differently. Make that decision explicit instead of treating every count change as an error.115- Do not mistake the sandbox output for the skill contract. The markdown pack is a benchmark surface; the real capability is the generation, validation, refinement, and export workflow.116- If acceptance criteria start sounding reusable across unrelated stories, stop and rewrite them before continuing. Generic success-path scaffolding is one of the easiest ways to produce weak backlog output.117- `Context` should explain the capability, the AS-IS state, the TO-BE state, the user gain, and the story's relationship to the rest of the epic and product. It should never describe the prompt, template, reconstruction process, or repository mechanics.118- When the source contains trailing notes, field wishlists, or partial ideas, decide explicitly whether they belong in stories, epic notes, or open questions. Do not let them drift into the pack by accident.119120## Story Authoring Rules121122- Write one markdown file per story.123- Use globally sequential `US-###` identifiers unless the repository already establishes a different convention.124- Keep story titles action-oriented and specific.125- Use concrete actors in the `As a` clause whenever possible.126- Make the `So that` clause express business value or operational outcome.127- Do not restate the epic name or say the capability is merely "available in the platform" as the value statement.128- Write `Context` as a short explanation of what the story is, what it changes from AS-IS to TO-BE, what users gain, and how it fits with the rest of the epic and product. Do not describe the prompt, repository, template, or reconstruction process there.129- Write acceptance criteria as observable `Given / When / Then` scenarios.130- Cover Happy Path, Alternative Flow, and Error/Edge cases in every story.131- Include technical contracts (Data Model, API, UI, and Diagrams) when the source material supports them.132- Treat `Diagrams` as an optional section. Decide whether a diagram materially clarifies the story before adding one, choose a fitting notation such as Mermaid, UML, or BPMN, and include a short explanation of what each diagram shows and why it matters.133- Define a comprehensive testing strategy (Unit, Integration, E2E) and a clear Definition of Done.134- Make each acceptance-criteria scenario specific to the story behavior. Do not use generic fallbacks such as "the platform completes the requested action successfully."135- Draft the story in this order: actor, capability, value, main success path, important failure path, then optional supporting sections.136- Capture negative paths, permission boundaries, and important edge cases when the source material implies them.137- Keep optional sections meaningful. If a section adds no value, mark it `N/A` rather than leaving template residue.138- Prefer `N/A` over generic filler for optional sections like `UX`, `Testing Notes`, or `Implementation Notes`.139- Keep `Source Traceability` explicit. Point to the requirement note, source file, workshop note, or observed code area that justified the story.140141## Guardrails142143- Do not invent requirements, integrations, frameworks, test tools, or architecture decisions that were not supplied or observed.144- Do not collapse unrelated work into giant placeholder stories just to reduce story count.145- Do not create filler-heavy optional sections.146- Do not use boilerplate prose that could fit any story, especially in `So that`, `Context`, and `Acceptance Criteria`.147- Do not claim a story pack is ready without running validation or clearly stating that validation was not run.148- Do not patch exported CSV by hand and treat it as authoritative. The markdown stories are the source of truth.149- When evidence is thin, label the gap in `Open Questions`, `Scope Notes`, or the delivery summary.150151## Output Contract152153Default output shape:154155```text156stories/157|-- epic-01-example-capability/158| |-- US-001-first-story.md159| `-- US-002-second-story.md160`-- epic-02-next-capability/161 `-- US-003-third-story.md162```163164Each story must follow the canonical structure in [references/user-story-template.md](references/user-story-template.md).165166When useful, also provide:167- an epic overview based on [references/epic-overview-template.md](references/epic-overview-template.md)168- a validation report from `scripts/validate-stories.js`169- a story-pack summary from `scripts/story-pack-report.js`170- a CSV export for the user-requested backlog platform171172## Memory Model173174Use memory deliberately and keep the boundaries explicit.175176### Runtime memory177178Use runtime memory for the current task only:179- extracted actors180- provisional epic candidates181- unresolved requirement gaps182- observed numbering continuity183- temporary export or validation results184185Do not assume runtime notes become persistent.186187### Project or skill memory188189Use project-local persistent memory only when it materially helps repeated work inside one repository or one backlog pack.190Examples:191- local naming preferences that are stable for this repository192- confirmed export defaults for this project193- a vetted assumptions ledger that the user wants preserved locally194195If you persist project-local memory, keep it auditable and scoped to this repository. Do not silently promote temporary notes.196197### Shared memory198199Do not implement shared cross-agent memory inside this skill.200If the task truly requires reusable cross-repository conventions, treat shared memory as an external dependency and integrate through a dedicated shared-memory skill or equivalent boundary.201202## References To Load As Needed203204- [references/user-story-template.md](references/user-story-template.md): canonical story file structure205- [references/naming-convention.md](references/naming-convention.md): epic folder, story ID, and filename rules206- [references/story-pack-structure.md](references/story-pack-structure.md): expected directory layout and derived artifacts207- [references/backlog-quality-checklist.md](references/backlog-quality-checklist.md): ready-for-review checklist208- [references/story-drafting-playbook.md](references/story-drafting-playbook.md): field-by-field drafting guidance for stronger story prose209- [references/acceptance-criteria-patterns.md](references/acceptance-criteria-patterns.md): scenario selection patterns for story-specific Gherkin210- [references/export-guide.md](references/export-guide.md): export behavior and field mappings211- [docs/adapt-for-your-org.md](docs/adapt-for-your-org.md): safe customization guidance212- [docs/story-pack-quality-workflow.md](docs/story-pack-quality-workflow.md): repeatable validation and refinement loop213- [docs/memory-model.md](docs/memory-model.md): repository memory policy and promotion rules214215## Tooling216217Useful commands:218219```bash220node scripts/validate-stories.js <dir>221node scripts/validate-stories.js <dir> --json222node scripts/lint-story-quality.js <dir>223node scripts/story-quality-report.js <dir>224node scripts/refine-generic-story-pack.js <dir>225node scripts/improve-story-pack.js <dir> --refine226node scripts/export-stories.js <dir> <out.csv> jira227node scripts/story-pack-report.js <dir>228node scripts/inspect-codebase-context.js <path>229```230231Run validation before export whenever feasible.232Run the story-quality lint when you need confidence that the pack is not merely structurally valid but also free of obvious boilerplate.233Run the story-quality report when the pack is large and you need a concise hotspot summary before refining weak stories.234Run the generic-story refiner when a pack clearly contains reusable boilerplate that should be replaced with story-specific value, context, and scenarios.235Run the improvement workflow when you want validation, reporting, optional refinement, and post-checks in one repeatable step.