ralph-loop-help
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRalph Loop Help
Ralph Loop 帮助
Trigger
触发条件
The user asks what Ralph Loop is, how it works, or needs usage guidance.
当用户询问Ralph Loop是什么、它的工作原理或需要使用指导时触发。
What to Explain
需要解释的内容
What is Ralph Loop?
什么是Ralph Loop?
Ralph Loop implements the Ralph Wiggum technique — an iterative development methodology based on continuous AI loops, pioneered by Geoffrey Huntley.
Core concept: the same prompt is fed to the agent repeatedly. The "self-referential" aspect comes from the agent seeing its own previous work in the files and git history, not from feeding output back as input.
Each iteration:
- The agent receives the SAME prompt
- Works on the task, modifying files
- Tries to exit
- Stop hook intercepts and feeds the same prompt again
- The agent sees its previous work in the files
- Iteratively improves until completion
Ralph Loop 实现了Ralph Wiggum技术——这是一种由Geoffrey Huntley首创的、基于持续AI循环的迭代开发方法论。
核心概念:将相同的提示重复提供给agent。其“自引用”特性源于agent能在文件和git历史中查看自己之前的工作成果,而非将输出作为输入反馈回去。
每次迭代流程:
- agent接收相同的提示
- 处理任务,修改文件
- 尝试退出
- 停止钩子拦截退出操作,并再次提供相同的提示
- agent查看文件中自己之前的工作成果
- 迭代优化直至任务完成
Starting a Ralph Loop
启动Ralph Loop
Tell the agent your task along with options:
Start a ralph loop: "Build a REST API for todos" --max-iterations 20 --completion-promise "COMPLETE"Options:
- — max iterations before auto-stop
--max-iterations N - — phrase to signal completion
--completion-promise "TEXT"
How it works:
- Creates state file
.cursor/ralph/scratchpad.md - Agent works on the task
- Stop hook intercepts exit and feeds the same prompt back
- Agent sees its previous work and iterates
- Continues until promise detected or max iterations reached
向agent告知你的任务及相关选项:
Start a ralph loop: "Build a REST API for todos" --max-iterations 20 --completion-promise "COMPLETE"选项说明:
- —— 自动停止前的最大迭代次数
--max-iterations N - —— 用于标记任务完成的短语
--completion-promise "TEXT"
工作流程:
- 创建 状态文件
.cursor/ralph/scratchpad.md - agent处理任务
- 停止钩子拦截退出操作,并再次反馈相同的提示
- agent查看之前的工作成果并进行迭代
- 持续执行直至检测到完成标记或达到最大迭代次数
Cancelling a Ralph Loop
取消Ralph Loop
Ask the agent to cancel the ralph loop. It will remove the state file and report the iteration count.
请求agent取消ralph loop,它会删除状态文件并报告已执行的迭代次数。
Completion Promises
完成标记
To signal completion, the agent outputs a tag:
<promise><promise>TASK COMPLETE</promise>The stop hook looks for this specific tag. Without it (or ), Ralph runs indefinitely.
--max-iterationsagent通过输出 标签来标记任务完成:
<promise><promise>TASK COMPLETE</promise>停止钩子会检测这个特定标签。如果没有该标签(或未设置),Ralph会无限运行。
--max-iterationsWhen to Use Ralph
何时使用Ralph
Good for:
- Well-defined tasks with clear success criteria
- Tasks requiring iteration and refinement
- Iterative development with self-correction
- Greenfield projects
Not good for:
- Tasks requiring human judgment or design decisions
- One-shot operations
- Tasks with unclear success criteria
适用场景:
- 具有明确成功标准的定义清晰的任务
- 需要迭代和细化的任务
- 具备自我修正能力的迭代开发
- 全新项目(Greenfield projects)
不适用场景:
- 需要人工判断或设计决策的任务
- 一次性操作
- 成功标准不明确的任务
Learn More
了解更多
- Original technique: https://ghuntley.com/ralph/
- Ralph Orchestrator: https://github.com/mikeyobrien/ralph-orchestrator
- 原始技术文档:https://ghuntley.com/ralph/
- Ralph Orchestrator:https://github.com/mikeyobrien/ralph-orchestrator
Output
输出要求
Present the above information clearly to the user, tailored to their specific question.
根据用户的具体问题,清晰呈现上述信息。