Task Review
Verifies that implemented tasks meet specifications and pass code quality standards. This is the bridge between implementation and verification.
Overview
This command reviews a completed task to ensure:
- Task Implementation: The task was implemented according to its specifications
- Spec Compliance: The implementation aligns with the functional specification
- Code Quality: The code passes code review standards
- Acceptance Criteria: All acceptance criteria are met
- Definition of Done: The documented completion conditions are fully satisfied
Input: docs/specs/[id]/tasks/TASK-XXX.md (from /skill:specs-kit-spec-to-tasks)
Output: Review report with pass/fail status and findings
Workflow Position
Idea → Functional Specification → Tasks → Implementation → Review → Code Cleanup → Done
(brainstorm) (spec-to-tasks) (task-implementation) (task-review) (code-cleanup)
Usage
# Review a specific task
/skill:specs-kit-task-review docs/specs/001-user-auth/tasks/TASK-001.md
Arguments
| Argument |
Required |
Description |
--task |
No |
Task file path |
--spec |
No |
Path to spec folder |
Examples
Basic Usage
/skill:specs-kit-task-review docs/specs/001-user-auth/tasks/TASK-001.md
Using Spec Detection
/skill:specs-kit-task-review --task=TASK-001
Inputs
Determine the task to review 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)
--no-confirm → skip confirmation prompts when set
If any required input is missing or ambiguous, ask the user via ask_user_question.
Core Principles
- Thorough verification: Check every acceptance criterion and every DoD item
- Spec alignment: Ensure implementation matches functional requirements
- Code quality: Verify code passes review standards
- Evidence-based: Base findings on actual code, not assumptions
- Use a checklist: Track all progress throughout
- No time estimates: DO NOT provide or request time estimates
Phase 1: Task Analysis
Goal: Read and understand the task and its specifications
Actions:
- (Argument parsing completed in Phase 0)
- Read the task file (
docs/specs/[id]/tasks/TASK-XXX.md)
- Extract:
- Task ID and title
- Description
- Acceptance criteria
- Definition of Ready (DoR) and Definition of Done (DoD) sections
- Dependencies
- Reference to specification file
imp-requirements and ac-mapping from frontmatter — which spec ACs this task claims to implement
- If either section is missing, stop the review and require the task document to be updated before continuing
- Read the functional specification file (from task's spec reference)
- Verify both files exist and are valid
- If files not found, ask user for correct path via ask_user_question
Phase 2: Implementation Verification
Goal: Verify the task was implemented according to specifications
Actions:
Identify what files/components were created for this task:
- Check git diff to see what changed since task was started
- Look for new files matching the task scope
- Review implementation details
Verify implementation matches task description:
- Compare implemented functionality with task description
- Check if all described features are present
- Identify any deviations or missing parts
Document findings:
- What was implemented vs. what was specified
- Any deviations from the original plan
- Additional changes that were made
Read decision-log.md if exists:
- Check for
decision-log.md in the spec folder
- If file exists, read any DEC entries related to this task (TASK-XXX)
- Use decision context to understand WHY deviations were made
- Reference specific decision IDs when explaining deviations in findings
Verify test count (do not estimate):
- Count the actual
@Test (or language-equivalent) annotations in the task's test files:
run grep -r "@Test" src/test/ --include="*.java" | wc -l or the equivalent for the project language
- Report the exact count in the review; never guess or round
- If the count cannot be determined programmatically (non-standard test framework), state only
"tests pass" without a number, or use the count reported by the build output (e.g.
Tests run: N)
Phase 3: Acceptance Criteria and DoD Validation
Goal: Verify all acceptance criteria and DoD items are met
Actions:
List all acceptance criteria from the task file
List all DoD items from the task file
For each acceptance criterion and DoD item:
- Identify code/tests/review evidence that validate it
- Check if tests exist and pass when relevant
- Verify the requirement is actually met
Mark each item as:
- ✅ Met (with evidence)
- ❌ Not met (with explanation)
- ⚠️ Partially met (with details) — treated as FAILED for
review_status
Update traceability-matrix.md:
- Read
docs/specs/[id]/traceability-matrix.md
- For this task (TASK-XXX), update the matrix:
- Fill in "Test Files" column with test file names created for this task,
written as
path/to/file::name of the test when a specific case proves
the row. The loop checks these citations when the range closes: a file
that is not there, or a name that is not in it, is reported as a claim
the matrix cannot back
- Fill in "Code Files" column with source files created for this task
- Update "Status" to "Implemented" only for rows whose citation you have
actually read in the cited file; leave the rest "Pending"
- Save updated matrix back to
docs/specs/[id]/traceability-matrix.md
**BOUNDED CONTEXT ADHERENCE CHECK **:
- Read
docs/specs/ontology.md for bounded context definitions
- Determine the primary bounded context of the feature
- For each file modified/created in the implementation:
- Determine its bounded context from path conventions or ontology
- If DIFFERENT from the feature's primary context:
- Check if the task file has a "Cross-Boundary Warning" section
- If YES and justification is valid: note in review as "acknowledged cross-boundary"
- If YES but justification is weak: add
warning issue
- If NO warning section: add
blocking issue
- Why this matters: Tasks that silently cross bounded context boundaries are the #1 cause of architectural drift.
Phase 4: Specification Compliance Check
Goal: Ensure implementation aligns with functional specification AND verify task necessity
Actions:
Review the functional specification to verify compliance
Compare implementation against:
- User stories and use cases
- Business rules
- Integration requirements
- Data requirements
Identify any gaps or misalignments
Check if implementation introduces any out-of-scope changes
**SPEC FIDELITY CHECK **:
- Read the task's
imp-requirements and ac-mapping from frontmatter
- For each AC-ID in
ac-mapping:
- Verify the implementation actually satisfies the acceptance criterion
- Check the criterion's taxonomy in the spec:
[IMP], [SEF], or [EXT]
- If the task claims to implement
[SEF] or [EXT] criteria:
- Flag as "Task Over-Specification"
- If the task has NO
ac-mapping or imp-requirements:
- Flag as "Legacy Task — no traceability metadata"
Verify task necessity:
- Ask: "Is this task implementing a criterion that requires new code?"
- If ALL the task's ACs are
[SEF] or [EXT]:
- Flag as "Unnecessary Task — no implementation needed"
- If the task creates entities/structs NOT mentioned in the functional spec:
- Check
data-model.md for (derived) marking
- If NOT marked
(derived): Flag as "Invented Entity — not in spec"
Check for spec contradictions:
- If the implementation does something DIFFERENT from the spec (a
requirement, an acceptance criterion or an interface contract):
- Record it in the
spec_conflicts frontmatter list, one line per
conflict, naming the requirement and what the code does instead
- Check
decision-log.md for a DEC entry justifying the deviation.
A DEC whose Decided By is the implementation agent of this same
task does not justify anything: the session that deviated wrote
it. Only a DEC decided outside the task (operator, earlier plan,
change-spec) closes the conflict
- Never resolve a contradiction by rewording the requirement, the
contract or the criterion: those documents are what the work is
measured against, and the loop refuses attempts that rewrite them
- A conflict is never a "clarification item", a "wording tension" or a
note in the body. Either the code changes, or the requirement changes
through a decision taken outside this session — and until then the
conflict stays in
spec_conflicts, where the loop reads it
Phase 5: Convention Provenance Check
Goal: Verify that every convention the implementation relied on was
already documented in the project before this task started, and that the
agent did not silently invent new patterns that will be picked up as
"pre-existing" by downstream tasks.
The motivation is that decision-log.md entries whose Decided By field
is the implementation agent itself are not actually authoritative — the
reviewer cannot use them as evidence that a convention was followed if
the convention was created in the same pass. This phase rebuilds the
authority check from the source documents (architecture.md,
ontology.md, data-model.md, prior task files, and DEC entries with
a pre-existing Decided By).
Runs: Always, on every review (including --no-confirm reviews and
reviews driven by the loop). It is the cheapest check in the pipeline
and the one most often skipped by mistake.
Actions:
Build the set of pre-existing conventions:
- Read
architecture.md (the project architecture document, not the
spec's technical plan) and collect every architectural rule that
appears as a bullet, list item, or numbered item. Record the file's
Last Updated header — anything added later is not pre-existing.
- Read
ontology.md and collect every bounded-context definition,
glossary entry, and naming convention.
- Read
data-model.md and collect every invariant listed under
"Business invariants" / "Regole di business" / equivalent headings.
- Walk every DEC entry in
decision-log.md whose Decided By is
not the implementation agent for the current task. Mark them
pre-existing.
- Walk every DEC entry whose
Decided By is the implementation
agent. Mark them as "agent-claimed" — they are candidates to be
flagged unless the corresponding convention can be sourced from the
architecture / ontology / data-model docs above.
Enumerate the conventions the implementation introduced or relied on:
- For each file the implementation created or modified, read it and
list every non-trivial pattern: factory methods, builder APIs,
annotations used as markers, package layouts, naming conventions,
visibility choices, constructor signatures, JSON property names,
log message shapes, etc.
- For each pattern, note the file and line where it appears.
Cross-check each implementation pattern against the pre-existing set:
For every pattern from step 2, run these three questions in order:
a. Is the pattern already in architecture.md / ontology.md /
data-model.md as written before this task started? If yes:
✅ pre-existing, no issue.
b. Is the pattern backed by a DEC entry with Decided By ≠ this
implementation? If yes: ✅ pre-existing (the DEC predates the
task even though the implementation honours it), no issue.
c. Is the pattern only documented by a DEC entry whose Decided By
is the implementation itself (or by nothing at all)? If yes:
❌ invented-convention issue. Severity depends on impact:
- blocking if the convention is observable from outside the
task's own files (package name, public API shape, JSON
property, schema annotation that the OpenAPI contract picks up,
marker annotation other modules will import). Downstream tasks
will read this convention as "the way things are done" without
knowing it was invented this morning.
- warning if the convention is purely internal to the task's
own classes (private helper, package-private overload,
internal validation order). Document it but do not block.
- suggestion if the convention is cosmetic (comment style,
blank line placement, import ordering).
For every invented-convention finding, recommend a remediation:
- Promote to architecture: add a bullet to
architecture.md
§3.5 (or the equivalent Architectural Rules section) describing
the convention in the same style as the surrounding bullets.
Cite the DEC entry that introduced it. Until the bullet exists,
downstream tasks cannot rely on the convention.
- Or ratify via DEC: if the convention is too narrow to belong
in
architecture.md, add a new DEC entry with Decided By: User
or Decided By: Architecture review rather than leaving the
agent-claimed DEC in place. The reviewer should not sign off on
patterns that are only justified by an agent-claimed DEC.
- Or revert: if the convention is not actually necessary, change
the implementation to match an existing documented pattern and
drop the agent-claimed DEC.
Add the findings to issues with the same severity vocabulary
already used in this skill (blocking / warning / suggestion).
A blocking invented-convention is enough to flip
review_status to FAILED — the implementation passes its ACs but
leaves the codebase without an authority for a convention downstream
tasks will assume is canonical.
Cross-reference with Phase 4 (Spec Compliance): if the
implementation already added a DEC entry in decision-log.md to
justify the deviation, do NOT treat that DEC as automatic authority.
Re-apply the same three-question check to the DEC itself. A DEC
written by the implementation to justify its own deviation is
exactly the case this phase exists to catch.
Why this phase is mandatory: every task downstream of TASK-N depends
on TASK-N's output being consistent with project conventions. If TASK-N
invented a convention without documenting it in architecture.md, TASK-(N+1)
will adopt it without knowing it is one task old. Three tasks downstream
the convention looks "established", and removing it requires touching
every consumer. Catching it at the review of the task that introduced it
is the cheapest place to intervene.
Phase 6: Code Review
Goal: Verify code passes quality standards
Actions:
- Perform the code review focusing on:
- Architectural alignment
- Coding standards and patterns
- Security and performance
- Error handling and edge cases
- Maintainability and readability
- Document specific code findings (file, line, issue, recommendation)
Phase 7: Review Report Generation
Goal: Generate a summary of review findings and set status
Actions:
Calculate overall status — review_status takes one of two values and no
others:
PASSED: all ACs and DoD met, no critical code issue, no architectural drift
FAILED: anything else — an unmet or partially met AC, a DoD item left
open, a critical finding, a spec contradiction without a DEC, an
architectural drift or an impossible requirement
A finding too large for the next implementation pass is still FAILED: put
the escalation in the first issues entry rather than inventing a status
for it. Automation reads this field and understands nothing else.
One kind of finding has its own list. When what blocks the task is an action
only a person can perform — an account, a credential written into a vault, a
signature, a purchase, physical or console access — the verdict stays
FAILED and the finding goes into escalation, one line each. No
implementation pass can close it, so the loop ends that task on the first
entry and continues with the next one instead of spending its remaining
attempts reaching the same verdict. Use it only for that: a fix the next
implementation could make is an issues entry, not an escalation.
A non-blocking suggestion you route to a later task does not by itself flip
the verdict, but a suggestion a prior review routed to this task that the
implementation left unactioned is a blocking issue (FAILED) — unless a
task still in the range will cover it. A deferred fix with no later owner is
exactly the gap the review exists to catch.
Two things the loop decides, not you:
- a report with a non-empty
spec_conflicts is treated as FAILED
whatever review_status says, so raising a contradiction and passing it
in the same breath is not available
- a
routed entry aimed at a task that is not still pending inside the
range is refused and comes back as a rejection, so route only to a task
that will actually run
Generate review report (docs/specs/[id]/tasks/TASK-XXX--review.md):
Read the review template using this lookup order:
templates/task-review.md
templates/task-review.md inside the installed skill folder for non-Claude agents.
Fill in the gathered findings and save to the tasks directory.
The file must open with the YAML frontmatter block of the template,
before the first heading, carrying review_status, a one-line summary, an
issues list (issues: [] when the review passes), a spec_conflicts list
([] when nothing contradicts the spec), an escalation list ([] unless
the task needs an operator action) and an optional routed list.
Every required fix listed in the body has a matching issues entry: that
list is what the next implementation pass is given to work from.
Quote every value with double quotes. The values here are prose and
prose contains colons; an unquoted summary, issues entry or routed
text carrying a colon followed by a space is not valid YAML, and the loop
then has to salvage the verdict line by line.
routed carries fixes you defer to a later task, not this one: each entry is
{ to: "<task-id>", text: "<one-line fix>" }, and [] when there is
nothing to route. The loop feeds routed entries to the target task's prompt
automatically, so they survive between reviews instead of living only as
prose a later task would have to grep for.
The review template defines these sections:
| Section |
Purpose |
| Review Summary |
High-level status table (AC, DoD, Code Quality, Spec Compliance, Architecture) |
| Acceptance Criteria & DoD Results |
Per-criterion and per-item status with evidence |
| Code Review Findings |
Table of issues with severity, file, category, recommendation |
| Spec Compliance & Architectural Alignment |
Fidelity check, cross-boundary adherence, decision log, traceability update |
| Required Fixes |
Critical / Warnings / Suggestions tables |
| Next Steps |
Action by review status |
Update task status:
- Set
status: reviewed and reviewed_date: YYYY-MM-DD in the task
frontmatter if PASSED
- Leave the task status untouched if
FAILED: the report is the record of
what has to change
Skip this step entirely when an automated loop drives the review — it owns
the task frontmatter and writes it once the whole task is closed.
Synchronization:
- Run
/skill:specs-kit-sync [spec-folder] to synchronize all components
- Skip this step under an automated loop: synchronization is a phase of its
own there, and running it from inside the review doubles the work
Inform user:
- Display review summary and status
- Provide link to full review report
- If
PASSED, suggest running Phase T-7 cleanup in task-implementation
Phase 8: Report the convention provenance verdict explicitly
Goal: Make the Convention Provenance Check from Phase 5 visible in the
review summary, not buried in the issues table.
Runs: Always.
Actions:
In the review report's summary section, add a row to the standard
summary table:
| Convention provenance | ✅ All conventions pre-existing / ⚠️ N invented-convention findings / ❌ N blocking |
List every invented-convention finding by DEC ID and file in a
dedicated section after "Code Review Findings", titled
"Convention Provenance Findings". Each entry must include:
- The pattern (one sentence)
- Where it appears (file + line)
- Whether it is
blocking / warning / suggestion
- The proposed remediation (promote to architecture, ratify via DEC,
or revert)
The verdict participates in review_status:
- any
blocking invented-convention → FAILED
- only
warning / suggestion → still PASSED, but the report must
enumerate them
This rule mirrors the existing rule that an unmet AC flips the status
to FAILED. The motivation is the same: the implementation may have
shipped working code, but the loop cannot move on to the next task
while the codebase carries undocumented conventions that future tasks
will treat as canonical.
1---2name: specs-kit-task-review3description: Provides capability to verify that implemented tasks meet specifications and pass code review. Use when needing to validate a completed task from /skill:specs-kit-task-implementation against its specification.4---56# Task Review78Verifies that implemented tasks meet specifications and pass code quality standards. This is the bridge between implementation and verification.910## Overview1112This command reviews a completed task to ensure:131. **Task Implementation**: The task was implemented according to its specifications142. **Spec Compliance**: The implementation aligns with the functional specification153. **Code Quality**: The code passes code review standards164. **Acceptance Criteria**: All acceptance criteria are met175. **Definition of Done**: The documented completion conditions are fully satisfied1819**Input**: `docs/specs/[id]/tasks/TASK-XXX.md` (from /skill:specs-kit-spec-to-tasks)20**Output**: Review report with pass/fail status and findings2122### Workflow Position2324```25Idea → Functional Specification → Tasks → Implementation → Review → Code Cleanup → Done26 (brainstorm) (spec-to-tasks) (task-implementation) (task-review) (code-cleanup)27```2829## Usage3031```bash32# Review a specific task33/skill:specs-kit-task-review docs/specs/001-user-auth/tasks/TASK-001.md34```3536## Arguments3738| Argument | Required | Description |39|----------|----------|-------------|40| `--task` | No | Task file path |41| `--spec` | No | Path to spec folder |4243## Examples4445### Basic Usage4647```bash48/skill:specs-kit-task-review docs/specs/001-user-auth/tasks/TASK-001.md49```5051### Using Spec Detection5253```bash54/skill:specs-kit-task-review --task=TASK-00155```5657## Inputs5859Determine the task to review from the invocation context:60- when driven by the loop, the task is provided in the `<task>` block of the prompt;61- when invoked directly, the task path (`--task=`) and optional spec folder (`--spec=`) arrive as skill arguments.6263Resolve, in order:64- `task` → the task file path (required)65- `spec` → the spec folder path (optional; derived from the task path when absent)66- `--no-confirm` → skip confirmation prompts when set6768If any required input is missing or ambiguous, ask the user via ask_user_question.6970## Core Principles7172- **Thorough verification**: Check every acceptance criterion and every DoD item73- **Spec alignment**: Ensure implementation matches functional requirements74- **Code quality**: Verify code passes review standards75- **Evidence-based**: Base findings on actual code, not assumptions76- **Use a checklist**: Track all progress throughout77- **No time estimates**: DO NOT provide or request time estimates7879---8081## Phase 1: Task Analysis8283**Goal**: Read and understand the task and its specifications8485**Actions**:86871. (Argument parsing completed in Phase 0)882. Read the task file (`docs/specs/[id]/tasks/TASK-XXX.md`)893. Extract:90 - Task ID and title91 - Description92 - Acceptance criteria93 - Definition of Ready (DoR) and Definition of Done (DoD) sections94 - Dependencies95 - Reference to specification file96 - `imp-requirements` and `ac-mapping` from frontmatter — which spec ACs this task claims to implement97 - If either section is missing, stop the review and require the task document to be updated before continuing984. Read the functional specification file (from task's spec reference)995. Verify both files exist and are valid1006. If files not found, ask user for correct path via ask_user_question101102---103104## Phase 2: Implementation Verification105106**Goal**: Verify the task was implemented according to specifications107108**Actions**:1091101. Identify what files/components were created for this task:111 - Check git diff to see what changed since task was started112 - Look for new files matching the task scope113 - Review implementation details1141152. Verify implementation matches task description:116 - Compare implemented functionality with task description117 - Check if all described features are present118 - Identify any deviations or missing parts1191203. Document findings:121 - What was implemented vs. what was specified122 - Any deviations from the original plan123 - Additional changes that were made1241254. **Read decision-log.md if exists**:126 - Check for `decision-log.md` in the spec folder127 - If file exists, read any DEC entries related to this task (TASK-XXX)128 - Use decision context to understand WHY deviations were made129 - Reference specific decision IDs when explaining deviations in findings1301315. **Verify test count** (do not estimate):132 - Count the actual `@Test` (or language-equivalent) annotations in the task's test files:133 run `grep -r "@Test" src/test/ --include="*.java" | wc -l` or the equivalent for the project language134 - Report the exact count in the review; never guess or round135 - If the count cannot be determined programmatically (non-standard test framework), state only136 "tests pass" without a number, or use the count reported by the build output (e.g. `Tests run: N`)137138---139140## Phase 3: Acceptance Criteria and DoD Validation141142**Goal**: Verify all acceptance criteria and DoD items are met143144**Actions**:1451461. List all acceptance criteria from the task file1472. List all DoD items from the task file1483. For each acceptance criterion and DoD item:149 - Identify code/tests/review evidence that validate it150 - Check if tests exist and pass when relevant151 - Verify the requirement is actually met1524. Mark each item as:153 - ✅ Met (with evidence)154 - ❌ Not met (with explanation)155 - ⚠️ Partially met (with details) — treated as FAILED for `review_status`1561575. **Update traceability-matrix.md**:158 - Read `docs/specs/[id]/traceability-matrix.md`159 - For this task (TASK-XXX), update the matrix:160 - Fill in "Test Files" column with test file names created for this task,161 written as `path/to/file::name of the test` when a specific case proves162 the row. The loop checks these citations when the range closes: a file163 that is not there, or a name that is not in it, is reported as a claim164 the matrix cannot back165 - Fill in "Code Files" column with source files created for this task166 - Update "Status" to "Implemented" only for rows whose citation you have167 actually read in the cited file; leave the rest "Pending"168 - Save updated matrix back to `docs/specs/[id]/traceability-matrix.md`1691706. **BOUNDED CONTEXT ADHERENCE CHECK **:171 - Read `docs/specs/ontology.md` for bounded context definitions172 - Determine the primary bounded context of the feature173 - For each file modified/created in the implementation:174 - Determine its bounded context from path conventions or ontology175 - If DIFFERENT from the feature's primary context:176 - Check if the task file has a "Cross-Boundary Warning" section177 - If YES and justification is valid: note in review as "acknowledged cross-boundary"178 - If YES but justification is weak: add `warning` issue179 - If NO warning section: add `blocking` issue180 - **Why this matters**: Tasks that silently cross bounded context boundaries are the #1 cause of architectural drift.181182---183184## Phase 4: Specification Compliance Check185186**Goal**: Ensure implementation aligns with functional specification AND verify task necessity187188**Actions**:1891901. Review the functional specification to verify compliance1912. Compare implementation against:192 - User stories and use cases193 - Business rules194 - Integration requirements195 - Data requirements1963. Identify any gaps or misalignments1974. Check if implementation introduces any out-of-scope changes1981995. **SPEC FIDELITY CHECK **:200 - Read the task's `imp-requirements` and `ac-mapping` from frontmatter201 - For each AC-ID in `ac-mapping`:202 - Verify the implementation actually satisfies the acceptance criterion203 - Check the criterion's taxonomy in the spec: `[IMP]`, `[SEF]`, or `[EXT]`204 - **If the task claims to implement `[SEF]` or `[EXT]` criteria**: 205 - Flag as "Task Over-Specification"206 - **If the task has NO `ac-mapping` or `imp-requirements`**:207 - Flag as "Legacy Task — no traceability metadata"2082096. **Verify task necessity**:210 - Ask: "Is this task implementing a criterion that requires new code?"211 - If ALL the task's ACs are `[SEF]` or `[EXT]`: 212 - Flag as "Unnecessary Task — no implementation needed"213 - If the task creates entities/structs NOT mentioned in the functional spec:214 - Check `data-model.md` for `(derived)` marking215 - If NOT marked `(derived)`: Flag as "Invented Entity — not in spec"2162177. **Check for spec contradictions**:218 - If the implementation does something DIFFERENT from the spec (a219 requirement, an acceptance criterion or an interface contract):220 - Record it in the `spec_conflicts` frontmatter list, one line per221 conflict, naming the requirement and what the code does instead222 - Check `decision-log.md` for a DEC entry justifying the deviation.223 A DEC whose `Decided By` is the implementation agent of this same224 task does **not** justify anything: the session that deviated wrote225 it. Only a DEC decided outside the task (operator, earlier plan,226 change-spec) closes the conflict227 - Never resolve a contradiction by rewording the requirement, the228 contract or the criterion: those documents are what the work is229 measured against, and the loop refuses attempts that rewrite them230 - A conflict is never a "clarification item", a "wording tension" or a231 note in the body. Either the code changes, or the requirement changes232 through a decision taken outside this session — and until then the233 conflict stays in `spec_conflicts`, where the loop reads it234235---236237## Phase 5: Convention Provenance Check238239**Goal**: Verify that every convention the implementation relied on was240already documented in the project before this task started, and that the241agent did not silently invent new patterns that will be picked up as242"pre-existing" by downstream tasks.243244The motivation is that `decision-log.md` entries whose `Decided By` field245is the implementation agent itself are not actually authoritative — the246reviewer cannot use them as evidence that a convention was followed if247the convention was created in the same pass. This phase rebuilds the248authority check from the source documents (`architecture.md`,249`ontology.md`, `data-model.md`, prior task files, and DEC entries with250a pre-existing `Decided By`).251252**Runs**: Always, on every review (including `--no-confirm` reviews and253reviews driven by the loop). It is the cheapest check in the pipeline254and the one most often skipped by mistake.255256**Actions**:2572581. **Build the set of pre-existing conventions**:259260 - Read `architecture.md` (the project architecture document, not the261 spec's technical plan) and collect every architectural rule that262 appears as a bullet, list item, or numbered item. Record the file's263 `Last Updated` header — anything added later is not pre-existing.264 - Read `ontology.md` and collect every bounded-context definition,265 glossary entry, and naming convention.266 - Read `data-model.md` and collect every invariant listed under267 "Business invariants" / "Regole di business" / equivalent headings.268 - Walk every DEC entry in `decision-log.md` whose `Decided By` is269 **not** the implementation agent for the current task. Mark them270 pre-existing.271 - Walk every DEC entry whose `Decided By` **is** the implementation272 agent. Mark them as "agent-claimed" — they are candidates to be273 flagged unless the corresponding convention can be sourced from the274 architecture / ontology / data-model docs above.2752762. **Enumerate the conventions the implementation introduced or relied on**:277278 - For each file the implementation created or modified, read it and279 list every non-trivial pattern: factory methods, builder APIs,280 annotations used as markers, package layouts, naming conventions,281 visibility choices, constructor signatures, JSON property names,282 log message shapes, etc.283 - For each pattern, note the file and line where it appears.2842853. **Cross-check each implementation pattern against the pre-existing set**:286287 For every pattern from step 2, run these three questions in order:288289 a. **Is the pattern already in `architecture.md` / `ontology.md` /290 `data-model.md` as written before this task started?** If yes:291 ✅ pre-existing, no issue.292293 b. **Is the pattern backed by a DEC entry with `Decided By` ≠ this294 implementation?** If yes: ✅ pre-existing (the DEC predates the295 task even though the implementation honours it), no issue.296297 c. **Is the pattern only documented by a DEC entry whose `Decided By`298 is the implementation itself (or by nothing at all)?** If yes:299 ❌ **`invented-convention`** issue. Severity depends on impact:300 - **blocking** if the convention is observable from outside the301 task's own files (package name, public API shape, JSON302 property, schema annotation that the OpenAPI contract picks up,303 marker annotation other modules will import). Downstream tasks304 will read this convention as "the way things are done" without305 knowing it was invented this morning.306 - **warning** if the convention is purely internal to the task's307 own classes (private helper, package-private overload,308 internal validation order). Document it but do not block.309 - **suggestion** if the convention is cosmetic (comment style,310 blank line placement, import ordering).3113124. **For every `invented-convention` finding, recommend a remediation**:313314 - **Promote to architecture**: add a bullet to `architecture.md`315 §3.5 (or the equivalent Architectural Rules section) describing316 the convention in the same style as the surrounding bullets.317 Cite the DEC entry that introduced it. Until the bullet exists,318 downstream tasks cannot rely on the convention.319 - **Or ratify via DEC**: if the convention is too narrow to belong320 in `architecture.md`, add a new DEC entry with `Decided By: User`321 or `Decided By: Architecture review` rather than leaving the322 agent-claimed DEC in place. The reviewer should not sign off on323 patterns that are only justified by an agent-claimed DEC.324 - **Or revert**: if the convention is not actually necessary, change325 the implementation to match an existing documented pattern and326 drop the agent-claimed DEC.3273285. **Add the findings to `issues`** with the same severity vocabulary329 already used in this skill (`blocking` / `warning` / `suggestion`).330 A `blocking` `invented-convention` is enough to flip331 `review_status` to `FAILED` — the implementation passes its ACs but332 leaves the codebase without an authority for a convention downstream333 tasks will assume is canonical.3343356. **Cross-reference with Phase 4** (Spec Compliance): if the336 implementation already added a DEC entry in `decision-log.md` to337 justify the deviation, do NOT treat that DEC as automatic authority.338 Re-apply the same three-question check to the DEC itself. A DEC339 written by the implementation to justify its own deviation is340 exactly the case this phase exists to catch.341342**Why this phase is mandatory**: every task downstream of TASK-N depends343on TASK-N's output being consistent with project conventions. If TASK-N344invented a convention without documenting it in `architecture.md`, TASK-(N+1)345will adopt it without knowing it is one task old. Three tasks downstream346the convention looks "established", and removing it requires touching347every consumer. Catching it at the review of the task that introduced it348is the cheapest place to intervene.349350---351352## Phase 6: Code Review353354**Goal**: Verify code passes quality standards355356**Actions**:3573581. Perform the code review focusing on:359 - Architectural alignment360 - Coding standards and patterns361 - Security and performance362 - Error handling and edge cases363 - Maintainability and readability3642. Document specific code findings (file, line, issue, recommendation)365366---367368## Phase 7: Review Report Generation369370**Goal**: Generate a summary of review findings and set status371372**Actions**:3733741. **Calculate overall status** — `review_status` takes one of two values and no375 others:376 - `PASSED`: all ACs and DoD met, no critical code issue, no architectural drift377 - `FAILED`: anything else — an unmet or partially met AC, a DoD item left378 open, a critical finding, a spec contradiction without a DEC, an379 architectural drift or an impossible requirement380381 A finding too large for the next implementation pass is still `FAILED`: put382 the escalation in the first `issues` entry rather than inventing a status383 for it. Automation reads this field and understands nothing else.384385 One kind of finding has its own list. When what blocks the task is an action386 only a person can perform — an account, a credential written into a vault, a387 signature, a purchase, physical or console access — the verdict stays388 `FAILED` and the finding goes into `escalation`, one line each. No389 implementation pass can close it, so the loop ends that task on the first390 entry and continues with the next one instead of spending its remaining391 attempts reaching the same verdict. Use it only for that: a fix the next392 implementation could make is an `issues` entry, not an escalation.393394 A non-blocking suggestion you route to a *later* task does not by itself flip395 the verdict, but a suggestion a prior review routed to *this* task that the396 implementation left unactioned is a blocking issue (`FAILED`) — unless a397 task still in the range will cover it. A deferred fix with no later owner is398 exactly the gap the review exists to catch.399400 Two things the loop decides, not you:401 - a report with a non-empty `spec_conflicts` is treated as `FAILED`402 whatever `review_status` says, so raising a contradiction and passing it403 in the same breath is not available404 - a `routed` entry aimed at a task that is not still pending inside the405 range is refused and comes back as a rejection, so route only to a task406 that will actually run4074082. **Generate review report** (`docs/specs/[id]/tasks/TASK-XXX--review.md`):409 Read the review template using this lookup order:410 1. `templates/task-review.md`411 2. `templates/task-review.md` inside the installed skill folder for non-Claude agents.412 Fill in the gathered findings and save to the tasks directory.413414 The file **must open with the YAML frontmatter block of the template**,415 before the first heading, carrying `review_status`, a one-line `summary`, an416 `issues` list (`issues: []` when the review passes), a `spec_conflicts` list417 (`[]` when nothing contradicts the spec), an `escalation` list (`[]` unless418 the task needs an operator action) and an optional `routed` list.419 Every required fix listed in the body has a matching `issues` entry: that420 list is what the next implementation pass is given to work from.421422 **Quote every value with double quotes.** The values here are prose and423 prose contains colons; an unquoted `summary`, `issues` entry or routed424 `text` carrying a colon followed by a space is not valid YAML, and the loop425 then has to salvage the verdict line by line.426427 `routed` carries fixes you defer to a later task, not this one: each entry is428 `{ to: "<task-id>", text: "<one-line fix>" }`, and `[]` when there is429 nothing to route. The loop feeds routed entries to the target task's prompt430 automatically, so they survive between reviews instead of living only as431 prose a later task would have to grep for.432433 The review template defines these sections:434 | Section | Purpose |435 |---------|----------|436 | Review Summary | High-level status table (AC, DoD, Code Quality, Spec Compliance, Architecture) |437 | Acceptance Criteria & DoD Results | Per-criterion and per-item status with evidence |438 | Code Review Findings | Table of issues with severity, file, category, recommendation |439 | Spec Compliance & Architectural Alignment | Fidelity check, cross-boundary adherence, decision log, traceability update |440 | Required Fixes | Critical / Warnings / Suggestions tables |441 | Next Steps | Action by review status |4424433. **Update task status**:444 - Set `status: reviewed` and `reviewed_date: YYYY-MM-DD` in the task445 frontmatter if `PASSED`446 - Leave the task status untouched if `FAILED`: the report is the record of447 what has to change448449 Skip this step entirely when an automated loop drives the review — it owns450 the task frontmatter and writes it once the whole task is closed.4514524. **Synchronization**:453 - Run `/skill:specs-kit-sync [spec-folder]` to synchronize all components454 - Skip this step under an automated loop: synchronization is a phase of its455 own there, and running it from inside the review doubles the work4564575. **Inform user**:458 - Display review summary and status459 - Provide link to full review report460 - If `PASSED`, suggest running Phase T-7 cleanup in `task-implementation`461462---463464## Phase 8: Report the convention provenance verdict explicitly465466**Goal**: Make the Convention Provenance Check from Phase 5 visible in the467review summary, not buried in the issues table.468469**Runs**: Always.470471**Actions**:4724731. In the review report's summary section, add a row to the standard474 summary table:475476 | Convention provenance | ✅ All conventions pre-existing / ⚠️ N invented-convention findings / ❌ N blocking |4774782. List every `invented-convention` finding by DEC ID and file in a479 dedicated section after "Code Review Findings", titled480 "Convention Provenance Findings". Each entry must include:481482 - The pattern (one sentence)483 - Where it appears (file + line)484 - Whether it is `blocking` / `warning` / `suggestion`485 - The proposed remediation (promote to architecture, ratify via DEC,486 or revert)4874883. The verdict participates in `review_status`:489490 - any `blocking` `invented-convention` → `FAILED`491 - only `warning` / `suggestion` → still `PASSED`, but the report must492 enumerate them493494 This rule mirrors the existing rule that an unmet AC flips the status495 to `FAILED`. The motivation is the same: the implementation may have496 shipped working code, but the loop cannot move on to the next task497 while the codebase carries undocumented conventions that future tasks498 will treat as canonical.