create-prd
Create a new Product Requirements Document (PRD) interactively with AI assistance.
Synopsis
The create-prd command generates a structured PRD through an interactive conversation with an AI agent. It asks about your feature goals, requirements, and quality gates, then produces a PRD Markdown file.
Use --chat mode (recommended) for AI-powered PRD creation. The AI asks contextual questions and generates higher-quality PRDs than the template wizard.
Aliases
Options
| Option | Description |
|---|---|
--chat, --ai | Use AI-powered chat mode (recommended) |
--agent <name> | Override agent for chat mode |
--prd-skill <name> | Use custom PRD skill from skills_dir |
--output, -o <dir> | Output directory for PRD files (default: ./tasks) |
--stories, -n <count> | Number of user stories (template mode only) |
--timeout, -t <ms> | Timeout for AI agent calls in milliseconds (0 = no timeout, default: 180000) |
--force, -f | Overwrite existing files |
Examples
AI-Powered Chat Mode (Recommended)
Template Mode
Custom Output Location
Disable Timeout
Custom PRD Skill
Use a custom PRD skill from your configured skills_dir:
See Configuration for how to set skills_dir.
PRD Format Requirements for Task Creation
Custom skills must produce PRDs that are compatible with downstream task creation. The generated PRD must include:
-
User Stories with IDs matching pattern
### US-XXX: Title:Markdown -
Quality Gates section (optional but recommended):
Markdown
If a custom skill generates a PRD without user stories (matching ### US-XXX: pattern), task creation will fail with an error message.
Chat Mode Workflow
When you run create-prd --chat, the AI guides you through:
Feature Goal
What problem does this feature solve? What's the high-level objective?
Target Users
Who will use this feature? What are their needs?
Scope Definition
What should be included? What's explicitly out of scope?
User Stories
The AI helps break down the feature into discrete, implementable stories.
Quality Gates
What commands must pass? (e.g., bun run typecheck, bun run lint)
Task Creation
After generating the PRD, you're asked whether to create tasks:
- JSON - Create
prd.jsonfor the json tracker - Beads - Create issues in your Beads project
- Skip - Just save the PRD Markdown
Output Files
The command creates:
| File | Description |
|---|---|
./tasks/prd-<feature-name>.md | The PRD Markdown document |
./prd.json | Task file (if JSON selected) |
PRD Structure
Generated PRDs follow this structure:
Quality Gates
Quality gates are critical for successful automation. They tell Ralph what commands must pass after each task.
Quality gates are extracted from the PRD and automatically appended to each user story's acceptance criteria during conversion.
Common quality gates:
Best Practices
Keep Stories Small
Each user story should be completable in one agent session (roughly one context window). If you can't describe it in 2-3 sentences, split it.
Make Criteria Verifiable
Acceptance criteria should be testable, not vague:
Order Dependencies
Put foundational stories first:
Troubleshooting
"Agent not responding"
Ensure your agent CLI is working:
"Output directory not found"
Create the output directory first: