Task Implementation
Overview
You are helping a developer implement a specific task from a task list generated by /skill:specs-kit-spec-to-tasks.
This command follows a focused workflow optimized for single-task implementation.
Usage
/skill:specs-kit-task-implementation --task=task-name
Arguments
| Argument |
Required |
Description |
--task |
Yes |
Task file path (e.g., docs/specs/XXX-feature/tasks/TASK-001.md) |
--spec |
No |
Path to spec folder |
Examples
Basic Usage
/skill:specs-kit-task-implementation --task=docs/specs/001-feature/tasks/TASK-001.md
Auto-Detect Spec from Branch
/skill:specs-kit-task-implementation --task=TASK-003
Inputs
Determine the task to implement from the invocation context:
- when driven by the loop, the task is provided in the
<task> block of the prompt;
- when invoked directly, the task path (
--task=) and optional spec folder (--spec=) arrive as skill arguments.
Resolve, in order:
task → the task file path (required)
spec → the spec folder path (optional; derived from the task path when absent)
If any required input is missing or ambiguous, ask the user via ask_user_question.
What this task may not change
The spec's requirement document and everything under its contracts/ folder
state what this implementation is measured against, so they are read-only here:
an attempt that rewrites one is refused by the loop, costs an attempt, and comes
back naming the file. When the code cannot honour them — the requirement is
impossible, contradictory, or the contract prescribes something that does not
work — say so in the implementation summary and leave the document untouched.
That is the channel that leads to a decision taken outside this session; editing
the document until it agrees with the code closes the mismatch for every later
reader without anyone deciding anything.
Working documents (decision-log.md, the task file, the technical plan, README
and architecture notes) stay writable as before.
Action Routing
The --action argument determines the workflow path:
| Action |
Workflow |
Description |
| (default) |
T-1 → T-7 |
Full implementation workflow |
cleanup |
T-7 only |
Jump directly to post-review code cleanup |
Resolve --action from the skill arguments:
- If absent → proceed with the full implementation workflow (T-1 through T-6, T-7 optional)
- If
cleanup → skip to T-7: Code Cleanup directly, using the provided --task= path
When routing to T-7 directly, still perform T-7.1: Verify Review Status to confirm the task is in reviewed state before executing cleanup.
Task Mode Detection
This command ONLY operates in Task Mode. If no --task= parameter is provided, inform the user that they should use the spec-driven flow (/skill:specs-kit-brainstorm → /skill:specs-kit-spec-to-tasks) to produce a task first.
Core Principles
- Ask clarifying questions only when the task or codebase leaves ambiguity: default to executing the task as written; use ask_user_question only for real blockers, dependency conflicts, or multiple valid interpretations.
- Understand before acting: Read and comprehend task requirements first
- Read files identified by agents: When launching agents, ask them to return lists of the most important files to
read. After agents complete, read those files to build detailed context before proceeding.
- Follow acceptance criteria and DoD: Implement exactly what is specified in the task and complete the documented Definition of Done
- Use a checklist: Track all progress throughout
- No time estimates: DO NOT provide or request time estimates or implementation timelines at any phase
Workflow: Task Implementation (10 Steps)
This command implements a specific task following a focused workflow:
- T-1: Task Identification
- T-2: Git State Check
- T-3: Dependency Check
- T-3.5: Codebase Graph Validation
- T-3.6: Contract Validation
- T-3.7: Review Feedback Check
- T-4: Implementation
- T-5: Verification
- T-6: Task Completion
- T-7: Code Cleanup (Post-Review)
T-1: Task Identification
Goal: Extract and validate the task from the task list
Actions:
(Argument parsing completed in Phase 0)
Read the task file and extract:
- Task ID and title from YAML frontmatter
- Description
- Acceptance criteria
- Definition of Ready (DoR) and Definition of Done (DoD) sections
- Dependencies from YAML frontmatter
- Reference to specification file
imp-requirements and ac-mapping from frontmatter — which spec ACs this task implements
- If either section is missing, stop and instruct the user to update the task document before implementation
**Spec Traceability Gate **:
- If the task file has
spec reference, read the spec file to get full context:
- Load the spec's acceptance criteria list with their
[IMP]/[SEF]/[EXT] taxonomy
- Identify which ACs this task covers (from
ac-mapping)
- Identify which
[IMP] ACs remain for other tasks
- Display to implementator:
Task Traceability Context:
- This task: TASK-XXX — "[title]"
- Implements Spec ACs: [ac-mapping, e.g., AC-1, AC-3]
- Corresponding REQ-IDs: [imp-requirements, e.g., REQ-001, REQ-003]
Full Specification Context:
- Total spec ACs: N ([I] implementable / [S] side-effect / [E] external)
- This task covers: X/[I] implementable criteria
- Remaining [IMP] criteria will be covered by: [list other tasks from task list]
- Primary bounded context: [from spec's Bounded Context Impact Statement, if present]
- If the task has a Cross-Boundary Warning section: read it and note the risk level before proceeding
T-2: Git State Check
Goal: Validate DoR items related to repository state and baseline quality before implementation
Actions:
- Check for uncommitted changes FIRST:
- Run
git status --porcelain to check for uncommitted changes
- If there are untracked files, staged changes, or unstaged modifications:
- Present the user with the specific changes found
- Ask via ask_user_question: "You have uncommitted changes. Please commit them before starting task implementation. Do you want to proceed anyway (not recommended) or commit first?"
- If user chooses to commit first, stop and wait for them to run
git commit
- If user proceeds anyway, document the uncommitted state and continue at user's risk
- Only proceed with implementation if no uncommitted changes exist OR user explicitly accepts the risk
- Run lint and tests (after git check passes):
- Treat these checks as explicit DoR validation for local readiness and baseline health.
- Detect available lint/test commands by checking
package.json (scripts), Makefile, pom.xml, build.gradle, pyproject.toml, build.gradle, pyproject.toml, composer.json, etc.
- Run lint first (e.g.,
npm run lint, make lint, ./mvnw checkstyle:check, ruff check .), then tests (e.g., npm test, make test, ./mvnw test -q, pytest, php artisan test)
- If lint or tests fail:
- Show the failing output to the user
- Ask via ask_user_question: "Lint/tests are failing. It is recommended to fix them before starting task implementation to avoid compounding issues. Do you want to fix them first (recommended) or proceed anyway?"
- If user chooses to fix first, stop and wait
- If user proceeds anyway, document the failures and continue at user's risk
- If no recognizable lint/test commands are found, skip this step and note it
- Only proceed if lint/tests pass OR user explicitly accepts the risk
T-3: Dependency Check
Goal: Validate DoR items related to task dependencies
Actions:
- Check if task has dependencies and compare them against the task's DoR section
- If dependencies exist:
- Read task list to check completion status
- If dependencies not completed:
- Ask user via ask_user_question: proceed anyway or complete dependencies first
- Record whether dependency-related DoR items are satisfied before implementation begins
- Proceed based on user decision
T-3.5: Codebase Graph Validation
Goal: Validate DoR technical context against actual codebase state
Actions:
Extract spec_id from task:
- Read
spec field from task frontmatter (e.g., docs/specs/001-feature-name/2026-03-07--feature-name.md)
- Extract spec folder path
Check for the codebase graph:
- Read
graphify-out/graph.json from the project root (produced by the
external graphify skill). It is the single codebase graph: there is no
per-spec projected file. Treat it as the only source — never hand-build or
supplement it from another tool.
- If missing or unreadable, skip validation with note: "No codebase graph found (graphify-out/graph.json), cannot validate dependencies — run /graphify "
If the graph exists:
- Extract task requirements from "Technical Context" or task description:
- Component references (services, repositories, controllers to use)
- API endpoints to integrate with
- Patterns to follow
- Validate each requirement directly against
graphify-out/graph.json:
- Confirm each referenced component exists as a node
- Confirm each referenced API endpoint exists
- Confirm each referenced pattern is present
Process validation results:
- If valid (no errors):
- Proceed with implementation, all dependencies exist
- Log: "Task validated against the codebase graph: All dependencies exist"
- If errors found:
- Present errors to user:
Task validation failed against the codebase graph:
Errors:
- Component UserService not found in codebase
- API /api/v1/payments not found, may need implementation
Options:
- "Proceed anyway" (implement missing components)
- "Update task" (remove/fix invalid dependencies)
- "Cancel" (fix task first, then implement)
- Ask user via ask_user_question how to proceed
- If warnings found:
- Present warnings but allow continuation
T-3.6: Contract Validation
Goal: Ensure interfaces and data structures are agreed upon before coding
Actions:
- Read the
expects and provides sections of the task
- Verify if the components mentioned in
expects are already implemented (check the codebase graph graphify-out/graph.json, or scan the codebase)
- If this is one of the first 3 tasks of the spec:
- Treat
provides as a proposal
- You may suggest changes to the proposed interface if implementation reveals a better way
- Document any changes in
decision-log.md
- If this is a later task:
- Treat
provides as a contract
- You MUST follow the agreed-upon interface to avoid breaking dependencies
- If a change is absolutely necessary, you MUST create a DEC entry in
decision-log.md justifying the break
T-3.7: Review Feedback Check
Goal: Ensure previous review failures are addressed
Actions:
- Check if a review report exists for this task:
docs/specs/[id]/tasks/TASK-XXX--review.md
- If it exists and status is NOT
passed:
- Read the "Required Fixes" and "Code Review Findings" sections
- Incorporate these requirements into your implementation plan
- Ensure every finding is addressed in the new implementation
T-4: Implementation
Goal: Execute the task requirements in the codebase
Actions:
- Explore the codebase to find relevant files and patterns
- Read the files identified by agents (if any)
- Create a detailed implementation plan with all necessary steps
- Implement the code changes:
- Create new files and directories as needed
- Modify existing files
- Follow project patterns and conventions
- Adhere to the functional specification and task description
- Ensure code is clean, well-documented, and follows best practices
- Use a checklist to track each step of the implementation
Decision velocity:
- After the initial codebase exploration (T-1 through T-3.7), make each design decision once
and move on — do not re-litigate the same trade-off across multiple rounds of internal
monologue
- When the task's Technical Context already documents a project pattern (e.g. "Entity uses
Lombok @Getter/@Setter"), follow it without debate unless the task's own ACs require
something different
- If a decision involves a genuine trade-off (factory vs builder, class-level vs targeted
setters), pick the option consistent with existing project conventions documented in the
task or the AGENTS.md, record it briefly, and proceed
- Limit re-reading of files: once a file has been read and its content is understood, refer
to it from memory unless a specific detail (line number, exact annotation value) must be
verified
T-5: Verification
Goal: Verify the implementation against acceptance criteria and DoD
Actions:
- Run the project's build/compile command to ensure no syntax errors
- Run relevant unit and integration tests:
- Identify existing tests for modified components
- Run them to ensure no regressions
- Create new tests for the implemented functionality:
- Follow the test instructions in the task description
- Use the project's testing framework and patterns
- Ensure high coverage of the new code
- Verify all acceptance criteria are met through manual or automated checks
- Verify all DoD items are satisfied
- If any verification fails, return to T-4 to fix the issues
T-6: Task Completion
Goal: Finalize the task and update status
Actions:
- Update the task file (
docs/specs/[id]/tasks/TASK-XXX.md):
- Check all acceptance criteria boxes:
- [x]
- Check all DoD boxes:
- [x]
- Set
status: implemented in frontmatter
- Set
implemented_date: YYYY-MM-DD
- Fill in
provides: in the frontmatter with the public API contracts that
downstream tasks depend on: factory methods, public constructors, domain methods,
new annotations, new test dependencies, and any other symbol a later task must
know to integrate correctly. Use one string per contract:provides:
- "Project.create(UUID organizationId, String name, String description, GitRepositoryReference gitRepository)"
- "Project.updateProfile(String name, String description) — bumps updatedAt"
- "@Searchable on Project.name — marker annotation, no behaviour"
- "Test dep: spring-boot-data-jpa-test (for @DataJpaTest in Spring Boot 4)"
- Add a summary of changes to the task file:
- Files created/modified
- New components and APIs
- Testing performed
- Synchronization:
- Run
/skill:specs-kit-sync [spec-folder] --kg-only --after-task=[TASK-ID] to update technical context
- Run
/skill:specs-kit-sync [spec-folder] --code-only to detect spec-to-code deviations
- Inform the user:
- Display a summary of the implementation
- Provide the command for review:
/skill:specs-kit-task-review --task=TASK-XXX
- Next Step: Run
/skill:specs-kit-task-review then Phase T-7 cleanup auto-activates
- Log completion of the task implementation workflow
T-7: Code Cleanup (Optional, Post-Review)
Goal: Cosmetic cleanup after review approval — the final step before completion.
Prerequisite: Task status is reviewed (review passed).
When to run: Automatically suggested after task-review passes. Skippable if user prefers manual cleanup.
Actions:
T-7.1: Verify Review Status
- Read the task file — confirm status is
reviewed or implemented
- Verify review report
TASK-XXX--review.md exists and is approved
- If not reviewed → stop and prompt user to run
/skill:specs-kit-task-review first
T-7.2: Identify Files to Clean
- Read
TASK-XXX--review.md for files created/modified
- Read task
provides field for file paths
- Build cleanup file list; categorize: source / test / config
T-7.3: Technical Debt Removal
Search with Grep for temporary/debug artifacts:
console.log, System.out.println, print(, // DEBUG:, // temp, // hack
- Resolved
TODO/FIXME comments (keep unresolved ones with context)
Remove confirmed debt. Document what was removed.
T-7.4: Import Optimization
- Discover and run the project's own import tooling from its configuration:
package.json scripts, Maven/Gradle plugins (e.g. Spotless), composer scripts, pyproject.toml ([tool.isort]/[tool.ruff]), .pre-commit-config.yaml
- If no tool is configured: manually remove unused imports
T-7.5: Code Formatting & Readability
- Discover and run the project's own formatter/linter from its configuration:
package.json scripts (format/lint), Maven/Gradle plugins (Spotless, Checkstyle), composer scripts, pyproject.toml ([tool.black]/[tool.ruff]), .pre-commit-config.yaml
- If no formatter is configured: fix indentation, break lines >120 chars, fix spacing
- Remove dead code only if obviously safe
T-7.6: Final Verification
- Run tests — must pass. If fail: stop, report, do NOT mark complete.
- Verify no logic or signature changes were introduced
- Update task status:
reviewed → completed
- Set
cleanup_date and completed_date in frontmatter
T-7.7: Summary
Report:
- Files cleaned
- Debt removed (what and where)
- Formatter/import tool used
- Status: completed
1---2name: specs-kit-task-implementation3description: Provides guided task implementation capability for executing specific tasks from a task list generated by spec-to-tasks. Use when implementing a specific task from a task list (use --task= prefix).4---56# Task Implementation78## Overview910You are helping a developer implement a specific task from a task list generated by `/skill:specs-kit-spec-to-tasks`.11This command follows a focused workflow optimized for single-task implementation.1213## Usage1415```bash16/skill:specs-kit-task-implementation --task=task-name17```1819## Arguments2021| Argument | Required | Description |22|----------|----------|-------------|23| `--task` | Yes | Task file path (e.g., docs/specs/XXX-feature/tasks/TASK-001.md) |24| `--spec` | No | Path to spec folder |2526## Examples2728### Basic Usage2930```bash31/skill:specs-kit-task-implementation --task=docs/specs/001-feature/tasks/TASK-001.md32```3334### Auto-Detect Spec from Branch3536```bash37/skill:specs-kit-task-implementation --task=TASK-00338```3940## Inputs4142Determine the task to implement from the invocation context:43- when driven by the loop, the task is provided in the `<task>` block of the prompt;44- when invoked directly, the task path (`--task=`) and optional spec folder (`--spec=`) arrive as skill arguments.4546Resolve, in order:47- `task` → the task file path (required)48- `spec` → the spec folder path (optional; derived from the task path when absent)4950If any required input is missing or ambiguous, ask the user via ask_user_question.5152## What this task may not change5354The spec's requirement document and everything under its `contracts/` folder55state what this implementation is measured against, so they are read-only here:56an attempt that rewrites one is refused by the loop, costs an attempt, and comes57back naming the file. When the code cannot honour them — the requirement is58impossible, contradictory, or the contract prescribes something that does not59work — say so in the implementation summary and leave the document untouched.60That is the channel that leads to a decision taken outside this session; editing61the document until it agrees with the code closes the mismatch for every later62reader without anyone deciding anything.6364Working documents (`decision-log.md`, the task file, the technical plan, README65and architecture notes) stay writable as before.6667## Action Routing6869The `--action` argument determines the workflow path:7071| Action | Workflow | Description |72|--------|----------|-------------|73| *(default)* | T-1 → T-7 | Full implementation workflow |74| `cleanup` | T-7 only | Jump directly to post-review code cleanup |7576Resolve `--action` from the skill arguments:77- If absent → proceed with the full implementation workflow (T-1 through T-6, T-7 optional)78- If `cleanup` → skip to **T-7: Code Cleanup** directly, using the provided `--task=` path7980When routing to T-7 directly, still perform **T-7.1: Verify Review Status** to confirm the task is in `reviewed` state before executing cleanup.8182## Task Mode Detection8384This command ONLY operates in Task Mode. If no `--task=` parameter is provided, inform the user that they should use the spec-driven flow (`/skill:specs-kit-brainstorm` → `/skill:specs-kit-spec-to-tasks`) to produce a task first.8586## Core Principles8788- **Ask clarifying questions only when the task or codebase leaves ambiguity**: default to executing the task as written; use ask_user_question only for real blockers, dependency conflicts, or multiple valid interpretations.89- **Understand before acting**: Read and comprehend task requirements first90- **Read files identified by agents**: When launching agents, ask them to return lists of the most important files to91 read. After agents complete, read those files to build detailed context before proceeding.92- **Follow acceptance criteria and DoD**: Implement exactly what is specified in the task and complete the documented Definition of Done93- **Use a checklist**: Track all progress throughout94- **No time estimates**: DO NOT provide or request time estimates or implementation timelines at any phase9596---9798## Workflow: Task Implementation (10 Steps)99100This command implements a specific task following a focused workflow:101- T-1: Task Identification102- T-2: Git State Check103- T-3: Dependency Check104- T-3.5: Codebase Graph Validation105- T-3.6: Contract Validation106- T-3.7: Review Feedback Check107- T-4: Implementation108- T-5: Verification109- T-6: Task Completion110- T-7: Code Cleanup (Post-Review)111112---113114## T-1: Task Identification115116**Goal**: Extract and validate the task from the task list117118**Actions**:1191201. (Argument parsing completed in Phase 0)1212. Read the task file and extract:122 - Task ID and title from YAML frontmatter123 - Description124 - Acceptance criteria125 - Definition of Ready (DoR) and Definition of Done (DoD) sections126 - Dependencies from YAML frontmatter127 - Reference to specification file128 - `imp-requirements` and `ac-mapping` from frontmatter — which spec ACs this task implements129 - If either section is missing, stop and instruct the user to update the task document before implementation1301313. **Spec Traceability Gate **:132 - If the task file has `spec` reference, read the spec file to get full context:133 - Load the spec's acceptance criteria list with their `[IMP]`/`[SEF]`/`[EXT]` taxonomy134 - Identify which ACs this task covers (from `ac-mapping`)135 - Identify which `[IMP]` ACs remain for other tasks136 - Display to implementator:137 ```138 Task Traceability Context:139 - This task: TASK-XXX — "[title]"140 - Implements Spec ACs: [ac-mapping, e.g., AC-1, AC-3]141 - Corresponding REQ-IDs: [imp-requirements, e.g., REQ-001, REQ-003]142 143 Full Specification Context:144 - Total spec ACs: N ([I] implementable / [S] side-effect / [E] external)145 - This task covers: X/[I] implementable criteria146 - Remaining [IMP] criteria will be covered by: [list other tasks from task list]147 - Primary bounded context: [from spec's Bounded Context Impact Statement, if present]148 ```149 - If the task has a **Cross-Boundary Warning** section: read it and note the risk level before proceeding150151---152153## T-2: Git State Check154155**Goal**: Validate DoR items related to repository state and baseline quality before implementation156157**Actions**:1581591. **Check for uncommitted changes FIRST**:160 - Run `git status --porcelain` to check for uncommitted changes161 - If there are untracked files, staged changes, or unstaged modifications:162 - Present the user with the specific changes found163 - Ask via ask_user_question: "You have uncommitted changes. Please commit them before starting task implementation. Do you want to proceed anyway (not recommended) or commit first?"164 - If user chooses to commit first, stop and wait for them to run `git commit`165 - If user proceeds anyway, document the uncommitted state and continue at user's risk166 - Only proceed with implementation if no uncommitted changes exist OR user explicitly accepts the risk1672. **Run lint and tests** (after git check passes):168 - Treat these checks as explicit DoR validation for local readiness and baseline health.169 - Detect available lint/test commands by checking `package.json` (scripts), `Makefile`, `pom.xml`, `build.gradle`, `pyproject.toml`, `build.gradle`, `pyproject.toml`, `composer.json`, etc.170 - Run lint first (e.g., `npm run lint`, `make lint`, `./mvnw checkstyle:check`, `ruff check .`), then tests (e.g., `npm test`, `make test`, `./mvnw test -q`, `pytest`, `php artisan test`)171 - If lint or tests fail:172 - Show the failing output to the user173 - Ask via ask_user_question: "Lint/tests are failing. It is recommended to fix them before starting task implementation to avoid compounding issues. Do you want to fix them first (recommended) or proceed anyway?"174 - If user chooses to fix first, stop and wait175 - If user proceeds anyway, document the failures and continue at user's risk176 - If no recognizable lint/test commands are found, skip this step and note it177 - Only proceed if lint/tests pass OR user explicitly accepts the risk178179---180181## T-3: Dependency Check182183**Goal**: Validate DoR items related to task dependencies184185**Actions**:1861871. Check if task has dependencies and compare them against the task's DoR section1882. If dependencies exist:189 - Read task list to check completion status190 - If dependencies not completed:191 - Ask user via ask_user_question: proceed anyway or complete dependencies first1923. Record whether dependency-related DoR items are satisfied before implementation begins1934. Proceed based on user decision194195---196197## T-3.5: Codebase Graph Validation198199**Goal**: Validate DoR technical context against actual codebase state200201**Actions**:2022031. **Extract spec_id from task**:204 - Read `spec` field from task frontmatter (e.g., `docs/specs/001-feature-name/2026-03-07--feature-name.md`)205 - Extract spec folder path2062072. **Check for the codebase graph**:208 - Read `graphify-out/graph.json` from the project root (produced by the209 external graphify skill). It is the single codebase graph: there is no210 per-spec projected file. Treat it as the only source — never hand-build or211 supplement it from another tool.212 - If missing or unreadable, skip validation with note: "No codebase graph found (graphify-out/graph.json), cannot validate dependencies — run /graphify <project-root>"2132143. **If the graph exists**:215 - Extract task requirements from "Technical Context" or task description:216 - Component references (services, repositories, controllers to use)217 - API endpoints to integrate with218 - Patterns to follow219 - Validate each requirement directly against `graphify-out/graph.json`:220 - Confirm each referenced component exists as a node221 - Confirm each referenced API endpoint exists222 - Confirm each referenced pattern is present2232244. **Process validation results**:225 - **If valid** (no errors):226 - Proceed with implementation, all dependencies exist227 - Log: "Task validated against the codebase graph: All dependencies exist"228 - **If errors found**:229 - Present errors to user:230 ```231 Task validation failed against the codebase graph:232 Errors:233 - Component UserService not found in codebase234 - API /api/v1/payments not found, may need implementation235236 Options:237 - "Proceed anyway" (implement missing components)238 - "Update task" (remove/fix invalid dependencies)239 - "Cancel" (fix task first, then implement)240 ```241 - Ask user via ask_user_question how to proceed242 - **If warnings found**:243 - Present warnings but allow continuation244245---246247## T-3.6: Contract Validation248249**Goal**: Ensure interfaces and data structures are agreed upon before coding250251**Actions**:2522531. Read the `expects` and `provides` sections of the task2542. Verify if the components mentioned in `expects` are already implemented (check the codebase graph `graphify-out/graph.json`, or scan the codebase)2553. If this is one of the **first 3 tasks** of the spec:256 - Treat `provides` as a **proposal**257 - You may suggest changes to the proposed interface if implementation reveals a better way258 - Document any changes in `decision-log.md`2594. If this is a **later task**:260 - Treat `provides` as a **contract**261 - You MUST follow the agreed-upon interface to avoid breaking dependencies262 - If a change is absolutely necessary, you MUST create a DEC entry in `decision-log.md` justifying the break263264---265266## T-3.7: Review Feedback Check267268**Goal**: Ensure previous review failures are addressed269270**Actions**:2712721. Check if a review report exists for this task: `docs/specs/[id]/tasks/TASK-XXX--review.md`2732. If it exists and status is NOT `passed`:274 - Read the "Required Fixes" and "Code Review Findings" sections275 - Incorporate these requirements into your implementation plan276 - Ensure every finding is addressed in the new implementation277278---279280## T-4: Implementation281282**Goal**: Execute the task requirements in the codebase283284**Actions**:2852861. Explore the codebase to find relevant files and patterns2872. Read the files identified by agents (if any)2883. Create a detailed implementation plan with all necessary steps2894. Implement the code changes:290 - Create new files and directories as needed291 - Modify existing files292 - Follow project patterns and conventions293 - Adhere to the functional specification and task description2945. Ensure code is clean, well-documented, and follows best practices2956. Use a checklist to track each step of the implementation296297**Decision velocity**:298- After the initial codebase exploration (T-1 through T-3.7), make each design decision once299 and move on — do not re-litigate the same trade-off across multiple rounds of internal300 monologue301- When the task's Technical Context already documents a project pattern (e.g. "Entity uses302 Lombok @Getter/@Setter"), follow it without debate unless the task's own ACs require303 something different304- If a decision involves a genuine trade-off (factory vs builder, class-level vs targeted305 setters), pick the option consistent with existing project conventions documented in the306 task or the AGENTS.md, record it briefly, and proceed307- Limit re-reading of files: once a file has been read and its content is understood, refer308 to it from memory unless a specific detail (line number, exact annotation value) must be309 verified310311---312313## T-5: Verification314315**Goal**: Verify the implementation against acceptance criteria and DoD316317**Actions**:3183191. Run the project's build/compile command to ensure no syntax errors3202. Run relevant unit and integration tests:321 - Identify existing tests for modified components322 - Run them to ensure no regressions3233. Create new tests for the implemented functionality:324 - Follow the test instructions in the task description325 - Use the project's testing framework and patterns326 - Ensure high coverage of the new code3274. Verify all acceptance criteria are met through manual or automated checks3285. Verify all DoD items are satisfied3296. If any verification fails, return to T-4 to fix the issues330331---332333## T-6: Task Completion334335**Goal**: Finalize the task and update status336337**Actions**:3383391. Update the task file (`docs/specs/[id]/tasks/TASK-XXX.md`):340 - Check all acceptance criteria boxes: `- [x]`341 - Check all DoD boxes: `- [x]`342 - Set `status: implemented` in frontmatter343 - Set `implemented_date: YYYY-MM-DD`344 - Fill in `provides:` in the frontmatter with the public API contracts that345 downstream tasks depend on: factory methods, public constructors, domain methods,346 new annotations, new test dependencies, and any other symbol a later task must347 know to integrate correctly. Use one string per contract:348 ```yaml349 provides:350 - "Project.create(UUID organizationId, String name, String description, GitRepositoryReference gitRepository)"351 - "Project.updateProfile(String name, String description) — bumps updatedAt"352 - "@Searchable on Project.name — marker annotation, no behaviour"353 - "Test dep: spring-boot-data-jpa-test (for @DataJpaTest in Spring Boot 4)"354 ```3552. Add a summary of changes to the task file:356 - Files created/modified357 - New components and APIs358 - Testing performed3593. **Synchronization**:360 - Run `/skill:specs-kit-sync [spec-folder] --kg-only --after-task=[TASK-ID]` to update technical context361 - Run `/skill:specs-kit-sync [spec-folder] --code-only` to detect spec-to-code deviations3624. Inform the user:363 - Display a summary of the implementation364 - Provide the command for review: `/skill:specs-kit-task-review --task=TASK-XXX`365 - **Next Step**: Run `/skill:specs-kit-task-review` then Phase T-7 cleanup auto-activates3665. Log completion of the task implementation workflow367368---369370## T-7: Code Cleanup (Optional, Post-Review)371372**Goal**: Cosmetic cleanup after review approval — the final step before completion.373374**Prerequisite**: Task status is `reviewed` (review passed).375376**When to run**: Automatically suggested after task-review passes. Skippable if user prefers manual cleanup.377378**Actions**:379380### T-7.1: Verify Review Status3813821. Read the task file — confirm status is `reviewed` or `implemented`3832. Verify review report `TASK-XXX--review.md` exists and is approved3843. If not reviewed → stop and prompt user to run `/skill:specs-kit-task-review` first385386### T-7.2: Identify Files to Clean3873881. Read `TASK-XXX--review.md` for files created/modified3892. Read task `provides` field for file paths3903. Build cleanup file list; categorize: source / test / config391392### T-7.3: Technical Debt Removal393394Search with Grep for temporary/debug artifacts:395- `console.log`, `System.out.println`, `print(`, `// DEBUG:`, `// temp`, `// hack`396- Resolved `TODO`/`FIXME` comments (keep unresolved ones with context)397398Remove confirmed debt. Document what was removed.399400### T-7.4: Import Optimization4014021. Discover and run the project's own import tooling from its configuration:403 - `package.json` scripts, Maven/Gradle plugins (e.g. Spotless), `composer` scripts, `pyproject.toml` (`[tool.isort]`/`[tool.ruff]`), `.pre-commit-config.yaml`4042. If no tool is configured: manually remove unused imports405406### T-7.5: Code Formatting & Readability4074081. Discover and run the project's own formatter/linter from its configuration:409 - `package.json` scripts (`format`/`lint`), Maven/Gradle plugins (Spotless, Checkstyle), `composer` scripts, `pyproject.toml` (`[tool.black]`/`[tool.ruff]`), `.pre-commit-config.yaml`4102. If no formatter is configured: fix indentation, break lines >120 chars, fix spacing4113. Remove dead code only if obviously safe412413### T-7.6: Final Verification4144151. Run tests — must pass. If fail: stop, report, do NOT mark complete.4162. Verify no logic or signature changes were introduced4173. Update task status: `reviewed` → `completed`4184. Set `cleanup_date` and `completed_date` in frontmatter419420### T-7.7: Summary421422Report:423- Files cleaned424- Debt removed (what and where)425- Formatter/import tool used426- Status: completed