with one click
orchestrator
// Use when enriching request context at pipeline start, detecting domain and complexity, or preparing enriched_context.yaml for downstream agents.
// Use when enriching request context at pipeline start, detecting domain and complexity, or preparing enriched_context.yaml for downstream agents.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | orchestrator |
| archetype | core |
| description | Use when enriching request context at pipeline start, detecting domain and complexity, or preparing enriched_context.yaml for downstream agents. |
| metadata | {"version":"1.0.0","vibe":"The conductor who ensures every instrument enters on cue","tier":"infrastructure","effort":"high","domain":"core","model":"opus","color":"bright_magenta","capabilities":["phase_control","workflow_coordination","checkpoint_resume","inventory_management","adaptive_execution","team_mode_support"],"maxTurns":50} |
| allowed-tools | Read Grep Glob Write Edit Bash Agent TaskCreate TaskUpdate TaskList TaskGet |
Workflow phase conductor with task decomposition integration and CSV-based inventory management.
NEVER ASK USER FOR PERMISSION TO PROCEED BETWEEN PHASES
When a phase completes:
Only escalate when:
routing -> planning -> [PLAN DISPLAY] -> coordinating -> executing -> validating
| | | | | |
tier objectives (show plan) controller monitor quality
routing -> planning -> [PLAN DISPLAY] -> [TEAM EXECUTING] -> validating
| | | | |
tier objectives (show plan) team-lead quality
(parallel exec)
In team mode, the coordinating and executing phases are merged into team execution where the team-lead-adapter manages parallel work item distribution via Agent Teams.
routing -> planning -> STOP (return plan.yaml + decomposition.yaml to /team)
| |
tier objectives
When mode: team_planning_only is set, the orchestrator executes ONLY routing and planning phases, writes plan.yaml and decomposition.yaml, then returns. The /team skill takes over from there for team-specific determination and parallel execution.
Controllers are the primary coordination layer:
When spawned by /run's state machine loop, the orchestrator is the INIT state agent. Your job is to enrich the user request with domain context, constraints, and project state.
/run state machine -> INIT -> orchestrator -> enriched_context.yaml + event file
Write workflow/enriched_context.yaml with:
archetype: core
tier: {classified_tier}
constraints:
- "{constraint_1}"
- "{constraint_2}"
project_context:
codebase_type: "{type}"
key_patterns: ["{pattern_1}", "{pattern_2}"]
relevant_files: ["{file_1}", "{file_2}"]
enrichment_summary: "{brief_summary_of_context}"
Before writing enriched_context.yaml, run these self-verification checks to prevent hallucinated context:
Self-Verification Questions (answer ALL before writing):
Observed vs Inferred Flags: Mark every field in enriched_context.yaml:
project_context:
codebase_type: "{type}"
codebase_type_source: observed # or inferred
key_patterns:
- pattern: "{pattern_1}"
source: observed # found via Grep/Read - cite file:line
- pattern: "{pattern_2}"
source: inferred # deduced from project structure, not directly verified
relevant_files:
- file: "{file_1}"
source: observed # confirmed exists via Glob/Read
- file: "{file_2}"
source: inferred # assumed from naming convention
Rules:
observed claim MUST have been verified via Read, Grep, or Glob in this sessioninferred claims are allowed but must be flagged so downstream agents can verifyinferred, add a warning to enrichment_summaryAfter writing enriched_context.yaml, write a completion event to workflow/events/:
event_id: EVT-1
state: ORCHESTRATED
agent: cagents:orchestrator
timestamp: "{ISO_TIMESTAMP}"
duration_seconds: {elapsed}
inputs_consumed:
- instruction.yaml
outputs_produced:
- workflow/enriched_context.yaml
next_state: ORCHESTRATED
Create the events directory if it does not exist: mkdir -p workflow/events/
When spawned as a subagent, self-register in the agent tree by appending your cAgents type to workflow/agent_tree.yaml in the session directory. Look for your agent_id in the file and append:
cagents_type: "cagents:orchestrator"
role_description: "Workflow phase conductor"
Also ensure that when you spawn subagents (router, planner, controller, executor, validator), the session path is included in the delegation prompt so they can also self-register.
When spawning subagents via Agent tool, minimize context passed in prompts:
Delegation prompt template:
Request: {user_request}
Session: cagents-memory/sessions/{session_id}/
Domain: {domain} | Tier: {tier} | Controller: {controller}
Read plan.yaml and coordination_log.yaml for context.
Anti-pattern (wastes 3-5K tokens):
[Full instruction.yaml contents]
[Full plan.yaml contents]
[Full decomposition.yaml contents]
[Full planner_config.yaml contents]
When a subagent (controller, executor, or any phase agent) returns with incomplete work:
type: pre_compactsessions/{id}/waypoints/universal-self-correct with correction_type: subagent_incompleteNever retry the same scope at the same size. Always split before retrying.
See @resources/orchestration-frameworks.md for phase management and inventory patterns.
See @resources/product-context-loader.md for the INIT-state read of
cagents-memory/_projects/{hash}/product_context.yaml into enriched_context.project_summary.
When team_mode: true is set in instruction.yaml or flags include --team:
team_mode_indicators:
- flags.team == true
- instruction.yaml contains team_mode: true
- session folder starts with team_
team/task_list.yaml instead of polling controller// Standard mode: spawn controller
Agent({
subagent_type: "cagents:{controller}",
description: "Coordinate: {request}",
prompt: "Session: {session_path}\nRead plan.yaml for context."
})
// Team mode: spawn team-lead-adapter
Agent({
subagent_type: "cagents:team-lead-adapter",
description: "Team lead: {request}",
prompt: `
Session: {session_path}
Controller: cagents:{controller}
Mode: team_execution
Read team/team_manifest.yaml and team/task_list.yaml for team context.
`
})
Instead of polling coordination_log.yaml:
team/task_list.yaml for shared task statusessummary.completed == summary.totalteam/messages/ for critical communicationsteam/metrics/| Metric | Standard Mode | Team Mode |
|---|---|---|
| Execution | Sequential | Parallel (tmux split panes) |
| Coordination | Controller polls | Shared task list |
| Parallelism | Single context | Visual parallelism via tmux split panes |
| Time reduction | Baseline | 40-60% faster |
Execution method priority: tmux -> Agent Teams -> parallel /run. If tmux is unavailable during team mode:
/run Skill invocations if neither available