ralph-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ralph Loop

Ralph Loop

Use this skill to operate Ralph loops from the outside.
使用此技能从外部操作Ralph循环。

Use This Skill For

使用此技能的场景

  • Starting or continuing a Ralph run with the right
    -c
    and
    -H
    inputs
  • Inspecting loop state, worktrees, logs, history, and diffs
  • Resuming a hook-suspended loop
  • Merging or discarding completed worktree loops
  • Debugging unexpected loop behavior with current diagnostics files
  • 使用正确的
    -c
    -H
    参数启动或继续Ralph运行
  • 检查循环状态、工作树、日志、历史记录和差异
  • 恢复被钩子暂停的循环
  • 合并或丢弃已完成的工作树循环
  • 使用当前诊断文件调试意外的循环行为

Workflow

工作流程

  1. Start with
    ralph loops list
    or
    ralph loops list --json
    to establish the current state.
  2. If the user wants execution, run
    ralph run ...
    with the right core config and hats source.
  3. If the loop is stuck or suspicious, inspect
    logs
    ,
    history
    , and
    diff
    before changing state.
  4. If the loop is suspended, read
    .ralph/suspend-state.json
    and use
    ralph loops resume <id>
    .
  5. If a loop is queued or in
    needs-review
    , inspect the diff first, then use
    merge
    ,
    process
    ,
    retry
    , or
    discard
    as appropriate.
  6. Use diagnostics when you need detailed evidence about hats, events, tool calls, parse errors, or performance.
  1. 先执行
    ralph loops list
    ralph loops list --json
    来确认当前状态。
  2. 如果用户需要执行任务,使用正确的核心配置和hats源运行
    ralph run ...
  3. 如果循环卡住或异常,在更改状态前先检查
    logs
    history
    diff
  4. 如果循环已暂停,读取
    .ralph/suspend-state.json
    并使用
    ralph loops resume <id>
    恢复。
  5. 如果循环处于排队或
    needs-review
    状态,先检查差异,再根据情况使用
    merge
    process
    retry
    discard
    操作。
  6. 当需要了解hats、事件、工具调用、解析错误或性能的详细信息时,使用诊断功能。

Guardrails

约束规则

  • Prefer the CLI over direct edits to
    .ralph
    state files.
  • Treat tasks and memories as the canonical runtime systems; do not center scratchpad as the primary state model.
  • Inspect diffs before merging.
  • Only remove lock or queue artifacts when the underlying process is confirmed dead.
  • Manual edits under
    .ralph/
    are last-resort recovery steps and should be called out explicitly when used.
  • 优先使用CLI而非直接编辑
    .ralph
    状态文件。
  • 将任务和内存视为标准的运行时系统;不要将临时工作区作为主要状态模型。
  • 合并前先检查差异。
  • 仅在确认底层进程已终止时,才能删除锁或队列文件。
  • .ralph/
    下的手动编辑是最后的恢复手段,使用时需明确说明。

Read These References When Needed

需要时参考以下文档

  • For command recipes and operator flows:
    references/commands.md
  • For diagnostics files and suspend-state details:
    references/diagnostics.md
  • 命令示例和操作流程:
    references/commands.md
  • 诊断文件和暂停状态详情:
    references/diagnostics.md