ralph-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRalph Loop
Ralph Loop
Trigger
触发条件
The user wants to start a Ralph loop. An iterative development loop where the same prompt is fed back after every turn, and the agent sees its own previous work each iteration.
用户希望启动Ralph Loop。这是一种迭代开发循环,每一轮后都会反馈相同的提示词,且Agent在每次迭代中都能查看自己之前的工作内容。
Workflow
工作流程
-
Gather the user's task prompt and optional parameters:
- (number, default 0 for unlimited)
max_iterations - (text, or "null" if not set)
completion_promise
-
Create the directoryif it doesn't exist, then write the state file at
.cursor/ralph/with this exact format:.cursor/ralph/scratchpad.mdmarkdown--- iteration: 1 max_iterations: <N or 0> completion_promise: "<TEXT>" or null --- <the user's task prompt goes here>Example:markdown--- iteration: 1 max_iterations: 20 completion_promise: "COMPLETE" --- Build a REST API for todos with CRUD operations, input validation, and tests. -
Confirm to the user that the Ralph loop is active, then begin working on the task.
-
The stop hook automatically intercepts each turn end and feeds the same prompt back as a followup message. You will see it prefixed with.
[Ralph loop iteration N.]
-
收集用户的任务提示词及可选参数:
- (number, default 0 for unlimited)
max_iterations - (text, or "null" if not set)
completion_promise
-
如果目录不存在则创建它,然后按照以下精确格式在
.cursor/ralph/中写入状态文件:.cursor/ralph/scratchpad.mdmarkdown--- iteration: 1 max_iterations: <N or 0> completion_promise: "<TEXT>" or null --- <the user's task prompt goes here>示例:markdown--- iteration: 1 max_iterations: 20 completion_promise: "COMPLETE" --- Build a REST API for todos with CRUD operations, input validation, and tests. -
向用户确认Ralph Loop已激活,然后开始处理任务。
-
停止钩子会自动拦截每一轮的结束,并将相同的提示词作为后续消息反馈回来。你会看到它带有前缀。
[Ralph loop iteration N.]
Guardrails
约束规则
- If a completion promise is set, you may ONLY output when the statement is completely and genuinely true.
<promise>TEXT</promise> - Do not output false promises to escape the loop.
- Always recommend setting as a safety net.
max_iterations - Quote the value in the YAML frontmatter if it contains special characters.
completion_promise
- 如果设置了完成承诺,只有当表述完全真实时,你才可以输出。
<promise>TEXT</promise> - 不要输出虚假承诺以退出循环。
- 始终建议设置作为安全保障。
max_iterations - 如果包含特殊字符,请在YAML前置元数据中用引号括起其值。
completion_promise
Output
输出要求
Confirm the loop is active (prompt, iteration limit, promise if set), then start working on the task immediately.
向用户确认循环已激活(包括提示词、迭代限制、已设置的承诺),然后立即开始处理任务。