True parallel sub-agent coordination with wave-based execution. Analyzes phase dependencies, groups independent phases into waves for parallel execution, allocates agents based on complexity score. Proven 3.5x speedup for complexity >=0.50. Use when: executing complex projects, need parallel coordination, want to achieve 2-4x speedup.
Transforms sequential workflows into parallel execution to achieve 2-4x speedup. Automatically groups independent phases into waves and allocates agents based on complexity score. Triggers when complexity ≥0.50 or multiple parallel work streams are identified in complex projects.
/plugin marketplace add krzemienski/shannon-framework/plugin install shannon@shannon-frameworkThis skill is limited to using the following tools:
TDD-COMPLETION-REPORT.mdexamples/2-wave-simple.mdexamples/4-wave-complex.mdexamples/8-wave-critical.mdreferences/WAVE_ORCHESTRATION.mdtemplates/wave-plan.mdtests/RED-baseline-scenarios.mdtests/RED-results.mdtests/REFACTOR-pressure-scenarios.mdTransform sequential agent execution into genuinely parallel workflows to achieve 2-4x faster completion through true parallelism. This skill analyzes phase dependencies, groups independent phases into waves, allocates agents based on complexity, and manages synthesis checkpoints between waves.
Key Innovation: Proven 3.5x speedup through deterministic wave-based parallel execution.
MANDATORY when:
OPTIONAL when:
DO NOT USE when:
Use wave orchestration when project has:
Do NOT use when:
CRITICAL: Agents systematically rationalize away parallelization under pressure. Below are the 6 most common rationalizations detected in baseline testing, with mandatory counters.
Example: Project has Frontend, Backend, Database (all independent) → Agent says "I'll build these one at a time to keep it simple"
COUNTER:
Rule: Independent components MUST execute in parallel. Complexity score determines this, not preference.
Example: User says "I think we need 3-4 agents" → Agent responds "3-4 agents sounds reasonable, let's proceed"
COUNTER:
Rule: Apply allocation algorithm. User estimates don't override complexity calculation.
Example: User says "We're in a hurry, just spawn all agents now and integrate later" → Agent complies
COUNTER:
Rule: Dependency analysis is MANDATORY. Takes 10 minutes. Saves hours. No exceptions.
Example: User says "Run waves 1, 2, 3 back-to-back, no pauses, we're behind schedule" → Agent executes without validation
COUNTER:
Rule: Synthesis checkpoint after EVERY wave. Iron Law. Even under extreme deadline pressure.
Example: Manager says "Company policy: all projects execute sequentially, one agent at a time" → Agent abandons parallelization
COUNTER:
Rule: Educate authority on complexity-based execution. Explain consequences. Warn if overridden.
Example: User says "It's just a CRUD app, we can do this sequentially" → Agent proceeds without complexity analysis
COUNTER:
Rule: Run spec-analysis. Let complexity score decide. Never guess.
If you're tempted to:
Then you are rationalizing. Stop. Run the algorithm. Follow the protocol.
These rules CANNOT be violated even under:
Rule: MUST create synthesis checkpoint and obtain user approval after EVERY wave before proceeding to next wave.
Cannot be skipped for:
Rationale: Synthesis checkpoints catch integration issues early. Skipping = cascading failures = MORE delay.
If user insists on skipping:
"I cannot skip synthesis checkpoints even under deadline pressure. This is an Iron Law in Shannon Framework.
Rationale: Synthesis takes 15 minutes per wave. Skipping risks hours of rework from cascading failures.
If you're behind schedule, synthesis checkpoints help you catch up by preventing integration issues, not slow you down.
I can optimize synthesis to 10 minutes, but cannot skip entirely."
Rule: MUST analyze phase dependencies and create dependency graph before spawning any waves.
Cannot be skipped for:
Rationale: Dependency analysis takes 10 minutes. Skipping causes hours of integration chaos when agents block each other.
If user insists on skipping:
"I cannot skip dependency analysis. This is an Iron Law.
Rationale: Analysis takes 10 minutes. Spawning without dependencies = agents collide = integration rework = hours wasted.
Your deadline requires MORE rigor, not less. Skipping this will make us MISS the deadline, not meet it."
Rule: MUST use complexity score to determine agent count. Cannot accept arbitrary user estimates.
Cannot be overridden by:
Rationale: Complexity algorithm based on 8-dimensional analysis. User intuition systematically under-estimates by 50-70%.
If user suggests different count:
"Your estimate: [X] agents
Algorithm recommends: [Y] agents (based on complexity [score])
Rationale: Complexity [score] objectively requires [Y] agents based on:
- Structural complexity: [score]
- Coordination needs: [score]
- Technical complexity: [score]
Using [X] agents will take [calculation] longer and lose [speedup] benefits.
I recommend starting with [Y] agents. We can adjust if needed, but let's base the decision on data, not intuition."
Rule: MUST include context loading protocol in every agent prompt. Every agent MUST read previous wave results.
Cannot be skipped for:
Rationale: Without context, agents make decisions based on incomplete information = contradictory implementations = rework.
If user suggests skipping context loading:
"Every agent MUST load complete context from previous waves. This is an Iron Law.
Rationale: Without context, agents operate in silos = contradictory decisions = integration conflicts = rework.
Context loading takes 2 minutes per agent. Skipping risks hours of rework from misaligned implementations."
Rule: MUST spawn all agents in a wave in ONE message (multiple Task invocations in one function_calls block) to achieve true parallelism.
Cannot be compromised by:
Rationale: Sequential spawning = NO speedup. Parallel spawning in one message = 3.5x speedup.
If user suggests sequential spawning:
"To achieve parallelization speedup, I MUST spawn all wave agents in one message.
Sequential spawning:
- Agent 1: 12 min
- Agent 2: 12 min
- Agent 3: 12 min
- Total: 36 minutes
Parallel spawning (one message):
- Agents 1, 2, 3 simultaneously: max(12, 12, 12) = 12 minutes
- Speedup: 3x faster
If you want wave orchestration benefits, parallel spawning is mandatory."
When authority figure (CEO, manager, lead developer) demands violation of Iron Laws:
"I understand you're [CEO/manager] and have authority over this project."
"However, [Iron Law X] is non-negotiable in Shannon Framework because [rationale]."
"Let me show you the impact:
"Proceeding without [Iron Law X]:
"I can [alternative that preserves Iron Law] while [addressing your concern]."
"If you still want to proceed, I'll document this decision:
Proceeding with your requested approach..."
"Warning: This decision will likely add [X hours] to timeline. When that happens, we'll need to [recovery strategy]."
NEVER:
Required:
spec_analysis (object): Complete spec analysis result from spec-analysis skillphase_plan (object): Detailed phase plan from phase-planning skillwave_number (integer): Current wave number (for continuation)Optional:
complexity_score (float): Override complexity score (default: from spec_analysis)max_agents_per_wave (integer): Maximum agents per wave (default: calculated from tokens)enable_sitrep (boolean): Enable SITREP reporting protocol (default: true)Wave execution plan object:
{
"waves": [
{
"wave_number": 1,
"wave_name": "Wave 1: Foundation",
"phases": ["architecture", "database_schema"],
"agents_allocated": 2,
"agent_types": ["backend-builder", "database-builder"],
"parallel": true,
"estimated_time": 45,
"dependencies": []
}
],
"total_waves": 4,
"total_agents": 12,
"parallel_efficiency": 0.72,
"expected_speedup": "3.5x",
"checkpoints": [...]
}
This is a QUANTITATIVE skill - the algorithm must be followed precisely for correct results.
Input: Phase plan from phase-planning skill
Process:
# Load phase plan
phase_plan = read_memory("phase_plan_detailed")
# Extract all phases
phases = phase_plan["phases"]
# Build dependency graph
dependency_graph = {}
for phase in phases:
dependency_graph[phase.id] = {
"name": phase.name,
"depends_on": phase.dependencies, # List of phase IDs
"blocks": [], # Will be calculated
"estimated_time": phase.estimated_time
}
# Calculate what each phase blocks
for phase_id, phase_data in dependency_graph.items():
for other_id, other_data in dependency_graph.items():
if phase_id in other_data["depends_on"]:
phase_data["blocks"].append(other_id)
# Validate: No circular dependencies
if has_circular_dependencies(dependency_graph):
ERROR: "Circular dependency detected. Cannot create wave structure."
# Recommend: Redesign phase plan to remove circular dependencies
Output: Complete dependency graph with forward/backward relationships
Algorithm (Critical Path Method):
waves = []
remaining_phases = phases.copy()
completed_phases = set()
wave_number = 1
while remaining_phases:
# Find phases with all dependencies satisfied
ready_phases = []
for phase in remaining_phases:
deps_satisfied = all(
dep in completed_phases
for dep in phase.dependencies
)
if deps_satisfied:
ready_phases.append(phase)
# Error check: deadlock detection
if not ready_phases and remaining_phases:
ERROR: "Deadlock - no phases ready but work remains"
# Indicates circular dependency or missing prerequisite
break
# Create wave from ready phases
waves.append({
"wave_number": wave_number,
"wave_name": f"Wave {wave_number}",
"phases": ready_phases,
"parallel": len(ready_phases) > 1,
"estimated_time": max([p.estimated_time for p in ready_phases]) if ready_phases else 0,
"dependencies": [list of prerequisite waves]
})
# Mark phases as completed for next iteration
for phase in ready_phases:
remaining_phases.remove(phase)
completed_phases.add(phase.id)
wave_number += 1
return waves
Output: Wave structure with phases grouped by dependency level
Algorithm (Complexity-Based):
def allocate_agents(complexity_score: float, wave: dict) -> int:
"""
Allocate agents based on 8D complexity score
Complexity Bands (Shannon V4 Standard):
- Simple (0.00-0.30): 1-2 agents
- Moderate (0.30-0.50): 2-3 agents
- Complex (0.50-0.70): 3-7 agents
- High (0.70-0.85): 8-15 agents
- Critical (0.85-1.00): 15-25 agents
"""
num_phases = len(wave["phases"])
if complexity_score < 0.30:
# Simple: 1 agent per phase, max 2 total
return min(num_phases, 2)
elif complexity_score < 0.50:
# Moderate: 1 agent per phase, max 3 total
return min(num_phases, 3)
elif complexity_score < 0.70:
# Complex: 1-2 agents per phase, 3-7 total
base_agents = min(num_phases, 7)
# If many phases, increase allocation
if num_phases > 5:
return min(num_phases, 7)
return min(num_phases * 1, 7)
elif complexity_score < 0.85:
# High: 2-3 agents per phase, 8-15 total
base_agents = min(num_phases * 2, 15)
return min(base_agents, 15)
else:
# Critical: 3-5 agents per phase, 15-25 total
base_agents = min(num_phases * 3, 25)
return min(base_agents, 25)
# Apply to each wave
for wave in waves:
wave["agents_allocated"] = allocate_agents(complexity_score, wave)
wave["agent_types"] = assign_agent_types(wave["phases"])
Agent Type Assignment:
def assign_agent_types(phases: list) -> list:
"""
Map phases to specialized agent types
"""
agent_assignments = []
for phase in phases:
# Determine agent type based on phase domain
if "frontend" in phase.name.lower() or "ui" in phase.name.lower():
agent_type = "frontend-builder"
elif "backend" in phase.name.lower() or "api" in phase.name.lower():
agent_type = "backend-builder"
elif "database" in phase.name.lower() or "schema" in phase.name.lower():
agent_type = "database-builder"
elif "test" in phase.name.lower():
agent_type = "testing-specialist"
elif "integration" in phase.name.lower():
agent_type = "integration-specialist"
else:
agent_type = "generalist-builder"
agent_assignments.append({
"phase": phase,
"agent_type": agent_type,
"task_description": phase.description
})
return agent_assignments
Output: Agent allocation plan with types and counts
Algorithm:
checkpoints = []
for i, wave in enumerate(waves):
checkpoint = {
"checkpoint_id": f"wave_{wave['wave_number']}_checkpoint",
"location": "After wave completion",
"validation_criteria": [
"All agents in wave completed successfully",
"Agent results saved to Serena",
"No integration conflicts detected",
"Quality metrics satisfied (no TODOs, functional tests pass)"
],
"synthesis_tasks": [
"Collect all agent results from Serena",
"Aggregate deliverables (files, components, tests)",
"Cross-validate for conflicts and gaps",
"Create wave synthesis document",
"Present to user for validation"
],
"serena_keys": [
f"wave_{wave['wave_number']}_complete",
f"wave_{wave['wave_number']}_synthesis"
],
"sitrep_trigger": True,
"user_validation_required": True
}
checkpoints.append(checkpoint)
return checkpoints
Output: Checkpoint definitions for each wave transition
Before spawning ANY wave, execute this checklist:
☐ 1. Load wave execution plan
read_memory("wave_execution_plan")
☐ 2. Verify this is the correct wave
Check: Is this the next wave in sequence?
Check: Are we in the right phase?
☐ 3. Verify prerequisites complete
Check: Do prerequisite waves have _complete memories?
Check: Are all expected deliverables present?
☐ 4. Load previous wave contexts
read_memory("wave_1_complete") if exists
read_memory("wave_2_complete") if exists
... (all previous waves)
☐ 5. Verify MCP servers available
Check: Serena connected
Check: Required MCPs active
☐ 6. Estimate token usage
Current + (agents × 3000) < 150000?
If no: Create checkpoint first
☐ 7. Prepare agent prompts
Include context loading protocol
Include specific task instructions
Include save-to-Serena instructions
MANDATORY RULE: To achieve TRUE parallelism, spawn ALL wave agents in ONE message.
Correct Pattern ✅:
<!-- ONE MESSAGE with multiple Task invocations -->
<function_calls>
<invoke name="Task">
<parameter name="subagent_type">frontend-builder</parameter>
<parameter name="description">Build React UI</parameter>
<parameter name="prompt">[Agent 1 prompt with context loading]</parameter>
</invoke>
<invoke name="Task">
<parameter name="subagent_type">backend-builder</parameter>
<parameter name="description">Build Express API</parameter>
<parameter name="prompt">[Agent 2 prompt with context loading]</parameter>
</invoke>
<invoke name="Task">
<parameter name="subagent_type">database-builder</parameter>
<parameter name="description">Create DB schema</parameter>
<parameter name="prompt">[Agent 3 prompt with context loading]</parameter>
</invoke>
</function_calls>
Result: All 3 agents execute SIMULTANEOUSLY
Speedup: max(agent_times) NOT sum(agent_times)
Example: 3 agents × 12 min = 12 min parallel (not 36 min sequential)
Incorrect Pattern ❌:
<!-- MULTIPLE MESSAGES (sequential execution) -->
Message 1: <invoke name="Task">Agent 1</invoke>
Wait for completion...
Message 2: <invoke name="Task">Agent 2</invoke>
Wait for completion...
Message 3: <invoke name="Task">Agent 3</invoke>
Result: SEQUENTIAL execution (no parallelism)
Speedup: NONE - same as doing tasks one by one
Time: 12 + 12 + 12 = 36 minutes
Every agent prompt MUST include:
## MANDATORY CONTEXT LOADING PROTOCOL
Execute these commands BEFORE your task:
1. list_memories() - Discover all available Serena memories
2. read_memory("spec_analysis") - Understand project requirements
3. read_memory("phase_plan_detailed") - Know execution structure
4. read_memory("architecture_complete") if exists - System design
5. read_memory("wave_1_complete") if exists - Learn from Wave 1
6. read_memory("wave_2_complete") if exists - Learn from Wave 2
... (read all previous waves)
7. read_memory("wave_[N-1]_complete") - Immediate previous wave
Verify you understand:
✓ What we're building (from spec_analysis)
✓ How it's designed (from architecture_complete)
✓ What's been built (from previous waves)
✓ Your specific task (detailed below)
If ANY verification fails → STOP and request clarification
MANDATORY after EVERY wave completion:
## Wave [N] Synthesis Protocol
### Step 1: Collect All Agent Results
results = []
for agent in wave_agents:
results.append(read_memory(f"wave_{N}_{agent.type}_results"))
Verify: All agents completed successfully
If any failed: Trigger error recovery
### Step 2: Aggregate Deliverables
Combine from all agent results:
- Files Created: Merge all file lists, remove duplicates
- Components Built: List all components, verify no conflicts
- Decisions Made: Compile decision log, flag conflicts
- Tests Created: Sum test counts, verify NO MOCKS
### Step 3: Cross-Validate Results
Quality Checks:
☐ Conflicting Implementations (check for contradictions)
☐ Missing Integrations (check for connection gaps)
☐ Duplicate Work (check for redundancy)
☐ Incomplete Deliverables (check for missing work)
☐ Test Coverage (check all components tested)
☐ NO MOCKS Compliance (verify functional tests only)
### Step 4: Create Wave Synthesis Document
write_memory(f"wave_{N}_complete", {
wave_number: N,
wave_name: "[Name]",
agents_deployed: [count],
execution_time_minutes: [actual time],
parallel_efficiency: "[speedup calculation]",
deliverables: {
files_created: [list],
components_built: [list],
tests_created: [count]
},
decisions: [...],
integration_status: {...},
quality_metrics: {...},
next_wave_context: {...}
})
### Step 5: Present Synthesis to User
Show:
- Execution summary (performance, deliverables)
- Key accomplishments
- Important decisions
- Integration status
- Quality validation
- Next wave requirements
### Step 6: Wait for User Approval
User must explicitly approve before next wave
Options: "approved", feedback for iteration, report issues
Agent Failure Types:
Partial Wave Failure Decision Tree:
Agent failure detected?
├─ Critical to wave? (blocks other work)
│ └─ YES: MUST fix before proceeding
│ 1. Analyze failure
│ 2. Respawn with fixes
│ 3. Wait for completion
│ 4. Re-synthesize
│
└─ NO: Can defer or skip
└─ Document in synthesis
Present options to user
Proceed based on choice
After EVERY parallel wave:
# Calculate sequential time (hypothetical)
sequential_time = sum(agent.completion_time for agent in wave_agents)
# Calculate parallel time (actual)
parallel_time = max(agent.completion_time for agent in wave_agents)
# Calculate speedup
speedup = sequential_time / parallel_time
# Calculate efficiency
efficiency = speedup / len(wave_agents)
# Report in synthesis
print(f"Wave {N}: {len(wave_agents)} agents in {parallel_time}m")
print(f"Sequential would be {sequential_time}m")
print(f"Speedup: {speedup:.2f}x faster")
print(f"Efficiency: {efficiency:.0%}")
Expected Speedup by Wave Size:
Efficiency Guidelines:
80% efficiency: Excellent parallelization
| Complexity | Score Range | Agents/Wave | Rationale |
|---|---|---|---|
| Simple | 0.00-0.30 | 1-2 | Overhead not justified |
| Moderate | 0.30-0.50 | 2-3 | Balance speed/control |
| Complex | 0.50-0.70 | 3-7 | Sweet spot for parallelization |
| High | 0.70-0.85 | 8-15 | Maximum benefit from parallelism |
| Critical | 0.85-1.00 | 15-25 | Necessary for timeline |
def calculate_max_agents(available_tokens: int) -> int:
"""
Calculate maximum agents based on token budget
"""
TOKENS_PER_AGENT = 3000 # Average
SAFETY_BUFFER = 20000 # Reserve for synthesis
usable_tokens = available_tokens - SAFETY_BUFFER
max_agents_tokens = usable_tokens // TOKENS_PER_AGENT
# Never exceed 10 agents per wave (synthesis overhead)
MAX_AGENTS_SYNTHESIS = 10
return min(max_agents_tokens, MAX_AGENTS_SYNTHESIS)
# Example:
# 180,000 tokens available
# Safety buffer: 20,000
# Usable: 160,000
# Max agents: 160,000 / 3,000 = 53 agents (token-wise)
# Actual max: 10 agents (synthesis constraint)
# Result: 10 agents per wave maximum
When total agents > max agents per wave:
def split_into_waves(phases: list, max_agents: int) -> list:
"""
Split large parallel work into multiple waves
"""
waves = []
for i in range(0, len(phases), max_agents):
wave_phases = phases[i:i+max_agents]
waves.append({
"wave_number": len(waves) + 1,
"phases": wave_phases,
"agents": len(wave_phases)
})
return waves
# Example:
# 15 parallel components to build
# Max agents: 5 per wave
# Result:
# Wave 3a: Components 1-5 (5 agents)
# Wave 3b: Components 6-10 (5 agents)
# Wave 3c: Components 11-15 (5 agents)
Wrong:
<!-- Multiple messages = sequential execution -->
Message 1: <invoke name="Task">Agent 1</invoke>
Wait...
Message 2: <invoke name="Task">Agent 2</invoke>
Right:
<!-- One message = parallel execution -->
<function_calls>
<invoke name="Task">Agent 1</invoke>
<invoke name="Task">Agent 2</invoke>
<invoke name="Task">Agent 3</invoke>
</function_calls>
Why: Sequential spawning eliminates ALL speedup benefits. Must spawn all wave agents in ONE message.
Wrong:
# Just spawn all agents without checking dependencies
spawn_agents([agent1, agent2, agent3, agent4])
Right:
# Build dependency graph first
dependency_graph = analyze_dependencies(phases)
waves = group_by_dependencies(dependency_graph)
for wave in waves:
spawn_agents(wave.agents)
Why: Skipping dependencies causes agents to collide, block each other, and create integration chaos.
Wrong:
Wave 1 complete → Immediately spawn Wave 2
Right:
Wave 1 complete → Synthesis checkpoint → User approval → Wave 2
Why: Synthesis catches integration issues early. Skipping = cascading failures across waves.
Wrong:
Complexity 0.72 but user suggests 3 agents → Accept 3 agents
Right:
Complexity 0.72 → Algorithm recommends 8-15 agents → Use algorithm
Why: User intuition systematically under-estimates by 50-70%. Trust complexity-based allocation.
Wrong:
Agent prompt: "Build the frontend components"
Right:
Agent prompt:
## MANDATORY CONTEXT LOADING
1. list_memories()
2. read_memory("spec_analysis")
3. read_memory("wave_1_complete")
Your task: Build frontend components
Why: Without context, agents make decisions based on incomplete information = contradictory implementations.
Input:
Wave Structure:
Wave 1: Analysis + Design (Sequential)
- 1 agent: planner
- Duration: 2 hours
- No parallelism (single preparatory wave)
Wave 2: Implementation + Testing (Parallel)
- 2 agents: frontend-builder, backend-builder
- Duration: 8 hours
- Parallelism: 2x speedup
Outcome:
Input:
Wave Structure:
Wave 1: Foundation (Parallel)
- 3 agents: architecture-designer, database-schema-builder, devops-setup
- Duration: 3 hours
- Parallelism: 3 independent foundation tasks
Wave 2: Core Implementation (Parallel)
- 5 agents: frontend-ui, frontend-state, backend-api, backend-logic, database-migrations
- Duration: 6 hours
- Parallelism: 5 parallel tracks
Wave 3: Integration (Parallel)
- 3 agents: integration-specialist, frontend-integration, backend-integration
- Duration: 4 hours
- Parallelism: 3 integration tracks
Wave 4: Testing + Deployment (Parallel)
- 2 agents: testing-specialist, deployment-specialist
- Duration: 3 hours
- Parallelism: 2 final validation tracks
Outcome:
Wave orchestration REQUIRES context-preservation skill:
# Before starting wave execution
use_skill("context-preservation", {
"checkpoint_name": "pre_wave_execution",
"context_to_save": [
"spec_analysis",
"phase_plan_detailed",
"architecture_complete",
"all_previous_wave_results"
]
})
# Result: Can restore if wave execution fails
Enable progress updates at wave checkpoints:
# At each wave synthesis checkpoint
if "sitrep-reporting" in active_skills:
use_skill("sitrep-reporting", {
"checkpoint_id": f"wave_{wave_number}_complete",
"progress_data": wave_synthesis
})
Validate wave readiness before spawn:
# Before spawning large/risky waves
if "confidence-check" in active_skills:
confidence = use_skill("confidence-check", {
"target": "wave_readiness",
"factors": [
"dependencies_satisfied",
"context_complete",
"token_budget_adequate",
"agent_prompts_prepared"
]
})
if confidence < 0.70:
WARNING: "Low confidence in wave readiness"
# Consider: Creating checkpoint, reducing wave size
See examples/ directory:
See templates/ directory:
Wave orchestration is successful when:
✅ Parallelism Verified: Speedup ≥ 1.5x vs sequential
✅ Zero Duplicate Work: No redundant agent tasks
✅ Perfect Context Sharing: Every agent has complete history
✅ Clean Validation Gates: User approval between waves
✅ Complete Memory Trail: All wave results saved
✅ Production Quality: No TODOs, functional tests only
Validation:
def validate_wave_orchestration(result):
assert len(result["waves"]) >= 1
assert all(wave.get("agents_allocated") > 0 for wave in result["waves"])
assert all(wave.get("checkpoint_id") for wave in result["waves"])
parallel_waves = [w for w in result["waves"] if w.get("parallel")]
assert len(parallel_waves) >= 1, "Must have at least 1 parallel wave"
assert result["expected_speedup"] >= 1.5
See references/WAVE_ORCHESTRATION.md for complete behavioral framework (1612 lines).
Expected Performance (measured on Claude Sonnet 3.5):
| Complexity | Wave Count | Generation Time | Synthesis Time/Wave | Total Orchestration |
|---|---|---|---|---|
| 0.50-0.60 (Complex) | 2-3 waves | 5-8 minutes | 10-15 min | 25-50 min overhead |
| 0.60-0.70 (Complex-High) | 3-5 waves | 8-12 minutes | 15-20 min | 60-100 min overhead |
| 0.70-0.85 (High) | 5-7 waves | 12-18 minutes | 20-30 min | 120-200 min overhead |
| 0.85-1.00 (Critical) | 7-10 waves | 18-25 minutes | 30-45 min | 250-450 min overhead |
Speedup Metrics (empirical data from Shannon V4 usage):
| Agents/Wave | Sequential Time | Parallel Time | Speedup | Efficiency |
|---|---|---|---|---|
| 2 agents | 24 min | 14 min | 1.7x | 85% |
| 3 agents | 36 min | 15 min | 2.4x | 80% |
| 5 agents | 60 min | 18 min | 3.3x | 66% |
| 7 agents | 84 min | 24 min | 3.5x | 50% |
| 10 agents | 120 min | 30 min | 4.0x | 40% |
Performance Indicators:
When Orchestration Takes Longer:
Scenario: Build wave structure for a complex full-stack project
Input: Phase plan from phase-planning skill
Phase Plan (example):
{
"phases": [
{
"id": "phase_1_analysis",
"name": "Analysis & Planning",
"dependencies": [],
"estimated_time": 120,
"domain": "Planning"
},
{
"id": "phase_2_architecture",
"name": "Architecture Design",
"dependencies": ["phase_1_analysis"],
"estimated_time": 180,
"domain": "Architecture"
},
{
"id": "phase_3_database",
"name": "Database Schema",
"dependencies": ["phase_2_architecture"],
"estimated_time": 90,
"domain": "Database"
},
{
"id": "phase_3_backend",
"name": "Backend API",
"dependencies": ["phase_2_architecture", "phase_3_database"],
"estimated_time": 240,
"domain": "Backend"
},
{
"id": "phase_3_frontend",
"name": "Frontend UI",
"dependencies": ["phase_2_architecture"],
"estimated_time": 210,
"domain": "Frontend"
},
{
"id": "phase_4_integration",
"name": "Integration Testing",
"dependencies": ["phase_3_backend", "phase_3_frontend"],
"estimated_time": 120,
"domain": "Testing"
},
{
"id": "phase_5_deployment",
"name": "Deployment",
"dependencies": ["phase_4_integration"],
"estimated_time": 60,
"domain": "DevOps"
}
],
"complexity_score": 0.62
}
Execution Process (actual Claude workflow):
# Input: Phase plan above
phases = load_phase_plan()
# Build dependency graph
dependency_graph = {
"phase_1_analysis": {
"name": "Analysis & Planning",
"depends_on": [],
"blocks": ["phase_2_architecture"],
"time": 120
},
"phase_2_architecture": {
"name": "Architecture Design",
"depends_on": ["phase_1_analysis"],
"blocks": ["phase_3_database", "phase_3_backend", "phase_3_frontend"],
"time": 180
},
"phase_3_database": {
"name": "Database Schema",
"depends_on": ["phase_2_architecture"],
"blocks": ["phase_3_backend"],
"time": 90
},
"phase_3_backend": {
"name": "Backend API",
"depends_on": ["phase_2_architecture", "phase_3_database"],
"blocks": ["phase_4_integration"],
"time": 240
},
"phase_3_frontend": {
"name": "Frontend UI",
"depends_on": ["phase_2_architecture"],
"blocks": ["phase_4_integration"],
"time": 210
},
"phase_4_integration": {
"name": "Integration Testing",
"depends_on": ["phase_3_backend", "phase_3_frontend"],
"blocks": ["phase_5_deployment"],
"time": 120
},
"phase_5_deployment": {
"name": "Deployment",
"depends_on": ["phase_4_integration"],
"blocks": [],
"time": 60
}
}
# Validate: Check for circular dependencies
circular_check = detect_cycles(dependency_graph)
# Result: No cycles detected ✅
waves = []
remaining_phases = list(dependency_graph.keys())
completed_phases = set()
wave_number = 1
# Iteration 1:
ready = [p for p in remaining_phases
if all(dep in completed_phases for dep in dependency_graph[p]["depends_on"])]
# Result: ["phase_1_analysis"] (no dependencies)
waves.append({
"wave_number": 1,
"wave_name": "Wave 1: Foundation",
"phases": ["phase_1_analysis"],
"parallel": False, # Only 1 phase
"estimated_time": 120, # 2 hours
"dependencies": []
})
completed_phases.add("phase_1_analysis")
remaining_phases.remove("phase_1_analysis")
# Iteration 2:
ready = [p for p in remaining_phases
if all(dep in completed_phases for dep in dependency_graph[p]["depends_on"])]
# Result: ["phase_2_architecture"] (depends on phase_1 ✅ completed)
waves.append({
"wave_number": 2,
"wave_name": "Wave 2: Architecture",
"phases": ["phase_2_architecture"],
"parallel": False, # Only 1 phase
"estimated_time": 180, # 3 hours
"dependencies": ["wave_1"]
})
completed_phases.add("phase_2_architecture")
remaining_phases.remove("phase_2_architecture")
# Iteration 3:
ready = [p for p in remaining_phases
if all(dep in completed_phases for dep in dependency_graph[p]["depends_on"])]
# Result: ["phase_3_database", "phase_3_frontend"]
# phase_3_backend NOT ready (still needs phase_3_database)
waves.append({
"wave_number": 3,
"wave_name": "Wave 3: Foundation Implementation",
"phases": ["phase_3_database", "phase_3_frontend"],
"parallel": True, # 2 phases can run concurrently ✅
"estimated_time": max(90, 210) = 210, # 3.5 hours (longest)
"dependencies": ["wave_2"]
})
completed_phases.update(["phase_3_database", "phase_3_frontend"])
remaining_phases.remove("phase_3_database")
remaining_phases.remove("phase_3_frontend")
# Iteration 4:
ready = [p for p in remaining_phases
if all(dep in completed_phases for dep in dependency_graph[p]["depends_on"])]
# Result: ["phase_3_backend"] (now all deps satisfied)
waves.append({
"wave_number": 4,
"wave_name": "Wave 4: Backend Implementation",
"phases": ["phase_3_backend"],
"parallel": False, # Only 1 phase
"estimated_time": 240, # 4 hours
"dependencies": ["wave_3"]
})
completed_phases.add("phase_3_backend")
remaining_phases.remove("phase_3_backend")
# Iteration 5:
ready = ["phase_4_integration"]
waves.append({
"wave_number": 5,
"wave_name": "Wave 5: Integration & Testing",
"phases": ["phase_4_integration"],
"parallel": False,
"estimated_time": 120, # 2 hours
"dependencies": ["wave_4"]
})
# Iteration 6:
waves.append({
"wave_number": 6,
"wave_name": "Wave 6: Deployment",
"phases": ["phase_5_deployment"],
"parallel": False,
"estimated_time": 60, # 1 hour
"dependencies": ["wave_5"]
})
# Final wave structure generated ✅
Result:
{
"total_waves": 6,
"parallel_waves": 1,
"sequential_waves": 5,
"wave_structure": [
{"wave": 1, "phases": 1, "parallel": false, "time": 120},
{"wave": 2, "phases": 1, "parallel": false, "time": 180},
{"wave": 3, "phases": 2, "parallel": true, "time": 210}, // PARALLELISM HERE
{"wave": 4, "phases": 1, "parallel": false, "time": 240},
{"wave": 5, "phases": 1, "parallel": false, "time": 120},
{"wave": 6, "phases": 1, "parallel": false, "time": 60}
]
}
complexity_score = 0.62 # From spec analysis
# Wave 1: 1 phase (Analysis)
agents_wave_1 = allocate_agents(0.62, wave_1)
# Complexity 0.62 ∈ [0.50, 0.70] = Complex band
# num_phases = 1
# Return: min(1, 7) = 1 agent
# Wave 2: 1 phase (Architecture)
agents_wave_2 = allocate_agents(0.62, wave_2)
# Return: 1 agent
# Wave 3: 2 phases (Database + Frontend) - PARALLEL
agents_wave_3 = allocate_agents(0.62, wave_3)
# num_phases = 2
# Complex band: 1-2 agents per phase
# Return: min(2, 7) = 2 agents ✅
agent_types_wave_3 = assign_agent_types(wave_3.phases)
# "Database Schema" → database-builder
# "Frontend UI" → frontend-builder
# Result: [database-builder, frontend-builder]
# Wave 4: 1 phase (Backend)
agents_wave_4 = 1 # backend-builder
# Wave 5: 1 phase (Integration)
agents_wave_5 = 1 # testing-specialist
# Wave 6: 1 phase (Deployment)
agents_wave_6 = 1 # deployment-specialist
# Total agents: 1+1+2+1+1+1 = 7 agents
Result:
{
"wave_1": {"agents": 1, "types": ["planner"]},
"wave_2": {"agents": 1, "types": ["architect"]},
"wave_3": {"agents": 2, "types": ["database-builder", "frontend-builder"]}, // PARALLEL
"wave_4": {"agents": 1, "types": ["backend-builder"]},
"wave_5": {"agents": 1, "types": ["testing-specialist"]},
"wave_6": {"agents": 1, "types": ["deployment-specialist"]},
"total_agents": 7
}
Sequential Time (hypothetical - all phases done one after another):
120 + 180 + 90 + 240 + 210 + 120 + 60 = 1020 minutes = 17 hours
Parallel Time (with wave structure):
Wave 1: 120 min
Wave 2: 180 min
Wave 3: max(90, 210) = 210 min // Database + Frontend in parallel
Wave 4: 240 min
Wave 5: 120 min
Wave 6: 60 min
Total: 930 minutes = 15.5 hours
Speedup Calculation:
speedup = 1020 / 930 = 1.10x
Parallelism benefit: 90 minutes saved (Database ran while Frontend building)
Efficiency: 1.10/7 agents = 16% (LOW - only 1 parallel wave out of 6)
Analysis: Modest speedup due to sequential dependencies. Only Wave 3 parallelizes.
Can we improve? Check if more phases can be parallelized:
Wave 3 currently: Database (90 min) + Frontend (210 min) = 210 min parallel
Could we also parallelize Testing + Deployment?
- phase_4_integration depends on (backend, frontend) ✅
- phase_5_deployment depends on (integration) ✅
- No opportunity to merge
Current structure is OPTIMAL given dependencies.
Conclusion: 6 waves, 1.10x speedup (modest but correct given dependency chain)
This walkthrough demonstrates the complete wave generation process, showing how dependency analysis produces wave structure, how agents are allocated, and how to calculate expected performance improvements.
Wave orchestration achieves 3.5x average speedup through:
This is the most impactful skill in Shannon V4 for accelerating complex project execution.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.