360 Secure SkillHub
360 安全技能中心

ralph-loop

该 Skill 用于启动 Ralph 迭代开发循环:收集用户任务提示及可选参数 max_iterations 与 completion_promise,在 .cursor/ralph/scratchpad.md 写入带 YAML 头部的状态文件,确认循环激活后立即开始执行任务;宿主 stop hook 在每轮结束时回灌同一提示,直到输出完成承诺或达到迭代上限。

cursor
热度 0.00
最近更新 2026-10-18 16:52:35
分类:开发依赖:读写文件应用场景:代码生成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cursor/plugins/ralph-loop
Metadata
name
ralph-loop
description
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.

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:

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

    Example:

    ---
    iteration: 1
    max_iterations: 20
    completion_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.