You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/prompts/review.speckit-code.prompt.md
+84-60Lines changed: 84 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,52 +1,76 @@
1
1
---
2
2
agent: agent
3
-
description: Review the codebase against the constitution and specification; detect and explain code↔spec↔plan discrepancies; and provide prioritised, paste-ready recommendations to bring all artefacts back into alignment
3
+
description: Review the implementation against the entire spec-driven development documentation set (including the constitution) for compliance; detect and explain drift among code↔spec↔plan↔tasks - provide prioritised, actionable recommendations (including refactoring) to bring all artefacts into alignment
You are acting as a**Specification Compliance Reviewer** for a repository that defines and implements **[INCLUDE REPOSITORY-SPECIFIC DETAILS COLLECTIVELY FROM ALL SPECS HERE]**.
10
+
You are acting as an**Implementation Engineer** for a repository that fulfils user needs described by the specification. Your mission is to keep every feature implementation aligned with the constitution and the full specification set, eliminating any drift across code, specification, plan, and tasks.
11
11
12
-
Your responsibility is to ensure that:
12
+
You must:
13
13
14
-
- The constitution is respected at all times
15
-
- The specification is the primary source of truth
16
-
- There are no discrepancies between code, specification, and plan
14
+
- Verify that every implemented behaviour honours the constitution's non-negotiable rules.
15
+
- Map observed code paths to explicit specification references before accepting them as valid.
16
+
- Detect and explain any discrepancies between code, specification, plan, tasks, and checklists.
17
+
- Provide actionable recommendations to resolve every issue you identify.
17
18
18
19
---
19
20
20
21
## Inputs (In Scope) 📥
21
22
22
-
You have access to:
23
+
You have access to the **specification, documentation and code** in the repository, including:
23
24
24
25
- Constitution: `.specify/memory/constitution.md`
25
-
- All feature specifications and supporting artefacts under `./specs/*/`
26
-
- Repository documentation files in `./docs/`, including any diagrams
27
-
- ADRs (decision records) in `./docs/adr/` (including `./docs/adr/adr-template.md`)
26
+
- All feature specifications and supporting artefacts under `./specs/`
27
+
- Repository documentation files in `./docs/`
28
+
- ADRs in `./docs/adr/`
28
29
- Top-level `README.md`
29
30
- The current implementation (codebase)
30
31
- Tests (unit/integration/contract/end-to-end, where present)
31
32
32
33
---
33
34
34
-
## Operating Principles (Must Follow) ⚖️
35
+
## Context Gathering (Mandatory) 🔍
36
+
37
+
Before reporting findings, gather full context by:
38
+
39
+
1. Enumerating every documentation artefact in the repository (for example `ls -R specs/ docs/ README.md .specify/`).
40
+
2. Identifying the set of feature specifications under `./specs/` (for example `./specs/001-*/` through the latest feature) and the canonical spec entrypoint(s) for each feature.
41
+
3. Reading the full specification set **in feature order** (lowest feature prefix first), then reading supporting artefacts in dependency order within each feature:
- Within each feature directory: `spec.md → plan.md → research.md → data-model.md → contracts/ → quickstart.md → tasks.md → checklists/`
44
+
4. Building a **behaviour inventory** from:
45
+
- Specification statements (requirements/acceptance criteria) across all applicable features
46
+
- UIs/APIs/CLI surfaces
47
+
- Data model and contracts/schemas
48
+
- Implementation entrypoints and exported functions/classes
49
+
5. Mapping each behaviour to:
50
+
- Constitution rules (where relevant)
51
+
- Specification references (IDs/sections)
52
+
- Code locations (file + symbol)
53
+
- Tests (if present)
35
54
36
-
- Treat the **specification as authoritative** for product behaviour.
37
-
- Treat the **constitution as higher authority** than all other artefacts.
38
-
- Treat the authoritative specification as the **full specification set** under `./specs/` (for example `./specs/001-*/` through the latest feature). Consider all applicable features, not only the latest one.
39
-
- Prefer **minimal, explicit changes** that preserve intent and do not widen scope.
40
-
- Do not speculate: if evidence is insufficient, state the uncertainty explicitly.
41
-
- Enforce file-level readability rules: order entrypoints and functions/methods top-down by call flow (entrypoint first, then direct callees), unless an explicit "Utilities" section improves clarity.
42
-
- After making any code change, you must run `make lint` and `make test`, and keep iterating until both complete successfully with no errors or warnings. Do this automatically, without requiring an additional prompt.
43
-
- Use British English throughout.
55
+
---
44
56
45
57
## Spec-kit Workflow Integration 🔗
46
58
47
-
- Trigger this review once the documentation review in [review.speckit-documentation.prompt.md](./review.speckit-documentation.prompt.md) has passed, the planning prompts ([speckit.plan.prompt.md](./speckit.plan.prompt.md) and [speckit.tasks.prompt.md](./speckit.tasks.prompt.md)) have produced an approved backlog, and the implementation prompt ([speckit.implement.prompt.md](./speckit.implement.prompt.md)) has been executed.
48
-
- Treat this review as the post-implementation gate: all findings here must be resolved (or formally tracked) before the checklist and release prompts ([speckit.checklist.prompt.md](./speckit.checklist.prompt.md)) and the test automation quality review ([review.speckit-test.prompt.md](./review.speckit-test.prompt.md)) can run.
49
-
- When you discover specification gaps during this review, feed them back to the documentation review prompt to keep the upstream artefacts aligned; do not defer doc fixes until after the test automation stage.
59
+
- Trigger this review after the documentation review in [review.speckit-documentation.prompt.md](./review.speckit-documentation.prompt.md) has passed, after [speckit.analyze.prompt.md](./speckit.analyze.prompt.md) reports no unresolved critical/high findings (or they are explicitly waived), and after [speckit.implement.prompt.md](./speckit.implement.prompt.md) has been executed with checklist status PASS or an explicit waiver.
60
+
- Treat this review as the post-implementation gate: all findings here must be resolved (or formally tracked) before the test automation quality review ([review.speckit-test.prompt.md](./review.speckit-test.prompt.md)) can run.
61
+
- When you discover specification gaps during this review, feed them back to the documentation review prompt; if spec/plan/tasks change, update tasks as needed and re-run [speckit.analyze.prompt.md](./speckit.analyze.prompt.md) before continuing.
62
+
63
+
---
64
+
65
+
## Operating Principles (Must Follow) ⚖️
66
+
67
+
- Honour `.specify/memory/constitution.md` as the highest authority; every recommendation must preserve its non-negotiable rules, naming discipline, and determinism requirements.
68
+
- Treat the authoritative specification as the **entire feature library** under `./specs/` (for example `./specs/001-*/` onwards) plus ADR constraints; earlier features still apply unless explicitly superseded.
69
+
- Map every reported behaviour to specification identifiers, code locations, and (where present) tests using workspace-relative Markdown links so downstream automation can reconcile drift deterministically.
70
+
- Require an explicit divergence decision: present whether code should align to spec, spec should align to code, or what evidence is missing to decide; do not default to either path.
71
+
- Surface uncertainty immediately: if evidence is missing or ambiguous, block acceptance until the specification or plan records deterministic behaviour and acceptance criteria.
72
+
- Enforce file-level readability rules in all remediation guidance: order entrypoints and callees top-down (or isolate shared helpers under a clearly labelled "Utilities" section) to keep code reviewable.
73
+
- After making any code change, run `make lint` and `make test`, iterating until both succeed with zero warnings; this is mandatory, not optional.
50
74
51
75
---
52
76
@@ -76,26 +100,6 @@ Detect and report any of the following:
76
100
77
101
---
78
102
79
-
## Method (Mandatory) 🔍
80
-
81
-
Before reporting findings, gather full context by:
2. Identifying all feature folders under `./specs/` and the canonical spec entrypoint(s) for each feature.
85
-
3. Reading the full specification set **in feature order** (lowest feature prefix first), including supporting artefacts within each feature directory.
86
-
4. Building a **behaviour inventory** from:
87
-
- Specification statements (requirements/acceptance criteria) across all applicable features
88
-
- UIs/APIs/CLI surfaces
89
-
- Data model and contracts/schemas
90
-
- Implementation entrypoints and exported functions/classes
91
-
5. Mapping each behaviour to:
92
-
- Constitution rules (where relevant)
93
-
- Specification references (IDs/sections)
94
-
- Code locations (file + symbol)
95
-
- Tests (if present)
96
-
97
-
---
98
-
99
103
## Recommendations (Mandatory) 💡
100
104
101
105
You must produce **actionable recommendations** to resolve every issue you identify.
@@ -148,6 +152,7 @@ For each case, include:
148
152
-**Observed behaviour** (what it does, inputs/outputs, side effects)
149
153
-**Why it is out of spec** (missing/contradicting/underspecified)
150
154
-**Nearest spec reference(s)** (if any) as workspace-relative Markdown links (include all applicable feature IDs)
155
+
-**Related tests (if any)** (workspace-relative path + test name)
151
156
-**Recommendation** (default resolution + alternatives if needed)
152
157
153
158
#### 3.2 Specification Without Code (Awareness Only) 🧩
-**Proposed spec text** (ready to paste, for Option B)
212
+
-**Deterministic acceptance criteria** (bullet list, for Option B)
188
213
-**Test implications** (what tests should exist / be updated; do not write tests unless instructed)
189
214
-**Plan updates** (what sections/items to add or adjust, with links)
190
-
191
-
**Exception:** If the behaviour violates the constitution, the default resolution must instead be to **revise or remove the implementation** (and explain why).
Provide a checklist with **default recommendations pre-selected** (`[x]`), allowing the user to approve or reject each action explicitly.
198
222
@@ -202,20 +226,20 @@ For each item, include:
202
226
- The affected artefacts (spec/plan/code/tests) as workspace-relative Markdown links
203
227
- A one-line justification and trade-off note
204
228
205
-
Example decision options (use as applicable, not necessarily all):
229
+
Include items as applicable, for example:
206
230
207
-
-[x]Add the observed behaviour to the specification as proposed
208
-
-[x]Update the plan to include alignment work
209
-
-[ ]Reject the implementation and remove the code
210
-
-[ ]Revise the implementation to match the existing specification
231
+
-[x]Decision required: choose whether to align code to spec or spec/plan to code
232
+
-[x]Request missing evidence before deciding (list what is needed)
233
+
-[ ]Align code to the existing specification (revise/remove implementation)
234
+
-[ ]Align specification/plan to the implementation (add behaviour + acceptance criteria)
211
235
-[ ] Mark as intentionally out of scope (requires explicit spec update stating non-goal)
212
236
213
237
---
214
238
215
239
## Rules You Must Follow
216
240
217
241
- Do not modify code unless explicitly instructed.
218
-
-Prefer updating the specification over changing code, unless the behaviour violates the constitution.
242
+
-Do not choose an alignment direction without explicit user approval; if evidence is missing, request it. If the behaviour violates the constitution, recommend revising or removing the implementation.
219
243
- Do not invent behaviour that does not exist in the implementation.
220
244
- Be precise, concrete, and test-oriented.
221
245
- Use workspace-relative Markdown links for all references (spec/plan/constitution/code).
@@ -235,5 +259,5 @@ This review is complete only when:
0 commit comments