Team planner

From drvoss/everything-copilot-cli · View interactive version

Team planner is an AI agent skill from the GitHub repository drvoss/everything-copilot-cli. Use when a task is too large or multi-domain for a single agent — assemble a specialist team, assign work via SQL tracking, dispatch with /fleet or task tool, and synthesize results

How to use this skill

Skill file

Team Planner (Copilot-Native)

A Copilot CLI-native redesign of the “harness meta-skill” concept.

It does not assume Claude Code primitives like TeamCreate/TaskCreate exist. Instead, it uses

Copilot CLI’s actual primitives:

The lead planner acts as the conductor: it assigns ownership, coordinates sequencing,

and decides when a second model should challenge or review another agent's output.

When to Use

NOT for: single-domain tasks, quick one-shot requests, tasks under ~30 minutes.

Pre-Flight Checklist

Before designing the team, verify all of the following:

The 6 Phases (Copilot-native)

Phase 1: Analyze — Decompose the task

Copilot CLI reads the request, identifies the domains involved, and decomposes work into parallelizable units.

Outputs to produce in this phase:

Phase 2: Design the Team

Create a team roster in SQL.

Team size guidelines — balance specialization against coordination overhead:

| Task scale | Recommended team size | Tasks per agent |

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

| Small (5–10 tasks) | 2–3 agents | 3–5 tasks each |

| Medium (10–20 tasks) | 3–5 agents | 4–6 tasks each |

| Large (20+ tasks) | 5–7 agents | 4–5 tasks each |

Rule of thumb: more than 7 agents creates more coordination overhead than parallelism value. Split into sub-phases instead.

Output: SQL INSERT statements into a team table:

CREATE TABLE IF NOT EXISTS team (
  id TEXT PRIMARY KEY,
  role TEXT NOT NULL,
  agent_type TEXT NOT NULL,     -- explore | task | general-purpose | code-review | research | security-review | rubber-duck
  focus TEXT NOT NULL,
  status TEXT NOT NULL DEFAULT 'ready'  -- ready | running | done | blocked
);

INSERT INTO team (id, role, agent_type, focus, status) VALUES
  ('lead', 'Coordinator', 'general-purpose', 'Decompose, dispatch, synthesize', 'ready'),
  ('sec', 'Security reviewer', 'security-review', 'Auth, injection, secrets, unsafe defaults', 'ready'),
  ('perf', 'Performance scout', 'explore', 'Hot paths, expensive ops, caching opportunities', 'ready'),
  ('arch', 'Architecture analyst', 'general-purpose', 'Boundaries, API contracts, maintainability', 'ready');

Phase 3: Assign Work

Track assignments in SQL so dispatch + monitoring is deterministic.

Output: SQL INSERT statements into an assignments table:

CREATE TABLE IF NOT EXISTS assignments (
  id TEXT PRIMARY KEY,
  agent_id TEXT NOT NULL,
  task TEXT NOT NULL,
  input_context TEXT,
  status TEXT NOT NULL DEFAULT 'pending',  -- pending | running | done | failed
  agent_run_id TEXT,                       -- returned by task tool when mode=background
  result_summary TEXT,
  decision_log TEXT,                       -- append-only: "<timestamp> <what/why>" per update
  touched_files TEXT                        -- comma- or newline-separated paths this track edited
);

INSERT INTO assignments (id, agent_id, task, input_context, status) VALUES
  ('a-sec-1', 'sec',  'Review security posture and identify critical vulnerabilities', 'Focus on auth, input validation, secrets, SSRF/XSS, unsafe deserialization', 'pending'),
  ('a-perf-1','perf', 'Scan for performance bottlenecks and high-cost code paths',       'Look for N+1, heavy loops, slow I/O, missing memoization/caching',          'pending'),
  ('a-arch-1','arch', 'Evaluate architecture risks and suggest refactors',               'Focus on boundaries, coupling, module ownership, API contracts',            'pending');
Conductor Pattern

For medium and large efforts, make one agent the explicit coordinator:

The conductor should own:

  1. Shared file boundaries
  2. Dependency ordering
  3. Review handoffs
  4. Final merge or synthesis criteria
  5. Track state persistence — after each meaningful step, the conductor appends a short entry

to that track's decision_log (what was decided and why, not just pending/running/done) and

keeps touched_files current. This lets the coordinator reconstruct a track's context after a

pause, a model swap, or a session resume without re-deriving it from scratch.

Semantic reversion (adapted from the conductor pattern, wshobson/agents ecosystem —

concept harvested, no code ported): when an implementer's track needs to be rolled back, prefer

undoing the unit of work the conductor assigned over a raw git revert of a commit range. A

single commit can span multiple tracks, and a single track can span multiple commits — reverting

