| name | compound-engineering |
| description | Executes multi-stream parallel feature development across isolated worktrees. Use when writing-plans detects 2+ independent work streams in the plan and the user chooses compound execution at the handoff. |
| phase | build |
| produces | ["multi-stream-code"] |
| chainsTo | ["requesting-code-review"] |
| chainsFrom | ["writing-plans"] |
Compound Engineering
Execute independent work streams in parallel across isolated worktrees, then integrate the results.
Prerequisite: super-agent-skills:writing-plans has already written the plan, detected independent streams, and the user chose compound execution. You receive the stream grouping (which tasks belong to which stream) and integration points (shared types, API contracts).
Announce at start: "I'm using compound-engineering to orchestrate parallel work streams."
Before Execution
Verify the stream grouping from writing-plans:
- Confirm independence — can each stream be built and tested without the others?
- Define contracts — if streams share interfaces (API schemas, type definitions, shared models), define them before splitting. Commit contract files to the base branch first.
- Max 3 streams — if more, merge the smallest streams until ≤3
Execute in Parallel
For each stream:
- Create an isolated worktree using
super-agent-skills:using-git-worktrees
- Dispatch
super-agent-skills:subagent-driven-development in each worktree with the stream's tasks from the plan
- Streams execute in parallel — each with its own task cycle, reviews, and commits
main branch
├── worktree: feature/sharing-backend ← Stream A executing
├── worktree: feature/sharing-frontend ← Stream B executing
└── worktree: feature/sharing-notifs ← Stream C executing
Integrate
After all streams complete:
- Merge streams sequentially — merge Stream A to main, then Stream B, then Stream C
- Resolve conflicts — if streams touched shared files (despite planning), resolve now
- Run full test suite — all tests from all streams must pass together
- Integration testing — test cross-stream connections (API contract adherence, end-to-end flows)
- If integration fails — identify which stream's changes caused the failure, fix in that stream's context
Review
Invoke super-agent-skills:requesting-code-review on the combined result. The chain then continues normally: requesting-code-review → user prompt → wrap-up or ship.
Safety Rules
- Sequential streams are fine — if Stream B depends on Stream A, run A first, then B
- Integration testing is mandatory — parallel work may produce individually correct but collectively broken code
- Streams sharing >30% of files are too coupled — should be a single stream
Red Flags
- No shared contract committed before streams split
- Streams that can't be tested independently
- More than 3 parallel streams
Verification
After integration: