npx skills add https://github.com/snarktank/ralph --skill ralph将现有的 PRD 转换为 Ralph 用于自主执行的 prd.json 格式。
获取一个 PRD(Markdown 文件或文本)并将其转换为位于您 ralph 目录中的 prd.json。
{
"project": "[项目名称]",
"branchName": "ralph/[功能名称-kebab-case]",
"description": "[来自 PRD 标题/简介的功能描述]",
"userStories": [
{
"id": "US-001",
"title": "[故事标题]",
"description": "作为 [用户],我想要 [功能],以便 [获益]",
"acceptanceCriteria": [
"标准 1",
"标准 2",
"类型检查通过"
],
"priority": 1,
"passes": false,
"notes": ""
}
]
}
每个故事必须能在一个 Ralph 迭代(一个上下文窗口)内完成。
Ralph 每次迭代都会生成一个全新的 Amp 实例,不保留之前工作的记忆。如果一个故事太大,LLM 会在完成之前耗尽上下文并产生损坏的代码。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
经验法则: 如果您无法用 2-3 句话描述这个变更,那么它就太大了。
故事按优先级顺序执行。较早的故事不能依赖于较晚的故事。
正确顺序:
错误顺序:
每个标准必须是 Ralph 可以检查的东西,而不是模糊的描述。
status 列,默认值为 'pending'”"Typecheck passes"
对于包含可测试逻辑的故事,还需包含:
"Tests pass"
"Verify in browser using dev-browser skill"
前端故事在视觉验证完成前不算完成。Ralph 将使用 dev-browser 技能导航到页面,与 UI 交互,并确认更改有效。
passes: false 且 notes 为空ralph/如果 PRD 包含大型功能,请拆分它们:
原始内容:
“添加用户通知系统”
拆分为:
每个都是一个可以独立完成和验证的专注变更。
输入 PRD:
# 任务状态功能
添加为任务标记不同状态的能力。
## 需求
- 在任务列表中切换待处理/进行中/已完成状态
- 按状态过滤列表
- 在每个任务上显示状态徽章
- 在数据库中持久化状态
输出 prd.json:
{
"project": "TaskApp",
"branchName": "ralph/task-status",
"description": "任务状态功能 - 使用状态指示器跟踪任务进度",
"userStories": [
{
"id": "US-001",
"title": "向 tasks 表添加 status 字段",
"description": "作为开发者,我需要在数据库中存储任务状态。",
"acceptanceCriteria": [
"添加 status 列:'pending' | 'in_progress' | 'done'(默认 'pending')",
"成功生成并运行迁移",
"类型检查通过"
],
"priority": 1,
"passes": false,
"notes": ""
},
{
"id": "US-002",
"title": "在任务卡片上显示状态徽章",
"description": "作为用户,我希望一眼就能看到任务状态。",
"acceptanceCriteria": [
"每个任务卡片显示带颜色的状态徽章",
"徽章颜色:灰色=待处理,蓝色=进行中,绿色=已完成",
"类型检查通过",
"使用 dev-browser 技能在浏览器中验证"
],
"priority": 2,
"passes": false,
"notes": ""
},
{
"id": "US-003",
"title": "向任务列表行添加状态切换",
"description": "作为用户,我希望直接从列表中更改任务状态。",
"acceptanceCriteria": [
"每行都有状态下拉菜单或切换开关",
"更改状态立即保存",
"UI 更新无需刷新页面",
"类型检查通过",
"使用 dev-browser 技能在浏览器中验证"
],
"priority": 3,
"passes": false,
"notes": ""
},
{
"id": "US-004",
"title": "按状态过滤任务",
"description": "作为用户,我希望过滤列表以仅查看特定状态的任务。",
"acceptanceCriteria": [
"过滤器下拉菜单:全部 | 待处理 | 进行中 | 已完成",
"过滤器在 URL 参数中持久化",
"类型检查通过",
"使用 dev-browser 技能在浏览器中验证"
],
"priority": 4,
"passes": false,
"notes": ""
}
]
}
在写入新的 prd.json 之前,检查是否存在来自不同功能的现有文件:
prd.jsonbranchName 是否与新功能的分支名称不同progress.txt 在标题之外还有内容:
archive/YYYY-MM-DD-功能名称/prd.json 和 progress.txt 复制到归档文件夹progress.txt当您运行 ralph.sh 脚本时,它会自动处理此过程,但如果您在运行之间手动更新 prd.json,请先进行归档。
在写入 prd.json 之前,请验证:
每周安装量
286
代码仓库
GitHub 星标数
13.7K
首次出现
2026 年 1 月 20 日
安全审计
安装于
opencode233
claude-code222
gemini-cli217
codex214
github-copilot192
cursor184
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 in your ralph directory.
{
"project": "[Project Name]",
"branchName": "ralph/[feature-name-kebab-case]",
"description": "[Feature description from PRD title/intro]",
"userStories": [
{
"id": "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": ""
}
]
}
Each story must be completable in ONE Ralph iteration (one context window).
Ralph spawns a fresh Amp 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.
passes: false and empty notesralph/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.
Input 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:
{
"project": "TaskApp",
"branchName": "ralph/task-status",
"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": ""
}
]
}
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:
Weekly Installs
286
Repository
GitHub Stars
13.7K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode233
claude-code222
gemini-cli217
codex214
github-copilot192
cursor184
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
56,200 周安装