/
/

Orchestrate

Coordinate multiple agents for complex tasks. Use for multi-perspective analysis, comprehensive reviews, or tasks requiring different domain expertise.

Run with: /orchestrate

Multi-Agent Orchestration

You are now in ORCHESTRATION MODE. Your task: coordinate specialized agents to solve this complex problem.

Task to Orchestrate

$ARGUMENTS


πŸ”΄ CRITICAL: Minimum Agent Requirement

⚠️ ORCHESTRATION = MINIMUM 3 DIFFERENT AGENTS

If you use fewer than 3 agents, you are NOT orchestrating - you're just delegating.

Validation before completion:

  • Count invoked agents
  • If agent_count < 3 β†’ STOP and invoke more agents
  • Single agent = FAILURE of orchestration

Agent Selection Matrix

Task Type REQUIRED Agents (minimum)
Web App frontend-specialist, backend-specialist, test-engineer
API backend-specialist, security-auditor, test-engineer
UI/Design frontend-specialist, seo-specialist, performance-optimizer
Database database-architect, backend-specialist, security-auditor
Full Stack project-planner, frontend-specialist, backend-specialist, devops-engineer
Debug debugger, explorer-agent, test-engineer
Security security-auditor, penetration-tester, devops-engineer

Pre-Flight: Mode Check

Current Mode Task Type Action
plan Any βœ… Proceed with planning-first approach
edit Simple execution βœ… Proceed directly
edit Complex/multi-file ⚠️ Ask: "This task requires planning. Switch to plan mode?"
ask Any ⚠️ Ask: "Ready to orchestrate. Switch to edit or plan mode?"

πŸ”΄ STRICT 2-PHASE ORCHESTRATION

PHASE 1: PLANNING (Sequential - NO parallel agents)

Step Agent Action
1 project-planner Create docs/PLAN.md
2 (optional) explorer-agent Codebase discovery if needed

πŸ”΄ NO OTHER AGENTS during planning! Only project-planner and explorer-agent.

⏸️ CHECKPOINT: User Approval

After PLAN.md is complete, ASK:

"βœ… Plan created: docs/PLAN.md

Do you approve? (Y/N)
- Y: Start implementation
- N: I'll revise the plan"

πŸ”΄ DO NOT proceed to Phase 2 without explicit user approval!

PHASE 2: IMPLEMENTATION (Parallel agents after approval)

Parallel Group Agents
Foundation database-architect, security-auditor
Core backend-specialist, frontend-specialist
Polish test-engineer, devops-engineer

βœ… After user approval, invoke multiple agents in PARALLEL.

Available Agents (17 total)

Agent Domain Use When
project-planner Planning Task breakdown, PLAN.md
explorer-agent Discovery Codebase mapping
frontend-specialist UI/UX React, Vue, CSS, HTML
backend-specialist Server API, Node.js, Python
database-architect Data SQL, NoSQL, Schema
security-auditor Security Vulnerabilities, Auth
penetration-tester Security Active testing
test-engineer Testing Unit, E2E, Coverage
devops-engineer Ops CI/CD, Docker, Deploy
mobile-developer Mobile React Native, Flutter
performance-optimizer Speed Lighthouse, Profiling
seo-specialist SEO Meta, Schema, Rankings
documentation-writer Docs README, API docs
debugger Debug Error analysis
game-developer Games Unity, Godot
orchestrator Meta Coordination

Orchestration Protocol

Step 1: Analyze Task Domains

Identify ALL domains this task touches:

β–‘ Security     β†’ security-auditor, penetration-tester
β–‘ Backend/API  β†’ backend-specialist
β–‘ Frontend/UI  β†’ frontend-specialist
β–‘ Database     β†’ database-architect
β–‘ Testing      β†’ test-engineer
β–‘ DevOps       β†’ devops-engineer
β–‘ Mobile       β†’ mobile-developer
β–‘ Performance  β†’ performance-optimizer
β–‘ SEO          β†’ seo-specialist
β–‘ Planning     β†’ project-planner

Step 2: Phase Detection

If Plan Exists Action
NO docs/PLAN.md β†’ Go to PHASE 1 (planning only)
YES docs/PLAN.md + user approved β†’ Go to PHASE 2 (implementation)

Step 3: Execute Based on Phase

PHASE 1 (Planning):

Use the project-planner agent to create PLAN.md
β†’ STOP after plan is created
β†’ ASK user for approval

PHASE 2 (Implementation - after approval):

Invoke agents in PARALLEL:
Use the frontend-specialist agent to [task]
Use the backend-specialist agent to [task]
Use the test-engineer agent to [task]

πŸ”΄ CRITICAL: Context Passing (MANDATORY)

When invoking ANY subagent, you MUST include:

  1. Original User Request: Full text of what user asked
  2. Decisions Made: All user answers to Socratic questions
  3. Previous Agent Work: Summary of what previous agents did
  4. Current Plan State: If plan files exist in workspace, include them

Example with FULL context:

Use the project-planner agent to create PLAN.md:

**CONTEXT:**
- User Request: "A social platform for students, using mock data"
- Decisions: Tech=Vue 3, Layout=Grid Widgets, Auth=Mock, Design=Youthful & dynamic
- Previous Work: Orchestrator asked 6 questions, user chose all options
- Current Plan: playful-roaming-dream.md exists in workspace with initial structure

**TASK:** Create detailed PLAN.md based on ABOVE decisions. Do NOT infer from folder name.

⚠️ VIOLATION: Invoking subagent without full context = subagent will make wrong assumptions!

Step 4: Verification (MANDATORY)

The LAST agent must run appropriate verification scripts:

python .agent/skills/vulnerability-scanner/scripts/security_scan.py .
python .agent/skills/lint-and-validate/scripts/lint_runner.py .

Step 5: Synthesize Results

Combine all agent outputs into unified report.


Output Format

## 🎼 Orchestration Report

### Task
[Original task summary]

### Mode
[Current Antigravity Agent mode: plan/edit/ask]

### Agents Invoked (MINIMUM 3)
| # | Agent | Focus Area | Status |
|---|-------|------------|--------|
| 1 | project-planner | Task breakdown | βœ… |
| 2 | frontend-specialist | UI implementation | βœ… |
| 3 | test-engineer | Verification scripts | βœ… |

### Verification Scripts Executed
- [x] security_scan.py β†’ Pass/Fail
- [x] lint_runner.py β†’ Pass/Fail

### Key Findings
1. **[Agent 1]**: Finding
2. **[Agent 2]**: Finding
3. **[Agent 3]**: Finding

### Deliverables
- [ ] PLAN.md created
- [ ] Code implemented
- [ ] Tests passing
- [ ] Scripts verified

### Summary
[One paragraph synthesis of all agent work]

πŸ”΄ EXIT GATE

Before completing orchestration, verify:

  1. βœ… Agent Count: invoked_agents >= 3
  2. βœ… Scripts Executed: At least security_scan.py ran
  3. βœ… Report Generated: Orchestration Report with all agents listed

If any check fails β†’ DO NOT mark orchestration complete. Invoke more agents or run scripts.


Begin orchestration now. Select 3+ agents, execute sequentially, run verification scripts, synthesize results.