Ralph PRD Creator
Create machine-executable PRDs that drive autonomous AI coding loops to reliable completion. A Ralph PRD is not a traditional spec — it's a living data structure the agent reads, executes against, and updates every iteration.
Core Principle
The PRD defines the end state. The agent figures out how to get there. Describe WHAT done looks like with:
- acceptance criteria — what must happen
- anti-criteria — what must never happen
- quantitative criteria — thresholds, budgets, and limits when available
Do NOT describe HOW to implement it step by step.
Working Style
- Keep the PRD high-signal. Skip ceremony.
- Extract constraints from the conversation before decomposing stories.
- Preserve exact user thresholds and hard prohibitions verbatim.
- Do not invent numeric targets just to make the PRD look precise.
- If a later story replaces an earlier requirement, record that explicitly so the agent does not treat obsolete constraints as still active.
Reference Files
Load these based on the task:
- PRD JSON schema and field reference: See
references/prd-schema.md
- Writing story criteria (acceptance, anti, quantitative): See
references/acceptance-criteria.md
- Story sizing, splitting, and dependency ordering: See
references/story-decomposition.md
- CLAUDE.md, AGENTS.md, and progress.txt patterns: See
references/companion-files.md
- Common failure modes and prevention: See
references/failure-modes.md
- Complete working example (Go/K8s): See
references/example-prd.json
Workflow: Creating a PRD from Scratch
Step 1: GATHER REQUIREMENTS
Recover from the conversation first. Ask only for information still missing.
Extract these before writing the PRD:
EX-Q: quantitative limits and thresholds
EX-P: prohibitions and must-not rules
EX-R: mandatory requirements
EX-I: assumptions, conventions, and non-goals
Then ask for any missing high-impact gaps:
- What are you building? (feature, tool, module, operator, pipeline)
- What's the tech stack? (language, framework, database, infra tools)
- What does "done" look like? (observable behaviors, outputs, endpoints)
- What's the scope? (MVP, full feature, spike/prototype)
- What quality tooling exists? (linter, type checker, test framework, CI)
- What should NOT be built? (explicit non-goals prevent scope creep)
- What exact limits matter? (latency, coverage, image size, concurrency, budgets)
- If this evolves an existing PRD: what older requirement or story is now obsolete? (capture invalidation explicitly)
If the user provides a vague description ("build me a CLI tool"), use the interview technique: ask the agent-relevant questions the user hasn't thought about — error handling strategy, output formats, configuration approach, testing strategy.
Step 2: READ ONLY THE NEEDED REFERENCES
Always load:
references/prd-schema.md — to use the correct JSON structure
references/acceptance-criteria.md — to write verifiable story criteria for the user's stack
Load only when needed:
references/story-decomposition.md — when creating or resizing stories
references/companion-files.md — when creating companion files
references/failure-modes.md — when pressure-testing the PRD or reviewing an existing one
references/example-prd.json — when the user wants an example or concrete pattern
Step 3: EXTRACT THE CONSTRAINTS INTO THE PRD
Create a compact root-level constraints block in prd.json with only decision-relevant items:
quantitative — explicit limits and thresholds from the conversation
prohibitions — must-not rules and scope boundaries
requirements — hard requirements the agent must satisfy
assumptions — implicit conventions, defaults, and non-goals
Rules:
- Prefer exact values from the conversation.
- If the user gave a relative requirement but no number, convert it into a measurable state when possible.
- Do not invent arbitrary numbers.
- If no quantitative constraint exists, leave the relevant list empty instead of fabricating one.
Step 4: DECOMPOSE INTO STORIES
Follow the decomposition rules in references/story-decomposition.md:
- Identify the real dependency order and prefer the smallest complete slice that can pass on its own
- Split into stories that each fit one agent context window (1-3 file changes, describable in 2-3 sentences)
- Set
dependsOn to enforce ordering
- Assign priority numbers (lower = higher priority = executed first)
- Assign effort labels (low/medium/high) for iteration estimation
Step 5: WRITE STORY CRITERIA
For each story, write criteria following references/acceptance-criteria.md:
- Write
acceptanceCriteria for what must happen
- Write
antiCriteria for what must never happen
- Write
quantitativeCriteria for budgets, thresholds, and numeric limits when the conversation or tooling supports them
- Append the project's quality gates from the user's tooling to
acceptanceCriteria on EVERY story
- Verify every criterion is machine-checkable (a command that returns pass/fail or a concrete observable state)
- Check for vague language — "works correctly", "handles edge cases", "good UX" are NEVER acceptable
Minimum bar:
- Every non-trivial story should include at least one anti-criterion.
- Add quantitative criteria whenever the conversation, existing tooling, or the domain gives a real number.
- If a story has no honest numeric threshold, keep
quantitativeCriteria empty rather than guessing.
Step 6: TRACK INVALIDATED STORIES EXPLICITLY
When a new story replaces or makes an earlier story obsolete, add supersedes to the new story.
Use it when:
- a temporary requirement is no longer valid
- a later design decision replaces an earlier one
- an old story would otherwise create false objections during later iterations
Rules:
- Prefer putting the relationship on the new story (
supersedes) rather than mutating history everywhere.
- Include the reason, not just the story ID.
- Use
supersedes only when the newer story fully replaces or invalidates the older one.
- Later stories win over superseded earlier stories when they conflict.
- Do not use
supersedes for normal dependency flow; use it only for true invalidation or replacement.
Step 7: WRITE COMPANION FILES
Create the supporting files per references/companion-files.md:
- CLAUDE.md or AGENTS.md — tech stack, conventions, MUST/MUST NOT rules, non-goals
- progress.txt — empty file, will be populated by the agent
- Makefile or task runner — with targets referenced in acceptance criteria
Step 8: VALIDATE THE PRD
Run through this checklist before delivering:
Step 9: DELIVER
Output these files:
- prd.json — the structured PRD
- CLAUDE.md (or AGENTS.md) — project constraints and conventions
- Makefile (or equivalent) — build/test/lint commands referenced in criteria
- Optionally: progress.txt — empty, ready for agent use
- Optionally: .golangci-lint.yaml / .eslintrc / linter config — quality tooling
Present a summary: total stories, rough iteration range, dependency graph overview, extracted constraints summary, any superseded stories, and any risks or ambiguities the user should resolve before running.
Workflow: Reviewing an Existing PRD
When the user provides an existing PRD for review:
- Load
references/prd-schema.md and validate the JSON structure
- Load
references/acceptance-criteria.md and check acceptance, anti-, and quantitative criteria for vagueness or loopholes
- Load
references/story-decomposition.md and check story sizing
- Load
references/failure-modes.md and scan for known anti-patterns
- Check whether root constraints from the conversation were actually preserved in the PRD
- Check whether superseded stories are tracked clearly enough to avoid obsolete requirements blocking future work
- Report issues using the validation checklist from Step 8
- Suggest specific fixes with before/after examples
Quick Reference: The 12 Rules
These are the most common mistakes. Check them first:
- JSON, not Markdown — agents are less likely to edit JSON inappropriately
- One story = one context window — if you can't describe the change in 2-3 sentences, split it
- Extract constraints first — capture thresholds, prohibitions, requirements, assumptions before story writing
- Acceptance + anti + quantitative — every story should say what must happen, what must not happen, and which limits matter
- Commands, states, thresholds — not adjectives — criteria must be testable, inspectable, or measurable
- Quality gates on EVERY story — append the project's real build/test/lint/validate/plan checks from the user's stack
- Explicit tech stack — agents have no opinions; without constraints they pick randomly
- Non-goals listed — agents cannot infer from omission; explicitly exclude unwanted features
- MUST/MUST NOT language — "consider using X" gets ignored; "MUST use X, MUST NOT use Y" gets followed
- Track invalidation explicitly — if a later story replaces an earlier one, add
supersedes
- Notes field for inter-iteration memory — agents write discoveries here for future iterations
- Set iteration caps — infinite loops with stochastic systems burn money and produce garbage
Source: mgajewskik/opencode-config — distributed by TomeVault.
1---2name: ralph-prd-creator3description: Create effective PRDs (Product Requirements Documents) for Ralph loops / Ralph Wiggum autonomous AI coding agents. Use whenever the user wants to create a PRD, task list, or specification for use with Ralph loops, Claude Code loops, Codex loops, or any autonomous agent loop. Also use when the user says 'create a PRD', 'write a task list for ralph', 'break this down into stories', 'plan this feature for autonomous coding', 'help me write acceptance criteria', 'prepare this for a ralph loop', or mentions creating prd.json. Also trigger when the user asks how to structure work for AI agents, wants to decompose a feature into agent-executable tasks, or needs help writing CLAUDE.md / AGENTS.md companion files for autonomous coding. Covers PRD schema, extracted constraints, machine-verifiable acceptance criteria, anti-criteria, quantified criteria, story invalidation tracking, quality gates, progress tracking, failure prevention, and companion file creation for DevOps/cloud-native/infrastructure projects. Use when 4---56# Ralph PRD Creator78Create machine-executable PRDs that drive autonomous AI coding loops to reliable completion. A Ralph PRD is not a traditional spec — it's a **living data structure** the agent reads, executes against, and updates every iteration.910## Core Principle1112**The PRD defines the end state. The agent figures out how to get there.** Describe WHAT done looks like with:1314- acceptance criteria — what must happen15- anti-criteria — what must never happen16- quantitative criteria — thresholds, budgets, and limits when available1718Do NOT describe HOW to implement it step by step.1920## Working Style2122- Keep the PRD high-signal. Skip ceremony.23- Extract constraints from the conversation before decomposing stories.24- Preserve exact user thresholds and hard prohibitions verbatim.25- Do not invent numeric targets just to make the PRD look precise.26- If a later story replaces an earlier requirement, record that explicitly so the agent does not treat obsolete constraints as still active.2728## Reference Files2930Load these based on the task:3132- **PRD JSON schema and field reference**: See `references/prd-schema.md`33- **Writing story criteria (acceptance, anti, quantitative)**: See `references/acceptance-criteria.md`34- **Story sizing, splitting, and dependency ordering**: See `references/story-decomposition.md`35- **CLAUDE.md, AGENTS.md, and progress.txt patterns**: See `references/companion-files.md`36- **Common failure modes and prevention**: See `references/failure-modes.md`37- **Complete working example (Go/K8s)**: See `references/example-prd.json`3839## Workflow: Creating a PRD from Scratch4041### Step 1: GATHER REQUIREMENTS4243Recover from the conversation first. Ask only for information still missing.4445Extract these before writing the PRD:4647- `EX-Q`: quantitative limits and thresholds48- `EX-P`: prohibitions and must-not rules49- `EX-R`: mandatory requirements50- `EX-I`: assumptions, conventions, and non-goals5152Then ask for any missing high-impact gaps:53541. **What are you building?** (feature, tool, module, operator, pipeline)552. **What's the tech stack?** (language, framework, database, infra tools)563. **What does "done" look like?** (observable behaviors, outputs, endpoints)574. **What's the scope?** (MVP, full feature, spike/prototype)585. **What quality tooling exists?** (linter, type checker, test framework, CI)596. **What should NOT be built?** (explicit non-goals prevent scope creep)607. **What exact limits matter?** (latency, coverage, image size, concurrency, budgets)618. **If this evolves an existing PRD: what older requirement or story is now obsolete?** (capture invalidation explicitly)6263If the user provides a vague description ("build me a CLI tool"), use the interview technique: ask the agent-relevant questions the user hasn't thought about — error handling strategy, output formats, configuration approach, testing strategy.6465### Step 2: READ ONLY THE NEEDED REFERENCES6667Always load:6869- `references/prd-schema.md` — to use the correct JSON structure70- `references/acceptance-criteria.md` — to write verifiable story criteria for the user's stack7172Load only when needed:7374- `references/story-decomposition.md` — when creating or resizing stories75- `references/companion-files.md` — when creating companion files76- `references/failure-modes.md` — when pressure-testing the PRD or reviewing an existing one77- `references/example-prd.json` — when the user wants an example or concrete pattern7879### Step 3: EXTRACT THE CONSTRAINTS INTO THE PRD8081Create a compact root-level `constraints` block in `prd.json` with only decision-relevant items:8283- `quantitative` — explicit limits and thresholds from the conversation84- `prohibitions` — must-not rules and scope boundaries85- `requirements` — hard requirements the agent must satisfy86- `assumptions` — implicit conventions, defaults, and non-goals8788Rules:8990- Prefer exact values from the conversation.91- If the user gave a relative requirement but no number, convert it into a measurable state when possible.92- Do not invent arbitrary numbers.93- If no quantitative constraint exists, leave the relevant list empty instead of fabricating one.9495### Step 4: DECOMPOSE INTO STORIES9697Follow the decomposition rules in `references/story-decomposition.md`:98991. Identify the real dependency order and prefer the smallest complete slice that can pass on its own1002. Split into stories that each fit one agent context window (1-3 file changes, describable in 2-3 sentences)1013. Set `dependsOn` to enforce ordering1024. Assign priority numbers (lower = higher priority = executed first)1035. Assign effort labels (low/medium/high) for iteration estimation104105### Step 5: WRITE STORY CRITERIA106107For each story, write criteria following `references/acceptance-criteria.md`:1081091. Write `acceptanceCriteria` for what must happen1102. Write `antiCriteria` for what must never happen1113. Write `quantitativeCriteria` for budgets, thresholds, and numeric limits when the conversation or tooling supports them1124. Append the project's quality gates from the user's tooling to `acceptanceCriteria` on EVERY story1135. Verify every criterion is machine-checkable (a command that returns pass/fail or a concrete observable state)1146. Check for vague language — "works correctly", "handles edge cases", "good UX" are NEVER acceptable115116Minimum bar:117118- Every non-trivial story should include at least one anti-criterion.119- Add quantitative criteria whenever the conversation, existing tooling, or the domain gives a real number.120- If a story has no honest numeric threshold, keep `quantitativeCriteria` empty rather than guessing.121122### Step 6: TRACK INVALIDATED STORIES EXPLICITLY123124When a new story replaces or makes an earlier story obsolete, add `supersedes` to the new story.125126Use it when:127128- a temporary requirement is no longer valid129- a later design decision replaces an earlier one130- an old story would otherwise create false objections during later iterations131132Rules:133134- Prefer putting the relationship on the new story (`supersedes`) rather than mutating history everywhere.135- Include the reason, not just the story ID.136- Use `supersedes` only when the newer story fully replaces or invalidates the older one.137- Later stories win over superseded earlier stories when they conflict.138- Do not use `supersedes` for normal dependency flow; use it only for true invalidation or replacement.139140### Step 7: WRITE COMPANION FILES141142Create the supporting files per `references/companion-files.md`:1431441. **CLAUDE.md or AGENTS.md** — tech stack, conventions, MUST/MUST NOT rules, non-goals1452. **progress.txt** — empty file, will be populated by the agent1463. **Makefile or task runner** — with targets referenced in acceptance criteria147148### Step 8: VALIDATE THE PRD149150Run through this checklist before delivering:151152- [ ] Every story fits in one context window (1-3 file changes)153- [ ] Root `constraints` block captures the conversation's important thresholds, prohibitions, requirements, and assumptions154- [ ] Every acceptance criterion is a runnable command or concrete observable state155- [ ] Every non-trivial story has at least one anti-criterion156- [ ] Quantitative criteria include exact thresholds when available and stay empty when none exist157- [ ] No vague criteria ("works correctly", "handles edge cases", "good UX")158- [ ] Project quality gates from the user's stack appear on EVERY story159- [ ] `dependsOn` creates a valid DAG (no circular dependencies)160- [ ] `supersedes` appears only where a later story truly replaces an earlier one161- [ ] Stories ordered by real dependency flow, with small complete slices preferred over horizontal batching when practical162- [ ] Non-goals explicitly listed in CLAUDE.md163- [ ] Tech stack fully specified (no ambiguous choices left to the agent)164- [ ] `branchName` is kebab-case and prefixed with `ralph/`165- [ ] All stories start with `"passes": false`166- [ ] Effort labels assigned for iteration estimation167168### Step 9: DELIVER169170Output these files:1711721. **prd.json** — the structured PRD1732. **CLAUDE.md** (or AGENTS.md) — project constraints and conventions1743. **Makefile** (or equivalent) — build/test/lint commands referenced in criteria1754. Optionally: **progress.txt** — empty, ready for agent use1765. Optionally: **.golangci-lint.yaml** / **.eslintrc** / linter config — quality tooling177178Present a summary: total stories, rough iteration range, dependency graph overview, extracted constraints summary, any superseded stories, and any risks or ambiguities the user should resolve before running.179180## Workflow: Reviewing an Existing PRD181182When the user provides an existing PRD for review:1831841. Load `references/prd-schema.md` and validate the JSON structure1852. Load `references/acceptance-criteria.md` and check acceptance, anti-, and quantitative criteria for vagueness or loopholes1863. Load `references/story-decomposition.md` and check story sizing1874. Load `references/failure-modes.md` and scan for known anti-patterns1885. Check whether root constraints from the conversation were actually preserved in the PRD1896. Check whether superseded stories are tracked clearly enough to avoid obsolete requirements blocking future work1907. Report issues using the validation checklist from Step 81918. Suggest specific fixes with before/after examples192193## Quick Reference: The 12 Rules194195These are the most common mistakes. Check them first:1961971. **JSON, not Markdown** — agents are less likely to edit JSON inappropriately1982. **One story = one context window** — if you can't describe the change in 2-3 sentences, split it1993. **Extract constraints first** — capture thresholds, prohibitions, requirements, assumptions before story writing2004. **Acceptance + anti + quantitative** — every story should say what must happen, what must not happen, and which limits matter2015. **Commands, states, thresholds — not adjectives** — criteria must be testable, inspectable, or measurable2026. **Quality gates on EVERY story** — append the project's real build/test/lint/validate/plan checks from the user's stack2037. **Explicit tech stack** — agents have no opinions; without constraints they pick randomly2048. **Non-goals listed** — agents cannot infer from omission; explicitly exclude unwanted features2059. **MUST/MUST NOT language** — "consider using X" gets ignored; "MUST use X, MUST NOT use Y" gets followed20610. **Track invalidation explicitly** — if a later story replaces an earlier one, add `supersedes`20711. **Notes field for inter-iteration memory** — agents write discoveries here for future iterations20812. **Set iteration caps** — infinite loops with stochastic systems burn money and produce garbage209210---211> Source: [mgajewskik/opencode-config](https://github.com/mgajewskik/opencode-config) — distributed by [TomeVault](https://tomevault.io).212<!-- tomevault:4.0:skill_md:2026-06-16 -->