Read the todos[] array in a ralph loop's YAML frontmatter and update the agent: field for each todo in-place. Determines which tasks benefit from subagent delegation versus running in the main orchestrator context; assigns agent IDs from the agents directory. Run after plan-skill-identification. Maintains canonical field order when editing. Triggers: assign agents, identify agents for todos, agent mapping, fill agent fields, subagent delegation, who does this task.
Reads a ralph loop's todos (with skills already assigned) and categorises which tasks are
execution-focused versus coordination-focused. Updates the agent: field in-place.
Note: In platforms where the worker cannot spawn subagents (e.g. Claude Code), the agent:
field is planning-time metadata — it categorises the task type but does not trigger separate
spawning during loop execution. The worker executes all todos inline. The field remains valuable
for planning clarity, future platform adapters, and cost/complexity signalling.
skill: fields have been assigned by plan-skill-identificationralph-loop-planner → plan-todos → plan-skill-identification → plan-subagent-identificationProvide:
plans/ralph-loop-002.md)Read the loop file — extract todos with agent: NA
Discover available agents:
name, description, and model fieldsFor each todo, assess delegation suitability:
Delegate to a subagent when:
Keep in orchestrator context (agent: NA) when:
Assign agent IDs from available agents, or flag MISSING: [description] if a suitable
agent does not exist yet.
Update agent: field in-place, maintaining canonical order:
id → content → skill → agent → outcome → status → complexity → priority
Subagent assignment also implies model tier selection. The three-tier model hierarchy:
| Role | Typical Model | Scope |
|---|---|---|
| Orchestrator / Planning | Opus | Strategic decisions, phase plans, loop decomposition |
| Loop orchestrator | Sonnet | Loop preparation, context assembly, handoff writing |
| Loop worker | Sonnet (default); Haiku for low-complexity | Bounded task execution, file operations, code runs |
When assigning tasks to a worker subagent, you are delegating execution to an isolated
execution context, keeping the orchestrator focused on coordination. Most worker todos
run at Sonnet tier for reliable compositional reasoning; only todos with complexity: low
are eligible for Haiku.
When assigning agents, also consider the todo's complexity field:
| Complexity | Model | Criteria |
|---|---|---|
low | Haiku eligible | Single-file edits, command execution, file copy, template fills |
medium (default) | Sonnet | Multi-file changes, skill-guided tasks, domain reasoning |
high | Sonnet | Cross-cutting changes, complex verification, architectural decisions |