ralph
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRALPH — Autonomous PRD Implementation
RALPH — 自动化PRD实现
RALPH (Repeated Autonomous Loop for PRD Handling) implements a PRD stored as GitHub issues — autonomously, with TDD, and a code review gate after every iteration.
RALPH(PRD处理重复自治循环,Repeated Autonomous Loop for PRD Handling)可自动实现存储为GitHub issue的PRD,采用TDD模式,每次迭代后都设有代码评审关卡。
The Pipeline
工作流
This skill is the execution engine for a 4-step coding workflow:
| Step | Command | What It Does |
|---|---|---|
| 1 | | Stress-test your idea with relentless questions before building |
| 2 | | Turn the idea into an engineering spec (PRD) as a GitHub issue |
| 3 | | Break the PRD into vertical-slice sub-issues with dependencies |
| 4 | | Implement each sub-issue autonomously with TDD + code review |
Steps 1-3 use skills from Matt Pocock. Install them:
bash
npx skills@latest add mattpocock/skills -s grill-me
npx skills@latest add mattpocock/skills -s write-a-prd
npx skills@latest add mattpocock/skills -s prd-to-issues本skill是4步编码工作流的执行引擎:
| 步骤 | 命令 | 功能 |
|---|---|---|
| 1 | | 开发前通过连续提问对你的想法进行压力测试 |
| 2 | | 将想法转化为存储为GitHub issue的工程规范(PRD) |
| 3 | | 将PRD拆解为带依赖关系的垂直切片子issue |
| 4 | | 通过TDD+代码评审自动实现每个子issue |
步骤1-3使用了Matt Pocock提供的skill,请按以下方式安装:
bash
npx skills@latest add mattpocock/skills -s grill-me
npx skills@latest add mattpocock/skills -s write-a-prd
npx skills@latest add mattpocock/skills -s prd-to-issuesSetup
安装配置
After installing this skill, copy the RALPH scripts to your project root:
bash
mkdir -p ralph
cp .agents/skills/ralph/afk-ralph.sh ralph/
cp .agents/skills/ralph/ralph-once.sh ralph/
cp .agents/skills/ralph/prompt.md ralph/
cp .agents/skills/ralph/review-prompt.md ralph/
chmod +x ralph/*.sh安装本skill后,将RALPH脚本复制到项目根目录:
bash
mkdir -p ralph
cp .agents/skills/ralph/afk-ralph.sh ralph/
cp .agents/skills/ralph/ralph-once.sh ralph/
cp .agents/skills/ralph/prompt.md ralph/
cp .agents/skills/ralph/review-prompt.md ralph/
chmod +x ralph/*.shRequirements
依赖要求
- Claude Code CLI
- GitHub CLI () — authenticated
gh - Docker Desktop with Sandbox support (AFK mode only)
- Git
- Claude Code CLI
- 已完成身份认证的GitHub CLI()
gh - 支持沙箱功能的Docker Desktop(仅AFK模式需要)
- Git
Usage
使用方法
/ralph <issue-number>
— Human-in-the-loop (start here)
/ralph <issue-number>/ralph <issue-number>
— 人在回路(推荐初次使用)
/ralph <issue-number>bash
./ralph/ralph-once.sh 42Implements one sub-issue from PRD #42, then stops for your review. Run again for the next one. Recommended for your first few iterations.
bash
./ralph/ralph-once.sh 42实现PRD #42中的一个子issue,随后停止运行等待你的评审,如需处理下一个子issue再次运行即可,推荐前几次迭代使用该模式。
/ralph <issue-number> afk [max-iterations]
— Autonomous
/ralph <issue-number> afk [max-iterations]/ralph <issue-number> afk [max-iterations]
— 全自动模式
/ralph <issue-number> afk [max-iterations]bash
./ralph/afk-ralph.sh 42 20Runs up to 20 iterations inside a Docker sandbox. Each iteration: implement one sub-issue, run tests, commit, code review, close issue. When all sub-issues are done, pushes the branch and opens a PR.
bash
./ralph/afk-ralph.sh 42 20在Docker沙箱中运行最多20次迭代,每次迭代流程:实现一个子issue、运行测试、提交代码、代码评审、关闭issue。所有子issue处理完成后,会推送分支并提交PR。
Instructions
操作说明
When the user invokes this skill:
- Parse arguments: first is the PRD issue number (required), second is mode (or
once, defaultafk), third is max iterations for afk mode (default 20)once - If no issue number is provided, ask for it
- Verify directory exists at the project root. If not, guide the user through setup (copy scripts from
ralph/).agents/skills/ralph/ - For mode (default):
oncebash./ralph/ralph-once.sh <issue-number> - For mode:
afkbash./ralph/afk-ralph.sh <issue-number> <max-iterations> - Report the result when complete
当用户调用本skill时:
- 解析参数:第一个参数是PRD issue编号(必填),第二个参数是模式(或
once,默认afk),第三个参数是afk模式下的最大迭代次数(默认20)once - 如果未提供issue编号,提示用户输入
- 校验项目根目录下是否存在目录,如果不存在,引导用户完成配置(从
ralph/复制脚本).agents/skills/ralph/ - 对于模式(默认):
oncebash./ralph/ralph-once.sh <issue-number> - 对于模式:
afkbash./ralph/afk-ralph.sh <issue-number> <max-iterations> - 运行完成后反馈结果
How It Works
工作原理
- Scripts fetch the PRD issue and all sub-issues via CLI
gh - Sub-issues are found by searching for in their body
Parent PRD #<number> - Each iteration: Claude picks one open, unblocked sub-issue and implements it using TDD
- Tests must pass before every commit (auto-detected from project config)
- After committing, a code review gate checks for bugs, logic errors, security issues, and architecture violations
- Claude closes the sub-issue on GitHub with a comment linking the commit
- Loop continues until all sub-issues are closed
- 脚本通过CLI拉取PRD issue和所有子issue
gh - 通过搜索子issue正文中的来识别关联的子issue
Parent PRD #<编号> - 每次迭代:Claude选择一个未关闭、无阻塞的子issue,使用TDD模式实现需求
- 每次提交前必须通过测试(从项目配置自动检测测试规则)
- 代码提交后,代码评审关卡会检查Bug、逻辑错误、安全问题和架构违规
- Claude会在GitHub上关闭对应子issue,并附上关联提交的评论
- 循环执行直到所有子issue都被关闭
Sub-Issue Format
子issue格式
Sub-issues created by follow this format:
/prd-to-issuesmarkdown
undefined由创建的子issue遵循以下格式:
/prd-to-issuesmarkdown
undefinedParent PRD
Parent PRD
#42
#42
What to build
What to build
Description of the work...
Description of the work...
Acceptance criteria
Acceptance criteria
- Criterion 1
- Criterion 2
- Criterion 1
- Criterion 2
Blocked by
Blocked by
- #43
undefined- #43
undefinedTips
提示
- Start with (once mode). Validate the first iteration before going AFK.
/ralph - Keep sub-issues small. One logical change per sub-issue prevents context rot.
- Use first. The more you think before coding, the better RALPH performs.
/grill-me - Use blocked-by. Declare dependencies so RALPH works in the right order.
- 先使用(单次模式)。 切换到AFK全自动模式前先验证首次迭代的结果是否符合预期。
/ralph - 保持子issue粒度足够小。 每个子issue只包含一项逻辑变更,避免上下文偏移。
- 优先使用。 编码前思考得越充分,RALPH的运行效果越好。
/grill-me - 使用阻塞依赖标记。 声明依赖关系,确保RALPH按正确的顺序处理任务。