← knowledge.oriz.in

Ralph-loop when loop-shaped — reach for the primitive, not another one-shot

rule agentloopskillsorchestrationralph

Ralph-loop when loop-shaped

The rule

When a task fits the loop-shape criteria below, invoke ralph-loop (skill) or one of its presets. Don't reinvent the loop each turn. Don't hand-roll a for-each in the main thread when the primitive is available.

Loop-shape criteria (all must hold)

  1. Task decomposes into repeatable iterations
  2. Task-done predicate is expressible (a search returns empty; a checklist empties; a test passes)
  3. Iteration cost is small vs main-thread context growth
  4. Bounded time budget acceptable
  5. Failure of one iteration does not require aborting the loop

When to invoke

Recognizable patterns that ARE loop-shaped:

Anti-patterns that are NOT loop-shaped:

Preset > Custom > Skip-and-invent

Order of preference:

  1. Existing preset (check agent-skills/* for a preset matching the shape) — best: reuses defaults, memory-file conventions, and cross-refs
  2. Custom ralph-loop invocation — invoke ralph-loop skill with task-specific args
  3. Hand-rolled loop in-workflow — only if the task shape truly doesn't fit either

Available presets (2026-07-04)

Autonomy inheritance

Ralph loop runs at the autonomy level the invoker was authorized for. External writes (issues, PRs, SOFA posts) inherit standing-auth. Standing-auth exceptions still apply:

Loop must halt + surface for MCQ on any of the above.

Anti-patterns

Cross-refs