by commit boundary risks clawing back unrelated work or leaving a track half-reverted. Roll back

by reading the track's touched_files and decision_log from its assignments row, restoring or

re-dispatching just those files, rather than reverting a git range and hoping the boundaries line

up.

Pair-Agent Review Loop

When quality matters more than raw speed, pair two agents on the same subproblem with

different roles:

  1. Builder — implements or drafts the output
  2. Checker — reviews, challenges assumptions, or red-teams the result

Good pairings:

If both agents need to edit the same files, do it sequentially rather than concurrently.

Phase 4: Dispatch

Dispatch each assignment using either:

Option A: Dispatch with `task` (explicit)

Run each assignment as a background agent so you can keep working while they run:

task:
  agent_type: "security-review"
  name: "security-review"
  mode: "background"
  prompt: "Review the repository for security vulnerabilities. Prioritize exploitable issues and list concrete remediations."

task:
  agent_type: "explore"
  name: "performance-scout"
  mode: "background"
  prompt: "Scan the repo for likely performance bottlenecks. Identify top 5 hotspots and where to measure."

task:
  agent_type: "general-purpose"
  name: "architecture-analyst"
  mode: "background"
  prompt: "Assess the system architecture. Identify boundary violations and propose refactors that reduce coupling."
Option B: Dispatch with `/fleet` (automatic fan-out)
/fleet Audit our API for security, performance, and architecture issues. Split the work into parallel specialists and report back with prioritized findings.
PowerShell example (dispatcher pattern for 3 agents)

Copilot CLI tool calls aren’t executed from PowerShell, but you can use PowerShell as a lightweight

dispatcher template: paste SQL results into variables, then generate the 3 task blocks you will run.

# 1) (In Copilot) SELECT your pending assignments:
# SELECT id, agent_id, task, input_context FROM assignments WHERE status='pending';

# 2) Paste the rows into a PS structure (example):
$assignments = @(
  @{ id = 'a-sec-1';  agent_type = 'security-review';  name='security-review';      prompt = 'Review repo security. Focus on auth, injection, secrets. Provide fixes.' },
  @{ id = 'a-perf-1'; agent_type = 'explore';          name='performance-scout';    prompt = 'Find perf hotspots. List top 5 and how to measure.' },
  @{ id = 'a-arch-1'; agent_type = 'general-purpose';  name='architecture-analyst'; prompt = 'Assess architecture. Identify coupling and propose refactors.' }
)

# 3) Generate the tool-call blocks to run in Copilot CLI:
$assignments | ForEach-Object {
@"
 task:
   agent_type: \"$($_.agent_type)\"
   name: \"$($_.name)\"
   mode: \"background\"
   prompt: \"$($_.prompt)\"
"@
}

Tip: after each task call returns an agent_id (run id), store it back into assignments.agent_run_id.

Use CODE0 to assign stronger review

models to the checker role without spending premium tokens on every agent in the batch.

Phase 5: Monitor

Monitor running background agents with read_agent and update SQL as they finish.

Suggested loop:

  1. Mark assignment running when dispatched
  2. Poll/await completion with read_agent
  3. Write a follow-up question with write_agent if the output is incomplete
  4. Store a short result_summary in SQL and mark done (or failed)

Example monitoring updates:

-- When dispatching
UPDATE assignments SET status='running', agent_run_id='AGENT_ID_HERE' WHERE id='a-sec-1';

-- When complete
UPDATE assignments
SET status='done', result_summary='Found 2 critical injection paths; recommend parameterization + validation'
WHERE id='a-sec-1';

Phase 6: Synthesize

Use a general-purpose agent as the “editor-in-chief”:

task:
  agent_type: "general-purpose"
  name: "synthesizer"
  prompt: "Read the SQL tables team + assignments (and any referenced artifacts) and produce a consolidated report: top risks, recommended fixes, sequencing, and quick wins."

Tool Mapping (why this is a redesign, not a port)

| Harness primitive | Copilot CLI equivalent |

|---|---|

| TeamCreate | SQL team table |

| TaskCreate | SQL assignments table |

| Agent (typed) | task tool with agent_type param |

| SendMessage | file/SQL message bus (and write_agent for follow-ups) |

| Persistent agent state | SQL session database |

Example: Full-Stack Security Audit

Goal: “Audit our API for security, performance, and architecture issues.”

  1. Analyze: identify domains → security, performance, architecture; decide parallelizable workstreams.
  2. Design the Team: create team rows (sec, perf, arch, lead).
  3. Assign Work: create assignments rows with clear prompts + input_context.
  4. Dispatch:
  1. Monitor:
  1. Synthesize:

Deliverable format (recommended):

Each item includes: evidence (paths), impact, and a concrete fix.

See Also

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.