Skip to content
Agent Orchestration
Skill

/ralph

Launcher for the Ralph-style queue drain script - emits the right `node ralph-loop.mjs` invocation based on the user's filter and bounds. The actual loop runs as a Node script that opens one server run and spawns one `claude -p --worktree` per iteration under its own seat; this

From plugin
task-orchestrator
21430 skills5 agents2 commands

Claude Code

$ npx -y skills add jpicklyk/task-orchestrator --skill ralph --agent claude-code

SKILL.md

ralph.SKILL.md
name: ralph
description: "Launcher for the Ralph-style queue drain script - emits the right `node ralph-loop.mjs` invocation based on the user's filter and bounds. The actual loop runs as a Node script that opens one server run and spawns one `claude -p --worktree` per iteration under its own seat; this skill is the configurator, not the loop. Use when a user says: drain the backlog, ralph the queue, run Ralph loop, work the queue, batch through queue items, autonomous queue worker."
argument-hint: "[optional: filter expression like 'tag=bug-fix' or 'type=quick-fix priority=high']"

ralph - Queue Drain Launcher

This skill is a **launcher** for the Ralph drain script (`scripts/ralph-loop.mjs` in this plugin). It does not run a loop in the current session. It helps you configure the right invocation, previews what will be processed, and emits the exact command to run.

The actual loop runs as a separate Node process that talks to the server over the REST API. It opens **one run per loop**. Each iteration selects the oldest ready queue item with `items_read next`, adds it to the run, assigns it an `implementer` seat, claims it under that seat's token, and spawns a fresh `claude -p` in its own git worktree (via Claude Code's `--worktree` flag) to work the item to terminal per its schema. The seat token reaches the iteration only as a file path. The iteration signals its outcome with a `RALPH_OUTCOME:` JSON marker; the driver then ends the seat, and on exit closes the run.

> **Why a separate script, not a slash-command loop?** Per Geoff Huntley's canonical Ralph: the value comes from carving off small bits of work into independent context windows. Each iteration is a fresh process - fresh context, fresh worktree, isolated logs, clean exit codes. The skill-as-orchestrator pattern (one session, internal loop) accumulates context within a session and doesn't preserve fresh-context isolation. For autonomous cadence, compose with `/loop`: `/loop 30m node scripts/ralph-loop.mjs --filter "tag=bug-fix"`.

**Requirements.** The REST API must be reachable: `TASK_ORCHESTRATOR_API_URL` (or `apiUrl` in `.taskorchestrator/client.json`), plus `TASK_ORCHESTRATOR_API_TOKEN` when the server requires a credential. The loop also needs a project root: `--root`, an `ancestorId=` in the filter, or `project.rootId` in the project config. Without either the script exits 64.

---

Step 1 - Resolve the filter

Determine what subset of the queue to drain.

**If `$ARGUMENTS` is non-empty**, parse it as a filter expression. Supported keys:

| Key | Effect | |---|---| | `tag=<value>` | Items carrying this tag (repeat the key, or comma-separate, for any-of) | | `type=<value>` | Items with this exact `type` | | `priority=<value>` | Items at this priority (`high`, `medium`, `low`) | | `parentId=<uuid-or-prefix>` | Only direct children of this container | | `ancestorId=<uuid-or-prefix>` | Only items anywhere in this ancestor's subtree, any depth - broader than `parentId` |

Multiple keys combine with AND (space-separated). Examples: `tag=bug-fix priority=high`, `type=quick-fix`, `parentId=89d02e32`, `ancestorId=<projectRootId>`. An unknown key is a CLI error (exit 64).

Every selection is scoped to a subtree: the filter's `ancestorId` when given, else the run's root. The same `ancestorId` scopes both the Step 3 preview and the drain itself.

**Project-scoped default:** when a **project** rootId is known (the `## Project Scope` section of the session context injected by the SessionStart hook, or the project-level config's `project.rootId`), the script uses it as the run's root and selection scope. Pass `--root` to drain another project. A personal root (`## Personal Scope`, or the user-level config) never defaults the root: it only anchors new items.

**If `$ARGUMENTS` is empty**, ask the user via `AskUserQuestion`:

* Ralph loop - what should I drain?
  1. Bug-fix backlog (tag=bug-fix)
  2. Quick fixes (type=quick-fix)
  3. Tech debt container (parentId=<lookup>)
  4. Anything in queue (no filter)
  5. Custom filter - specify

If the user picks "Tech debt container", search for it: `items_read(select="search", query="Tech Debt", limit=5)` and use the resulting UUID.

---

Step 2 - Resolve bounds

Set sensible loop bounds. Show defaults and let the user adjust.

* Loop bounds (default in parens):
  Max iterations:           10
  Gate-failure budget:      3 consecutive
  Error budget:             2 consecutive
  Idle budget:              3 consecutive
  Per-iteration USD cap:    $5           (the hard stop)
  Iteration timeout:        2700s (45 min)
  Claim TTL per iteration:  1800s (30 min)
  Run budget:               none         (attempts per seat only)
  Model and effort:         the policy's implementation class
                            (effort one level higher per retry of a seat)
  Cleanup on terminal:      smart (remove if no commits/changes; preserve otherwise)
  Resume continuations:     2 per iteration (0 disables)

  Adjust any?  Reply "ok" to use defaults.

If the user adjusts, capture the overrides. Common patterns:

  • High-volume drain: `--max 30`
  • Low-confidence run: `--gate-budget 1 --error-budget 1`
  • Architecture-heavy items: `--model <the implementation-complex class model> --budget 15 --iteration-timeout 5400`
  • Stop re-seating a struggling item: `--max-attempts 2`
  • Drain an exact list of items: `--items <id>,<id>,...`
  • Drain another project's queue: `--root <rootId>`
  • Preserve every worktree (debugging-heavy session): `--no-cleanup`
  • Disable resume-on-marker-less-exit: `--max-continuations 0`

The iteration's model and effort come from the `implementation` class in the plugin's dispatch policy (see `task-orchestrator:model-effort`), and the driver passes both to `claude -p` as `--model` and `--effort`. When the assign result reports `attempt` > 1 (the run already seated this item before), the effort is raised one level per earlier attempt, up to the policy's escalati

Read more
@jpicklyk
Ships withtask-orchestrator

Server-enforced workflow discipline for AI agents. Prompt-based frameworks hope the LLM follows instructions. This one blocks the call if it doesn't.

21430 skills5 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
214
Star history of jpicklyk/task-orchestrator on GitHub, a chart by star-history.com

Other skills on task-orchestrator.

implement

implement

End-to-end workflow for taking MCP work items from backlog to merged PR. Handles git branching, schema-driven planning,…

perf-review

perf-review

Performance impact assessment for items with the needs-perf-review trait. Evaluates hot paths, query patterns, and measurement…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw9d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca7d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip8d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about ralph.

Which coding agents can use ralph?
ralph installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.