implement
Implement the active spec — work through tasks, mark them complete, update progress
Implement Spec
Implement tasks from the active spec. The argument can specify scope.
User's request: $ARGUMENTS
Scope Detection
Parse the user's request to determine what to implement:
- No argument / "the spec" / "implement" → Start from the
← currenttask and work forward through all remaining tasks - "phase N" / "phase <name>" → Implement all unchecked tasks in that specific phase only
- "all phases" / "everything" → Implement all remaining unchecked tasks across all phases, in order
- "task CODE-NN" → Implement just that specific task
Implementation Workflow
- Read
.specs/registry.mdto find the spec withactivestatus - If none is active, show the user their specs so they can choose one
- Load
.specs/<id>/SPEC.md - Parse all phases and tasks — identify which tasks are in scope
- Present a brief plan: "I'll implement N tasks across M phases. Starting with [TASK-CODE] — <task description>."
- TUI Progress: Create a TaskCreate entry for each in-scope task so
they appear as live checkboxes in the Claude Code TUI:
- subject:
[TASK-CODE] <task description> - activeForm:
Implementing [TASK-CODE]The SPEC.md checkboxes remain the source of truth — TUI entries are a convenience view for real-time progress.
- subject:
For each task in scope, in order:
Execute
- Set the task's TUI entry to
in_progressvia TaskUpdate - Mark the task with
← currentin the SPEC.md - Implement the task — write the actual application code:
- Follow the patterns and conventions identified in the research notes
- Use the libraries and approaches specified in the spec
- Write clean, maintainable, professional code
- If the task has specific file paths or function names, use them
- Write tests if the task has a corresponding test task or if the spec's testing strategy calls for it
- Run tests to verify correctness after implementation
Update Progress (sacred — never skip)
Progress tracking is the most important bookkeeping in specmint-core. If you skip this, resume breaks, the registry lies, and the spec becomes useless. After completing each task, immediately update the spec files:
- Check off the task:
- [ ]→- [x] - Remove
← currentfrom the completed task - Move
← currentto the next unchecked task (or the next in-scope task) - If all tasks in the current phase are done:
- Phase status:
[in-progress]→[completed] - Next phase (if any):
[pending]→[in-progress] - Review Acceptance Criteria — check off any that are now satisfied
- Phase status:
- Update the
updateddate in YAML frontmatter - Recompute progress count (X/Y) from checkboxes
- Update progress and
updateddate in.specs/registry.md - Verify: Re-read both
SPEC.mdandregistry.mdto confirm edits landed. If registry progress doesn't match SPEC.md checkbox count, fix it before moving on. - Update Resume Context with current state
- Set the task's TUI entry to
completedvia TaskUpdate
If you realize you forgot to update after a previous task, stop and fix it now before continuing with the next task.
Phase Review (after completing a phase)
When all tasks in a phase are completed, review before moving to the next:
- Dispatch the
superpowers:code-revieweragent (if available) with:- The phase requirements from the SPEC.md
- The list of files created/modified during this phase
- The acceptance criteria relevant to this phase
- If no reviewer agent is available, do an inline review:
- Re-read the phase's tasks and acceptance criteria
- Verify each task's implementation matches what was specified
- Check for missing edge cases, incomplete implementations, or spec drift
- If the review finds issues, fix them before marking the phase complete
- Log any review findings in the Decision Log
Handle Issues
- If a task is more complex than expected, split it into subtasks and update the SPEC.md before continuing
- If implementation diverges from the spec (better approach found, errors in spec, etc.), log it in the Deviations section
- Log any new technical decisions in the Decision Log
- If blocked on a task:
- Keep the task unchecked and add a blocker note in Resume Context
- Set the phase marker to
[blocked]only when the whole phase is blocked - Move to the next unblocked task if possible
Parallel Task Execution (optional)
When multiple tasks within a phase are independent (no shared files, no sequential dependencies), you may dispatch them in parallel using the Agent tool:
- Identify which tasks have no file-level or logical dependencies on each other
- Dispatch an Agent for each independent task with:
- The full task specification from the SPEC.md
- The research notes and library choices for context
- Clear instructions on which files to create/modify
- After all agents complete, integrate results and run tests
- Update all checkboxes, registry, and TUI entries in a single batch
Default to sequential execution. Only parallelize when tasks are clearly independent and the speedup is worth the coordination overhead. When in doubt, execute sequentially.
Verification Gate (mandatory before claiming completion)
Before reporting any phase or spec as complete, provide evidence:
- Run the project's test suite (or the relevant subset) via Bash
- Show the actual command and output in your response
- If tests fail, fix the issues before claiming completion
- Never use language like "should pass", "probably works", or "seems correct"
This applies at every completion boundary: task, phase, and spec. Evidence first, then assertions. No exceptions.
Completion
When all in-scope tasks are done:
- If all tasks in the spec are complete:
- Run the full test suite and show the output (verification gate)
- Verify all Acceptance Criteria are checked. If any remain unchecked, report which ones and ask the user before marking complete.
- Set all phases to
[completed] - Set spec status to
completedin frontmatter - Update
.specs/registry.mdwithcompletedstatus - Present a summary: tasks completed, files created/modified, test output
- Suggest next spec to activate if any are paused
- If only a phase was completed:
- Run tests for the phase's scope and show the output (verification gate)
- Report phase completion and remaining work
- Set the next phase to
[in-progress]if applicable
Quality Standards
During implementation:
- Write clean, simple, maintainable code — no over-engineering
- Follow existing codebase patterns and conventions
- Use the libraries specified in the spec's Library Choices section
- Write comprehensive tests as specified in the Testing Strategy
- Handle edge cases identified in the spec
- Validate at system boundaries, trust internal code