| name | build-phase |
| description | Execute one phase from a plan file using the TDD → Test → Self-Review loop. Use when a plan has been approved and it's time to build. Accepts a plan file path and phase number. Builds phase by phase and produces a build completion report. Review (/3p-review) and handoff (/handoff-summary) are driven by the orchestrating workflow — agentic-workflow for the main model, build-model for a dedicated build model — not by this skill. |
| argument-hint | [plan-file-path] [Phase N] |
| allowed-tools | Read, Grep, Glob, Write, Edit, Bash, Agent |
Build Phase
You are entering the Build Phase of the Structured Agentic Development Workflow.
Output style: Check memory for workflow-config:caveman-level. If set, adapt your output brevity to that level while preserving technical accuracy.
Your Mission
Execute $ARGUMENTS using the strict phase-wise loop.
The Loop: Read Plan → TDD (Red/Green/Refactor) → Test Suite → Self-Review → Proceed
You MUST follow this loop for every phase. Do not skip steps. Every step produces output — do not stop after one step.
Step 1: Read the Plan
- Read the plan file and locate the specified phase.
- Understand what the phase requires: files to modify/create, expected behavior, test criteria.
- Surface discrepancies — do not silently work around them. If the plan is ambiguous, contradictory, or assumes something that doesn't match the codebase, STOP and flag it to the user. Do not guess or make design decisions that the plan should have made. The user may need to take the issue back to the planning model.
Step 2: TDD — Write Tests, Then Implement
Use /test-driven-development. This is mandatory for every phase.
- Red: Write the failing tests first — encode the expected behavior from the plan's test criteria before writing any production code.
- Green: Implement the minimum code to make the tests pass. Implement exactly what the plan describes — no more, no less. Do not refactor surrounding code unless the plan explicitly calls for it.
- Refactor: Clean up while keeping all tests green.
You must complete all three steps. Do not stop after writing tests. The tests exist to drive the implementation — writing them is the beginning of the phase, not the end.
Step 3: Run the Full Test Suite
- Run the tests specified in the plan's "Test criteria" for this phase.
- Also run any tests for other modules you modified — check for regressions.
- Command:
uv run pytest tests/ -x (or the project's test command).
- All tests must pass before proceeding. If tests fail, fix the implementation — do not modify existing tests to make them pass.
Step 4: Self-Review
Review your own changes with a critical eye. This is NOT the full /3p-review — that happens after ALL phases are complete. This is a quick self-review to catch obvious issues before moving on.
Check for:
- Does the implementation match what the plan specified?
- Are there any obvious bugs, edge cases, or regressions?
- Does the code follow existing project conventions and patterns?
- Is anything over-engineered or under-tested?
If you find CRITICAL issues, fix them and re-test before proceeding. For minor concerns, note them — the full /3p-review will catch them after all phases.
Present the self-review findings to the human for confirmation before proceeding.
Step 5: Proceed
Report:
- What was implemented
- Test results (pass/fail count)
- Self-review findings and any fixes applied
- Whether you recommend proceeding to the next phase
Then auto-advance: if the phase is clean and more phases remain, immediately suggest and begin the next phase. Do not wait for the user to say "proceed" unless the plan requires a human decision gate.
Resuming After External Model Execution
If the user tells you that code was written by another agent (Cursor, Copilot, a local model, etc.) or simply says "it's done" / "I've implemented Phase N" / pastes a diff:
- Do NOT re-implement. The code is already written.
- Immediately run Step 3 (Test Suite) — verify the external model's work passes tests.
- Then run Step 4 (Self-Review) — review the external model's code carefully. External models are more likely to have drifted from project conventions.
- Continue the loop as normal — fix issues, re-test, re-review until clean.
- Then auto-advance to the next phase.
The user should not have to tell you to continue the workflow. You own the process from the moment they hand you back control.
Phase Completion
When all phases in the plan are complete:
- Run the FULL test suite:
uv run pytest tests/ -x. All tests must pass.
- Produce a short build completion report: which phases were built, the final test result (pass/fail count), and a one-line note on any phase that deviated from the plan.
This skill ends here. Building is one responsibility — review and handoff are owned by the orchestrating workflow, not by this skill. Do not run /3p-review, write the handoff summary, or verify from inside build-phase.
agentic-workflow (main model) drives /3p-review → /handoff-summary → /verification-before-completion.
build-model (dedicated build model) drives /3p-review → /handoff-summary → STOP.
Whichever launched you takes over once you report completion. You do not need to decide which — just report and hand back.
What Happens Next
If more phases remain, auto-advance: suggest and begin /build-phase <plan-file> Phase N+1.
When all phases are complete, present the build completion report and return control to the orchestrating workflow. That workflow drives review and handoff next — do not start them yourself.