Ralph-style orchestrator loop — dispatches each phase as a subagent, hooks enforce progression
Orchestrates multi-phase AI agent workflows by sequentially dispatching specialized subagents and enforcing progression gates.
npx claudepluginhub kenkenmain/ken-cc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Dispatch each phase as a subagent. Hooks enforce output validation, gate checks, state advancement, and loop re-injection. This skill only handles the dispatch loop.
The orchestrator uses the Ralph Loop pattern: the Stop hook generates a phase-specific orchestrator prompt (~40-70 lines) via generate_sl_prompt() in superlaunch.sh every time Claude tries to stop. Claude reads state from disk and dispatches the current phase — no conversation memory required.
Claude dispatches phase N as a subagent (Task tool)
↓
Subagent completes
↓
SubagentStop hook fires:
- Validates output file exists
- Checks gate if at stage boundary
- Marks phase completed
- Advances state to phase N+1
- Exits silently (no stdout)
↓
Claude tries to stop (subagent done, nothing left to do)
↓
Stop hook fires:
- Generates phase-specific prompt via generate_sl_prompt() in superlaunch.sh
- Increments loopIteration in state
- Returns {"decision":"block","reason":"<phase-specific orchestrator prompt>"}
↓
Claude receives phase-specific orchestrator prompt
- Reads .agents/tmp/state.json (now pointing to phase N+1)
- Dispatches phase N+1 as a subagent
↓
Repeat until SubagentStop marks workflow "completed" → Stop hook allows exit
| Phase | subagent_type | model | Notes |
|---|---|---|---|
| S0 | minions:explorer | inherit | Parallel batch: dispatch 1-10 agents |
| S1 | minions:brainstormer | inherit | Single agent |
| S2 | minions:planner | inherit | Parallel batch: dispatch 1-10 agents |
| S3 | minions:plan-reviewer | inherit | plan-reviewer |
| S4 | minions:task-agent | inherit | Parallel batch: dispatch per-task |
| S5 | minions:simplifier | inherit | Single agent |
| S6 | minions:impl-reviewer | inherit | impl-reviewer |
| S7 | state.testDeveloper | inherit | Dynamic: test-developer |
| S8 | state.failureAnalyzer | inherit | Dynamic: failure-analyzer |
| S9 | state.testDeveloper | inherit | Dynamic: test-developer |
| S10 | minions:test-dev-reviewer | inherit | test-dev-reviewer |
| S11 | minions:test-reviewer | inherit | test-reviewer; coverage loop |
| S12 | state.docUpdater | inherit | Dynamic: doc-updater |
| S13 | minions:final-reviewer | inherit | final-reviewer |
| S14 | minions:shipper | inherit | Single agent |
For each phase dispatch, build the prompt as:
[PHASE {phase_id}]
{contents of prompts/superlaunch/{phase_id}-*.md}
## Task Context
Task: {state.task}
## Input Files
{contents or summaries of input files for this phase}
The [PHASE {id}] tag is used by the PreToolUse hook to validate dispatches.
These phases dispatch multiple parallel subagents. The workflow skill:
The workflow skill does NOT handle errors directly. If a subagent fails:
If retries exhaust (hook keeps blocking):
on-subagent-stop.sh hookon-subagent-stop.sh hookon-subagent-stop.sh hookon-stop.sh hookon-task-gate.sh hookYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.