spec-driven-tdd
Plan and track in OpenSpec. Implement with Superpowers discipline. One change at a time, one task at a time.
Core principle: OpenSpec owns what and progress; the execution skills own how. A task is done only after its review is clean — not at green tests.
Dependencies
Requires OpenSpec CLI + Superpowers installed. If a referenced skill or command
is unavailable, say so and fall back per docs/dependencies.md — never silently
skip a step. /code-review is a Claude-Code-only optional enhancement.
Lifecycle
1. Plan (OpenSpec)
Optional — feasibility spike (risk-gated). If the work carries unproven
technical risk (an untested approach, an external API, an open "is this
possible?"), invoke the spike skill before proposing. Skip it when
feasibility is already clear. Act on its verdict: VALIDATED → proceed to
propose; PARTIAL → narrow scope to the viable subset, then propose;
INVALIDATED → stop, do not create the change (tell the user why). Spike code
is throwaway and never enters the change's worktree.
If no change exists for the work, run /opsx:propose (it uses brainstorming
to shape scope, then writes proposal/design/tasks). OpenSpec is the single
source of truth for scope and the task list. Do not invent tasks outside it.
2. Isolate (worktree)
Before touching code, invoke using-git-worktrees to create an isolated
worktree for the change so the main workspace stays clean. (Pairs with
finishing-a-development-branch at the end.)
3. Implement — per-task loop
Get the task list and context via /opsx:apply (read every contextFiles
path). Then, for EACH pending task, run this micro-cycle:
- RED — invoke
test-driven-development: write a failing test first. No production code without a failing test. - GREEN — minimal code to pass. If a test fails unexpectedly, invoke
systematic-debuggingbefore guessing. - REFACTOR — unit-local cleanup under green tests.
- simplify — invoke this pack's
simplifyskill for a diff-wide quality pass; it applies edits. - Re-run tests — they must stay green after simplify.
- Review — invoke
requesting-code-reviewon the task's diff; usereceiving-code-reviewto act on it. On Claude Code you may additionally run/code-review. Fix Critical + Important before continuing. - Mark done — only now flip the task
- [ ]→- [x]in the OpenSpec tasks file.
Optional mode — large changes: delegate to subagent-driven-development
only when the task list is genuinely large and tasks are independent — not for
a handful of tasks you can run inline. It dispatches each task to a fresh
subagent with per-task review. Use dispatching-parallel-agents only for
tasks with no shared state, and keep the number of concurrent subagents low.
Pause and ask if a task is ambiguous or implementation reveals a design issue (then suggest updating the OpenSpec artifacts).
4. Finish
When all tasks are [x]:
verification-before-completion— confirm the change actually works.finishing-a-development-branch— integrate the worktree's branch./opsx:archivethen/opsx:sync— close tracking and update main specs.
Checklist
- Change selected/created in OpenSpec
- Worktree created
- Every task ran RED→GREEN→REFACTOR→simplify→review before
[x] - All tasks
[x] - Verified, branch finished, change archived + synced