agentleFS
mattstrublemattstruble/skills/prd-to-stories/SKILL.md

prd-to-stories

Skill2 starsChanged 4 months agoMITView on GitHub

Decompose a behavioral PRD into deliverable stories with technically specific acceptance criteria, saved as Markdown files. Use when the user wants to generate stories from a PRD, break capability groups into work items, create acceptance criteria, or go from PRD to implementable stories. Also trigger when the user mentions \"stories from PRD\", \"decompose the PRD\", \"break down capabilities\", or wants to turn behavioral requirements into testable deliverables.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. About 0 are common, 16 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before reading the PRD, explore the repo.

    line 24
  2. Very specific:

    Do NOT read or surface the contents of secrets files (.env, *.key, credentials.*, secrets/).

    line 32
  3. Very specific:

    Check if docs/prd.md exists.

    line 36
  4. Very specific:

    If not found, ask the user where the PRD is or to paste it directly.

    line 40
  5. Distinctive:

    If the PRD has more than 5 capability groups, recommend starting with one — generating all stories at once tends to produce lower-quality …

    line 48
  6. Distinctive:

    If the PRD has no capability groups (behaviors are in a flat list), treat the entire PRD as a single capability group and proceed.

    line 50
  7. Very specific:

    Check if docs/stories/ exists and contains any files.

    line 54
  8. Distinctive:

    If overlapping story files exist, ask:

    line 56
  9. Distinctive:

    Read the selected capability group(s) from the PRD.

    line 64
  10. Distinctive:

    Keep this brief — the PRD interview already captured the high-level behaviors.

    line 87
  11. Distinctive:

    If the user gives two consecutive non-answers on the same question, move on and record it as an Open Question in the story.

    line 89
  12. Distinctive:

    After completing interviews for all stories, scan for contradictory answers on shared technical concerns (e.g., latency, error behavior, …

    line 91
  13. Very specific:

    Read technical-writing/references/simplified-technical-english.md from the skills catalog before you write, and write every story in that …

    line 95
  14. Very specific:

    Write one file per story to docs/stories/<story-name>.md using kebab-case naming derived from the story title.

    line 97
  15. Distinctive:

    Do NOT commit the files — not even if the user says "save" or "finalize".

    line 99
  16. Distinctive:

    After writing stories, report which PRD behaviors from the selected scope are covered and which aren't.

    line 103
  17. Distinctive:

    If fewer than half the behaviors in the selected scope are covered, ask whether the user wants to continue with the remaining behaviors now …

    line 107
  18. Very specific:

    Check if .beads/ exists in the project root.

    line 111
  19. Very specific:

    If .beads/ exists, create beads tasks mirroring the story files:

    line 113
  20. Very specific:

    After all tasks are created, report the IDs created: "Created beads epic bd-42 with tasks bd-43, bd-44, bd-45."

    line 132
  21. Distinctive:

    If a beads command fails, log the error and continue — do not abort story creation.

    line 137
  22. Very specific:

    Do not create duplicate epics if an epic for the same capability group already exists.

    line 138
  23. Distinctive:

    Condition, actor, result: Write each criterion as "When [condition], [actor] [observable result]." One result per criterion.

    line 179
  24. Distinctive:

    Exact outcomes: No verdict words ("invalid", "malformed", "handles", "supports", "gracefully").

    line 183
  25. Distinctive:

    Same terms as the PRD: Use the PRD's term for each concept.

    line 187
  26. Distinctive:

    Final check: Before you report the files, run the reference's final check over each story and fix what it finds.

    line 197

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PRD to Stories

Decompose a behavioral PRD into independently deliverable stories with technically specific acceptance criteria. Each story is a Markdown file in docs/stories/. This skill reads a PRD and produces the next level of granularity below capability groups.

Scope Model

prd-writing produces: PRD → Capability Groups → Behaviors

This skill produces: Behaviors → Stories (docs/stories/*.md) → Acceptance Criteria

Workflow

Step 1: Explore the codebase

Before reading the PRD, explore the repo. The codebase provides technical context needed for specific acceptance criteria — what exists, what patterns are used, what constraints are real.

Look for:

  • Code structure and module organization
  • Existing tests and how they verify behavior
  • Integration points, external dependencies, and API contracts
  • Any prior stories, specs, or design docs in docs/

Do NOT read or surface the contents of secrets files (.env, *.key, credentials.*, secrets/). Do not reproduce literal hostnames, connection strings, or API keys in story files.

Step 2: Find the PRD

Check if docs/prd.md exists. If found, read it, briefly summarize what it covers, and confirm with the user:

"I found a PRD at docs/prd.md covering [brief summary — fill in from the Problem Statement or first capability group]. Should I use this?"

If not found, ask the user where the PRD is or to paste it directly. If the user cannot locate a PRD, offer to run the prd-writing skill first.

Step 3: Ask scope

Ask the user:

"Do you want to generate stories for the entire PRD, or for a specific capability group?"

If the PRD has more than 5 capability groups, recommend starting with one — generating all stories at once tends to produce lower-quality output. If the user selects the entire PRD and it has more than 5 groups, confirm once more before proceeding.

If the PRD has no capability groups (behaviors are in a flat list), treat the entire PRD as a single capability group and proceed.

Step 4: Check for existing story files

Check if docs/stories/ exists and contains any files. Determine overlap by checking whether existing files reference the same capability group in their Source section or have titles that correspond to the selected scope.

If overlapping story files exist, ask:

"I found existing stories in docs/stories/ that cover [capability group name] — should I update them or start fresh?"

Clarify: "start fresh" means writing new files alongside existing ones, not deleting them. Warn the user before overwriting any existing file.

Step 5: Propose stories

Read the selected capability group(s) from the PRD. Note any behaviors that depend on behaviors in other capability groups — flag these as Open Questions in the affected stories.

Propose a story decomposition. For each proposed story, show:

  • Title: short descriptive name
  • Behaviors covered: which PRD behaviors this story addresses
  • Draft acceptance criteria: initial set of checkboxes

Then ask: "Does this decomposition look right? Should any stories be merged or split?"

Iterate until the user approves the structure. If the user has requested more than three rounds of restructuring without approving, ask: "Should we proceed with the current decomposition and record remaining concerns as Open Questions?"

Step 6: Technical precision interview

For each proposed story, briefly interview the user about technical specifics. Ask one question at a time. Focus on:

  • Boundary conditions ("What's the maximum number of results?")
  • Error behavior ("What happens when the API returns a 500?")
  • Performance expectations ("Is there a latency requirement for this?")
  • Integration points ("Does this need to work with the existing auth system?")

Provide a recommended answer with each question, grounded in what you found during codebase exploration. Reference patterns and behaviors — not literal hostnames, IP addresses, or connection strings.

Keep this brief — the PRD interview already captured the high-level behaviors. This interview adds technical precision. If a story has no unresolved technical questions after codebase exploration, skip the interview for that story and proceed directly to writing.

If the user gives two consecutive non-answers on the same question, move on and record it as an Open Question in the story.

After completing interviews for all stories, scan for contradictory answers on shared technical concerns (e.g., latency, error behavior, auth). Surface contradictions as Open Questions in the affected stories.

Step 7: Write story files

Read technical-writing/references/simplified-technical-english.md from the skills catalog before you write, and write every story in that Simplified Technical English. Use the PRD's Terms; add a term to the PRD's Open Questions instead of defining it differently in a story.

Write one file per story to docs/stories/<story-name>.md using kebab-case naming derived from the story title. Strip any path separators (/, \) and .. sequences from the filename. Create docs/stories/ (and docs/ if needed) if it doesn't exist.

Do NOT commit the files — not even if the user says "save" or "finalize". Writing files to disk is the complete action. Tell the user what was created.

Step 8: Report coverage

After writing stories, report which PRD behaviors from the selected scope are covered and which aren't. This is informational only — don't require 100% coverage.

Example: "5 of 7 behaviors in the Search capability group are covered. Not yet covered: bulk export, rate-limit behavior."

If fewer than half the behaviors in the selected scope are covered, ask whether the user wants to continue with the remaining behaviors now or in a future session.

Step 9: Create beads tasks (conditional)

Check if .beads/ exists in the project root. If it does not exist, skip this step entirely — behavior is unchanged.

If .beads/ exists, create beads tasks mirroring the story files:

  1. One epic per capability group covered in this session:
    bd create "<capability group name>" --description="<capability group description from PRD>" -t epic -p 1 --json
    Capture the returned epic ID (e.g., bd-42).
  2. One task per story under its epic:
    bd create "<story title>" \
      --description="<story summary paragraph>" \
      -t task \
      --parent <epic-id> \
      --acceptance="<acceptance criteria as newline-separated list>" \
      --json
    The --description value is the Summary section from the story file. The --acceptance value is the Acceptance Criteria section (criteria joined with newlines, without checkbox syntax).
  3. After all tasks are created, report the IDs created: "Created beads epic bd-42 with tasks bd-43, bd-44, bd-45."

Constraints:

  • Markdown files are always written (Step 7) regardless of beads existence. They are the committed source of truth; beads is the local execution plan.
  • If a beads command fails, log the error and continue — do not abort story creation.
  • Do not create duplicate epics if an epic for the same capability group already exists. Check with bd ready --json or bd show if unsure.

Story Template

# Story: [Story Title]

## Source
PRD Capability Group: [name]
Behaviors covered:
- [PRD behavior 1]
- [PRD behavior 2]

## Summary
Today: [current behavior, or "No current behavior."]
After this story: [required behavior, in one or two sentences].

## Acceptance Criteria
- [ ] When [condition], [actor] [observable result].
- [ ] [actor] [observable result within a numbered limit].

## Open Questions
- None.

## Out of Scope
- What this story explicitly does not cover, even if it's in the PRD.

Notes on the template:

  • Source ties back to specific PRD capability groups and behaviors — this is how coverage is tracked.
  • Acceptance Criteria are the heart — technically specific, verifiable statements with checkboxes.
  • Open Questions captures uncertainty surfaced during the technical interview. Write - None. if there are no open questions; do not omit the section.
  • Out of Scope prevents scope creep at the story level.

Writing Guidelines

Apply these when writing stories. The Simplified Technical English reference applies to every section.

  1. Acceptance criteria must be verifiable. Each criterion is one sentence that an engineer can mark pass or fail without asking the author. If you can't describe how to verify it, it's not specific enough.
  2. Condition, actor, result. Write each criterion as "When [condition], [actor] [observable result]." One result per criterion; split a criterion that joins two results with "and".
  3. Numbers, not adjectives. "Within 200 ms", "at most 50 items", not "fast" or "large". A missing number goes in Open Questions.
  4. Exact outcomes. No verdict words ("invalid", "malformed", "handles", "supports", "gracefully"). Name the status, error, message, or state the caller observes.
  5. Today versus after. The Summary separates current from required behavior. Criteria describe only the required behavior.
  6. Same terms as the PRD. Use the PRD's term for each concept; never a synonym.
  7. Be terse. Say enough to be testable, no more.
  8. Reference PRD behaviors, don't restate them. The Source section ties back to the PRD. Acceptance criteria add specificity — they don't repeat what the PRD already says.
  9. Technical specificity is welcome, implementation prescription is not. "Search returns results within 200ms" is good. "Use Elasticsearch with a fuzzy query" is not.
  10. Make uncertainty visible. Unresolved technical decisions go in Open Questions. Don't bury assumptions in acceptance criteria.
  11. Final check. Before you report the files, run the reference's final check over each story and fix what it finds. Beads descriptions and acceptance fields copy the checked text.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.