From octoswitch
Main delegation entrypoint. Plan, split, and dispatch tasks to routed subagents with two-stage review gates and verification-before-completion discipline.
How this skill is triggered — by the user, by Claude, or both
Slash command
/octoswitch:delegate <task description><task description>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this as the main execution command when work should be handed to fresh subagents.
Use this as the main execution command when work should be handed to fresh subagents.
This command must create one or more fresh subagents via the Task tool.
Do NOT use the Skill tool. The agents are launched via the Task tool's subagent_type parameter.
Do not execute the delegated work in the current session unless subagents are unavailable.
Compatibility forms:
/delegate .../octoswitch:delegate ...When exported as a plugin artifact, publish this command under the octoswitch namespace.
/delegate <task>/delegate --to <group> <task>Related command:
/task-route: stores task-type routing preferencesThe controller (this session) orchestrates. Subagents execute with fresh context. The controller never performs the delegated work itself.
DONE, DONE_WITH_CONCERNS, BLOCKED, NEEDS_CONTEXTdoneWhen criteria are actually metBLOCKED, do not proceed to dependent tasks; escalate to userEvery /delegate follows three phases:
The controller analyzes the request and builds an explicit task plan before any agent is launched. This plan is the controller's internal blueprint — do NOT present it to the user for approval.
Break the request into the smallest set of focused, independently scoped tasks. Each task must have:
id — sequential number (1, 2, 3...)kind — task kind for route lookup (implementation, review, search, debug, refactor, test, docs, or other user-defined kind)description — what this task does, in one sentencescope — specific files/areas/deliverables this task touchesmode — execution mode (see below)blocks — list of task IDs that cannot start until this task completesblockedBy — list of task IDs that must complete before this task can startdoneWhen — concrete completion criteria (what does "done" look like for this task?)For each task, assign one mode:
| Mode | Meaning | Launch strategy |
|---|---|---|
parallel | No dependencies on other tasks | Launch in the same message as other parallel tasks |
serial | Depends on one or more prior tasks | Launch after all blockedBy tasks complete; review gate applies |
standalone | Single task, no other tasks in plan | Launch one agent, done |
For each task:
kindgroup--to groupoctoswitch:<agent-name>Create a TodoWrite entry for each task to track progress:
TodoCreate({
subject: "Task #<id> [<kind>]: <description>",
description: "Route: <group> | Done when: <doneWhen>",
status: "pending"
})
Update status to in_progress when launching, completed when verified done.
Group tasks into waves:
blockedBy dependencies — launch together (parallel)blockedBy tasks are all in Wave 1 — launch together after Wave 1 completesExample plan structure:
Plan — [brief summary of the delegated request]
| # | kind | mode | blockedBy | blocks | route | agent |
|---|----------------|----------|-----------|-----------|--------|--------------------------|
| 1 | search | parallel | — | 2, 3 | Haiku | octoswitch:search |
| 2 | implementation | serial | 1 | — | Sonnet | octoswitch:implementation|
| 3 | review | serial | 1 | — | Opus | octoswitch:review |
Execution order:
Before dispatching, verify:
modeblockedBy references point to valid task IDsdoneWhen criterion--to group is providedIf validation fails, explain the error and stop. Do NOT dispatch.
For each wave:
Each subagent receives a structured prompt with all necessary context:
Execute this task using route: <group>.
Treat the route as fixed for this task.
You are Task #<id> of <total> in a split delegation.
## Your assigned work
<description>
## Scope
<scope>
## Context from prior tasks
<if blockedBy: include summarized output of all blocking tasks>
<if no blockedBy: "This is the first task — no prior context needed.">
## Done when
<doneWhen>
## Structured status protocol
Before finishing, classify your result as ONE of:
- **DONE**: All `doneWhen` criteria are met. No unresolved issues.
- **DONE_WITH_CONCERNS**: Criteria met, but you identified risks or follow-ups worth flagging.
- **BLOCKED**: Cannot proceed due to a concrete blocker (describe what and why).
- **NEEDS_CONTEXT**: Missing information needed to proceed (specify what).
**Do NOT** claim DONE if you did not verify the criteria.
## You are an execution-focused worker
Do:
- execute the requested work within scope
- run relevant checks or tests when appropriate
- fix direct follow-up issues only when clearly in scope
Do not:
- change the routing target
- re-plan the whole task unless blocked
- broaden scope beyond what's described
- return long reasoning dumps
Return only:
- route confirmation (state your route: <group>)
- status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
- summary of what you did (3-5 bullets max)
- files changed (paths only)
- commands run
- test results (pass/fail counts)
- unresolved risks (if any)
When a serial task completes:
doneWhen criteria are actually met by examining the worker's outputDONE or DONE_WITH_CONCERNS and criteria verified → proceed to dependent tasksBLOCKED → STOP. Do not launch dependent tasks. Escalate to user with blocker details.NEEDS_CONTEXT → retry once with additional context from the controller. If still stuck, escalate.Parallel tasks have no review gates between them — they launch together and report independently.
Each still gets verified against its own doneWhen criteria.
As each wave completes, immediately report to the user — do NOT wait for all waves.
Format for each completed task:
✅ Task #<id> [<kind>] completed (route: <group>) — STATUS: <DONE|DONE_WITH_CONCERNS>
<worker summary>
Files changed: <list or "none">
For any task that clearly failed:
Previous attempt failed because: <reason>. Please retry with this in mind.
❌ Task #<id> [<kind>] failed (route: <group>)
<error or failure reason>
Before presenting the final summary:
doneWhen criteria against the worker's outputdoneWhen is verifiedWhen ALL tasks have returned (including retries):
## Delegate Report — Summary
| # | Task | Kind | Status | Route |
|---|------|------|--------|-------|
| 1 | [description] | search | ✅ | Haiku |
| 2 | [description] | implementation | ⚠️ concerns | Sonnet |
| 3 | [description] | review | ❌ | Opus |
## Summary
<overall summary combining all completed tasks>
## Files Changed
<consolidated list from all tasks>
## Unresolved Risks
<consolidated risks from all tasks>
The controller must NOT perform the delegated implementation itself.
/delegate <task>
/delegate --to <group> <task>
All tasks resolve to the specified group directly. The group name is used as the agent's model field so requests go through the OctoSwitch gateway, where the active member can be switched in real time.
Generated agents are created from the OctoSwitch Skills page preferences.
After preferences change, the user must sync the local plugin and then run /agents to reload agents or restart the session.
Plugin-provided agents are addressed as octoswitch:<agent-name> — do not drop the namespace.
If no generated agents are registered:
If the resolved target group does not exist in the generated agents:
/delegate --to <existing-group> ...If the platform does not support subagents or the Task tool is unavailable:
/delegate requires subagent support/delegate 按当前确认方案完成实现并测试
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|----------------|------------|-----------|--------|--------|---------------------------|
| 1 | implementation | standalone | — | — | Sonnet | octoswitch:implementation |
→ single task → launch one agent → verify doneWhen → report
/delegate 审查新添加的 API 端点风险,并搜索是否有类似的历史 bug
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|--------|----------|-----------|--------|-------|--------------------|
| 1 | review | parallel | — | — | Opus | octoswitch:review |
| 2 | search | parallel | — | — | Haiku | octoswitch:search |
→ Wave 1: parallel launch of both agents → report each → summarize
/delegate 研究一下石头为什么是圆的并给我讲个笑话
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|-----------|----------|-----------|--------|----------|-----------------------|
| 1 | research | parallel | — | — | Haiku | octoswitch:research |
| 2 | joke | parallel | — | — | Sonnet | octoswitch:joke |
→ Wave 1: parallel launch of both agents
/delegate 先搜索 login 相关入口,然后实现 token 刷新逻辑
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|----------------|----------|-----------|--------|--------|---------------------------|
| 1 | search | parallel | — | 2 | Haiku | octoswitch:search |
| 2 | implementation | serial | 1 | — | Sonnet | octoswitch:implementation |
→ Wave 1: Task 1 (search)
→ verify search results are complete
→ Wave 2: Task 2 (implementation) — receives Task 1 output in context
→ review gate: verify implementation matches search findings
/delegate 实现新的用户认证模块,同时更新对应的数据库迁移和前端表单
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|----------------|----------|-----------|--------|--------|---------------------------|
| 1 | implementation | parallel | — | 2, 3 | Sonnet | octoswitch:implementation |
| 2 | implementation | serial | 1 | — | Sonnet | octoswitch:implementation |
| 3 | implementation | serial | 1 | — | Sonnet | octoswitch:implementation |
→ Wave 1: Task 1 (auth module)
→ Wave 2: Tasks 2 + 3 (migration + form) — parallel after Task 1 completes
/delegate --to Haiku 用 Haiku 分组审查当前改动风险
Plan:
| # | kind | mode | blockedBy | blocks | route | agent |
|---|--------|------------|-----------|--------|-------|--------------------|
| 1 | review | standalone | — | — | Haiku | octoswitch:review |
→ single task with explicit group → launch one agent, route: Haiku
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub normalight/octoswitch --plugin octoswitch