ralph-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ralph-loop - Completion Enforcement Loop

ralph-loop - 完成强制循环

When to use this skill

何时使用此Skill

  • Long-running implementation tasks that tend to stop early
  • Tasks that need strict completion signaling
  • Workflows using
    ultrawork
    /
    ulw
    in OpenCode
  • Sessions where the agent must continue until exact completion

  • 容易提前终止的长期实现任务
  • 需要严格完成信号的任务
  • 在OpenCode中使用
    ultrawork
    /
    ulw
    的工作流
  • 需要Agent持续执行直到完全完成的会话

1. Core Command Pattern

1. 核心命令模式

Use the built-in command form:
text
/ralph-loop "<task description>" [--completion-promise=TEXT] [--max-iterations=N]
Defaults:
  • Completion promise:
    DONE
  • Max iterations:
    100

使用内置命令格式:
text
/ralph-loop "<任务描述>" [--completion-promise=文本] [--max-iterations=数字]
默认值:
  • 完成承诺:
    DONE
  • 最大迭代次数:
    100

2. How the Loop Behaves

2. 循环工作机制

  1. Starts with your task prompt.
  2. On each idle cycle, verifies whether the assistant output contains:
xml
<promise>DONE</promise>
  1. If not found, injects a continuation prompt and increments iteration.
  2. Stops only when:
    • Completion promise is detected, or
    • Max iterations is reached, or
    • You run
      /cancel-ralph
      .

  1. 从你的任务提示开始。
  2. 在每个空闲周期,检查助手输出是否包含:
xml
<promise>DONE</promise>
  1. 如果未找到,注入续期提示并增加迭代次数。
  2. 仅在以下情况停止:
    • 检测到完成承诺,或
    • 达到最大迭代次数,或
    • 你执行
      /cancel-ralph

3. Practical Usage

3. 实际用法

Standard run

标准运行

text
/ralph-loop "Refactor auth module and finish all tests"
text
/ralph-loop "重构认证模块并完成所有测试"

Custom promise

自定义承诺

text
/ralph-loop "Migrate API clients to v2" --completion-promise=SHIP_IT
text
/ralph-loop "将API客户端迁移到v2版本" --completion-promise=SHIP_IT

Bounded iteration run

限制迭代次数的运行

text
/ralph-loop "Fix flaky CI tests" --max-iterations=20
text
/ralph-loop "修复不稳定的CI测试" --max-iterations=20

Cancel active loop

取消活跃循环

text
/cancel-ralph

text
/cancel-ralph

4. Integration Notes for skills-template

4. 与skills-template的集成说明

  • Keep this skill as an operational guide for OpenCode workflows.
  • Pair with orchestration skills (for example,
    ohmg
    ) when tasks require delegation.
  • Require explicit completion tags in final responses to avoid premature stop.

  • 将此Skill作为OpenCode工作流的操作指南。
  • 当任务需要委托时,与编排类Skill(例如
    ohmg
    )配合使用。
  • 要求最终响应中包含明确的完成标签,避免提前终止。

Quick Reference

快速参考

ActionCommand
Start loop
/ralph-loop "task"
Custom promise
/ralph-loop "task" --completion-promise=TEXT
Iteration cap
/ralph-loop "task" --max-iterations=N
Cancel
/cancel-ralph
操作命令
启动循环
/ralph-loop "任务"
自定义承诺
/ralph-loop "任务" --completion-promise=文本
迭代次数上限
/ralph-loop "任务" --max-iterations=数字
取消
/cancel-ralph