ralph

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RALPH — 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:
StepCommandWhat It Does
1
/grill-me
Stress-test your idea with relentless questions before building
2
/write-a-prd
Turn the idea into an engineering spec (PRD) as a GitHub issue
3
/prd-to-issues
Break the PRD into vertical-slice sub-issues with dependencies
4
/ralph
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
/grill-me
开发前通过连续提问对你的想法进行压力测试
2
/write-a-prd
将想法转化为存储为GitHub issue的工程规范(PRD)
3
/prd-to-issues
将PRD拆解为带依赖关系的垂直切片子issue
4
/ralph
通过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-issues

Setup

安装配置

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/*.sh

Requirements

依赖要求

Usage

使用方法

/ralph <issue-number>
— Human-in-the-loop (start here)

/ralph <issue-number>
— 人在回路(推荐初次使用)

bash
./ralph/ralph-once.sh 42
Implements 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]
— 全自动模式

bash
./ralph/afk-ralph.sh 42 20
Runs 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:
  1. Parse arguments: first is the PRD issue number (required), second is mode (
    once
    or
    afk
    , default
    once
    ), third is max iterations for afk mode (default 20)
  2. If no issue number is provided, ask for it
  3. Verify
    ralph/
    directory exists at the project root. If not, guide the user through setup (copy scripts from
    .agents/skills/ralph/
    )
  4. For
    once
    mode (default):
    bash
    ./ralph/ralph-once.sh <issue-number>
  5. For
    afk
    mode:
    bash
    ./ralph/afk-ralph.sh <issue-number> <max-iterations>
  6. Report the result when complete
当用户调用本skill时:
  1. 解析参数:第一个参数是PRD issue编号(必填),第二个参数是模式(
    once
    afk
    ,默认
    once
    ),第三个参数是afk模式下的最大迭代次数(默认20)
  2. 如果未提供issue编号,提示用户输入
  3. 校验项目根目录下是否存在
    ralph/
    目录,如果不存在,引导用户完成配置(从
    .agents/skills/ralph/
    复制脚本)
  4. 对于
    once
    模式(默认):
    bash
    ./ralph/ralph-once.sh <issue-number>
  5. 对于
    afk
    模式:
    bash
    ./ralph/afk-ralph.sh <issue-number> <max-iterations>
  6. 运行完成后反馈结果

How It Works

工作原理

  1. Scripts fetch the PRD issue and all sub-issues via
    gh
    CLI
  2. Sub-issues are found by searching for
    Parent PRD #<number>
    in their body
  3. Each iteration: Claude picks one open, unblocked sub-issue and implements it using TDD
  4. Tests must pass before every commit (auto-detected from project config)
  5. After committing, a code review gate checks for bugs, logic errors, security issues, and architecture violations
  6. Claude closes the sub-issue on GitHub with a comment linking the commit
  7. Loop continues until all sub-issues are closed
  1. 脚本通过
    gh
    CLI拉取PRD issue和所有子issue
  2. 通过搜索子issue正文中的
    Parent PRD #<编号>
    来识别关联的子issue
  3. 每次迭代:Claude选择一个未关闭、无阻塞的子issue,使用TDD模式实现需求
  4. 每次提交前必须通过测试(从项目配置自动检测测试规则)
  5. 代码提交后,代码评审关卡会检查Bug、逻辑错误、安全问题和架构违规
  6. Claude会在GitHub上关闭对应子issue,并附上关联提交的评论
  7. 循环执行直到所有子issue都被关闭

Sub-Issue Format

子issue格式

Sub-issues created by
/prd-to-issues
follow this format:
markdown
undefined
/prd-to-issues
创建的子issue遵循以下格式:
markdown
undefined

Parent 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
undefined

Tips

提示

  • Start with
    /ralph
    (once mode).
    Validate the first iteration before going AFK.
  • Keep sub-issues small. One logical change per sub-issue prevents context rot.
  • Use
    /grill-me
    first.
    The more you think before coding, the better RALPH performs.
  • Use blocked-by. Declare dependencies so RALPH works in the right order.
  • 先使用
    /ralph
    (单次模式)。
    切换到AFK全自动模式前先验证首次迭代的结果是否符合预期。
  • 保持子issue粒度足够小。 每个子issue只包含一项逻辑变更,避免上下文偏移。
  • 优先使用
    /grill-me
    编码前思考得越充分,RALPH的运行效果越好。
  • 使用阻塞依赖标记。 声明依赖关系,确保RALPH按正确的顺序处理任务。