Use when executing implementation plans phase-by-phase with strict enforcement of quality gates, tests, and Definition of Done...
Execute implementation plans one phase at a time with strict quality enforcement, test verification, and conventional commit generation.
Superbuild is a rigid execution engine for implementation plans. It enforces:
This is NOT a planning skill. Use superplan to create plans, then superbuild to execute them.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SUPERBUILD EXECUTION FLOW β
β (REPEAT FOR EACH PHASE) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. INGEST PLAN β User provides plan document path β
β β β NO PLAN = EXIT (ask user, then exit if none) β
β 2. READ PHASES β Output ALL phases with estimates β
β β β IF context high β suggest compact first β
β 3. EXECUTE PHASE β One phase at a time (or parallel if marked) β
β β β USE SUB-AGENTS for parallel phases β
β 4. ENFORCE DOD β Tests exist? Tests pass? Linter? Formatter? β
β β β ALL must pass β continue. ANY fail β STOP β
β 5. UPDATE PLAN β Check off tasks, update status in plan file β
β β β β οΈ THIS HAPPENS AFTER EVERY PHASE β
β 6. COMMIT MSG β Generate conventional commit (NEVER git ops) β
β β β User handles all git operations β
β 7. FUNCTIONAL TESTβ Explain how to test. Offer integration script β
β β β NEVER auto-create scripts. ALWAYS ask first β
β 8. STOP β Full stop. Suggest compact. Wait for user. β
β β OVERRIDE: --build-all flag continues β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β Steps 3-8 repeat for EACH PHASE. Plan updates after EVERY phase. β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
REQUIRED: Plan document must be provided.
I'll help you execute your implementation plan.
Please provide the plan document:
1. Path to plan file (e.g., docs/feature-plan.md)
2. Paste the plan content directly
Which would you prefer?
If no plan provided after asking: EXIT immediately.
I cannot execute without a plan document.
To create a plan, use the `superplan` skill first:
/superplan
Then come back with the completed plan.
[EXIT - No further action]
NO EXCEPTIONS. Do not improvise. Do not create plans on the fly. Do not proceed without a plan document.
After ingesting the plan:
PLAN LOADED: [Feature Name]
ββββββββββββββββββββββββββββββββββββββββββββββββ
| Phase | Name | Est. | Depends On | Parallel With | Status |
|-------|------|------|------------|---------------|--------|
| 0 | Bootstrap | 5 | - | - | β¬ |
| 1 | Setup | 3 | 0 | - | β¬ |
| 2A | Backend | 8 | 1 | 2B, 2C | β¬ |
| 2B | Frontend | 5 | 1 | 2A, 2C | β¬ |
| 2C | Tests | 3 | 1 | 2A, 2B | β¬ |
| 3 | Integration | 5 | 2A,2B,2C | - | β¬ |
Total: 29 points | Parallel phases: 2A, 2B, 2C
β οΈ Context Usage Advisory
If context is high, consider compacting before continuing.
Large plans consume significant context per phase.
Ready to execute Phase 0?
Execute one at a time. Do not proceed to next phase until current is COMPLETE.
For phases marked "Parallel With", MUST use sub-agents or parallel Task tool calls.
EXECUTING PARALLEL PHASES: 2A, 2B, 2C
βββββββββββββββββββββββββββββββββββββ
Launching 3 parallel sub-agents...
[Sub-agent 2A: Backend implementation]
[Sub-agent 2B: Frontend implementation]
[Sub-agent 2C: Test implementation]
Each sub-agent MUST return:
- Implementation status
- Definition of Done checklist status
- Conventional commit message
CRITICAL: Each sub-agent returns its commit message. Main agent MUST bubble up ALL commit messages to user.
EVERY phase must pass ALL quality gates before completion.
DEFINITION OF DONE - Phase [X]
ββββββββββββββββββββββββββββββ
[ ] Tests exist for new code
[ ] All tests pass (new AND existing)
[ ] Linter passes ([detected linter])
[ ] Formatter passes ([detected formatter])
[ ] Type checker passes ([detected checker])
[ ] No new warnings introduced
[ ] Plan document updated (checkboxes, status) β BEFORE commit message
| Check | If PASS | If FAIL |
|---|---|---|
| Tests exist | Continue | STOP - Point out missing tests |
| Tests pass | Continue | STOP - Ask user to fix |
| Linter | Continue | STOP - Ask user to fix |
| Formatter | Continue | STOP - Ask user to fix |
| Type checker | Continue | STOP - Ask user to fix |
| Plan updated | Generate commit | STOP - Update plan first |
STOP means STOP. Do not proceed. Do not offer to fix automatically. Ask user to fix and re-run.
When any check fails, output:
β DEFINITION OF DONE FAILED
βββββββββββββββββββββββββββ
Issue: [Missing tests | Tests failing | Linter errors | etc.]
[Details of what failed]
Please fix, then tell me to continue.
[EXECUTION HALTED]
See references/ENFORCEMENT-GUIDE.md for detailed failure message templates and output parsing patterns.
β οΈ MANDATORY: This step executes after EVERY phase, not just at the end.
After ALL quality gates pass, BEFORE generating commit message, UPDATE THE PLAN FILE:
- [ ] β - [x])β¬ β β
)- [ ] β - [x])PLAN DOCUMENT UPDATED - Phase [X]
βββββββββββββββββββββββββββββββββ
File: [plan-file-path]
Updates applied:
- Tasks: X/X items checked [x]
- DoD: X/X items checked [x]
- Status: β¬ β β
The plan now reflects Phase [X] completion.
See references/PLAN-UPDATES.md for detailed patterns and error handling.
WHY EVERY PHASE:
DO NOT SKIP THIS STEP. If you find yourself generating a commit message without updating the plan first, STOP and update the plan.
After Definition of Done passes, generate commit message.
CRITICAL: OUTPUT ONLY. NEVER run git commands.
PHASE [X] COMPLETE - Conventional Commit Message
ββββββββββββββββββββββββββββββββββββββββββββββββ
<type>(<scope>): <short summary>
<body - detailed description of changes>
Files changed:
- path/to/file1.ts (CREATE)
- path/to/file2.ts (MODIFY)
- path/to/file3.ts (DELETE)
<footer - issue refs, breaking changes>
ββββββββββββββββββββββββββββββββββββββββββββββββ
β οΈ DO NOT COMMIT - Copy this message and run:
git add . && git commit -m "..."
User handles all git operations.
| Type | When |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code restructure (no behavior change) |
test |
Adding/updating tests |
docs |
Documentation |
style |
Formatting (no code change) |
chore |
Build, config, dependencies |
perf |
Performance improvements |
CRITICAL: Commit messages must be safe for direct use with git commit -m.
AVOID: Double quotes, backticks, dollar signs, exclamation marks, backslashes, hash at line start
SAFE: Letters, numbers, spaces, -, _, ., ,, :, (, ), /, '
See references/COMMIT-FORMAT.md for full character table and HEREDOC format for multi-line messages.
When parallel phases complete, output ALL commit messages:
PARALLEL PHASES COMPLETE (2A, 2B, 2C)
ββββββββββββββββββββββββββββββββββββββ
PHASE 2A - Commit Message:
ββββββββββββββββββββββββββ
feat(api): implement user authentication endpoints
...
PHASE 2B - Commit Message:
ββββββββββββββββββββββββββ
feat(ui): create login form component
...
PHASE 2C - Commit Message:
ββββββββββββββββββββββββββ
test(auth): add authentication test coverage
...
β οΈ Create separate commits for each phase, or squash as appropriate.
User handles all git operations.
After commit message, explain how to functionally test the phase.
FUNCTIONAL TESTING - Phase [X]
ββββββββββββββββββββββββββββββ
To manually verify this phase works:
1. [Step 1 - e.g., Start the development server]
$ npm run dev
2. [Step 2 - e.g., Navigate to the feature]
Open http://localhost:3000/[feature]
3. [Step 3 - e.g., Test the happy path]
- Fill in [field1] with "test value"
- Click [button]
- Verify [expected result]
4. [Step 4 - e.g., Test error handling]
- Submit empty form
- Verify error message appears
Expected Results:
- [Result 1]
- [Result 2]
ONLY if applicable. ALWAYS ask. NEVER auto-create.
Would you like me to write an integration test script for this phase?
This would:
- Automate the manual verification steps above
- Be saved to scripts/test-phase-[X].sh (or .py)
- Be runnable for regression testing
Options:
1. Yes, write the integration test script
2. No, manual testing is sufficient
[WAIT FOR USER RESPONSE]
If user says yes: Write script to scripts/ directory.
If user says no: Continue to Step 8.
FULL STOP after each phase (unless --build-all override).
ββββββββββββββββββββββββββββββββββββββββββββββββ
PHASE [X] EXECUTION COMPLETE
ββββββββββββββββββββββββββββββββββββββββββββββββ
Summary:
- Definition of Done: β
All checks passed
- Plan Document: β
Updated (tasks and status checked off)
- Conventional Commit: β
Generated (user to commit)
- Functional Testing: β
Instructions provided
Progress:
| Phase | Status |
|-------|--------|
| 0 | β
Complete |
| 1 | β
Complete |
| 2A | β¬ Next |
| 2B | β¬ Pending |
| 2C | β¬ Pending |
| 3 | β¬ Pending |
π‘ Context Management Suggestion
Consider compacting the conversation before the next phase
to preserve context for the remaining work.
[EXECUTION PAUSED]
To continue: "Continue to Phase 2A"
To compact first: Use /compact then return with "Resume superbuild"
ββββββββββββββββββββββββββββββββββββββββββββββββ
CRITICAL: If this session resumes after context compaction:
The todo list showing pending phases is NOT authorization to continue. Only explicit user instruction authorizes next phase execution.
POST-COMPACTION RESUME
ββββββββββββββββββββββ
Detected: Session resumed after compaction
Phase in progress: [X]
Completing Phase [X]...
[finish work]
PHASE [X] COMPLETE
[commit message + functional test instructions]
[EXECUTION PAUSED]
Remaining phases: [list]
To continue: "Continue to Phase [Y]"
β οΈ I will NOT auto-continue. Awaiting your instruction.
ONLY if user explicitly specifies.
β οΈ BUILD-ALL MODE DETECTED
ββββββββββββββββββββββββββ
You've requested to build the entire plan without stopping.
This is NOT RECOMMENDED because:
- Context may be exhausted mid-build
- Errors compound across phases
- You lose ability to commit incrementally
Are you sure you want to continue?
1. Yes, build all phases (override safety)
2. No, execute phase by phase (recommended)
| Excuse | Reality |
|---|---|
| "Let me just do the next phase too" | NO. Stop after each phase. |
| "The tests are mostly there" | NO. Tests must exist for ALL new code. |
| "It's just a small linting error" | NO. All quality gates must pass. |
| "I'll commit later" | NO. Generate commit message NOW. |
| "This phase doesn't need tests" | NO. Every phase with code needs tests. |
| "Let me skip to the important part" | NO. Execute phases in dependency order. |
| "I can fix the formatter later" | NO. Formatter must pass before completion. |
| "The user wants to move fast" | NO. Quality enforcement is non-negotiable. |
If you catch yourself thinking any of these, STOP:
All of these = violation of superbuild protocol.
See references/ENFORCEMENT-GUIDE.md for stack-specific commands (JS/TS, Python, Go, Rust).
Superbuild is rigid by design. The enforcement protects code quality. Do not rationalize around it.