Skip to content
agent-orchestration logo

Agent Orchestration

agent-orchestration

Coordinate parallel agent execution with context handoff. Use when: (1) task has parallelizable subtasks, (2) need to explore multiple areas, (3) research and implementation can happen concurrently. Updates AGENTS.md with status and results.

SKILL.md

Full skill instructions

Agent Orchestration

Coordinates parallel agent execution with context handoff via documentation.

Trigger Conditions

Invoke when:

  • Task has independent subtasks
  • Need to explore multiple code areas
  • Research and implementation can run in parallel
  • Complex task benefits from divide-and-conquer

Also invoke explicitly with:

  • /​agent-orchestration [task]
  • "coordinate agents"
  • "run in parallel"

Procedure

Step 1: Analyze Task

Break down the task into subtasks:

Questions to ask:

  • Can subtasks run independently?
  • Do subtasks have dependencies?
  • What context does each agent need?
  • How will results be combined?

Step 2: Classify Parallelization Pattern

PatternDescriptionExample
IndependentNo dependenciesExplore 3 code areas
Fan-out/​Fan-inParallel then combineResearch multiple approaches, then decide
PipelineSequential handoffResearch → Plan → Implement
HybridMix of aboveResearch (parallel) → Plan → Implement (parallel)

Step 3: Create Agent Specifications

For each agent, define:

## Agent: {{agent_id}}

**Task:** {{specific_task}}
**Type:** Explore | Research | Implement | Review
**Dependencies:** {{none | agent_ids}}
**Expected output:** {{files | summary | decision}}
**Context:** {{what this agent needs to know}}

Step 4: Update AGENTS.md

Before launching:

# Agent Coordination

## Current Task

Implement user authentication with OAuth support

## Active Agents

| ID | Task | Status | Started | Output |
|----|------|--------|---------|--------|
| a1 | Research OAuth providers | running | 14:30 | - |
| a2 | Explore existing auth code | running | 14:30 | - |
| a3 | Review security requirements | running | 14:30 | - |

## Dependencies

a1 ─┐
a2 ─┼─> a4 (implementation)
a3 ─┘

Step 5: Launch Agents

Independent agents (launch in parallel):

Launch agents a1, a2, a3 in parallel:

Agent a1: "Research OAuth providers (Google, GitHub, Microsoft). Compare features, security, implementation complexity. Output to RESEARCH.md"

Agent a2: "Explore existing auth code in src/​auth/​. Document current patterns, identify extension points. Output findings to AGENTS.md"

Agent a3: "Review security requirements in docs/​security.md. List authentication requirements and constraints."

Dependent agents (wait for predecessors):

Wait for a1, a2, a3 to complete.

Agent a4: "Using research from a1, patterns from a2, and requirements from a3, implement OAuth authentication. Follow TDD workflow."

Step 6: Collect Results

Update AGENTS.md with results:

## Completed Agents

### Agent a1: Research OAuth providers

**Status:** complete
**Duration:** 15 min

**Results:**
Recommended Google OAuth for:
- Widest user base
- Best documentation
- Simplest implementation

**Files modified:**
- RESEARCH.md (OAuth findings section)

### Agent a2: Explore existing auth code

**Status:** complete
**Duration:** 12 min

**Results:**
Found extension points in:
- src/​auth/​middleware.ts (add OAuth check)
- src/​auth/​providers/ (add Google provider)

**Files modified:**
- None (exploration only)

Step 7: Context Handoff

Document what each agent discovered for the next phase:

## Context Handoff

### From a1 to a4

**Discovered:** Google OAuth is best choice. Use @google-cloud/​oauth2 library.

**Next steps:** Implement Google OAuth provider in src/​auth/​providers/​google.ts

### From a2 to a4

**Discovered:** Existing auth middleware at src/​auth/​middleware.ts can be extended. Pattern: each provider exports `authenticate()` and `getUser()` functions.

**Next steps:** Follow existing pattern when adding Google provider.

Parallelization Patterns

Pattern 1: Independent Exploration

Good for: Understanding codebase, initial research

┌─ Agent a1: Explore frontend ────┐
├─ Agent a2: Explore backend ─────┼─> Synthesize
└─ Agent a3: Explore infrastructure ─┘

Pattern 2: Research Then Decide

Good for: Evaluating options before implementation

┌─ Agent a1: Research option A ───┐
├─ Agent a2: Research option B ───┼─> Decision Agent
└─ Agent a3: Research option C ───┘

Pattern 3: Parallel Implementation

Good for: Independent features or components

┌─ Agent a1: Implement feature A ─┐
├─ Agent a2: Implement feature B ─┼─> Integration
└─ Agent a3: Implement feature C ─┘

Pattern 4: Pipeline

Good for: Sequential transformation

Research Agent ─> Design Agent ─> Implementation Agent ─> Review Agent

Agent Types

TypePurposeTools
ExploreFind files, understand structureGlob, Grep, Read
ResearchGather information, compare optionsWebSearch, WebFetch, Read
ImplementWrite code, make changesEdit, Write, Bash
ReviewCheck quality, security, testsRead, Grep, Bash

Skill Chaining

With TDD

Implementation agents should follow TDD:

  1. Write failing test
  2. Implement to pass
  3. Refactor

With doc-maintenance

After all agents complete:

  1. Update PLAN.md with completed tasks
  2. Add discovered work to backlog

With research-to-plan

Research agents output feeds into planning:

  1. Research agents gather information
  2. research-to-plan converts to executable plan

Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired Action
"I'll do it sequentially"Wastes time on independent tasksParallelize
"Context is in my head"Other agents can't read mindsDocument in AGENTS.md
"Results are obvious"Future reference needs explicit recordWrite it down
"Dependencies are clear"Implicit dependencies cause bugsDocument explicitly

Example Session

/​agent-orchestration "Add OAuth authentication"

Analyzing task...

Identified subtasks:
1. Research OAuth providers (independent)
2. Explore existing auth code (independent)
3. Review security requirements (independent)
4. Implement OAuth (depends on 1, 2, 3)
5. Write tests (depends on 4)

Parallelization plan:

Phase 1 (parallel):
  - a1: Research providers
  - a2: Explore auth code
  - a3: Review requirements

Phase 2 (sequential):
  - a4: Implementation (after phase 1)
  - a5: Tests (after a4)

Launch phase 1? [y/​n]

Notes

  • Maximum 5 parallel agents recommended
  • Each agent should have clear, bounded scope
  • Use AGENTS.md for all context handoff
  • Prefer explicit over implicit dependencies
  • Document agent outputs even if "obvious"

References

For detailed guidance, see:

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View