Execute approved implementation plans phase by phase with TDD and verification gates
Executes approved implementation plans phase-by-phase using strict TDD (test-first) with automated verification and human gates between phases. Use this to implement complex changes systematically with full test coverage.
/plugin marketplace add astrosteveo/claude-code-plugins/plugin install superharness@astrosteveo-plugins<path to plan file>You are tasked with implementing an approved technical plan from .harness/. These plans contain phases with specific changes and success criteria.
For EVERY task in EVERY phase:
No production code without a failing test first. This is non-negotiable.
When given a plan path:
- [x]If no plan path provided, ask for one.
Plans are carefully designed, but reality can be messy. Your job is to:
When things don't match exactly, think about why and communicate clearly. The plan is your guide, but your judgment matters too.
For EACH task in the phase:
RED Phase:
1. Write a failing test for the functionality
2. Run the test
3. VERIFY it fails (if it passes, your test is wrong)
4. Commit: "test: add failing test for [feature]"
GREEN Phase:
1. Write the MINIMAL code to make the test pass
2. Run the test
3. VERIFY it passes
4. Commit: "feat: implement [feature]"
REFACTOR Phase (if needed):
1. Clean up code while keeping tests green
2. Run tests after each change
3. Commit: "refactor: clean up [feature]"
DO NOT skip the RED phase. DO NOT write production code before the test.
Execute all automated verification commands from the plan:
- [ ] Tests pass: `make test` or equivalent
- [ ] Type checking passes
- [ ] Linting passes
Fix any issues before proceeding.
Use Edit tool to check off completed items:
- [ ] becomes - [x]Create a commit with the phase trailer:
git add -A
git commit -m "feat: complete Phase N - [Phase Name]
[Brief description of what was implemented]
phase(N): complete"
This trailer is how the session hook detects incomplete work.
After automated verification passes:
Phase [N] Complete - Ready for Manual Verification
Automated verification passed:
- [x] Tests pass (X tests)
- [x] Type checking passes
- [x] Linting passes
Please perform the manual verification steps:
- [ ] [Manual step 1 from plan]
- [ ] [Manual step 2 from plan]
Let me know when manual testing is complete so I can proceed to Phase [N+1].
Wait for user confirmation before proceeding.
Exception: If instructed to execute multiple phases consecutively, skip the pause until the last phase.
These thoughts mean STOP - you're rationalizing skipping TDD:
| Thought | Reality |
|---|---|
| "This is too simple to test" | Simple code breaks too. Write the test. |
| "I'll write tests after" | After = never. Write them now. |
| "The test would be trivial" | Trivial tests catch trivial bugs. Write it. |
| "I know this works" | Prove it with a test. |
| "Testing this is hard" | Hard to test = bad design. Fix the design. |
| "Just this once" | No exceptions. TDD always. |
If you encounter a mismatch between plan and reality:
Issue in Phase [N]:
Expected: [what the plan says]
Found: [actual situation]
Why this matters: [explanation]
How should I proceed?
DO NOT proceed with guesswork - get guidance.
If the plan has existing checkmarks:
Maintain a todo list with:
Phase 1: [Name] - in_progress/completed
- Task 1.1 (TDD) - completed
- Task 1.2 (TDD) - in_progress
Phase 2: [Name] - pending
...
Update todos as you complete work.
Before marking a phase complete:
phase(N): complete trailerUser: /superharness:implement .harness/003-auth/plan.md
Agent: [Reads plan, identifies 3 phases]
Starting Phase 1: Database Schema Changes
Task 1.1: Add user table migration
- RED: Writing failing test for migration...
[Creates test, runs it, verifies failure]
Committed: "test: add failing test for user migration"
- GREEN: Implementing migration...
[Creates migration, runs test, verifies pass]
Committed: "feat: add user table migration"
Task 1.2: Add user model
- RED: Writing failing test for user model...
[Creates test, runs it, verifies failure]
- GREEN: Implementing user model...
[Creates model, runs test, verifies pass]
Running automated verification...
- Tests: PASS (12 tests)
- Type check: PASS
- Lint: PASS
Committing phase completion...
"feat: complete Phase 1 - Database Schema
Added user table migration and model with full test coverage.
phase(1): complete"
Phase 1 Complete - Ready for Manual Verification
Automated verification passed:
- [x] Migration applies cleanly
- [x] Unit tests pass (12 tests)
- [x] Type checking passes
Please perform the manual verification:
- [ ] Verify table appears in database
- [ ] Check foreign key constraints
Let me know when manual testing is complete.
User: Manual testing complete, looks good!
Agent: Proceeding to Phase 2...
/superharness:validate/superharness:handoff/superharness:iterate