Ralph-style orchestrator loop — dispatches each phase as a subagent, hooks enforce progression
Orchestrates multi-phase workflows by dispatching specialized subagents and advancing state through automated hooks.
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_phase_prompt() in schedule.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_phase_prompt() in schedule.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
prompts/orchestrator-loop.md kept as reference only.| Phase | subagent_type | model | Notes |
|---|---|---|---|
| 0 | subagents:explorer | config | Parallel batch: dispatch 1-10 agents |
| 1.1 | subagents:brainstormer | config | Single agent |
| 1.2 | subagents:planner | config | Parallel batch: dispatch 1-10 agents |
| 1.3 | state.reviewer | inherit | Dynamic: codex-reviewer or claude-reviewer |
| 2.1 | complexity-routed agents | per-task | Easy→sonnet-task-agent, Medium→opus-task-agent, Hard→codex-task-agent (or opus if codexAvailable:false) |
| 2.2 | subagents:simplifier | config | Single agent |
| 2.3 | state.reviewer | inherit | Dynamic: codex-reviewer or claude-reviewer |
| 3.1 | state.testDeveloper | config | Dynamic: test-developer or codex-test-developer |
| 3.2 | state.failureAnalyzer | config | Dynamic: failure-analyzer or codex-failure-analyzer |
| 3.3 | state.testDeveloper | config | Dynamic: test-developer or codex-test-developer |
| 3.4 | state.reviewer | review-tier | Dynamic: codex-reviewer or claude-reviewer |
| 3.5 | state.reviewer | review-tier | Dynamic: codex-reviewer or claude-reviewer; coverage loop |
| 4.1 | state.docUpdater | config | Dynamic: doc-updater or codex-doc-updater |
| 4.2 | state.reviewer | inherit | Dynamic: codex-reviewer or claude-reviewer |
| 4.3 | subagents:completion-handler | config | Single agent |
For each phase dispatch, build the prompt as:
[PHASE {phase_id}]
{contents of prompts/phases/{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):
/subagents:resumeIf configured (compaction.betweenStages or compaction.betweenPhases):
on-subagent-stop.sh hookon-subagent-stop.sh hookon-subagent-stop.sh hookon-stop.sh hookon-task-dispatch.sh hookExpert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.