Subagent strategy

From andreaswasita/copilot-agents-dojo · View interactive version

Subagent strategy is an AI agent skill from the GitHub repository andreaswasita/copilot-agents-dojo. Delegates research and parallel work to sub-agents.

How to use this skill

Skill file

Subagent Strategy Skill

Delegates focused work to Copilot sub-agents via the task tool so the parent context stays clean. Supports decomposition, where agents own different workstreams, and competition, where isolated agents attempt the same high-risk artifact before a judge and lead select the result. Does NOT apply when the work must outlive the current turn — use the durable board (skills/durable-work) for that, since sub-agents are cancelled if the parent is interrupted.

When to Use

Prerequisites

How to Run

1. Choose decomposition or competition mode.
2. Define one mission, scope, deliverable, and success rubric.
3. Give every sub-agent an isolated, non-overlapping target.
4. Invoke the `task` tool with mode=background for independent work,
   mode=sync only when you must block on the result.
5. Inspect evidence and artifacts; synthesize rather than forwarding summaries.

Quick Reference

| Role | Mission shape | Tool & mode |

|---|---|---|

| Research | "Find X across the codebase; report file:line citations." | task (background) |

| Analysis | "Diagnose this stack trace; report root cause and 3 candidate fixes." | task (background) |

| Refactor scout | "Identify code smells in path/; propose alternatives." | task (background) |

| Test scout | "List untested branches in module/." | task (background) |

| Self-review | "Audit my diff against tasks/todo.md; flag gaps." | task (sync) |

| Mode | Use when | Ownership |

|---|---|---|

| Decomposition | Work separates into independent files, layers, or questions. | One distinct workstream per sub-agent. |

| Competition | A high-cost decision has several credible shapes and weak precedent. | Same task and rubric, isolated outputs, independent judge. |

Competition defaults to two or three candidates. More candidates require a reason because model diversity costs time and context.

Procedure

Step 1: Choose the Mode

Use decomposition for ordinary parallel work. Use competition only when choosing one implementation too early would lock in the wrong architecture, interface, or artifact.

Competition requires:

  1. The same task statement for every candidate.
  2. A private rubric with three to six concrete criteria.
  3. A separate output path or worktree for every candidate.
  4. A judge that sees sanitized candidate labels, not model identities.
  5. Lead review of every candidate before selecting or combining work.

Step 2: One Mission Per Sub-Agent

Each sub-agent gets exactly one focused mission. Bundling unrelated questions blurs the output. Spawn a second sub-agent instead.

Step 3: Bound the Scope

Tell the sub-agent which paths, files, or symbols to focus on. Unbounded sub-agents wander.

For competition, give candidates isolated targets. Shared writes destroy independence and can corrupt both outputs.

Step 4: Specify the Deliverable and Rubric

Be explicit: "Return a bullet list of file:line citations" beats "look into this." If you want code, say so. If you want a recommendation with tradeoffs, say so.

For competition, define success before launching. Keep the rubric from candidates when it would cue them to game the evaluation; give it to the judge.

Step 5: Launch, Don't Babysit

Use mode: background for independent sub-agents and continue planning in the foreground. Use mode: sync only when the next step genuinely depends on the result.

Step 6: Inspect, Then Integrate

Do not repeat the sub-agent's whole search. Spot-check the cited evidence, inspect produced artifacts, and verify claims that drive a decision. A sub-agent summary is input, not ground truth.

For competition:

  1. Read every candidate end to end.
  2. Have the judge score each sanitized candidate against the same rubric.
  3. Select the most maintainable base, not the most elaborate artifact.
  4. Integrate only compatible strengths from other candidates.
  5. Record rejected alternatives and why they lost.

Step 7: Resolve Conflicts

If two sub-agents disagree, re-issue with sharper scope or pick the one with stronger citations. Never silently choose — log discrepancies in tasks/lessons.md.

Step 8: Respect the Configured Knobs

All limits live in .dojo/delegation.yaml (read at session start). The agent MUST respect:

To override per-project, edit .dojo/delegation.yaml. To override per-call, pass the corresponding argument to the task tool — and log the exception in tasks/lessons.md.

Pitfalls

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.