do-in-parallel
Pattern: Parallel Orchestration with Independence Validation
Phase 1: Parse Input and Identify Targets
│
Phase 2: Task Analysis with Zero-shot CoT
┌─ Task Type Identification ─────────────────┐
│ (transformation, analysis, documentation) │
├─ Per-Target Complexity Assessment ─────────┤
│ (high/medium/low) │
├─ Independence Validation ──────────────────┤
│ ⚠️ CRITICAL: Must pass before proceeding │
└────────────────────────────────────────────┘
│
Phase 3: Model and Agent Selection
Is task COMPLEX? → Opus
Is task SIMPLE/MECHANICAL? → Haiku
Otherwise → Opus (default for balanced work)
│
Phase 4: Construct Per-Target Prompts
[CoT Prefix] + [Task Body] + [Self-Critique Suffix]
(Same structure for ALL agents, customized per target)
│
Phase 5: Parallel Dispatch (ALL agents in SINGLE response)
┌─ Agent 1 (target A) ─┐
├─ Agent 2 (target B) ─┼─→ Concurrent Execution
└─ Agent 3 (target C) ─┘
│
Phase 6: Collect and Summarize Results
Aggregate outcomes, report failures, suggest remediationUsage
Advanced Options
When to Use
Context Isolation Best Practices
Theoretical Foundation
Last updated