skills/implement-phase/SKILL.md
Execute a single phase from an implementation plan with all quality gates. This skill is the unit of work for implement-plan, handling implementation, verification, code review, ADR compliance, and plan synchronization for ONE phase. Triggers when implement-plan delegates a phase, or manually with "/implement-phase" and a phase reference.
npx skillsauth add mhylle/claude-skills-collection implement-phaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Execute a single phase from an implementation plan with comprehensive quality gates. Designed to be called by implement-plan, but can also be invoked directly.
This session is an orchestrator. Never implement code directly.
| DO (orchestrator) | DON'T (direct implementation) | |---|---| | Spawn subagents to write code | Write code yourself | | Spawn subagents to create files | Use Write/Edit tools directly | | Spawn subagents to run tests | Run tests yourself | | Spawn subagents to fix issues | Fix code yourself | | Read files to understand context | Read files to copy/paste code | | Track progress with Task tools | Implement while tracking | | Coordinate and delegate | Do the work yourself |
Violations: using Write/Edit/NotebookEdit directly, creating files without spawning a subagent, fixing code without spawning a subagent, running implementation commands directly.
Why orchestrate?
Subagent communication protocol → references/subagent-protocol.md. Every subagent prompt must include a response-format block demanding terse STATUS/FILES/ERRORS output and disk-based logs for large output. Verbose subagent responses are the single biggest context waster this skill faces.
Steps 1–8 execute as one continuous operation. The orchestrator does not pause between them.
current_step = 1
while current_step <= 8:
result = execute_step(current_step)
if result == PASS:
current_step += 1 # AUTO-CONTINUE, no user pause
elif result == FAIL:
fix_and_retry(current_step) # Stay on step, spawn fix subagent, retry
elif result == BLOCKED:
return BLOCKED # Only valid early exit
return COMPLETE # Only stop here (after Step 8)
The only valid pause points are:
Everything else is a fix loop, not a pause. Verification failed → spawn fix subagent → re-run → PASS → continue. Code review returned PASS_WITH_NOTES → spawn fix subagent → re-run → PASS → continue. None of these require user input; they require retries.
After each step, output a progress tracker and continue. Example after Step 4:
┌─────────────────────────────────────────┐
│ PROGRESS: Step 4 → Step 5 │
├─────────────────────────────────────────┤
│ ✅ Step 1: Implementation [DONE] │
│ ✅ Step 2: Exit Conditions [DONE] │
│ ✅ Step 3: Integration Test [DONE] │
│ ✅ Step 4: Code Review [DONE] │
│ ⏳ Step 5: ADR Compliance [CURRENT] │
│ ⬚ Step 6: Plan Sync [PENDING] │
│ ⬚ Step 7: Prompt Archival [PENDING] │
│ ⬚ Step 8: Completion Report [PENDING] │
├─────────────────────────────────────────┤
│ NEXT ACTION: Check ADR compliance now │
└─────────────────────────────────────────┘
NEXT ACTION must describe executing the next step, not "waiting for user confirmation." Any tracker whose NEXT ACTION says otherwise (before Step 8) is a contract violation.
Self-check after a skill invocation (like code-review):
A blocker is something you cannot fix autonomously. Do not stop for fixable issues.
Valid blockers:
| Blocker | Example | |---|---| | Permission denied | Subagent cannot write to a protected directory | | Infrastructure unavailable | Cannot reach required inference server | | Missing credentials | API key not configured, auth token expired | | External service down | Third-party API returning 503 | | Ambiguous requirements | Plan says "integrate with payment system" but doesn't specify which | | Destructive operation | Phase requires dropping a production database |
NOT blockers — fix these yourself: test fails, lint errors, build errors, type errors, code-review feedback, API returning an error, UI element not found.
When you hit a genuine blocker:
⛔ BLOCKED: [brief description]
Phase: [N] - [Name]
Step: [current step]
Blocker Type: [Permission | Infrastructure | Credentials | External | Ambiguous | Destructive]
Details:
[what failed and why]
What I need:
[specific action from user]
Options:
A) [resolve and continue]
B) [skip this verification and proceed with risk]
C) [abort phase]
After the user resolves, resume from the blocked step (not Step 1).
Non-negotiable — a phase cannot complete until all are satisfied.
| Condition | Requirement | Why | |---|---|---| | verification-loop PASS | All 6 checks pass (Build, Type, Lint, Test, Security, Diff) | Code must compile, type-check, pass linting, tests, and security | | Integration tests PASS | All API/UI tests pass | Feature must work end-to-end | | Code review PASS | Clean PASS status (not PASS_WITH_NOTES) | No outstanding issues | | All recommendations fixed | Every recommendation addressed | Recommendations are blocking, not optional | | ADR compliance PASS | Follows existing ADRs, new decisions documented | Architectural consistency | | Plan verified | All work items confirmed complete | Specification fulfilled |
Why recommendations are mandatory, not "nice to have":
The only acceptable Step 4 outcome is clean PASS.
Plan Path: [path to plan file]
Phase: [number or name]
Task ID: [from implement-plan's TaskList]
Prompt Path: [optional - path to pre-generated prompt from prompt-generator]
Changed Files: [optional - auto-detected if not provided]
Skip Steps: [optional - list of steps to skip, for testing]
TDD Mode: [enabled/disabled - see references/tdd-mode.md]
Coverage Threshold: [percentage - default 80%, applies when TDD enabled]
If a Prompt Path is provided (from prompt-generator):
implement-plan (orchestrates full plan)
│
└── implement-phase (this skill — one phase at a time)
│
├── 1. Implementation (spawn subagents)
├── 2. Exit Condition Verification (verification-loop skill)
├── 3. Automated Integration Testing (API or Playwright)
├── 4. Code Review (code-review skill)
├── 5. ADR Compliance Check
├── 6. Plan Synchronization
├── 7. Prompt Archival (if prompt provided)
└── 8. Phase Completion Report
Full subagent-spawning patterns and per-step output formats live in references/step-details.md. Read that file when you're about to execute a step. Summary here:
Spawn test subagents first (verification-first pattern), then implementation subagents with a coding-standards pointer embedded. Monitor, collect changed files. If TDD mode is enabled, the order reverses and adds a RED → GREEN → REFACTOR cycle — see references/tdd-mode.md.
Output: IMPLEMENTATION_STATUS, FILES_CREATED/MODIFIED, TEST_RESULTS. Gate: PASS. Next: Step 2.
Invoke the verification-loop skill. It runs 6 checks (Build, Type, Lint, Test, Security, Diff).
Output: VERIFICATION_LOOP_STATUS, per-check results. Gate: all 6 PASS. Next: Step 3.
You are the tester. Not the user. API → curl/httpie/fetch subagent. Web UI → browser-verification-agent (one test scenario per spawn). CLI → execute and verify output. Database → query and verify.
Output: aggregated INTEGRATION_TEST_STATUS, pass/fail counts, evidence paths. Gate: PASS. Next: Step 4.
Invoke the code-review skill with phase context. Clean PASS is required; PASS_WITH_NOTES and NEEDS_CHANGES both require fix subagents and re-review (max 3 retries).
Output: CODE_REVIEW_STATUS, blocking issues, recommendations. Gate: clean PASS. Next: Step 5.
Read docs/decisions/INDEX.md, check against applicable ADRs, invoke the adr skill if new decisions need documentation.
Output: ADR_COMPLIANCE_STATUS, applicable ADRs, any new ADR numbers. Gate: PASS. Next: Step 6.
Verify all work items completed, add ADR references, note deviations. Per ADR-0001, plans are specification documents — progress lives in Task tools (TaskUpdate), not checkbox edits.
Output: PLAN_SYNC_STATUS, work-items count. Gate: PASS. Next: Step 7.
If a prompt file was used, move it to docs/prompts/completed/. If none, mark skipped.
Output: PROMPT_ARCHIVAL_STATUS. Gate: non-blocking (a failed archive logs but doesn't stop completion). Next: Step 8.
Final. Generate the summary (see references/step-details.md for the format), invoke continuous-learning to capture patterns, present to user, stop.
Some pipelines insert additional steps at specific points. See references/optional-steps.md for the full list and enablement mechanism. Currently supported:
security-review.Optional. When enabled (via plan metadata, --tdd flag, or global settings), Step 1 follows the RED → GREEN → REFACTOR cycle and a coverage-verification check is added. See references/tdd-mode.md for full details.
The pipeline is defined as an ordered list of steps:
PHASE_STEPS = [
{ name: "implementation", required: true, skill: null },
{ name: "exit_conditions", required: true, skill: null },
{ name: "integration_testing", required: true, skill: null },
{ name: "code_review", required: true, skill: "code-review" },
{ name: "adr_compliance", required: true, skill: "adr" },
{ name: "plan_sync", required: true, skill: null },
{ name: "prompt_archival", required: false, skill: null },
{ name: "completion_report", required: true, skill: null },
]
Adding a new step: define gate criteria, insert at the right position, implement the logic or delegate to a skill. Steps can be conditional (e.g., phase-type-based, metadata-flag-gated). Full step-config schema, gate-criteria field definitions, retry/timeout semantics, and worked examples for security-scan / performance-check / docs-update → references/phase-steps.md.
Step failures:
Retry limit: default 3 per step. Exhausted retries escalate:
⛔ PHASE BLOCKED: [Step Name] failed after 3 attempts
Last Error: [details]
Options:
A) Retry with different approach
B) Skip this step (if non-blocking)
C) Abort phase and return to plan
How should I proceed?
Blocker protocol (above): stop all pending work, preserve state for resume, report with full context, await decision.
# In the plan file
phase_config:
strict_mode: true # Fail on any warning
skip_steps: []
additional_steps: []
retry_limit: 3
tdd_mode: false
coverage_threshold: 80
# Global defaults (~/.claude/settings.json)
implement_phase:
default_retry_limit: 3
always_run_security: false
require_adr_for_decisions: true
default_tdd_mode: false
default_coverage_threshold: 80
From implement-plan (primary use):
Skill(skill="implement-phase"): Execute Phase 2 of the implementation plan.
Context:
- Plan: docs/plans/auth-implementation.md
- Phase: 2 (Authentication Service)
- Previous Phase Status: Complete
Execute all quality gates and return structured result.
Manual:
/implement-phase docs/plans/my-plan.md phase:3
Or interactively:
/implement-phase
> Which plan? docs/plans/auth-implementation.md
> Which phase? 2
When called by implement-plan, returns a structured PHASE_RESULT object with per-step status, files changed, test results, ADR info, and a ready_for_next flag. Full schema in references/return-value.md.
/clear or /compact.Future extensibility: the step design allows adding security-scan, performance-check, documentation-update, changelog-entry, and similar quality gates without modifying the core logic.
For implement-plan authors:
For direct users:
docs/decisions/INDEX.md available.For step developers:
required, whether it wraps a skill.references/step-details.md with the subagent pattern and references/phase-steps.md with the step's config entry.references/subagent-protocol.md — mandatory response-format block, concise-response examples, disk-based communication patterns, coding-standards pointer templatereferences/step-details.md — detailed subagent-spawning patterns and per-step output formats for all 8 default stepsreferences/tdd-mode.md — optional Step 1 inversion: RED → GREEN → REFACTOR cycle, TDD subagent prompts, coverage verificationreferences/optional-steps.md — Step 4.5 Security Review insertion point, enablement via plan metadata, per-phase overridesreferences/phase-steps.md — default pipeline table, step config schema, adding custom steps, conditional execution rules, step insertion pointsreferences/return-value.md — full PHASE_RESULT schema returned to implement-plan, status values per step, ready_for_next semanticstools
--- name: tt-workflow-build description: Tasktracker-native trigger for a PARALLEL build via the Claude Code Workflow tool. Thin by design — it does two things, then drives to done: (1) ensure a tasktracker project exists (use the existing one, or create one), then (2) start a dynamic `Workflow` that builds it, tracking the work in tasktracker and using the build + verify skills. It does NOT analyze parallelism up front, ask the user to choose a mode, hand back, or fall back to a sequential skil
tools
--- name: grumpy-reviewer description: A single grumpy, nitpicky structural code reviewer that runs as an isolated subagent and treats the code as third-party work submitted by a junior programmer for validation. It cares about exactly one thing — maintainability — judged through separation of concerns, service-oriented design, helper-method extraction, small files, and the rule of 7 (as any grouping nears 7 members, it pushes for sub-groupings). It is deliberately kept OUT of the implementation
development
--- name: tt-workflow-run description: Tasktracker-native autonomous build-loop orchestrator. Drives a first-class `workflow_run` end-to-end — create the run (Gate 1 lifecycle completeness + Gate 2 zero-defects-in), then loop while `getNextReadyTask(projectId)` returns a slice — `setActiveTask` → record a pre-slice `scanArchitectureDrift` baseline → delegate the slice to `/tt-implement-phase` (which does the code work, registers the architecture delta in-slice, and auto-logs defects/learnings/fr
tools
Tasktracker-native project-wide parallel audit using the Claude Code Workflow tool (dynamic workflows). Partitions a repo / backlog / architecture and fans out read-only agents (one per partition) that return schema-checked findings, aggregates them into a deduplicated, ranked risk register, and OPTIONALLY writes fixes back as tasks under a Bug Fix phase — with all tasktracker writes done by the PARENT, never the parallel agents (single global active-task pointer). Journaled and resumable, so a rate-limit or crash mid-audit resumes without re-running completed partitions. Use for large, embarrassingly-parallel, read/analyze-heavy jobs where each unit is self-contained and the output aggregates — audit every file/component for risk, find all architecture drift (scanArchitectureDrift) or duplicate tasks (detectDuplicates/auditDuplicates), per-file tech-debt sweep, test-coverage or security-surface scan across a whole project. Triggers on "/tt-workflow-audit", "audit the whole repo", "parallel audit", "scan every file/component", "find all drift/duplicates", "tech-debt sweep (tasktracker)", or any whole-project analyze-at-scale request inside a session with a tasktracker project. Prefer this over /codebase-audit or /code-quality-audit when the project is tracked in tasktracker AND you want the findings written back as tasks; prefer it over team-* modes when the units don't need to negotiate live (they just report).