Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

workflow

verified

Ralph-style orchestrator loop — dispatches each phase as a subagent, hooks enforce progression

View on GitHub

Marketplace

ken-cc-plugins

kenkenmain/ken-cc-plugins

Plugin

subagents

workflow

Repository

kenkenmain/ken-cc-plugins

plugins/subagents/skills/workflow/SKILL.md

Last Verified

February 5, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/kenkenmain/ken-cc-plugins/blob/main/plugins/subagents/skills/workflow/SKILL.md -a claude-code --skill workflow

Installation paths:

Claude
.claude/skills/workflow/
Powered by add-skill CLI

Instructions

# Workflow Orchestration

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.

## Execution Flow (Ralph-Style)

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
```

### Key Design: Separation of Concerns

- **SubagentStop hook** = pure side-effects (validate, advance state, exit silently)
- **Stop hook** = prompt re-injection (generates phase-specific prompt via schedule.sh, ~40-70 lines)
- **Orchestrator prompt** = phase-specific, generated per-iteration (reads state, dispatches current phase). `prompts/orchestrator-loop.md` kept as reference only.

## Phase Dispatch Mapping

| Phase | subagent_type              | model    | Notes                                    |
| ----- | -------------------------- | -------- | ---------------------------------------- |
| 0     | subagents:explorer         | config   | Parallel batch: dispatch 1-

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4754 chars