Code Review Skill
This skill runs a structured review within the Spec Kit pipeline. It supports three review types, each with a distinct focus and output format.
Review Type Resolution
Resolve the review type from the user's input ($ARGUMENTS). Match against the table below.
| Type |
Role |
Focus |
Position in pipeline |
| documentation |
Product Owner |
Spec integrity, traceability, language, structure, redundancy, cross-document alignment |
After spec + plan, before implementation |
| code |
Implementation Engineer |
Constitution compliance, specification coverage, discrepancy detection, plan/tasks alignment |
After implementation, before test review |
| test |
Implementation Engineer |
Test pyramid health, unit test quality, high-value gaps, spec alignment, test refactoring |
After code review |
If the review type is not in this table, inform the user and list the supported types.
Mandatory Context Gathering
For all review types:
- Read the constitution - it has the highest authority.
- Enumerate available artefacts in the
specs/ directory of the current feature.
- Read the spec set in feature order:
spec.md → plan.md → tasks.md.
- Read any relevant ADRs in
docs/adr/.
Additional Context by Type
documentation: Also read docs/ directory contents and README.md for cross-document alignment checks.
code: Build a behaviour inventory mapping constitution rules → spec requirements → implementation code → test coverage. Identify any gaps.
test: Execute make test and review the output. Analyse the test pyramid (unit, integration, end-to-end) and identify coverage gaps.
Spec Kit Workflow Integration
This review is positioned within the spec-driven development pipeline:
speckit-specify → speckit-clarify → speckit-plan → speckit-tasks → review → speckit-implement
- Documentation review should run before code review.
- Code review should run before test review.
Operating Principles
- Honour the constitution as the highest authority.
- Base all findings on evidence from the codebase and spec artefacts.
- Do not guess - use Unknown from code - {action} for missing information.
- Keep recommendations specific, deterministic, minimal, and ready to implement.
Objectives by Type
Each review type has a dedicated companion document with the full role, operating principles, objectives, Required Output Structure, Decision Checklist, rules, and Definition of Done. Follow the companion document for the review type being executed.
Documentation Review
See type-documentation.md for the full workflow, including the seven-section objectives (Integrity & Traceability, Ubiquitous Language, Definition Ownership, Structural Consistency, Redundancy, Cross-Document Alignment, Completeness) and the seven-part Required Output Structure with the Decision Checklist.
Headline objectives:
- Integrity and Traceability: Every spec requirement traces to a plan item and task via unique identifiers.
- Ubiquitous Language: Consistent terminology across all documents.
- Definition Ownership: Each concept has exactly one authoritative location.
- Structural Consistency: Documents follow the expected spec-kit structure.
- Redundancy: No duplicated requirements across documents.
- Cross-Document Alignment: README, ADRs, and specs are mutually consistent.
- Completeness: Mandatory ADRs and LikeC4 diagrams exist; data flow diagrams where material.
Code Review
See type-code.md for the full workflow, including the three objectives (Constitution Compliance, Specification Coverage, Discrepancy Detection), the six-part Required Output Structure (with Proposed Resolutions covering Options A/B/C), and the Decision Checklist.
Headline objectives:
- Constitution Compliance: All code respects non-negotiable rules; severity
critical/major/minor.
- Specification Coverage: Every implemented behaviour is explicitly covered by the spec set.
- Discrepancy Detection: Identify code without spec, spec without code, underspecified requirements, and plan/tasks drift.
- Plan/Tasks Alignment: Implementation matches the planned approach.
Test Review
See type-test.md for the full workflow, including the five objectives, the Test Quality Rules (Behaviour and Scope, Structure and Style, Determinism and Isolation, Assertions, Errors and Edge Cases, Mocking and Fixtures, Maintainability), the eight-part Required Output Structure, and the Decision Checklist.
Headline objectives:
- Test Pyramid Health: Appropriate distribution of unit, integration, and end-to-end tests.
- Unit Test Quality: Tests are focused, deterministic, well-named, and tied to requirement identifiers.
- High-Value Gaps: Missing happy paths, unhappy paths, edge cases, and branches.
- Spec Alignment: Tests validate spec requirements (no orphan tests; no orphan behaviours).
- Test Refactoring: Identify opportunities to improve clarity, determinism, and speed.
Output Requirements
- Produce a structured report matching the review type's objectives.
- Use concrete evidence links for every finding.
- Reference constitution rules and spec requirements by identifier.
- Keep recommendations actionable - each should be implementable without further clarification.
- Prioritise findings by severity: blockers first, then warnings, then suggestions.
Examples
- example-01-happy-path.md - a
code-type review of a freshly implemented feature, showing the behaviour inventory, discrepancy register, and proposed resolutions.
1---2name: code-review3description: Run a structured Spec Kit review focused on code compliance, documentation quality, or test coverage, positioned within the spec-driven development pipeline.4license: MIT5---67# Code Review Skill89This skill runs a structured review within the Spec Kit pipeline. It supports three review types, each with a distinct focus and output format.1011## Review Type Resolution1213Resolve the review type from the user's input (`$ARGUMENTS`). Match against the table below.1415| Type | Role | Focus | Position in pipeline |16| ------------- | ----------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------- |17| documentation | Product Owner | Spec integrity, traceability, language, structure, redundancy, cross-document alignment | After spec + plan, before implementation |18| code | Implementation Engineer | Constitution compliance, specification coverage, discrepancy detection, plan/tasks alignment | After implementation, before test review |19| test | Implementation Engineer | Test pyramid health, unit test quality, high-value gaps, spec alignment, test refactoring | After code review |2021If the review type is not in this table, inform the user and list the supported types.2223## Mandatory Context Gathering2425For all review types:26271. Read the [constitution](../../../.specify/memory/constitution.md) - it has the highest authority.282. Enumerate available artefacts in the `specs/` directory of the current feature.293. Read the spec set in feature order: `spec.md` → `plan.md` → `tasks.md`.304. Read any relevant ADRs in `docs/adr/`.3132### Additional Context by Type3334**documentation**: Also read `docs/` directory contents and `README.md` for cross-document alignment checks.3536**code**: Build a behaviour inventory mapping constitution rules → spec requirements → implementation code → test coverage. Identify any gaps.3738**test**: Execute `make test` and review the output. Analyse the test pyramid (unit, integration, end-to-end) and identify coverage gaps.3940## Spec Kit Workflow Integration4142This review is positioned within the spec-driven development pipeline:4344- `speckit-specify` → `speckit-clarify` → `speckit-plan` → `speckit-tasks` → **review** → `speckit-implement`45- Documentation review should run before code review.46- Code review should run before test review.4748## Operating Principles49501. Honour the constitution as the highest authority.512. Base all findings on evidence from the codebase and spec artefacts.523. Do not guess - use **Unknown from code - {action}** for missing information.534. Keep recommendations specific, deterministic, minimal, and ready to implement.5455## Objectives by Type5657Each review type has a dedicated companion document with the full role, operating principles, objectives, Required Output Structure, Decision Checklist, rules, and Definition of Done. Follow the companion document for the review type being executed.5859### Documentation Review6061See [type-documentation.md](type-documentation.md) for the full workflow, including the seven-section objectives (Integrity & Traceability, Ubiquitous Language, Definition Ownership, Structural Consistency, Redundancy, Cross-Document Alignment, Completeness) and the seven-part Required Output Structure with the Decision Checklist.6263Headline objectives:64651. **Integrity and Traceability**: Every spec requirement traces to a plan item and task via unique identifiers.662. **Ubiquitous Language**: Consistent terminology across all documents.673. **Definition Ownership**: Each concept has exactly one authoritative location.684. **Structural Consistency**: Documents follow the expected spec-kit structure.695. **Redundancy**: No duplicated requirements across documents.706. **Cross-Document Alignment**: README, ADRs, and specs are mutually consistent.717. **Completeness**: Mandatory ADRs and LikeC4 diagrams exist; data flow diagrams where material.7273### Code Review7475See [type-code.md](type-code.md) for the full workflow, including the three objectives (Constitution Compliance, Specification Coverage, Discrepancy Detection), the six-part Required Output Structure (with Proposed Resolutions covering Options A/B/C), and the Decision Checklist.7677Headline objectives:78791. **Constitution Compliance**: All code respects non-negotiable rules; severity `critical`/`major`/`minor`.802. **Specification Coverage**: Every implemented behaviour is explicitly covered by the spec set.813. **Discrepancy Detection**: Identify code without spec, spec without code, underspecified requirements, and plan/tasks drift.824. **Plan/Tasks Alignment**: Implementation matches the planned approach.8384### Test Review8586See [type-test.md](type-test.md) for the full workflow, including the five objectives, the **Test Quality Rules** (Behaviour and Scope, Structure and Style, Determinism and Isolation, Assertions, Errors and Edge Cases, Mocking and Fixtures, Maintainability), the eight-part Required Output Structure, and the Decision Checklist.8788Headline objectives:89901. **Test Pyramid Health**: Appropriate distribution of unit, integration, and end-to-end tests.912. **Unit Test Quality**: Tests are focused, deterministic, well-named, and tied to requirement identifiers.923. **High-Value Gaps**: Missing happy paths, unhappy paths, edge cases, and branches.934. **Spec Alignment**: Tests validate spec requirements (no orphan tests; no orphan behaviours).945. **Test Refactoring**: Identify opportunities to improve clarity, determinism, and speed.9596## Output Requirements9798- Produce a structured report matching the review type's objectives.99- Use concrete evidence links for every finding.100- Reference constitution rules and spec requirements by identifier.101- Keep recommendations actionable - each should be implementable without further clarification.102- Prioritise findings by severity: blockers first, then warnings, then suggestions.103104## Examples105106- [example-01-happy-path.md](./examples/example-01-happy-path.md) - a `code`-type review of a freshly implemented feature, showing the behaviour inventory, discrepancy register, and proposed resolutions.