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 從公開儲存庫中收錄這些內容。

檢舉或申請下架