| name | agent-orchestrate |
| description | Analyze the user's task and propose the optimal orchestration pattern, then execute it.
4 patterns: Sequential Pipeline, Parallel Subagent, Team Mode, Ralph Loop.
Situation-aware pattern selection with user confirmation before execution.
Use when: "/agent-orchestrate", "agent-orchestrate", "์ค์ผ์คํธ๋ ์ด์
", "์ด๋ค ํจํด์ผ๋ก",
"๋ณ๋ ฌ๋ก ํ ๊น", "์์ฐจ๋ก ํ ๊น", "ํ ๋ชจ๋", "์์ด์ ํธ ํจํด", "์์
๋ฐฉ์ ์ ์",
"how should we run this", "pick a pattern".
Also trigger when the user describes a complex multi-step task that would clearly
benefit from agent coordination โ e.g., "A์ฌ B์ฌ C์ฌ ๋ถ์ํด์ค", "์ค๊ณํ๊ณ ๊ตฌํํ๊ณ
๋ฆฌ๋ทฐ๊น์ง", "์ด๊ฑฐ ์์๋๋ก ํด์ค", "3๊ฐ ๋์์ ๋๋ ค", or any task with 3+ subtasks
where choosing the right execution pattern matters for efficiency.
|
| allowed-tools | ["Read","Grep","Glob","Bash","Write","Edit","Agent","Task","AskUserQuestion","Skill","SendMessage","TeamCreate","TeamDelete"] |
/agent-orchestrate โ Situation-Aware Agent Orchestration
Analyze the user's task, recommend the best orchestration pattern, and execute it upon approval.
4 Orchestration Patterns
| Pattern | When | Mechanism | Best For |
|---|
| Sequential Pipeline | Steps depend on each other (AโBโC) | TaskCreate โ execute one by one | Blog writing, migration, ordered workflows |
| Parallel Subagent | N independent tasks, results merged | Agent ร N spawn โ main collects | Competitor analysis, multi-file review, bulk processing |
| Team Mode | Roles need inter-agent communication | TeamCreate โ agents talk directly | Design+implement+review, complex features |
| Ralph Loop | Clear done-criteria, iterative refinement | Activate /ralph skill with DoD | Bug fixing to spec, quality gates, polish tasks |
Phase 1: Task Analysis
When the user provides a task (as argument or in conversation):
1.1 Extract Signal
Read the task description and identify:
signals = {
step_count: how many distinct steps/subtasks?
dependencies: are steps dependent (AโB) or independent (AโฅB)?
parallelizable: how many tasks can run simultaneously?
roles_needed: does the task need distinct roles (designer, implementer, reviewer)?
inter_comm: do workers need to communicate with each other mid-task?
done_criteria: is there a clear, binary definition of done?
iterative: does the task likely need multiple passes to get right?
}
1.2 Pattern Selection Logic
The key insight: check structural signals (parallelism, roles) first, then refinement signals (iteration).
Ralph is for tasks where the primary challenge is "getting it right" through iteration, not for any task that happens to have success criteria.
recommend_pattern =
IF parallelizable >= 2 AND no inter_comm needed:
"Parallel Subagent"
ELIF roles_needed >= 2 AND inter_comm needed:
"Team Mode"
ELIF step_count >= 2 AND all dependencies are sequential (AโBโC):
"Sequential Pipeline"
ELIF done_criteria is clear AND iterative AND step_count <= 2:
"Ralph Loop"
ELIF step_count == 1:
"Sequential Pipeline" # simplest default for single task
ELSE:
"Parallel Subagent" # safe default for multi-task
Why Ralph is checked later: Most multi-step tasks benefit from structural parallelism even if they have clear done-criteria. Ralph shines when the task is focused (1-2 subtasks) but needs iterative refinement to meet quality โ e.g., "์ด ๋ฒ๊ทธ ๊ณ ์ณ์ ํ
์คํธ ํต๊ณผ์์ผ", "์ฑ๋ฅ 200ms ์ดํ๋ก ๋ง๋ค์ด".
Phase 2: Propose to User
Present the recommendation using AskUserQuestion. Include:
- Why this pattern โ 1-2 sentence reasoning based on signals
- Execution plan preview โ what agents/tasks will be created
- All 4 options โ let the user override
AskUserQuestion Format
question: "์ด ์์
์ '{recommended}' ํจํด์ ์ถ์ฒํฉ๋๋ค. {reason}. ์ด๋ค ํจํด์ผ๋ก ์งํํ ๊น์?"
header: "ํจํด ์ ํ"
options:
- label: "{recommended} (Recommended)"
description: "{why this fits}"
- label: "{2nd best}"
description: "{when this would be better}"
- label: "{3rd}"
description: "{description}"
- label: "{4th}"
description: "{description}"
After pattern selection, present the execution plan preview:
question: "์คํ ๊ณํ์
๋๋ค. ์งํํ ๊น์?"
header: "์คํ ํ์ธ"
options:
- label: "์งํ"
description: "{plan summary}"
- label: "์์ ํ ์งํ"
description: "๊ณํ์ ์กฐ์ ํ๊ณ ์ถ์ด์"
"์์ ํ ์งํ" ์ ํ ์: AskUserQuestion์ผ๋ก "์ด๋ค ๋ถ๋ถ์ ์์ ํ ๊น์?"๋ฅผ ์ด๋ฆฐ ์ง๋ฌธ์ผ๋ก ๋ฌผ์ด๋ณธ๋ค. ์ฌ์ฉ์ ํผ๋๋ฐฑ์ ๋ฐ์ํด ์คํ ๊ณํ์ ์ฌ๊ตฌ์ฑํ ๋ค, ๋ค์ ์คํ ํ์ธ์ ์ ์ํ๋ค. ํจํด ์์ฒด๋ฅผ ๋ฐ๊พธ๊ณ ์ถ๋ค๋ฉด Phase 2์ ํจํด ์ ํ์ผ๋ก ๋์๊ฐ๋ค.
Phase 3: Execute by Pattern
Pattern A: Sequential Pipeline
1. Parse task into ordered steps
2. FOR each step:
TaskCreate(title=step.name, description=step.detail)
3. FOR each task in order:
Execute the task directly (read, write, bash, etc.)
TaskUpdate(status="completed")
4. Output: summary of all completed steps
Key rule: Each task must complete before the next begins. Pass outputs forward as context.
Pattern B: Parallel Subagent
1. Parse task into independent subtasks
2. Spawn Agent per subtask (all in ONE message for true parallelism):
Agent(
description="subtask summary",
prompt="full context + specific subtask + output format",
subagent_type=<appropriate type or general-purpose>
)
3. Collect all agent results
4. Synthesize/merge results into final output
5. Present unified result to user
Key rule: All agents must be spawned in a single message. The main agent does the synthesis โ never delegate merging to a subagent.
Pattern C: Team Mode
1. Define roles from task analysis (e.g., designer, implementer, reviewer)
2. TeamCreate with role-based agents:
TeamCreate(
agents=[
{name: "role-1", description: "...", tools: [...]},
{name: "role-2", description: "...", tools: [...]}
]
)
3. Orchestrate via SendMessage:
- Kick off first role's work
- Route outputs between roles
- Coordinate handoffs
4. TeamDelete when complete
5. Present final result
Key rule: Define clear handoff points. The orchestrator (you) coordinates โ agents talk through you or directly via SendMessage.
Pattern D: Ralph Loop
Do NOT reimplement ralph. Activate the existing skill.
1. Formulate the task as a ralph-compatible request:
- Clear goal statement
- Implicit or explicit done-criteria the user provided
2. Invoke: Skill(skill="hoyeon:ralph", args="{task description with context}")
3. Ralph handles the rest:
- Phase 1: DoD proposal + user confirmation
- Phase 2: Work + Stop hook verification loop
Key rule: Pass through all relevant context (file paths, requirements, constraints) in the args so ralph has full picture. Do not pre-define DoD โ let ralph propose it.
Phase 4: Report
After execution completes (regardless of pattern), output a brief summary:
## Orchestration Complete
**Pattern**: {chosen pattern}
**Tasks**: {count} completed
**Result**: {1-3 sentence summary of what was done}
Rules
- Always ask before executing โ never skip Phase 2 confirmation
- Ralph is a skill call, not a reimplementation โ use
Skill(skill="hoyeon:ralph")
- Parallel agents in one message โ don't spawn sequentially
- Match pattern to situation โ don't force a pattern; if the task is trivial, sequential is fine
- Pass context forward โ each step/agent needs enough context to work independently
- Keep proposals concise โ the user wants a recommendation, not an essay