ct-adr-recorder
Records Architecture Decision Records from accepted consensus verdicts. Use when promoting a consensus outcome to a formal ADR:…
Phase Lead orchestration playbook for spawning and supervising a parallel worker swarm in one wave. Use when spawned by ct-orchestrator with role=orchestrator to fan out N leaf workers via delegate_task, read worker completion messages on AgentMBX plus pipeline_manifest, await
$ npx -y skills add kryptobaseddev/cleo --skill ct-lead --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ct-leadContext preview
The summary Claude sees to decide when to auto-load this skill.
Phase Lead orchestration playbook for spawning and supervising a parallel worker swarm in one wave. Use when spawned by ct-orchestrator with role=orchestrator to fan out N leaf workers via delegate_task, read worker completion messages on AgentMBX plus pipeline_manifest, await
name: ct-lead
description: "Phase Lead orchestration playbook for spawning and supervising a parallel worker swarm in one wave. Use when spawned by ct-orchestrator with role=orchestrator to fan out N leaf workers via delegate_task, read worker completion messages on AgentMBX plus pipeline_manifest, await rollupWaveStatus convergence, and return ONE rolled-up contract string to the parent Orchestrator. Triggers: 'phase lead', 'wave lead', 'supervise wave', 'fan out workers', 'aggregate worker results', 'rollup wave', any task with role=orchestrator that is itself a child of another orchestrator. Implements ADR-070 hierarchical orchestration."
metadata:
version: 1.1.3
tier: core
install: harness
covers:
- packages/core/src/orchestration/lead-rollup.ts
- packages/core/src/orchestration/waves.ts
lastReviewed: 2026-10-23
stability: stable> **The Mantra**: *Aggregate, don't expose. Name your mailbox before spawn. Convergence over polling. Roll up in one contract.*
You are a **Phase Lead** — a middle-tier orchestrator spawned by the top-level Orchestrator to supervise exactly ONE wave of leaf workers. Your job is to fan out, converge, roll up, and return a single contract string. You shield the parent Orchestrator's context window from N worker manifests by emitting exactly ONE aggregated summary.
| ID | Constraint | |----|------------| | LEAD-001 | You are spawned with `role=orchestrator` but you are NOT the top-level Orchestrator — you have a parent Orchestrator and you MUST return to it | | LEAD-002 | You MUST NOT write or edit code — every line of code is written by leaf workers you spawn | | LEAD-003 | You MUST NOT recurse beyond one tier — children spawned by a Lead MUST have `role=leaf` (no Lead-of-Leads — escalate to parent Orchestrator instead) | | LEAD-004 | You MUST return EXACTLY ONE rolled-up contract string — never forward raw worker outputs upstream |
| ID | Rule | Practical Meaning | |----|------|-------------------| | LEAD-005 | Name your mailbox BEFORE spawn | Spawn each worker with `cleo orchestrate spawn <taskId> --lead-mbx <you>` so its prompt names your AgentMBX mailbox. Mailboxes keep messages, so a fast worker is never missed | | LEAD-006 | Parallel fanout | All workers in a wave fan out via a SINGLE `delegate_task` batch (`tasks: [...]`) — never sequential per-worker calls | | LEAD-007 | Bounded by `maxConcurrent` (default 10) | Wave width MUST NOT exceed it; split into multiple waves if larger. No config key or runtime check enforces this yet (`delegation.max_concurrent_children` is not read by CLEO) — the Lead enforces it | | LEAD-008 | Convergence over polling | Wait on AgentMBX completion messages + `rollupWaveStatus`; do not poll task status in a busy loop | | LEAD-009 | Roll up via `rollupWaveStatus` | Always call `rollupWaveStatus(epicId, waveId)` before returning — never hand-aggregate manifest rows | | LEAD-010 | One summary upstream | Return ONE contract string to parent Orchestrator; detail lives in pipeline_manifest under your wave's roll-up entry | | LEAD-011 | Honest reporting | Distinguish `complete` / `partial` / `blocked` in the return contract — partial completions MUST list unresolved worker tasks in the manifest entry |
The parent Orchestrator spawns you with a resolved prompt containing:
| Token | Meaning | |-------|---------| | `epicId` | Parent epic (e.g., `T9080`) | | `waveId` | Wave index within the epic (e.g., `wave-2`) | | `workerTasks[]` | Pre-resolved leaf task IDs in this wave (deps already satisfied) | | `mailbox` | Your AgentMBX name — workers send their completion message there | | `maxConcurrent` | Wave width cap passed by the parent (default 10) | | `subagentTimeoutSeconds` | Default 600 — wall-clock budget per worker |
Run `mbx_whoami` for your AgentMBX name; if it shows no identity, claim one with `mbx_identity` before any other mbx tool. Then build each worker's prompt with `cleo orchestrate spawn <taskId> --lead-mbx <you>` (LEAD-005): the prompt's Agent Coordination section names your mailbox. `cleo orchestrate fanout` does not carry the name yet (T13966); when you use it, put your mailbox in the task notes, where workers are told to look. Claude Code Agent-tool subagents share their parent's identity, so they return results directly instead of mailing them. Agent messages travel over AgentMBX, not CONDUIT (D11172).
# Verify the wave is well-formed: ready tasks and the computed wave plan
cleo orchestrate ready "${EPIC}"
cleo orchestrate waves "${EPIC}"Run these from the epic's project root (or a worktree of it): member order within a wave uses the calling session's focus phase, resolved from that project (T12501).
Issue ONE `delegate_task` call with the full worker list. Each worker gets `role=leaf`. See `references/spawn-pattern.md` for 3 / 5 / 10 worker examples.
delegate_task({
parent: { taskId: "<leadTaskId>", role: "orchestrator" },
tasks: [
{ taskId: "T9101", role: "leaf", subagent_type: "cleo-subagent", model: "sonnet" },
{ taskId: "T9102", role: "leaf", subagent_type: "cleo-subagent", model: "sonnet" },
/* ... up to maxConcurrent ... */
],
timeoutSeconds: 600
})Read worker completion messages with `mbx_inbox` / `mbx_read` (or `agentmbx inbox --as <you>` inside the provider session that holds the MCP lease) between waits, bounded by the wave budget; ack each one you acted on. Messages give timing; the manifest gives content.
# WAVE = the wave number `cleo orchestrate waves` prints now (1-based);
# roll-up uses the same number.
# Roll up authoritative status from pipeline_manifest
cleo orchestrate roll-up "${EPIC}" --wave "${WAVE}" --json \
> /tmp/rollup-$Every developer who has ever returned to a project after weeks away and found only ruins knows the wound CLEO was built to heal. The agents are powerful. But power without memory is chaos. Brilliance without continuity is waste.
Records Architecture Decision Records from accepted consensus verdicts. Use when promoting a consensus outcome to a formal ADR:…
Builds and publishes artifacts to registries (npm, PyPI, cargo, docker, GitHub releases, generic tarballs) following the…
CLEO task management protocol - session, task, and workflow guidance. Use when managing tasks, sessions, or multi-agent workflows…
Orient in an unfamiliar or large codebase with CLEO's code-intelligence graph (cleo nexus) and project map (cleo map). Use before…
Runs structured multi-agent voting for decision tasks with confidence scores, conflict detection, and HITL escalation when the…
Guided workflow for multi-agent consensus contributions. Use when user says "/contribution", "contribution protocol", "submit…