Ultraplan - Parallel Orchestration Workflow
Ultraplan enables coordinated multi-phase implementation using parallel Task invocations (up to 100 simultaneous). It leverages subagents for each implementation phase.
Core Concept
Ultraplan orchestrates work through phases:
| Phase | Purpose | Subagent Role |
|---|---|---|
| Phase 1 | Exploration | Understand codebase areas |
| Phase 2 | Planning | Design implementation approach |
| Phase 3 | Implementation | Execute planned changes |
| Phase 4 | Verification | Validate correctness |
Each phase may spawn multiple parallel Task invocations for independent subtasks.
Invocation Process
Step 1: Context Gathering
Before orchestrating, gather implementation context:
- Identify target areas of the codebase
- Determine parallelization opportunities - independent subtasks within each phase
- Map dependencies - which tasks block others
Query the user if context is insufficient:
- "Which areas should I focus on?"
- "Should I work on a specific phase or orchestrate all phases?"
Step 2: Task Decomposition
For each task, decompose into parallelizable subtasks:
Parallelization Rules:
- Tasks within the same phase MAY run in parallel if no data dependency
- Tasks across phases MUST respect phase ordering (1 -> 2 -> 3 -> 4)
- Maximum 100 parallel Task invocations per orchestration batch
Task Schema:
task_id: unique-task-identifier
phase: 1|2|3|4
description: imperative description
deps: [task_id, ...]
files: [affected files]
acceptance: testable criteria
Step 3: Subagent Dispatch
Launch parallel Task invocations for independent subtasks:
Dispatch Pattern:
For each phase in [1, 2, 3, 4]:
identify_ready_tasks(phase) # Tasks with satisfied deps
batch_tasks = partition(ready_tasks, max_batch=100)
for batch in batch_tasks:
parallel_invoke(Task, batch) # Up to 100 simultaneous
await_all(batch)
validate_phase_output()
proceed_to_next_phase()
Subagent Prompt Template:
Each Task invocation receives:
- Specific task identifier
- Target file paths
- Acceptance criteria
- Phase-specific instructions
Step 4: Progress Tracking
Track implementation progress:
- Before work: Mark task as in-progress
- After completion: Mark task as complete
- Add traceability: Note validation method
Step 5: Verification Gate
Before marking orchestration complete:
- Run build - no warnings
- Run tests - all pass
- Run linting - no warnings
Phase-Specific Subagent Instructions
Phase 1 Subagent: Exploration
Instructions for Phase 1 Task invocations:
- Read and understand target files
- Identify key types and APIs
- Find existing patterns
- Map dependencies
- Report findings (do NOT make changes)
Phase 2 Subagent: Planning
Instructions for Phase 2 Task invocations:
- Design changes based on exploration
- Specify file paths and line ranges
- Order changes by dependency
- Identify test cases needed
- Return structured plan
Phase 3 Subagent: Implementation
Instructions for Phase 3 Task invocations:
- Execute planned changes
- Follow existing code patterns
- Add documentation
- Run local tests
- Report completion status
Phase 4 Subagent: Verification
Instructions for Phase 4 Task invocations:
- Run full test suite
- Check linting
- Verify documentation
- Report any issues found
Orchestration Commands
| Action | How to Invoke |
|---|---|
| Start ultraplan | "Run /ultraplan" or "start parallel implementation" |
| Target specific area | "Implement changes to the auth module" |
| Single phase only | "Run exploration phase only" |
| Check status | "What tasks remain?" |
| Verify completion | "Validate all tasks are complete" |
Error Handling
When a subagent Task fails:
- Capture failure context - error message, affected files
- Determine retry eligibility - transient vs. fundamental failure
- Isolate affected tasks - do not block unrelated parallel work
- Report to orchestrator - aggregate failure summary
- Suggest remediation - specific fix guidance
Best Practices
Parallelization Guidelines
- Maximize parallelism within phases (independent subtasks)
- Respect phase boundaries - never start Phase N+1 before Phase N completes
- Batch appropriately - group related subtasks to minimize context switches
- Use explicit dependencies - model task DAG accurately
Code Quality Gates
Every subagent must ensure:
- No compiler/linter warnings
- All tests pass
- Documentation complete
Quick Start
To begin an ultraplan orchestration:
- Identify target areas of the codebase
- Confirm scope with user
- Decompose into parallelizable tasks
- Dispatch Phase 1 subagents in parallel
- On Phase 1 completion, dispatch Phase 2, etc.
- Run verification gate
- Report final status