一键导入
ralph
Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | ralph |
| description | Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format. |
Converts existing PRDs to the prd.json format that Ralph uses for autonomous execution.
Take a PRD (markdown file or text) and convert it to prd.json.
ALWAYS save to the global Ralph projects directory — never ask the user where to save.
Get project directory:
ralph project-dir
Save prd.json to: $(ralph project-dir)/prd.json
{
"project": "[Project Name]",
"branchName": "[detected-prefix]/[feature-name-kebab-case]",
"description": "[Feature description from PRD title/intro]",
"userStories": [
{
"id": "[TICKET-0000 or US-001]",
"title": "[Story title]",
"description": "As a [user], I want [feature] so that [benefit]",
"acceptanceCriteria": ["Criterion 1", "Criterion 2", "Typecheck passes"],
"priority": 1,
"passes": false,
"notes": ""
}
]
}
Note: Branch prefix and ticket IDs are detected from project conventions. See "Ticket Convention Detection" and "Branch Convention Detection" sections below.
Each story must be completable in ONE Ralph iteration (one context window).
Ralph spawns a fresh Claude Code instance per iteration with no memory of previous work. If a story is too big, the LLM runs out of context before finishing and produces broken code.
Rule of thumb: If you cannot describe the change in 2-3 sentences, it is too big.
Stories execute in priority order. Earlier stories must not depend on later ones.
Correct order:
Wrong order:
Each criterion must be something Ralph can CHECK, not something vague.
status column to tasks table with default 'pending'""Typecheck passes"
For stories with testable logic, also include:
"Tests pass"
"Verify in browser using dev-browser skill"
Frontend stories are NOT complete until visually verified. Ralph will use the dev-browser skill to navigate to the page, interact with the UI, and confirm changes work.
Before assigning story IDs, detect the project's existing ticket convention from git history:
# Run in the target project directory to find ticket patterns
git log --oneline -50 | grep -oE '[A-Z]{2,10}-[0-9]+' | cut -d'-' -f1 | sort | uniq -c | sort -rn | head -1
This returns the most common ticket prefix with its count. Example output: 31 CI means "CI" prefix was found 31 times → use CI-0000.
Rules:
If a prefix is found (e.g., "CI", "JIRA", "PROJ"):
CI-0000, JIRA-0000If NO ticket convention is found:
US-001, US-002, etc.Examples of detected patterns:
feat: CI-1234 - Something → prefix is CI → use CI-0000fix: JIRA-567 Something → prefix is JIRA → use JIRA-0000[PROJ-890] Something → prefix is PROJ → use PROJ-0000US-001, US-002, etc.Before setting the branch name, detect the project's existing branch naming convention:
# Run in the target project directory to find branch prefixes
git branch -a | grep -oE '(feature|feat|fix|bugfix|hotfix|release|chore)/' | sort | uniq -c | sort -rn | head -1
This returns the most common branch prefix with its count. Example output: 150 feat/ means "feat/" prefix was found 150 times → use feat/.
Rules:
If a branch prefix is found (e.g., feature/, feat/, fix/):
ralph/feature/task-status instead of ralph/task-statusIf NO branch convention is found:
ralph/ prefix: ralph/feature-nameCommon prefixes to detect:
feature/feat/fix/bugfix/hotfix/release/chore/Examples:
feature/add-login, feature/user-profile → use feature/task-statusfeat/api-v2, feat/dashboard → use feat/task-statusralph/task-statusCRITICAL: PRDs often contain explicit instructions that MUST be preserved in prd.json. When converting, scan the PRD for:
src/pages/playground/Playground.tsx")
→ Include in the story's description or acceptanceCriteriaacceptanceCriteria (e.g., "Test using staging-browser-localhost skill")acceptanceCriteria or notesdescriptionacceptanceCriteriaThese are non-negotiable requirements that the user explicitly stated. Do NOT omit them — they provide essential context for Ralph to complete the story correctly.
Example:
PRD says: "Add the component to src/components/Dashboard.tsx and test it using the staging-browser-localhost skill"
Story should include:
{
"description": "As a developer, I need to add the widget to src/components/Dashboard.tsx",
"acceptanceCriteria": [
"Widget added to src/components/Dashboard.tsx",
"Test using staging-browser-localhost skill",
"Typecheck passes"
]
}
PREFIX-0000 (e.g., CI-0000)US-001, US-002, etc.passes: false and empty notesfeature/task-status)ralph/ prefix (e.g., ralph/task-status)If a PRD has big features, split them:
Original:
"Add user notification system"
Split into:
Each is one focused change that can be completed and verified independently.
For features with significant logic or multiple components, create specification files in the project's .specs/ directory.
<project-root>/.specs/
├── feature-name.md # Feature specification
├── api-contracts.md # API definitions (if applicable)
└── data-models.md # Schema/type definitions
# [Feature Name] Specification
## Overview
Brief description of the feature.
## Requirements
- REQ-1: Specific requirement
- REQ-2: Another requirement
## Technical Decisions
- Decision 1: We chose X because Y
- Decision 2: Pattern Z will be used for...
## Data Model
[Schema definitions, types, etc.]
## API Contract (if applicable)
[Endpoints, request/response formats]
Ralph reads specs at the start of EVERY iteration. Well-written specs:
If the PRD describes a complex feature, suggest creating specs:
.specs/<feature-name>.md with the key decisions and contractsInput PRD:
# Task Status Feature
Add ability to mark tasks with different statuses.
## Requirements
- Toggle between pending/in-progress/done on task list
- Filter list by status
- Show status badge on each task
- Persist status in database
Output prd.json (no conventions detected - uses defaults):
{
"project": "TaskApp",
"branchName": "ralph/task-status", // No branch convention found → ralph/
"description": "Task Status Feature - Track task progress with status indicators",
"userStories": [
{
"id": "US-001",
"title": "Add status field to tasks table",
"description": "As a developer, I need to store task status in the database.",
"acceptanceCriteria": [
"Add status column: 'pending' | 'in_progress' | 'done' (default 'pending')",
"Generate and run migration successfully",
"Typecheck passes"
],
"priority": 1,
"passes": false,
"notes": ""
},
{
"id": "US-002",
"title": "Display status badge on task cards",
"description": "As a user, I want to see task status at a glance.",
"acceptanceCriteria": [
"Each task card shows colored status badge",
"Badge colors: gray=pending, blue=in_progress, green=done",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 2,
"passes": false,
"notes": ""
},
{
"id": "US-003",
"title": "Add status toggle to task list rows",
"description": "As a user, I want to change task status directly from the list.",
"acceptanceCriteria": [
"Each row has status dropdown or toggle",
"Changing status saves immediately",
"UI updates without page refresh",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 3,
"passes": false,
"notes": ""
},
{
"id": "US-004",
"title": "Filter tasks by status",
"description": "As a user, I want to filter the list to see only certain statuses.",
"acceptanceCriteria": [
"Filter dropdown: All | Pending | In Progress | Done",
"Filter persists in URL params",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 4,
"passes": false,
"notes": ""
}
]
}
Output prd.json (when project has conventions detected):
If the project has:
feat: CI-1234 - Add login → ticket prefix is CIfeature/add-login → branch prefix is feature/{
"project": "TaskApp",
"branchName": "feature/task-status", // Detected branch prefix
"userStories": [
{ "id": "CI-0000", "title": "Add status field to tasks table", ... },
{ "id": "CI-0000", "title": "Display status badge on task cards", ... },
{ "id": "CI-0000", "title": "Add status toggle to task list rows", ... },
{ "id": "CI-0000", "title": "Filter tasks by status", ... }
]
}
Before writing a new prd.json, check if there is an existing one from a different feature:
prd.json if it existsbranchName differs from the new feature's branch nameprogress.txt has content beyond the header:
archive/YYYY-MM-DD-feature-name/prd.json and progress.txt to archiveprogress.txt with fresh headerThe ralph.sh script handles this automatically when you run it, but if you are manually updating prd.json between runs, archive first.
Before writing prd.json, verify: