Ralph Loop

作者 cursorccb5507cec15无许可证10K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Start a Ralph Loop for iterative self-referential development. Use when the user asks to run a ralph loop, start an iterative loop, or wants repeated autonomous iteration on a task until completion.

AI 生成的概览

设置 Ralph 循环,反复将任务提示重新送入智能体,直到达成完成承诺或达到迭代上限。

功能
该技能指示智能体启动一个自引用的迭代开发循环。它收集用户的任务提示以及可选的 max_iterations 和 completion_promise 参数,创建 .cursor/ralph/ 目录,并在 .cursor/ralph/scratchpad.md 写入状态文件,其 YAML 前置元数据包含 iteration、max_iterations 和 completion_promise,后接任务提示。随后智能体确认循环已激活并开始执行任务,停止钩子会在每轮结束时将同一提示作为后续消息重新送入,并带有迭代编号前缀。它还规定了何时可以输出完成承诺的约束。
适用场景
当用户要求运行 Ralph 循环、启动迭代循环,或希望对某项任务进行反复自主迭代直至完成时使用。它适用于智能体在每轮迭代中都能看到自己先前工作、并持续进行直到明确承诺真正达成或触及迭代上限的任务。
运行要求
该技能不附带脚本,仅为指令。它需要能够创建目录并写入文件(具体为 .cursor/ralph/scratchpad.md),以及一个在轮次结束时拦截并重新送入提示的停止钩子。未指定任何软件包、凭据或网络访问要求。

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.

Workflow

  1. Gather the user's task prompt and optional parameters:

    • max_iterations (number, default 0 for unlimited)
    • completion_promise (text, or "null" if not set)
  2. Create the directory .cursor/ralph/ if it doesn't exist, then write the state file at .cursor/ralph/scratchpad.md with this exact format:

    markdown
    ---iteration: 1max_iterations: <N or 0>completion_promise: "<TEXT>" or null---
    <the user's task prompt goes here>

    Example:

    markdown
    ---iteration: 1max_iterations: 20completion_promise: "COMPLETE"---
    Build a REST API for todos with CRUD operations, input validation, and tests.
  3. Confirm to the user that the Ralph loop is active, then begin working on the task.

  4. 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.].

Guardrails

  • If a completion promise is set, you may ONLY output <promise>TEXT</promise> when the statement is completely and genuinely true.
  • Do not output false promises to escape the loop.
  • Always recommend setting max_iterations as a safety net.
  • Quote the completion_promise value in the YAML frontmatter if it contains special characters.

Output

Confirm the loop is active (prompt, iteration limit, promise if set), then start working on the task immediately.

来源与署名

来源:cursor/plugins位于ralph-loop/skills/ralph-loop提交ccb5507

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架