ralph
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRalph Wiggum Loop Skill
Ralph Wiggum Loop Skill
Autonomous AI coding pattern that runs agents in iterations with clean context, working on PRD-driven features while maintaining CI green.
一种自主AI编码模式,以全新上下文循环运行Agent,在保持CI构建正常的同时开发PRD驱动的功能。
Commands
命令
| Command | Action |
|---|---|
| Show help menu |
| Create Ralph infrastructure |
| Build custom PRD interactively |
| Execute the autonomous loop |
| 命令 | 操作 |
|---|---|
| 显示帮助菜单 |
| 创建Ralph基础架构 |
| 交互式构建自定义PRD |
| 执行自主循环 |
/ralph setup
/ralph setup/ralph setup
/ralph setupCreate all Ralph files in the current directory.
Steps:
-
Read and copy templates from this skill'sfolder:
templates/- templates/ralph-loop.sh →
./ralph-loop.sh - templates/prd.json →
./prd.json - templates/progress.txt →
./progress.txt - templates/README-RALPH.md →
./README-RALPH.md
- templates/ralph-loop.sh →
-
Make script executable:
chmod +x ralph-loop.sh -
Detect project context and customize:
- Check for → determine package manager (pnpm/npm/yarn)
package.json - Check for → TypeScript project
tsconfig.json - Update test commands in ralph-loop.sh accordingly
- Check for
-
Show completion message with next steps
在当前目录创建所有Ralph文件。
步骤:
-
读取并复制本skill的文件夹中的模板:
templates/- templates/ralph-loop.sh →
./ralph-loop.sh - templates/prd.json →
./prd.json - templates/progress.txt →
./progress.txt - templates/README-RALPH.md →
./README-RALPH.md
- templates/ralph-loop.sh →
-
赋予脚本可执行权限:
chmod +x ralph-loop.sh -
检测项目上下文并自定义配置:
- 检查是否存在→ 确定包管理器(pnpm/npm/yarn)
package.json - 检查是否存在→ 判断是否为TypeScript项目
tsconfig.json - 相应更新ralph-loop.sh中的测试命令
- 检查是否存在
-
显示完成消息及后续步骤
/ralph init
/ralph init/ralph init
/ralph initGuide user through creating a custom PRD interactively.
Questions to ask:
- Project name?
- What features do you want to build? (collect 3-5 user stories)
- For each story:
- Title?
- Description?
- Acceptance criteria? (3-5 specific, testable criteria)
Output: Generate with user's input. Offer to create other Ralph files if not present.
prd.json引导用户交互式创建自定义PRD。
需询问的问题:
- 项目名称?
- 你想要构建哪些功能?(收集3-5个用户故事)
- 针对每个故事:
- 标题?
- 描述?
- 验收标准?(3-5条具体、可测试的标准)
输出: 根据用户输入生成。若Ralph其他文件不存在,提供创建选项。
prd.json/ralph run
/ralph run/ralph run
/ralph runExecute the Ralph loop.
Pre-flight checks:
- Verify exists
ralph-loop.sh - Verify exists
prd.json - Show summary:
- Total user stories
- Incomplete stories (where )
passes: false - Max iterations configured
- Ask for confirmation
- Execute:
./ralph-loop.sh
执行Ralph循环。
预检查:
- 验证是否存在
ralph-loop.sh - 验证是否存在
prd.json - 显示摘要:
- 用户故事总数
- 未完成的故事(的条目)
passes: false - 配置的最大迭代次数
- 请求确认
- 执行:
./ralph-loop.sh
/ralph
(no args)
/ralph/ralph
(无参数)
/ralphShow help menu:
Ralph Wiggum Loop - Autonomous AI Coding
Commands:
/ralph setup - Create Ralph infrastructure in this directory
/ralph init - Create a new PRD from scratch
/ralph run - Run the Ralph loop
What would you like to do?显示帮助菜单:
Ralph Wiggum Loop - Autonomous AI Coding
Commands:
/ralph setup - Create Ralph infrastructure in this directory
/ralph init - Create a new PRD from scratch
/ralph run - Run the Ralph loop
What would you like to do?Key Principles
核心原则
- Clean slate each iteration - Fresh context, no baggage
- One feature at a time - Prevents scope creep
- CI must stay green - Tests and types pass every commit
- Progress tracking - Append to progress.txt each iteration
- Clear stop condition - when all stories pass
<promise>COMPLETE</promise> - Safety limit - Max iterations prevents infinite loops
- 每次迭代全新开始 - 上下文全新,无历史遗留
- 一次开发一个功能 - 防止范围蔓延
- CI必须保持正常 - 每次提交都要通过测试与类型检查
- 进度追踪 - 每次迭代后追加内容至progress.txt
- 明确终止条件 - 所有故事通过后标记
<promise>COMPLETE</promise> - 安全限制 - 最大迭代次数防止无限循环
PRD Quality Checklist
PRD质量检查清单
Good user stories are:
- ✅ Specific and scoped (completable in one iteration)
- ✅ Clear acceptance criteria (testable, unambiguous)
- ✅ Properly prioritized (1 = highest)
- ✅ Has initially
"passes": false
Bad user stories are:
- ❌ Too vague ("build the UI")
- ❌ Too large (touches many systems)
- ❌ Unclear criteria ("make it nice")
优质用户故事:
- ✅ 具体且边界清晰(可在一次迭代内完成)
- ✅ 验收标准明确(可测试、无歧义)
- ✅ 优先级合理(1为最高优先级)
- ✅ 初始状态为
"passes": false
劣质用户故事:
- ❌ 过于模糊(如“构建UI”)
- ❌ 范围过大(涉及多个系统)
- ❌ 标准不明确(如“做得好看”)