/prd
---
$ golems-cli skills install prdUpdated 2 weeks ago
name: prd description: Use when planning a feature, starting a new project, or asked to create a PRD. Generates JSON-based PRD for Ralph. Adding stories uses update.json pattern. Covers PRD, create PRD, plan feature, Ralph stories. NOT for: running Ralph (user runs externally).
Create PRDs for autonomous AI implementation via Ralph loop.
The Job
- Ask 3-5 clarifying questions (use
AskUserQuestiontool) - Find git root:
git rev-parse --show-toplevel - Discover relevant skills for this project (see below)
- Create JSON output:
prd-json/index.json- Story order (stats computed automatically)prd-json/stories/{US-XXX}.json- One file per story
- Create
prd-json/AGENTS.mdwith skills section - Create
progress.txtat git root - STOP and say: "PRD ready. Run Ralph to execute."
🛑 DO NOT IMPLEMENT - Ralph handles that externally.
Skill Discovery (CRITICAL for Ralph)
Before creating stories, determine which skills are relevant for THIS project:
Step 1: Check Project Context
# What's in this project?
[ -f "convex.json" ] && echo "HAS_CONVEX=true"
[ -f ".linear" ] || grep -q "linear" package.json 2>/dev/null && echo "HAS_LINEAR=true"
[ -d "src/components" ] || [ -d "app" ] && echo "HAS_UI=true"
[ -f "playwright.config.ts" ] && echo "HAS_PLAYWRIGHT=true"Step 2: Match Skills to Project
UNIVERSAL (always include):
| Skill | Why |
|---|---|
/ralph-commit | Atomic commits with criterion check |
/coderabbit | Code review before commits (iterate until clean) |
/context7 | Look up library docs when unsure about APIs |
/github | Git operations, PRs, issues |
/create-pr | Push and create PRs |
/catchup | Context recovery after long breaks |
PROJECT-SPECIFIC (include if detected):
| If Project Has... | Include Skill | Why |
|---|---|---|
convex.json | /convex | Dev server, deploy, functions |
.linear or Linear in deps | /linear | Issue tracking |
UI (/app, /components) | /brave | Browser automation |
| 1Password secrets | /1password | Secrets management |
| Complex PRD (10+ stories) | /prd-manager | Bulk story operations |
| Needs isolation | /worktrees | Branch isolation |
DO NOT INCLUDE (meta skills, not for Ralph):
/prd,/skills,/writing-skills,/ralph-install,/example-*
Step 3: List Available Skills (Reference)
# See all installed skills
ls -1 ~/.claude/commands/*/SKILL.md 2>/dev/null | while read f; do
skill=$(dirname "$f" | xargs basename)
desc=$(awk '/^description:/{gsub(/^description: *"?/, ""); gsub(/"$/, ""); print}' "$f")
echo "/$skill: $desc"
doneStep 4: Include ONLY Relevant Skills in AGENTS.md
Don't dump all skills - only include ones this project will actually use. Ralph should see a focused list, not 20+ skills.
Story Prefix = Model Selection (CRITICAL)
Ralph routes stories to AI models based on the prefix. Wrong prefix = wrong model = failed story.
| Prefix | Model | When to Use |
|---|---|---|
US- | Sonnet | Simple features, UI, CRUD. < 5 criteria, 1-3 files. Clear implementation path. |
BUG- | Sonnet | Bug fixes, error handling, regressions. |
V- | Haiku | Verification only (checking criteria, no code changes). |
TEST- | Haiku | Writing tests only, no production code. |
MP- | Opus | Complex infra, algorithms, multi-file refactors, architectural decisions. > 6 criteria, 4+ files. |
AUDIT- | Opus | Deep code review, security, architecture. |
Decision rule: If any criterion says "approach chosen", "design decision", or requires choosing between strategies — use MP-, not US-. Sonnet struggles with open-ended design. When in doubt, use MP-.
Config: ~/.config/golems/config.json → models object. Default fallback: opus.
Full SKILL.md source — includes LLM directives, anti-patterns, and technical instructions stripped from the Overview tab.
name: prd description: Use when planning a feature, starting a new project, or asked to create a PRD. Generates JSON-based PRD for Ralph. Adding stories uses update.json pattern. Covers PRD, create PRD, plan feature, Ralph stories. NOT for: running Ralph (user runs externally).
Create PRDs for autonomous AI implementation via Ralph loop.
The Job
- Ask 3-5 clarifying questions (use
AskUserQuestiontool) - Find git root:
git rev-parse --show-toplevel - Discover relevant skills for this project (see below)
- Create JSON output:
prd-json/index.json- Story order (stats computed automatically)prd-json/stories/{US-XXX}.json- One file per story
- Create
prd-json/AGENTS.mdwith skills section - Create
progress.txtat git root - STOP and say: "PRD ready. Run Ralph to execute."
🛑 DO NOT IMPLEMENT - Ralph handles that externally.
Skill Discovery (CRITICAL for Ralph)
Before creating stories, determine which skills are relevant for THIS project:
Step 1: Check Project Context
# What's in this project?
[ -f "convex.json" ] && echo "HAS_CONVEX=true"
[ -f ".linear" ] || grep -q "linear" package.json 2>/dev/null && echo "HAS_LINEAR=true"
[ -d "src/components" ] || [ -d "app" ] && echo "HAS_UI=true"
[ -f "playwright.config.ts" ] && echo "HAS_PLAYWRIGHT=true"Step 2: Match Skills to Project
UNIVERSAL (always include):
| Skill | Why |
|---|---|
/ralph-commit | Atomic commits with criterion check |
/coderabbit | Code review before commits (iterate until clean) |
/context7 | Look up library docs when unsure about APIs |
/github | Git operations, PRs, issues |
/create-pr | Push and create PRs |
/catchup | Context recovery after long breaks |
PROJECT-SPECIFIC (include if detected):
| If Project Has... | Include Skill | Why |
|---|---|---|
convex.json | /convex | Dev server, deploy, functions |
.linear or Linear in deps | /linear | Issue tracking |
UI (/app, /components) | /brave | Browser automation |
| 1Password secrets | /1password | Secrets management |
| Complex PRD (10+ stories) | /prd-manager | Bulk story operations |
| Needs isolation | /worktrees | Branch isolation |
DO NOT INCLUDE (meta skills, not for Ralph):
/prd,/skills,/writing-skills,/ralph-install,/example-*
Step 3: List Available Skills (Reference)
# See all installed skills
ls -1 ~/.claude/commands/*/SKILL.md 2>/dev/null | while read f; do
skill=$(dirname "$f" | xargs basename)
desc=$(awk '/^description:/{gsub(/^description: *"?/, ""); gsub(/"$/, ""); print}' "$f")
echo "/$skill: $desc"
doneStep 4: Include ONLY Relevant Skills in AGENTS.md
Don't dump all skills - only include ones this project will actually use. Ralph should see a focused list, not 20+ skills.
Story Prefix = Model Selection (CRITICAL)
Ralph routes stories to AI models based on the prefix. Wrong prefix = wrong model = failed story.
| Prefix | Model | When to Use |
|---|---|---|
US- | Sonnet | Simple features, UI, CRUD. < 5 criteria, 1-3 files. Clear implementation path. |
BUG- | Sonnet | Bug fixes, error handling, regressions. |
V- | Haiku | Verification only (checking criteria, no code changes). |
TEST- | Haiku | Writing tests only, no production code. |
MP- | Opus | Complex infra, algorithms, multi-file refactors, architectural decisions. > 6 criteria, 4+ files. |
AUDIT- | Opus | Deep code review, security, architecture. |
Decision rule: If any criterion says "approach chosen", "design decision", or requires choosing between strategies — use MP-, not US-. Sonnet struggles with open-ended design. When in doubt, use MP-.
Config: ~/.config/golems/config.json → models object. Default fallback: opus.
Story Rules
Sizing (THE NUMBER ONE RULE)
Each story must complete in ONE context window (~10 min of AI work).
Right-sized: Add one component, update one action, fix one bug Too big (split): "Build dashboard" → Schema + Queries + UI + Filters
Ordering (Dependencies First)
- Schema/database
- Server actions
- UI components
- Verification stories (V-XXX)
Acceptance Criteria
- Must be verifiable (not vague)
- Include "Typecheck passes"
- Include "Verify in browser" for UI stories
⚠️ MANDATORY: Last two criteria of EVERY story (in this exact order):
"Run CodeRabbit review - must pass (or create BUG if unfixable)""Commit: {type}: {STORY-ID} {description}"
CodeRabbit ALWAYS comes BEFORE commit. No exceptions.
TDD / Test Enforcement (CRITICAL)
When to add test criteria:
- New functions/helpers: "Add unit test for [function] in tests/"
- Bug fixes: "Add regression test to prevent reintroduction"
- Core logic changes: "Verify all existing tests pass (X/X)"
- Refactors that touch tested code: "Run test suite - must pass with same count"
Why this matters: If a function has tests, and a future story accidentally deletes that function, the tests will fail and block the commit. Tests are your safety net against regressions.
Example criteria:
"Add unit test for _ralph_new_helper_function"
"Run ./tests/test-ralph.zsh - must pass (49/49)"
"Add regression test: verify X doesn't break when Y"
Commit Convention
Every story ends with a commit criterion. Match type to story:
| Story Type | Commit Type | Example |
|---|---|---|
| US-XXX (feature) | feat: | feat: US-001 add login button |
| BUG-XXX (bug fix) | fix: | fix: BUG-001 resolve crash on empty state |
| V-XXX (verification) | test: | test: V-001 verify login flow |
| TEST-XXX (e2e tests) | test: | test: TEST-001 playwright tests for auth |
| MP-XXX (infrastructure) | refactor: or chore: | refactor: MP-001 restructure auth module |
| AUDIT-XXX (audit/review) | docs: or chore: | docs: AUDIT-001 update README |
Last two criteria (always):
"Run CodeRabbit review - must pass (or create BUG if unfixable)"
"Commit: {type}: {STORY-ID} {description}"
Examples:
"Run CodeRabbit review - must pass (or create BUG if unfixable)""Commit: feat: US-034 add user profile page""Commit: fix: BUG-012 handle null response from API""Commit: test: V-034 verify profile page renders correctly""Commit: refactor: MP-002 migrate to modular contexts"
Conditional Rules
For RTL projects (Hebrew/Arabic): Include RTL checklist in stories: flex order reversal, text-right/items-end, RTL propagation in nested flex containers.
For modals/dynamic states: Each dynamic state = separate story. Don't bundle modal states into one story.
⚠️ ADDING TO EXISTING PRD (CRITICAL)
NEVER edit index.json directly when adding stories to an existing PRD!
Use prd-json/update.json instead. Ralph auto-merges it on next run.
To add new stories:
- Create story files in
prd-json/stories/(e.g.,US-034.json) - Create
prd-json/update.json:
{
"storyOrder": ["...existing IDs...", "US-034", "US-035"],
"pending": ["...existing pending...", "US-034", "US-035"]
}Note: Do NOT include stats - they are computed automatically from arrays.
3. Ralph merges update.json → index.json automatically, then deletes update.json
Why update.json?
- Prevents merge conflicts
- Clear audit trail
- Multiple agents can queue changes safely
JSON Templates
index.json
{
"$schema": "https://ralph.dev/schemas/prd-index.schema.json",
"generatedAt": "2026-01-19T12:00:00Z",
"nextStory": "US-001",
"storyOrder": ["US-001", "US-002", "V-001", "V-002"],
"pending": ["US-001", "US-002", "V-001", "V-002"],
"blocked": []
}Note: Do NOT include stats - the UI computes them from array lengths.
Story JSON (prd-json/stories/US-XXX.json)
{
"id": "US-001",
"title": "[Story Title]",
"description": "[What and why]",
"acceptanceCriteria": [
{"text": "[Specific criterion]", "checked": false},
{"text": "Typecheck passes", "checked": false},
{"text": "Verify in browser", "checked": false},
{"text": "Run CodeRabbit review - must pass (or create BUG if unfixable)", "checked": false},
{"text": "Commit: feat: US-001 [description]", "checked": false}
],
"passes": false,
"blockedBy": null
}Output
Create at repository root:
prd-json/index.jsonprd-json/stories/*.jsonprd-json/AGENTS.md- Instructions for AI agents (see template below)progress.txt
AGENTS.md Template
IMPORTANT: Run skill discovery first and include ACTUAL descriptions in AGENTS.md:
# Generate skills table for AGENTS.md
echo "| Skill | When to Use |"
echo "|-------|-------------|"
ls -1 ~/.claude/commands/golem-powers/*/SKILL.md 2>/dev/null | while read f; do
skill=$(dirname "$f" | xargs basename)
desc=$(awk '/^description:/{gsub(/^description: *"?/, ""); gsub(/"$/, ""); print}' "$f")
echo "| \`/$skill\` | $desc |"
done
# Get project contexts from registry
project_key="$(basename $(pwd))" # or the registered project name
jq -r --arg p "$project_key" '.projects[$p].contexts // [] | .[]' ~/.config/golems/registry.json 2>/dev/null# AI Agent Instructions for PRD
## 🚀 Available Skills
**Invoke skills via `/skill-name` - read the description to know WHEN to use each:**
<!-- PASTE OUTPUT FROM SKILL DISCOVERY HERE -->
| Skill | When to Use |
|-------|-------------|
| `/ralph-commit` | Atomic commit + criterion check for Ralph stories. Use for "Commit:" criteria. |
| `/coderabbit` | Runs AI code reviews. Use when reviewing changes, preparing PRs, or checking code quality. |
| `/prd-manager` | Manage PRD stories - add, update, bulk operations. |
| `/catchup` | Recover context by reading all files changed since diverging from main. |
## 📦 Project Contexts
**Ralph loads these contexts automatically from the registry:**
<!-- List contexts from: jq '.projects["<project>"].contexts[]' ~/.config/golems/registry.json -->
- `base` - Universal rules (scratchpad, AIDEV-NOTE, type safety)
- `skill-index` - Available skills reference
- `workflow/interactive` - CLAUDE_COUNTER, git safety
These contexts provide project-specific rules and patterns. If you need additional contexts, update the project's `contexts` array in `~/.config/golems/registry.json`.
## 🔄 CodeRabbit Iteration Rule
**For "Run CodeRabbit review" criteria, iterate until clean:**
1. Run: `cr review --prompt-only --type uncommitted`
2. If issues found → Fix them
3. Run CR again
4. Repeat until: "No issues found" or only intentional patterns remain
5. If intentional pattern → Add to CLAUDE.md's CodeRabbit Context section
**Never skip CR or commit with unresolved issues.**
## ⚠️ NEVER EDIT index.json DIRECTLY
To add/modify stories, use `update.json`:
1. Create story files in `stories/`
2. Write changes to `update.json` (not index.json!)
3. Ralph merges automatically on next run
## Example update.json
\`\`\`json
{
"storyOrder": ["existing...", "NEW-001"],
"pending": ["existing...", "NEW-001"]
}
\`\`\`
Note: Do NOT include `stats` - computed automatically.
## Story ID Rules
- Check `archive/` for used IDs before creating new ones
- Use next available number (e.g., if US-033 exists, use US-034)Then say:
✅ PRD saved to
prd-json/with X stories + X verification stories. Run Ralph to execute. I will not implement - that's Ralph's job.
Checklist
- Ran skill discovery - identified relevant skills for project
- prd-json/ created at repo root
- index.json has storyOrder, pending, blocked (NO stats - computed automatically)
- AGENTS.md created with skills section + update.json instructions
- Each story has its own JSON file
- Stories ordered by dependency
- All criteria are verifiable
- Every story has "Typecheck passes"
- UI stories have "Verify in browser"
- Verification stories (V-XXX) for each US-XXX
- Every story ends with CodeRabbit + Commit criteria
- RTL rules included (if applicable) — flex order, text-right, items-end, nested RTL
- Modal rules followed (if applicable) — each state = separate story
Best Pass Rate
89%
Opus 4.6
Assertions
9
3 models tested
Avg Cost / Run
$0.2976
across models
Fastest (p50)
2.4s
Sonnet 4.6
Behavior Evals
Phase 2 baseline — skill quality on ClaudeBehavior Baseline
| Assertion | Opus 4.6 | Sonnet 4.6 | Haiku 4.5 | Consensus |
|---|---|---|---|---|
| generates-json-prd | 3/3 | |||
| includes-scope-and-stakeholders | 3/3 | |||
| stories-have-acceptance-criteria | 3/3 | |||
| references-relevant-skills | 2/3 | |||
| maintains-structure | 3/3 | |||
| explains-prd-value | 3/3 | |||
| uses-update-json-pattern | 3/3 | |||
| validates-existing-prd | 2/3 | |||
| new-stories-have-criteria | 1/3 |
Token Usage
Cost per Run
| Model | Input Tokens | Output Tokens | Cost / Run | Cost / 1K Runs |
|---|---|---|---|---|
| Opus 4.6 | 7,654 | 9,865 | $0.8547 | $854.70 |
| Sonnet 4.6 | 2,322 | 1,803 | $0.0340 | $34.00 |
| Haiku 4.5 | 2,137 | 2,924 | $0.0042 | $4.20 |
Response Time (p50)
Response Time (p95)
| Model | p50 | p95 | Overhead |
|---|---|---|---|
| Opus 4.6 | 5.2s | 8.0s | +54% |
| Sonnet 4.6 | 2.4s | 4.8s | +99% |
| Haiku 4.5 | 3.4s | 5.7s | +68% |
Last evaluated: 2026-03-12 · Data is generated from skill assertions (real cross-model benchmarks coming soon)
Changelog entries are derived from eval runs and skill version updates. Full cascading changelog (Phase 4D) coming soon.
Best Pass Rate
89%
Assertions
9
Models Tested
3
Evals Run
3
- +Initial release to Golems skill library
- +9 assertions across 3 eval scenarios