convert
Convert PRD markdown files to executable task formats like prd.json.
Synopsis
The convert command transforms a PRD markdown file into a task format that Ralph can execute. It extracts user stories, acceptance criteria, and quality gates to create structured task files.
If you used create-prd --chat, you were likely already prompted to convert to tasks. Use this command when you have an existing PRD that needs conversion.
Options
| Option | Description |
|---|---|
--to <format> | Target format: json |
--output, -o <path> | Output file path (default: ./prd.json) |
--branch, -b <name> | Git branch name (prompts if not provided) |
--force, -f | Overwrite existing files |
Arguments
| Argument | Description |
|---|---|
<prd-file> | Path to the PRD markdown file to convert |
Examples
Basic Conversion
Explicit Format
Overwrite Existing
With Git Branch
Conversion Process
When you run convert, the command:
Parse PRD
Reads the markdown file and extracts:
- Feature title and description
- User stories with their IDs
- Acceptance criteria for each story
- Dependencies between stories
Extract Quality Gates
Finds the "## Quality Gates" section and extracts commands that must pass.
Append Gates to Stories
Adds quality gate commands to each story's acceptance criteria, ensuring every task runs the required checks.
Generate Output
Creates the task file in the specified format with proper structure for Ralph to execute.
Output Format
JSON (prd.json)
The JSON output follows this structure:
The passes: false field indicates the task hasn't been completed. Ralph sets this to true when the task is done.
Quality Gate Integration
Quality gates from the PRD are automatically appended to acceptance criteria:
PRD Input:
JSON Output:
Dependency Detection
The converter attempts to detect dependencies from:
- Explicit "depends on" mentions in the PRD
- Prerequisites sections in user stories
- Story ordering (later stories may depend on earlier ones)
You can also manually add dependencies in the PRD:
Workflow Example
Create PRD
Write or generate a PRD markdown file:
Review PRD
Open and review the PRD, adjusting stories and criteria as needed.
Convert to Tasks
Run Ralph
Troubleshooting
"No user stories found"
Ensure your PRD uses the expected format:
"Quality gates section not found"
Add a quality gates section to your PRD:
"Output file exists"
Use --force to overwrite, or specify a different output path:
Related Commands
- create-prd - Create a new PRD with AI assistance
- run - Execute tasks from the converted file
- status - Check execution progress