跳到正文
Skillpedia
智能体15k · #11010

ralph-loop

它能做什么

该技能启动一个迭代循环,智能体在多轮中持续处理同一项任务。适合希望较大任务稳步推进、又不想手动重新开始的人。

适用场景

  • ✓当你希望智能体在一项任务上持续迭代,直到达成目标的时候。
  • ✓当你想为一项自主任务设定最大轮数的时候。
  • ✓当你希望循环在出现特定完成短语时停止的时候。

技能链接

https://github.com/cursor/plugins/blob/main/ralph-loop/skills/ralph-loop/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/cursor/plugins/blob/main/ralph-loop/skills/ralph-loop/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“启动一个 Ralph 循环,构建一个带测试的待办事项 API,并在二十轮后停止。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会把你的任务和循环设置保存在状态文件中,然后开始处理任务。每次它尝试停止时,同一个提示词会被反馈回去,它会继续工作,直到出现完成短语或达到轮数上限。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

常见问题

如果我不设置上限会怎样?

默认没有轮数上限,因此该技能建议你设置一个上限。

什么是完成短语?

只有在任务真正完成时,智能体才会输出的一句话,输出它会结束循环。

智能体可以伪造完成短语吗?

不可以。该技能禁止为了退出循环而输出虚假的完成短语。

详情

作者的原始描述

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.

repo: cursor/plugins

热度

GitHub 星标
15k
排名
#11010
许可证
—
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能