Execute specific implementation phases from task plans with test-first enforcement
Execute implementation phases with test-first enforcement and mandatory worklog tracking for tasks, bugs, and spikes.
/plugin marketplace add TaylorHuston/ai-toolkit/plugin install ai-toolkit@ai-workflow-marketplace### PHASE | ### --next | --next | ### --full | --fullclaude-sonnet-4-5WHAT: Execute implementation phases with test-first enforcement and agent coordination.
HOW: Detects issue type, follows its workflow, enforces quality gates.
MANDATORY: You MUST create/update WORKLOG.md for EVERY phase. Read docs/development/workflows/worklog-format.md for entry format. No phase is complete without a WORKLOG entry documenting what was done, decisions made, and gotchas encountered.
/implement 001 1.1 # Execute specific phase (detects type from file)
/implement 003 2.2 # Execute bug fix phase
/implement 005 # Spike: asks which plan, creates spike branch
/implement 001 --next # Auto-find next uncompleted phase
/implement --next # Auto-detect issue + next phase
/implement 001 --full # Execute all remaining phases
/implement PROJ-123 --next # Jira issue
Reads issue file to determine type and workflow:
# In pm/issues/###-name/ directory:
if [ -f "TASK.md" ]; then type="task" # TDD phases
elif [ -f "BUG.md" ]; then type="bug" # Reproduction-first
elif [ -f "SPIKE.md" ]; then type="spike" # Exploration plans
fi
| Issue File | Workflow | Branch Pattern |
|---|---|---|
| TASK.md | TDD (RED/GREEN/REFACTOR) | feature/### |
| BUG.md | Reproduction-first | bugfix/### |
| SPIKE.md | Exploration (per plan) | spike/###/plan-N |
pm/issues/{ID}-*/For TASK/BUG:
For SPIKE (see below):
Select agent based on phase domain:
frontend-specialist, backend-specialist, database-specialisttest-engineer for RED phasescode-reviewer for REFACTOR phasesresearch-specialist when agents need external knowledge:
docs/project/research/ for existing docsdocs/development/workflows/worklog-format.md:
date '+%Y-%m-%d %H:%M' for timestamp⚠️ A phase is NOT complete until WORKLOG.md is updated.
When issue type is SPIKE, behavior changes significantly.
Which plan do you want to explore?
Available plans:
1. PLAN-1.md: GraphQL with Apollo Server
2. PLAN-2.md: REST with Express
Enter plan number: _
# From current branch (usually develop)
git checkout -b spike/005/plan-1
Differences from TASK/BUG:
| Aspect | TASK/BUG | SPIKE |
|---|---|---|
| TDD checkpoints | Required | Not enforced |
| Code review | Required (≥90) | Not required |
| Commits | To feature branch | To spike branch |
| WORKLOG | WORKLOG.md | WORKLOG-N.md |
| Branch merge | Yes (to develop) | Never |
User: /implement 005
AI: Issue 005 (spike): "GraphQL vs REST for our API?"
Which plan do you want to explore?
1. PLAN-1.md: GraphQL with Apollo Server
2. PLAN-2.md: REST with Express
User: 1
AI: Creating branch spike/005/plan-1...
> ⚠️ SPIKE EXPLORATION
> Code will be committed to spike branch, not merged to main.
> Track discoveries in WORKLOG-1.md.
Executing PLAN-1.md Phase 1: Setup
→ Installing Apollo Server...
→ Creating basic schema...
→ Updating WORKLOG-1.md
✓ Phase 1 complete (1.5 hours spent, 6.5 remaining)
Continue to Phase 2? (yes/no/stop)
Temporary scripts go in task directory:
pm/issues/001-user-auth/
├── TASK.md
├── PLAN.md
├── WORKLOG.md
└── scripts/
├── generate-test-users.sh
├── migrate-passwords.js
└── debug-jwt-validation.js
Why: Easy cleanup, clear context, no root clutter.
Root scripts/: Only for universal utilities used across tasks.
| Mode | Command | Behavior |
|---|---|---|
| Specific | /implement 001 1.1 | Execute single phase |
| Next | /implement 001 --next | Find first uncompleted |
| Full | /implement 001 --full | Execute all remaining phases |
| Auto | /implement --next | Auto-detect issue + next |
--full mode requirements:
User: /implement 001 --next
AI: Next: 1.RED - Write failing tests for user login
Proceed? (yes/no)
User: yes
AI: Spawning test-engineer...
→ Tests written (8 test cases)
→ Running tests...
→ [RED CHECKPOINT] 8 tests FAILED ✓
✓ Phase 1.RED complete
Next: /implement 001 --next
| Error | Resolution |
|---|---|
| Issue not found | Check pm/issues/{ID}-*/ exists |
| PLAN.md missing | Run /plan {ID} first |
| Unknown type | Verify TASK.md/BUG.md/SPIKE.md exists |
| Spike no plans | Run /plan ### to create plans |
| Phase complete | Use --next for next phase |
/issue → /plan ### → /implement ### → /complete ### → /branch merge
SPIKE flow:
/issue → /plan ### → /implement ### → /complete ###
↓
(creates spike branch)
↓
(never merges to develop)