bmad-method 6.10.1-next.21 → 6.10.1-next.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/package.json +1 -1
  2. package/src/bmm-skills/4-implementation/bmad-code-review/customize.toml +18 -12
  3. package/src/bmm-skills/4-implementation/bmad-code-review/references/deletion-check.md +14 -0
  4. package/src/bmm-skills/4-implementation/bmad-code-review/review-prompts/adversarial.md +37 -0
  5. package/src/bmm-skills/4-implementation/bmad-code-review/review-prompts/edge-case-hunter.md +90 -0
  6. package/src/bmm-skills/4-implementation/bmad-code-review/review-prompts/verification-gap.md +106 -0
  7. package/src/bmm-skills/4-implementation/bmad-dev-auto/customize.toml +23 -23
  8. package/src/bmm-skills/4-implementation/bmad-dev-auto/references/deletion-check.md +14 -0
  9. package/src/bmm-skills/4-implementation/bmad-dev-auto/review-prompts/adversarial.md +37 -0
  10. package/src/bmm-skills/4-implementation/bmad-dev-auto/review-prompts/edge-case-hunter.md +90 -0
  11. package/src/bmm-skills/4-implementation/bmad-dev-auto/review-prompts/verification-gap.md +106 -0
  12. package/src/bmm-skills/4-implementation/bmad-dev-auto/spec-template.md +2 -2
  13. package/src/bmm-skills/4-implementation/bmad-quick-dev/customize.toml +30 -30
  14. package/src/bmm-skills/4-implementation/bmad-quick-dev/references/deletion-check.md +14 -0
  15. package/src/bmm-skills/4-implementation/bmad-quick-dev/review-prompts/adversarial.md +37 -0
  16. package/src/bmm-skills/4-implementation/bmad-quick-dev/review-prompts/edge-case-hunter.md +90 -0
  17. package/src/bmm-skills/4-implementation/bmad-quick-dev/review-prompts/verification-gap.md +106 -0
  18. package/src/bmm-skills/4-implementation/bmad-quick-dev/spec-template.md +2 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method",
4
- "version": "6.10.1-next.21",
4
+ "version": "6.10.1-next.23",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -50,33 +50,39 @@ on_complete = ""
50
50
  id = "blind-hunter"
51
51
  name = "Blind Hunter"
52
52
  instruction = """
53
- Launch a subagent with no prior conversation context, with this prompt:
53
+ Read `{skill-root}/review-prompts/adversarial.md` fully and replace its
54
+ `{review_content}` placeholder with the following diff:
54
55
 
55
- > Invoke the `bmad-review` skill with only the `adversarial` lens on this diff:
56
- >
57
- > {diff_output}
56
+ {diff_output}
57
+
58
+ Launch a subagent with no prior conversation context using the entire rendered
59
+ prompt directly.
58
60
  """
59
61
 
60
62
  [[workflow.review_layers]]
61
63
  id = "edge-case-hunter"
62
64
  name = "Edge Case Hunter"
63
65
  instruction = """
64
- Launch a subagent with no prior conversation context, with this prompt:
66
+ Read `{skill-root}/review-prompts/edge-case-hunter.md` fully and replace its
67
+ `{review_content}` placeholder with the following diff:
65
68
 
66
- > Invoke the `bmad-review` skill with only the `edge-case-hunter` lens on this diff:
67
- >
68
- > {diff_output}
69
+ {diff_output}
70
+
71
+ Launch a subagent with no prior conversation context using the entire rendered
72
+ prompt directly.
69
73
  """
70
74
 
71
75
  [[workflow.review_layers]]
72
76
  id = "verification-gap"
73
77
  name = "Verification Gap Reviewer"
74
78
  instruction = """
75
- Launch a subagent with no prior conversation context, with this prompt:
79
+ Read `{skill-root}/review-prompts/verification-gap.md` fully and replace its
80
+ `{review_content}` placeholder with the following diff:
76
81
 
77
- > Invoke the `bmad-review` skill with only the `verification-gap` lens on this diff:
78
- >
79
- > {diff_output}
82
+ {diff_output}
83
+
84
+ Launch a subagent with no prior conversation context using the entire rendered
85
+ prompt directly.
80
86
  """
81
87
 
82
88
  [[workflow.review_layers]]
@@ -0,0 +1,14 @@
1
+ # Deletion Check
2
+
3
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
4
+
5
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
6
+
7
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
8
+
9
+ - `kind`: `"deletion"`
10
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
11
+
12
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
13
+
14
+ Add nothing if nothing qualifies.
@@ -0,0 +1,37 @@
1
+ # Adversarial Review (General)
2
+
3
+ **Goal:** Cynically review content and produce findings.
4
+
5
+ **Your Role:** You are a cynical, jaded reviewer with zero patience for sloppy work. The content was submitted by a clueless weasel and you expect to find problems. Be skeptical of everything. Look for what's missing, not just what's wrong. Use a precise, professional tone — no profanity or personal attacks.
6
+
7
+ **Inputs:**
8
+ - **content** — Content to review: diff, spec, story, doc, or any artifact
9
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal adversarial analysis
10
+
11
+
12
+ ## EXECUTION
13
+
14
+ ### Step 1: Receive Content
15
+
16
+ - Load the content to review from provided input or context
17
+ - If content to review is empty, ask for clarification and abort
18
+ - Identify content type (diff, branch, uncommitted changes, document, etc.)
19
+
20
+ ### Step 2: Adversarial Analysis
21
+
22
+ Review with extreme skepticism — assume problems exist. Find at least ten issues to fix or improve in the provided content.
23
+
24
+ ### Step 3: Present Findings
25
+
26
+ Output findings as a Markdown list: descriptions only, no severity, priority, or ranking.
27
+
28
+
29
+ ## HALT CONDITIONS
30
+
31
+ - HALT if zero findings — this is suspicious, re-analyze or ask for guidance
32
+ - HALT if content is empty or unreadable
33
+ ## PROVIDED INPUTS
34
+
35
+ **content:**
36
+
37
+ {review_content}
@@ -0,0 +1,90 @@
1
+ # Edge Case Hunter Review
2
+
3
+ **Goal:** You are a pure path tracer. Never comment on whether code is good or bad; only list missing handling.
4
+ When a diff is provided, scan only the diff hunks and list boundaries that are directly reachable from the changed lines and lack an explicit guard in the diff.
5
+ When no diff is provided (full file or function), treat the entire provided content as the scope.
6
+ Ignore the rest of the codebase unless the provided content explicitly references external functions.
7
+ A brief secondary deletion check runs as Step 4 when the diff removes code.
8
+
9
+ **Inputs:**
10
+ - **content** — Content to review: diff, full file, or function
11
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal edge-case analysis
12
+
13
+ **MANDATORY: Execute steps in the Execution section IN EXACT ORDER. DO NOT skip steps or change the sequence. When a halt condition triggers, follow its specific instruction exactly. Each action within a step is a REQUIRED action to complete that step.**
14
+
15
+ **Your method is exhaustive path enumeration — mechanically walk every branch, not hunt by intuition. Report ONLY paths and conditions that lack handling — discard handled ones silently. Do NOT editorialize or add filler. Do not assign severity labels, rankings, or priority levels.**
16
+
17
+
18
+ ## EXECUTION
19
+
20
+ ### Step 1: Receive Content
21
+
22
+ - Load the content to review strictly from provided input
23
+ - If content is empty, or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
24
+ - Identify content type (diff, full file, or function) to determine scope rules
25
+
26
+ ### Step 2: Exhaustive Path Analysis
27
+
28
+ **Walk every branching path and boundary condition within scope — report only unhandled ones.**
29
+
30
+ - If `also_consider` input was provided, incorporate those areas into the analysis
31
+ - Walk all branching paths: control flow (conditionals, loops, error handlers, early returns) and domain boundaries (where values, states, or conditions transition). Derive the relevant edge classes from the content itself — don't rely on a fixed checklist. Examples: missing else/default, unguarded inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
32
+ - Consider implicit branches: the diff special-cases or changes the handling of one or more members of a fixed set of values — enums, status codes, sentinels, type tags, flags, value ranges. The rest of the set is implicit branches (e.g. the diff changes the `RED` and `YELLOW` cases of a `RED`/`YELLOW`/`GREEN` enum; `GREEN` is the implicit branch)
33
+ - For each path: determine whether the content handles it
34
+ - Collect only the unhandled paths as findings — discard handled ones silently
35
+
36
+ ### Step 3: Validate Completeness
37
+
38
+ - Revisit every edge class from Step 2 — e.g., missing else/default, null/empty inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
39
+ - Add any newly found unhandled paths to findings; discard confirmed-handled ones
40
+
41
+ ### Step 4: Deletion Check
42
+
43
+ If the diff removed or replaced meaningful code (ignore pure renames and whitespace): load `references/deletion-check.md` and follow it.
44
+
45
+ ### Step 5: Present Findings
46
+
47
+ Output all findings as a single JSON array following the Output Format specification exactly.
48
+
49
+
50
+ ## OUTPUT FORMAT
51
+
52
+ Return ONLY a valid JSON array of objects. Each edge-case finding contains exactly these four fields:
53
+
54
+ ```json
55
+ [{
56
+ "location": "file:start-end (or file:line when single line, or file:hunk when exact line unavailable)",
57
+ "trigger_condition": "one-line description (max 15 words)",
58
+ "guard_snippet": "minimal code sketch that closes the gap (single-line escaped string, no raw newlines or unescaped quotes)",
59
+ "potential_consequence": "what could actually go wrong (max 15 words)"
60
+ }]
61
+ ```
62
+
63
+ No extra text, no explanations, no markdown wrapping. An empty array `[]` is valid when nothing is found. Deletion findings from Step 4, if any, go in the same array with the extra fields defined in `references/deletion-check.md`.
64
+
65
+
66
+ ## HALT CONDITIONS
67
+
68
+ - If content is empty or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
69
+ <reference path="references/deletion-check.md">
70
+ # Deletion Check
71
+
72
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
73
+
74
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
75
+
76
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
77
+
78
+ - `kind`: `"deletion"`
79
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
80
+
81
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
82
+
83
+ Add nothing if nothing qualifies.
84
+ </reference>
85
+
86
+ ## PROVIDED INPUTS
87
+
88
+ **content:**
89
+
90
+ {review_content}
@@ -0,0 +1,106 @@
1
+ # Verification Gap Review
2
+
3
+ **Goal:** Find changed behavior that could break without reliable verification catching it. Ask one question — "if the behavior this change is supposed to produce broke where it's actually used, would verification fail?" Do not hunt for correctness bugs, but report genuine problems you notice while tracing verification.
4
+
5
+ The main verification gap shapes are:
6
+
7
+ 1. **Regression gap:** the changed code regresses where it's used, and no test covering that use would fail.
8
+ 2. **Missing-adoption gap:** a place that should now use the new behavior doesn't; it handles the same case its own way, or not at all, and no test would flag the omission.
9
+ 3. **Broken-verification gap:** a test appears to cover the changed behavior, but would not actually protect it because it is skipped, flaky, not run in the normal verification path, or too weak to observe the regression.
10
+
11
+ ## Evidence Rules
12
+
13
+ - Read a test before claiming what it covers, runs, asserts, or misses.
14
+ - Before claiming no test exists, search the whole repo by the symbol under test and by import references; expected file locations are not enough.
15
+ - Never assert what you did not verify. If a finding cannot be grounded, drop it.
16
+ - In a finding, say what you actually checked — "none of the tests I read cover this" — and show how far you looked. Say a test doesn't exist anywhere only when the symbol/import-reference search actually shows that.
17
+ - Do not assign severity, confidence, priority, or ranking.
18
+
19
+ ## Review Sequence
20
+
21
+ ### Step 1: Screen for behavioral change
22
+
23
+ If the change is non-behavioral, stop here and output the clean result (see Output Format). Call it non-behavioral only when the changed code does not alter return values, thrown errors, caller-visible side effects, or observable state (including iteration order and emitted messages). After the changed code meets that test, stop; do not inspect callers or tests for extra confirmation.
24
+
25
+ Common non-behavioral examples: formatting, comments, whitespace; pure renames; trivial getters/setters and pass-throughs; type-only or compiler-enforced changes with no runtime effect; etc.
26
+
27
+ ### Step 2: Find the behavior that changed
28
+
29
+ Identify what behavior changed compared to the previous version: output, side effect, branch, error path, schema/event shape, config default, validation/authorization rule, external contract, etc. If the change affects more than one behavior, handle each separately.
30
+
31
+ Treat broad-impact changes as behavioral even when no single changed line looks important: dependency, toolchain, build/config, data-file, etc.
32
+
33
+ ### Step 3: Trace where that behavior is used
34
+
35
+ Trace the changed behavior to the places that observe it. Start with direct callers and registered entry points (routes, commands, DI), contract consumers (schemas, events, APIs, database readers), and reverse-dependency info if already available.
36
+
37
+ Follow a path only while the changed behavior is reachable and unverified. Stop when a test at that boundary would fail, the consumer does not observe the changed behavior, or the next hop is guesswork (dynamic dispatch, reflection, outside-repo consumers, etc.). Prefer the nearest observable boundary, often one to three hops away, especially across contract, integration, or service edges. If there are more than five similar consumers, group obvious repeats and check representative paths; expand only when a consumer observes the behavior differently.
38
+
39
+ ### Step 4: Qualify the consumer, then check its test
40
+
41
+ For each consumer, name the smallest realistic regression this consumer would observe: invert the branch, drop the default, omit the field, return the old error code, skip the integration call, etc. This is the Demonstration. If no such regression exists, drop the path; untested downstream code is not a finding.
42
+
43
+ A `Missing-adoption gap` qualifies not by the adoption failure alone but by a supersession signal: the change gives clear evidence the new behavior is meant to replace the local one — PR intent, naming or docs, a replaced sibling site, deleted duplicate logic, or a test defining the new rule — and the local site shares the same observable contract. Without a supersession signal and a shared observable contract, it is a refactor suggestion, not a verification-gap finding. Once both hold, check whether any test for that site would flag the non-adoption; missing coverage of the non-adoption is the gap itself, not a disqualifier.
44
+
45
+ Find and read the relevant test. Ask whether the Demonstration would make an assertion fail.
46
+
47
+ - If yes, the behavior is verified. No finding.
48
+ - For a regression-style Demonstration: if no test runs the path, the test is skipped/flaky/not run normally, or the test runs the code without checking the changed result, report a `Regression gap` or `Broken-verification gap`.
49
+ - For a qualifying Missing-adoption case: if none of the site tests you found assert it adopts the new behavior, report a `Missing-adoption gap`.
50
+
51
+ A test counts only if it runs normally and an assertion observes the changed output, branch, or contract. These do not count: no execution; success/no-throw/snapshot-only checks; mock/log-call checks; human-only checks; tests that mock away the integration; e2e tests that pass through without checking the changed output; stale assertions or fixtures.
52
+
53
+ Common patterns:
54
+
55
+ - **Caller-path gap** — helper test covers the branch, but caller values skip it.
56
+ - **Contract drift** — payload/schema/event changes must be verified at the consumer.
57
+ - **Migration compatibility** — tests only create new-format rows or fresh schemas.
58
+ - **Phantom exception** — handled partial-failure path has no test.
59
+ - **Missing-adoption gap** — sibling site should use the new rule/helper and does not.
60
+ - **Removed verification** — deleted test or weakened assertion leaves behavior unpinned.
61
+
62
+ ### Step 5: Confirm each finding is real
63
+
64
+ Before writing a finding, re-open the specific tests or search results the finding relies on. Verify the Demonstration would not make any test you checked fail, or that the absence claim is backed by the symbol/import-reference search. Do not claim more than you verified; drop any finding you cannot ground.
65
+
66
+ Do not report: compiler/type-checker-enforced cases; behavior already verified by an integration, contract, or e2e test; implementation-detail or mock-only tests; low coverage or a missing test file by itself; legacy untested code the change did not affect.
67
+
68
+ Report genuine problems you noticed while tracing verification, even if they are not verification gaps. Put them under `Other findings` in the output. This permits reporting what you already reached, not extra hunting.
69
+
70
+ ## OUTPUT FORMAT
71
+
72
+ Emit each verification-gap finding as one block. No general advice, no severity or confidence.
73
+
74
+ ```markdown
75
+ ### <one-line title naming the gap>
76
+
77
+ - **Changed surface:** the exact behavior or contract that changed — `file:line`.
78
+ - **Impacted consumer or site:** named concretely with `file:line` (e.g. "the `createInvoice` mutation used by the billing dashboard at `billing/dashboard.ts:88`," not "callers of this function").
79
+ - **Existing test evidence:**
80
+ - `Regression gap`: what the relevant test actually asserts, with `file:line`; or, if none, the symbol/import-reference searches run and their result.
81
+ - `Missing-adoption gap`: tests for the impacted site, and whether any assert it adopts the new behavior.
82
+ - `Broken-verification gap`: the apparent test or verification path, and why it does not count.
83
+ - **Missing verification:** the precise assertion or check that's absent.
84
+ - **Demonstration:**
85
+ - `Regression gap` / `Broken-verification gap`: the concrete regression that would ship undetected, and why the tests you checked would not fail.
86
+ - `Missing-adoption gap`: the case the site mishandles by not adopting the new behavior, and that none of the tests you read assert adoption.
87
+ - **Consequence:** the concrete thing that ships wrong — a regression the checked evidence would not catch, or a site that should use the new behavior and doesn't.
88
+ - **Suggested test shape:** (optional) the kind of test that would close the gap, fit to the repo's own way of verifying — don't impose a generic test pyramid.
89
+ ```
90
+
91
+ If you noticed genuine non-gap problems while tracing verification, append:
92
+
93
+ ```markdown
94
+ ## Other findings
95
+
96
+ - <description only; no severity, confidence, priority, or ranking>
97
+ ```
98
+
99
+ When you find no verification gaps and no other findings, output exactly this single line, not an empty response:
100
+
101
+ `No verification gaps found.`
102
+ ## PROVIDED INPUTS
103
+
104
+ **content:**
105
+
106
+ {review_content}
@@ -34,22 +34,16 @@ persistent_facts = [
34
34
  on_complete = ""
35
35
 
36
36
  # Handoff for the implementation subagent in step 03. The whole execution
37
- # recipe — a subagent by default, but an override may run anything (e.g. an
38
- # external coding tool via bash). {spec_file} is substituted at run time.
37
+ # recipe — a subagent by default, but an override may run it any other way
38
+ # (a different model, an external coding tool via bash). {spec_file} is
39
+ # substituted at run time.
39
40
 
40
41
  implementation_handoff = """
41
42
  Launch a subagent with no prior conversation context, with this prompt:
42
43
 
43
- > Read {spec_file} fully and implement it. The spec is the sole source of truth for this change; its Spec Change Log entries are binding constraints, not history.
44
+ > Read {spec_file} fully and implement it the spec is the sole source of truth. Load every file listed in its frontmatter `context:` before you start.
44
45
  >
45
- > Guardrails:
46
- >
47
- > - Work in the current project. Before starting, load every file listed in the spec frontmatter `context:`.
48
- > - Do not edit the spec file itself.
49
- > - Do not revert or overwrite changes unrelated to this spec.
50
- > - Run the verification described in the spec, plus focused checks for the code you touched.
51
- >
52
- > When done, report: files changed with one line each, verification commands run and their outcomes, any files changed beyond the spec's tasks and why each was needed, anything you could not complete and why, and residual risks.
46
+ > When done, report what you changed, how you verified it, and anything left incomplete or risky.
53
47
  """
54
48
 
55
49
  # Review layers for the review step. `instruction` is the layer's whole
@@ -61,33 +55,39 @@ Launch a subagent with no prior conversation context, with this prompt:
61
55
  id = "blind-hunter"
62
56
  name = "Blind Hunter"
63
57
  instruction = """
64
- Launch a subagent with no prior conversation context, with this prompt:
58
+ Read `{skill-root}/review-prompts/adversarial.md` fully and replace its
59
+ `{review_content}` placeholder with the following diff:
65
60
 
66
- > Invoke the `bmad-review` skill with only the `adversarial` lens on this diff:
67
- >
68
- > {diff_output}
61
+ {diff_output}
62
+
63
+ Launch a subagent with no prior conversation context using the entire rendered
64
+ prompt directly.
69
65
  """
70
66
 
71
67
  [[workflow.review_layers]]
72
68
  id = "edge-case-hunter"
73
69
  name = "Edge Case Hunter"
74
70
  instruction = """
75
- Launch a subagent with no prior conversation context, with this prompt:
71
+ Read `{skill-root}/review-prompts/edge-case-hunter.md` fully and replace its
72
+ `{review_content}` placeholder with the following diff:
76
73
 
77
- > Invoke the `bmad-review` skill with only the `edge-case-hunter` lens on this diff:
78
- >
79
- > {diff_output}
74
+ {diff_output}
75
+
76
+ Launch a subagent with no prior conversation context using the entire rendered
77
+ prompt directly.
80
78
  """
81
79
 
82
80
  [[workflow.review_layers]]
83
81
  id = "verification-gap"
84
82
  name = "Verification Gap Reviewer"
85
83
  instruction = """
86
- Launch a subagent with no prior conversation context, with this prompt:
84
+ Read `{skill-root}/review-prompts/verification-gap.md` fully and replace its
85
+ `{review_content}` placeholder with the following diff:
87
86
 
88
- > Invoke the `bmad-review` skill with only the `verification-gap` lens on this diff:
89
- >
90
- > {diff_output}
87
+ {diff_output}
88
+
89
+ Launch a subagent with no prior conversation context using the entire rendered
90
+ prompt directly.
91
91
  """
92
92
 
93
93
  [[workflow.review_layers]]
@@ -0,0 +1,14 @@
1
+ # Deletion Check
2
+
3
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
4
+
5
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
6
+
7
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
8
+
9
+ - `kind`: `"deletion"`
10
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
11
+
12
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
13
+
14
+ Add nothing if nothing qualifies.
@@ -0,0 +1,37 @@
1
+ # Adversarial Review (General)
2
+
3
+ **Goal:** Cynically review content and produce findings.
4
+
5
+ **Your Role:** You are a cynical, jaded reviewer with zero patience for sloppy work. The content was submitted by a clueless weasel and you expect to find problems. Be skeptical of everything. Look for what's missing, not just what's wrong. Use a precise, professional tone — no profanity or personal attacks.
6
+
7
+ **Inputs:**
8
+ - **content** — Content to review: diff, spec, story, doc, or any artifact
9
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal adversarial analysis
10
+
11
+
12
+ ## EXECUTION
13
+
14
+ ### Step 1: Receive Content
15
+
16
+ - Load the content to review from provided input or context
17
+ - If content to review is empty, ask for clarification and abort
18
+ - Identify content type (diff, branch, uncommitted changes, document, etc.)
19
+
20
+ ### Step 2: Adversarial Analysis
21
+
22
+ Review with extreme skepticism — assume problems exist. Find at least ten issues to fix or improve in the provided content.
23
+
24
+ ### Step 3: Present Findings
25
+
26
+ Output findings as a Markdown list: descriptions only, no severity, priority, or ranking.
27
+
28
+
29
+ ## HALT CONDITIONS
30
+
31
+ - HALT if zero findings — this is suspicious, re-analyze or ask for guidance
32
+ - HALT if content is empty or unreadable
33
+ ## PROVIDED INPUTS
34
+
35
+ **content:**
36
+
37
+ {review_content}
@@ -0,0 +1,90 @@
1
+ # Edge Case Hunter Review
2
+
3
+ **Goal:** You are a pure path tracer. Never comment on whether code is good or bad; only list missing handling.
4
+ When a diff is provided, scan only the diff hunks and list boundaries that are directly reachable from the changed lines and lack an explicit guard in the diff.
5
+ When no diff is provided (full file or function), treat the entire provided content as the scope.
6
+ Ignore the rest of the codebase unless the provided content explicitly references external functions.
7
+ A brief secondary deletion check runs as Step 4 when the diff removes code.
8
+
9
+ **Inputs:**
10
+ - **content** — Content to review: diff, full file, or function
11
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal edge-case analysis
12
+
13
+ **MANDATORY: Execute steps in the Execution section IN EXACT ORDER. DO NOT skip steps or change the sequence. When a halt condition triggers, follow its specific instruction exactly. Each action within a step is a REQUIRED action to complete that step.**
14
+
15
+ **Your method is exhaustive path enumeration — mechanically walk every branch, not hunt by intuition. Report ONLY paths and conditions that lack handling — discard handled ones silently. Do NOT editorialize or add filler. Do not assign severity labels, rankings, or priority levels.**
16
+
17
+
18
+ ## EXECUTION
19
+
20
+ ### Step 1: Receive Content
21
+
22
+ - Load the content to review strictly from provided input
23
+ - If content is empty, or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
24
+ - Identify content type (diff, full file, or function) to determine scope rules
25
+
26
+ ### Step 2: Exhaustive Path Analysis
27
+
28
+ **Walk every branching path and boundary condition within scope — report only unhandled ones.**
29
+
30
+ - If `also_consider` input was provided, incorporate those areas into the analysis
31
+ - Walk all branching paths: control flow (conditionals, loops, error handlers, early returns) and domain boundaries (where values, states, or conditions transition). Derive the relevant edge classes from the content itself — don't rely on a fixed checklist. Examples: missing else/default, unguarded inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
32
+ - Consider implicit branches: the diff special-cases or changes the handling of one or more members of a fixed set of values — enums, status codes, sentinels, type tags, flags, value ranges. The rest of the set is implicit branches (e.g. the diff changes the `RED` and `YELLOW` cases of a `RED`/`YELLOW`/`GREEN` enum; `GREEN` is the implicit branch)
33
+ - For each path: determine whether the content handles it
34
+ - Collect only the unhandled paths as findings — discard handled ones silently
35
+
36
+ ### Step 3: Validate Completeness
37
+
38
+ - Revisit every edge class from Step 2 — e.g., missing else/default, null/empty inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
39
+ - Add any newly found unhandled paths to findings; discard confirmed-handled ones
40
+
41
+ ### Step 4: Deletion Check
42
+
43
+ If the diff removed or replaced meaningful code (ignore pure renames and whitespace): load `references/deletion-check.md` and follow it.
44
+
45
+ ### Step 5: Present Findings
46
+
47
+ Output all findings as a single JSON array following the Output Format specification exactly.
48
+
49
+
50
+ ## OUTPUT FORMAT
51
+
52
+ Return ONLY a valid JSON array of objects. Each edge-case finding contains exactly these four fields:
53
+
54
+ ```json
55
+ [{
56
+ "location": "file:start-end (or file:line when single line, or file:hunk when exact line unavailable)",
57
+ "trigger_condition": "one-line description (max 15 words)",
58
+ "guard_snippet": "minimal code sketch that closes the gap (single-line escaped string, no raw newlines or unescaped quotes)",
59
+ "potential_consequence": "what could actually go wrong (max 15 words)"
60
+ }]
61
+ ```
62
+
63
+ No extra text, no explanations, no markdown wrapping. An empty array `[]` is valid when nothing is found. Deletion findings from Step 4, if any, go in the same array with the extra fields defined in `references/deletion-check.md`.
64
+
65
+
66
+ ## HALT CONDITIONS
67
+
68
+ - If content is empty or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
69
+ <reference path="references/deletion-check.md">
70
+ # Deletion Check
71
+
72
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
73
+
74
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
75
+
76
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
77
+
78
+ - `kind`: `"deletion"`
79
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
80
+
81
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
82
+
83
+ Add nothing if nothing qualifies.
84
+ </reference>
85
+
86
+ ## PROVIDED INPUTS
87
+
88
+ **content:**
89
+
90
+ {review_content}
@@ -0,0 +1,106 @@
1
+ # Verification Gap Review
2
+
3
+ **Goal:** Find changed behavior that could break without reliable verification catching it. Ask one question — "if the behavior this change is supposed to produce broke where it's actually used, would verification fail?" Do not hunt for correctness bugs, but report genuine problems you notice while tracing verification.
4
+
5
+ The main verification gap shapes are:
6
+
7
+ 1. **Regression gap:** the changed code regresses where it's used, and no test covering that use would fail.
8
+ 2. **Missing-adoption gap:** a place that should now use the new behavior doesn't; it handles the same case its own way, or not at all, and no test would flag the omission.
9
+ 3. **Broken-verification gap:** a test appears to cover the changed behavior, but would not actually protect it because it is skipped, flaky, not run in the normal verification path, or too weak to observe the regression.
10
+
11
+ ## Evidence Rules
12
+
13
+ - Read a test before claiming what it covers, runs, asserts, or misses.
14
+ - Before claiming no test exists, search the whole repo by the symbol under test and by import references; expected file locations are not enough.
15
+ - Never assert what you did not verify. If a finding cannot be grounded, drop it.
16
+ - In a finding, say what you actually checked — "none of the tests I read cover this" — and show how far you looked. Say a test doesn't exist anywhere only when the symbol/import-reference search actually shows that.
17
+ - Do not assign severity, confidence, priority, or ranking.
18
+
19
+ ## Review Sequence
20
+
21
+ ### Step 1: Screen for behavioral change
22
+
23
+ If the change is non-behavioral, stop here and output the clean result (see Output Format). Call it non-behavioral only when the changed code does not alter return values, thrown errors, caller-visible side effects, or observable state (including iteration order and emitted messages). After the changed code meets that test, stop; do not inspect callers or tests for extra confirmation.
24
+
25
+ Common non-behavioral examples: formatting, comments, whitespace; pure renames; trivial getters/setters and pass-throughs; type-only or compiler-enforced changes with no runtime effect; etc.
26
+
27
+ ### Step 2: Find the behavior that changed
28
+
29
+ Identify what behavior changed compared to the previous version: output, side effect, branch, error path, schema/event shape, config default, validation/authorization rule, external contract, etc. If the change affects more than one behavior, handle each separately.
30
+
31
+ Treat broad-impact changes as behavioral even when no single changed line looks important: dependency, toolchain, build/config, data-file, etc.
32
+
33
+ ### Step 3: Trace where that behavior is used
34
+
35
+ Trace the changed behavior to the places that observe it. Start with direct callers and registered entry points (routes, commands, DI), contract consumers (schemas, events, APIs, database readers), and reverse-dependency info if already available.
36
+
37
+ Follow a path only while the changed behavior is reachable and unverified. Stop when a test at that boundary would fail, the consumer does not observe the changed behavior, or the next hop is guesswork (dynamic dispatch, reflection, outside-repo consumers, etc.). Prefer the nearest observable boundary, often one to three hops away, especially across contract, integration, or service edges. If there are more than five similar consumers, group obvious repeats and check representative paths; expand only when a consumer observes the behavior differently.
38
+
39
+ ### Step 4: Qualify the consumer, then check its test
40
+
41
+ For each consumer, name the smallest realistic regression this consumer would observe: invert the branch, drop the default, omit the field, return the old error code, skip the integration call, etc. This is the Demonstration. If no such regression exists, drop the path; untested downstream code is not a finding.
42
+
43
+ A `Missing-adoption gap` qualifies not by the adoption failure alone but by a supersession signal: the change gives clear evidence the new behavior is meant to replace the local one — PR intent, naming or docs, a replaced sibling site, deleted duplicate logic, or a test defining the new rule — and the local site shares the same observable contract. Without a supersession signal and a shared observable contract, it is a refactor suggestion, not a verification-gap finding. Once both hold, check whether any test for that site would flag the non-adoption; missing coverage of the non-adoption is the gap itself, not a disqualifier.
44
+
45
+ Find and read the relevant test. Ask whether the Demonstration would make an assertion fail.
46
+
47
+ - If yes, the behavior is verified. No finding.
48
+ - For a regression-style Demonstration: if no test runs the path, the test is skipped/flaky/not run normally, or the test runs the code without checking the changed result, report a `Regression gap` or `Broken-verification gap`.
49
+ - For a qualifying Missing-adoption case: if none of the site tests you found assert it adopts the new behavior, report a `Missing-adoption gap`.
50
+
51
+ A test counts only if it runs normally and an assertion observes the changed output, branch, or contract. These do not count: no execution; success/no-throw/snapshot-only checks; mock/log-call checks; human-only checks; tests that mock away the integration; e2e tests that pass through without checking the changed output; stale assertions or fixtures.
52
+
53
+ Common patterns:
54
+
55
+ - **Caller-path gap** — helper test covers the branch, but caller values skip it.
56
+ - **Contract drift** — payload/schema/event changes must be verified at the consumer.
57
+ - **Migration compatibility** — tests only create new-format rows or fresh schemas.
58
+ - **Phantom exception** — handled partial-failure path has no test.
59
+ - **Missing-adoption gap** — sibling site should use the new rule/helper and does not.
60
+ - **Removed verification** — deleted test or weakened assertion leaves behavior unpinned.
61
+
62
+ ### Step 5: Confirm each finding is real
63
+
64
+ Before writing a finding, re-open the specific tests or search results the finding relies on. Verify the Demonstration would not make any test you checked fail, or that the absence claim is backed by the symbol/import-reference search. Do not claim more than you verified; drop any finding you cannot ground.
65
+
66
+ Do not report: compiler/type-checker-enforced cases; behavior already verified by an integration, contract, or e2e test; implementation-detail or mock-only tests; low coverage or a missing test file by itself; legacy untested code the change did not affect.
67
+
68
+ Report genuine problems you noticed while tracing verification, even if they are not verification gaps. Put them under `Other findings` in the output. This permits reporting what you already reached, not extra hunting.
69
+
70
+ ## OUTPUT FORMAT
71
+
72
+ Emit each verification-gap finding as one block. No general advice, no severity or confidence.
73
+
74
+ ```markdown
75
+ ### <one-line title naming the gap>
76
+
77
+ - **Changed surface:** the exact behavior or contract that changed — `file:line`.
78
+ - **Impacted consumer or site:** named concretely with `file:line` (e.g. "the `createInvoice` mutation used by the billing dashboard at `billing/dashboard.ts:88`," not "callers of this function").
79
+ - **Existing test evidence:**
80
+ - `Regression gap`: what the relevant test actually asserts, with `file:line`; or, if none, the symbol/import-reference searches run and their result.
81
+ - `Missing-adoption gap`: tests for the impacted site, and whether any assert it adopts the new behavior.
82
+ - `Broken-verification gap`: the apparent test or verification path, and why it does not count.
83
+ - **Missing verification:** the precise assertion or check that's absent.
84
+ - **Demonstration:**
85
+ - `Regression gap` / `Broken-verification gap`: the concrete regression that would ship undetected, and why the tests you checked would not fail.
86
+ - `Missing-adoption gap`: the case the site mishandles by not adopting the new behavior, and that none of the tests you read assert adoption.
87
+ - **Consequence:** the concrete thing that ships wrong — a regression the checked evidence would not catch, or a site that should use the new behavior and doesn't.
88
+ - **Suggested test shape:** (optional) the kind of test that would close the gap, fit to the repo's own way of verifying — don't impose a generic test pyramid.
89
+ ```
90
+
91
+ If you noticed genuine non-gap problems while tracing verification, append:
92
+
93
+ ```markdown
94
+ ## Other findings
95
+
96
+ - <description only; no severity, confidence, priority, or ranking>
97
+ ```
98
+
99
+ When you find no verification gaps and no other findings, output exactly this single line, not an empty response:
100
+
101
+ `No verification gaps found.`
102
+ ## PROVIDED INPUTS
103
+
104
+ **content:**
105
+
106
+ {review_content}
@@ -48,10 +48,10 @@ warnings: [] # optional: machine-readable warnings for orchestration, e.g. overs
48
48
 
49
49
  ## Code Map
50
50
 
51
- <!-- Agent-populated during planning: the distilled investigation map, so the spec carries what exploration found and the implementation handoff need only point here. Annotated paths prevent blind codebase searching. Entries may drill to symbol/line and carry reuse pointers ("mirror X at FILE:LINE") or read-only evidence, where they save the implementer a search. -->
51
+ <!-- Agent-populated during planning. Annotated paths prevent blind codebase searching. -->
52
52
 
53
53
  - `FILE` -- ROLE_OR_RELEVANCE
54
- - `FILE:LINE` -- ROLE_OR_RELEVANCE; reuse pointer or READ-ONLY evidence when relevant
54
+ - `FILE` -- ROLE_OR_RELEVANCE
55
55
 
56
56
  ## Tasks & Acceptance
57
57
 
@@ -33,27 +33,17 @@ persistent_facts = [
33
33
 
34
34
  on_complete = ""
35
35
 
36
- # Handoff for the implementation subagent in step 03 nailed down here the same
37
- # way the review layers below are, so the main session never improvises a fat
38
- # dispatch prompt. The spec is the subagent's sole source of truth; investigation
39
- # findings belong in the spec's Code Map (see step 02), not re-narrated here.
40
- # {spec_file} is substituted at run time. An override may replace the whole recipe
41
- # (e.g. drive an external coding tool via bash).
36
+ # Handoff for the implementation subagent in step 03. The whole execution
37
+ # recipe a subagent by default, but an override may run it any other way
38
+ # (a different model, an external coding tool via bash). {spec_file} is
39
+ # substituted at run time.
42
40
 
43
41
  implementation_handoff = """
44
42
  Launch a subagent with no prior conversation context, with this prompt:
45
43
 
46
- > Read {spec_file} fully and implement it. The spec is the sole source of truth for this change; its Code Map is your investigation map, and its Spec Change Log entries are binding constraints, not history.
44
+ > Read {spec_file} fully and implement it the spec is the sole source of truth. Load every file listed in its frontmatter `context:` before you start.
47
45
  >
48
- > Guardrails:
49
- >
50
- > - Work in the current project. Before starting, load every file listed in the spec frontmatter `context:`.
51
- > - Do not edit the spec file itself.
52
- > - Do not commit or push — that happens later in the workflow.
53
- > - Do not revert or overwrite changes unrelated to this spec.
54
- > - Run the verification described in the spec, plus focused checks for the code you touched.
55
- >
56
- > When done, report: files changed with one line each, verification commands run and their outcomes, any files changed beyond the spec's tasks and why each was needed, anything you could not complete and why, and residual risks.
46
+ > When done, report what you changed, how you verified it, and anything left incomplete or risky.
57
47
  """
58
48
 
59
49
  # Review layers for the review step. `instruction` is the layer's whole
@@ -65,33 +55,39 @@ Launch a subagent with no prior conversation context, with this prompt:
65
55
  id = "blind-hunter"
66
56
  name = "Blind Hunter"
67
57
  instruction = """
68
- Launch a subagent with no prior conversation context, with this prompt:
58
+ Read `{skill-root}/review-prompts/adversarial.md` fully and replace its
59
+ `{review_content}` placeholder with the following diff:
69
60
 
70
- > Invoke the `bmad-review` skill with only the `adversarial` lens on this diff:
71
- >
72
- > {diff_output}
61
+ {diff_output}
62
+
63
+ Launch a subagent with no prior conversation context using the entire rendered
64
+ prompt directly.
73
65
  """
74
66
 
75
67
  [[workflow.review_layers]]
76
68
  id = "edge-case-hunter"
77
69
  name = "Edge Case Hunter"
78
70
  instruction = """
79
- Launch a subagent with no prior conversation context, with this prompt:
71
+ Read `{skill-root}/review-prompts/edge-case-hunter.md` fully and replace its
72
+ `{review_content}` placeholder with the following diff:
80
73
 
81
- > Invoke the `bmad-review` skill with only the `edge-case-hunter` lens on this diff:
82
- >
83
- > {diff_output}
74
+ {diff_output}
75
+
76
+ Launch a subagent with no prior conversation context using the entire rendered
77
+ prompt directly.
84
78
  """
85
79
 
86
80
  [[workflow.review_layers]]
87
81
  id = "verification-gap"
88
82
  name = "Verification Gap Reviewer"
89
83
  instruction = """
90
- Launch a subagent with no prior conversation context, with this prompt:
84
+ Read `{skill-root}/review-prompts/verification-gap.md` fully and replace its
85
+ `{review_content}` placeholder with the following diff:
91
86
 
92
- > Invoke the `bmad-review` skill with only the `verification-gap` lens on this diff:
93
- >
94
- > {diff_output}
87
+ {diff_output}
88
+
89
+ Launch a subagent with no prior conversation context using the entire rendered
90
+ prompt directly.
95
91
  """
96
92
 
97
93
  # Review layers for the one-shot route.
@@ -100,7 +96,11 @@ Launch a subagent with no prior conversation context, with this prompt:
100
96
  id = "blind-hunter"
101
97
  name = "Blind Hunter"
102
98
  instruction = """
103
- Launch a subagent with no prior conversation context, with this prompt:
99
+ Read `{skill-root}/review-prompts/adversarial.md` fully and replace its
100
+ `{review_content}` placeholder with this review target:
101
+
102
+ The changed files in the current worktree. Inspect them directly before reviewing.
104
103
 
105
- > Invoke the `bmad-review` skill with only the `adversarial` lens on the changed files.
104
+ Launch a subagent with no prior conversation context using the entire rendered
105
+ prompt directly.
106
106
  """
@@ -0,0 +1,14 @@
1
+ # Deletion Check
2
+
3
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
4
+
5
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
6
+
7
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
8
+
9
+ - `kind`: `"deletion"`
10
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
11
+
12
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
13
+
14
+ Add nothing if nothing qualifies.
@@ -0,0 +1,37 @@
1
+ # Adversarial Review (General)
2
+
3
+ **Goal:** Cynically review content and produce findings.
4
+
5
+ **Your Role:** You are a cynical, jaded reviewer with zero patience for sloppy work. The content was submitted by a clueless weasel and you expect to find problems. Be skeptical of everything. Look for what's missing, not just what's wrong. Use a precise, professional tone — no profanity or personal attacks.
6
+
7
+ **Inputs:**
8
+ - **content** — Content to review: diff, spec, story, doc, or any artifact
9
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal adversarial analysis
10
+
11
+
12
+ ## EXECUTION
13
+
14
+ ### Step 1: Receive Content
15
+
16
+ - Load the content to review from provided input or context
17
+ - If content to review is empty, ask for clarification and abort
18
+ - Identify content type (diff, branch, uncommitted changes, document, etc.)
19
+
20
+ ### Step 2: Adversarial Analysis
21
+
22
+ Review with extreme skepticism — assume problems exist. Find at least ten issues to fix or improve in the provided content.
23
+
24
+ ### Step 3: Present Findings
25
+
26
+ Output findings as a Markdown list: descriptions only, no severity, priority, or ranking.
27
+
28
+
29
+ ## HALT CONDITIONS
30
+
31
+ - HALT if zero findings — this is suspicious, re-analyze or ask for guidance
32
+ - HALT if content is empty or unreadable
33
+ ## PROVIDED INPUTS
34
+
35
+ **content:**
36
+
37
+ {review_content}
@@ -0,0 +1,90 @@
1
+ # Edge Case Hunter Review
2
+
3
+ **Goal:** You are a pure path tracer. Never comment on whether code is good or bad; only list missing handling.
4
+ When a diff is provided, scan only the diff hunks and list boundaries that are directly reachable from the changed lines and lack an explicit guard in the diff.
5
+ When no diff is provided (full file or function), treat the entire provided content as the scope.
6
+ Ignore the rest of the codebase unless the provided content explicitly references external functions.
7
+ A brief secondary deletion check runs as Step 4 when the diff removes code.
8
+
9
+ **Inputs:**
10
+ - **content** — Content to review: diff, full file, or function
11
+ - **also_consider** (optional) — Areas to keep in mind during review alongside normal edge-case analysis
12
+
13
+ **MANDATORY: Execute steps in the Execution section IN EXACT ORDER. DO NOT skip steps or change the sequence. When a halt condition triggers, follow its specific instruction exactly. Each action within a step is a REQUIRED action to complete that step.**
14
+
15
+ **Your method is exhaustive path enumeration — mechanically walk every branch, not hunt by intuition. Report ONLY paths and conditions that lack handling — discard handled ones silently. Do NOT editorialize or add filler. Do not assign severity labels, rankings, or priority levels.**
16
+
17
+
18
+ ## EXECUTION
19
+
20
+ ### Step 1: Receive Content
21
+
22
+ - Load the content to review strictly from provided input
23
+ - If content is empty, or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
24
+ - Identify content type (diff, full file, or function) to determine scope rules
25
+
26
+ ### Step 2: Exhaustive Path Analysis
27
+
28
+ **Walk every branching path and boundary condition within scope — report only unhandled ones.**
29
+
30
+ - If `also_consider` input was provided, incorporate those areas into the analysis
31
+ - Walk all branching paths: control flow (conditionals, loops, error handlers, early returns) and domain boundaries (where values, states, or conditions transition). Derive the relevant edge classes from the content itself — don't rely on a fixed checklist. Examples: missing else/default, unguarded inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
32
+ - Consider implicit branches: the diff special-cases or changes the handling of one or more members of a fixed set of values — enums, status codes, sentinels, type tags, flags, value ranges. The rest of the set is implicit branches (e.g. the diff changes the `RED` and `YELLOW` cases of a `RED`/`YELLOW`/`GREEN` enum; `GREEN` is the implicit branch)
33
+ - For each path: determine whether the content handles it
34
+ - Collect only the unhandled paths as findings — discard handled ones silently
35
+
36
+ ### Step 3: Validate Completeness
37
+
38
+ - Revisit every edge class from Step 2 — e.g., missing else/default, null/empty inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
39
+ - Add any newly found unhandled paths to findings; discard confirmed-handled ones
40
+
41
+ ### Step 4: Deletion Check
42
+
43
+ If the diff removed or replaced meaningful code (ignore pure renames and whitespace): load `references/deletion-check.md` and follow it.
44
+
45
+ ### Step 5: Present Findings
46
+
47
+ Output all findings as a single JSON array following the Output Format specification exactly.
48
+
49
+
50
+ ## OUTPUT FORMAT
51
+
52
+ Return ONLY a valid JSON array of objects. Each edge-case finding contains exactly these four fields:
53
+
54
+ ```json
55
+ [{
56
+ "location": "file:start-end (or file:line when single line, or file:hunk when exact line unavailable)",
57
+ "trigger_condition": "one-line description (max 15 words)",
58
+ "guard_snippet": "minimal code sketch that closes the gap (single-line escaped string, no raw newlines or unescaped quotes)",
59
+ "potential_consequence": "what could actually go wrong (max 15 words)"
60
+ }]
61
+ ```
62
+
63
+ No extra text, no explanations, no markdown wrapping. An empty array `[]` is valid when nothing is found. Deletion findings from Step 4, if any, go in the same array with the extra fields defined in `references/deletion-check.md`.
64
+
65
+
66
+ ## HALT CONDITIONS
67
+
68
+ - If content is empty or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
69
+ <reference path="references/deletion-check.md">
70
+ # Deletion Check
71
+
72
+ Secondary pass for the Edge Case Hunter — runs only when the diff removed meaningful code. Subordinate to the edge-case pass; findings are usually few or none.
73
+
74
+ For each chunk of removed or replaced code (ignore pure renames and whitespace), ask: did it carry behavior or a contract that the change neither re-established nor intentionally retired? Add a finding for any resulting regression, orphaned reference, or newly-dead code. Skip anything already covered by your edge-case findings.
75
+
76
+ Append each finding to the same JSON array as the edge-case findings, with the four standard fields plus:
77
+
78
+ - `kind`: `"deletion"`
79
+ - `confidence`: `"high"`, `"medium"`, or `"low"` — these are inferences; rate them
80
+
81
+ For a deletion finding the standard fields read as: `location` = the removed item; `trigger_condition` = the behavior or contract it enforced; `guard_snippet` = where or how to re-establish it; `potential_consequence` = the regression or orphan.
82
+
83
+ Add nothing if nothing qualifies.
84
+ </reference>
85
+
86
+ ## PROVIDED INPUTS
87
+
88
+ **content:**
89
+
90
+ {review_content}
@@ -0,0 +1,106 @@
1
+ # Verification Gap Review
2
+
3
+ **Goal:** Find changed behavior that could break without reliable verification catching it. Ask one question — "if the behavior this change is supposed to produce broke where it's actually used, would verification fail?" Do not hunt for correctness bugs, but report genuine problems you notice while tracing verification.
4
+
5
+ The main verification gap shapes are:
6
+
7
+ 1. **Regression gap:** the changed code regresses where it's used, and no test covering that use would fail.
8
+ 2. **Missing-adoption gap:** a place that should now use the new behavior doesn't; it handles the same case its own way, or not at all, and no test would flag the omission.
9
+ 3. **Broken-verification gap:** a test appears to cover the changed behavior, but would not actually protect it because it is skipped, flaky, not run in the normal verification path, or too weak to observe the regression.
10
+
11
+ ## Evidence Rules
12
+
13
+ - Read a test before claiming what it covers, runs, asserts, or misses.
14
+ - Before claiming no test exists, search the whole repo by the symbol under test and by import references; expected file locations are not enough.
15
+ - Never assert what you did not verify. If a finding cannot be grounded, drop it.
16
+ - In a finding, say what you actually checked — "none of the tests I read cover this" — and show how far you looked. Say a test doesn't exist anywhere only when the symbol/import-reference search actually shows that.
17
+ - Do not assign severity, confidence, priority, or ranking.
18
+
19
+ ## Review Sequence
20
+
21
+ ### Step 1: Screen for behavioral change
22
+
23
+ If the change is non-behavioral, stop here and output the clean result (see Output Format). Call it non-behavioral only when the changed code does not alter return values, thrown errors, caller-visible side effects, or observable state (including iteration order and emitted messages). After the changed code meets that test, stop; do not inspect callers or tests for extra confirmation.
24
+
25
+ Common non-behavioral examples: formatting, comments, whitespace; pure renames; trivial getters/setters and pass-throughs; type-only or compiler-enforced changes with no runtime effect; etc.
26
+
27
+ ### Step 2: Find the behavior that changed
28
+
29
+ Identify what behavior changed compared to the previous version: output, side effect, branch, error path, schema/event shape, config default, validation/authorization rule, external contract, etc. If the change affects more than one behavior, handle each separately.
30
+
31
+ Treat broad-impact changes as behavioral even when no single changed line looks important: dependency, toolchain, build/config, data-file, etc.
32
+
33
+ ### Step 3: Trace where that behavior is used
34
+
35
+ Trace the changed behavior to the places that observe it. Start with direct callers and registered entry points (routes, commands, DI), contract consumers (schemas, events, APIs, database readers), and reverse-dependency info if already available.
36
+
37
+ Follow a path only while the changed behavior is reachable and unverified. Stop when a test at that boundary would fail, the consumer does not observe the changed behavior, or the next hop is guesswork (dynamic dispatch, reflection, outside-repo consumers, etc.). Prefer the nearest observable boundary, often one to three hops away, especially across contract, integration, or service edges. If there are more than five similar consumers, group obvious repeats and check representative paths; expand only when a consumer observes the behavior differently.
38
+
39
+ ### Step 4: Qualify the consumer, then check its test
40
+
41
+ For each consumer, name the smallest realistic regression this consumer would observe: invert the branch, drop the default, omit the field, return the old error code, skip the integration call, etc. This is the Demonstration. If no such regression exists, drop the path; untested downstream code is not a finding.
42
+
43
+ A `Missing-adoption gap` qualifies not by the adoption failure alone but by a supersession signal: the change gives clear evidence the new behavior is meant to replace the local one — PR intent, naming or docs, a replaced sibling site, deleted duplicate logic, or a test defining the new rule — and the local site shares the same observable contract. Without a supersession signal and a shared observable contract, it is a refactor suggestion, not a verification-gap finding. Once both hold, check whether any test for that site would flag the non-adoption; missing coverage of the non-adoption is the gap itself, not a disqualifier.
44
+
45
+ Find and read the relevant test. Ask whether the Demonstration would make an assertion fail.
46
+
47
+ - If yes, the behavior is verified. No finding.
48
+ - For a regression-style Demonstration: if no test runs the path, the test is skipped/flaky/not run normally, or the test runs the code without checking the changed result, report a `Regression gap` or `Broken-verification gap`.
49
+ - For a qualifying Missing-adoption case: if none of the site tests you found assert it adopts the new behavior, report a `Missing-adoption gap`.
50
+
51
+ A test counts only if it runs normally and an assertion observes the changed output, branch, or contract. These do not count: no execution; success/no-throw/snapshot-only checks; mock/log-call checks; human-only checks; tests that mock away the integration; e2e tests that pass through without checking the changed output; stale assertions or fixtures.
52
+
53
+ Common patterns:
54
+
55
+ - **Caller-path gap** — helper test covers the branch, but caller values skip it.
56
+ - **Contract drift** — payload/schema/event changes must be verified at the consumer.
57
+ - **Migration compatibility** — tests only create new-format rows or fresh schemas.
58
+ - **Phantom exception** — handled partial-failure path has no test.
59
+ - **Missing-adoption gap** — sibling site should use the new rule/helper and does not.
60
+ - **Removed verification** — deleted test or weakened assertion leaves behavior unpinned.
61
+
62
+ ### Step 5: Confirm each finding is real
63
+
64
+ Before writing a finding, re-open the specific tests or search results the finding relies on. Verify the Demonstration would not make any test you checked fail, or that the absence claim is backed by the symbol/import-reference search. Do not claim more than you verified; drop any finding you cannot ground.
65
+
66
+ Do not report: compiler/type-checker-enforced cases; behavior already verified by an integration, contract, or e2e test; implementation-detail or mock-only tests; low coverage or a missing test file by itself; legacy untested code the change did not affect.
67
+
68
+ Report genuine problems you noticed while tracing verification, even if they are not verification gaps. Put them under `Other findings` in the output. This permits reporting what you already reached, not extra hunting.
69
+
70
+ ## OUTPUT FORMAT
71
+
72
+ Emit each verification-gap finding as one block. No general advice, no severity or confidence.
73
+
74
+ ```markdown
75
+ ### <one-line title naming the gap>
76
+
77
+ - **Changed surface:** the exact behavior or contract that changed — `file:line`.
78
+ - **Impacted consumer or site:** named concretely with `file:line` (e.g. "the `createInvoice` mutation used by the billing dashboard at `billing/dashboard.ts:88`," not "callers of this function").
79
+ - **Existing test evidence:**
80
+ - `Regression gap`: what the relevant test actually asserts, with `file:line`; or, if none, the symbol/import-reference searches run and their result.
81
+ - `Missing-adoption gap`: tests for the impacted site, and whether any assert it adopts the new behavior.
82
+ - `Broken-verification gap`: the apparent test or verification path, and why it does not count.
83
+ - **Missing verification:** the precise assertion or check that's absent.
84
+ - **Demonstration:**
85
+ - `Regression gap` / `Broken-verification gap`: the concrete regression that would ship undetected, and why the tests you checked would not fail.
86
+ - `Missing-adoption gap`: the case the site mishandles by not adopting the new behavior, and that none of the tests you read assert adoption.
87
+ - **Consequence:** the concrete thing that ships wrong — a regression the checked evidence would not catch, or a site that should use the new behavior and doesn't.
88
+ - **Suggested test shape:** (optional) the kind of test that would close the gap, fit to the repo's own way of verifying — don't impose a generic test pyramid.
89
+ ```
90
+
91
+ If you noticed genuine non-gap problems while tracing verification, append:
92
+
93
+ ```markdown
94
+ ## Other findings
95
+
96
+ - <description only; no severity, confidence, priority, or ranking>
97
+ ```
98
+
99
+ When you find no verification gaps and no other findings, output exactly this single line, not an empty response:
100
+
101
+ `No verification gaps found.`
102
+ ## PROVIDED INPUTS
103
+
104
+ **content:**
105
+
106
+ {review_content}
@@ -46,10 +46,10 @@ context: [] # optional: `{project-root}/`-prefixed paths to project-wide standar
46
46
 
47
47
  ## Code Map
48
48
 
49
- <!-- Agent-populated during planning: the distilled investigation map, so the spec carries what exploration found and the implementation handoff need only point here. Annotated paths prevent blind codebase searching. Entries may drill to symbol/line and carry reuse pointers ("mirror X at FILE:LINE") or read-only evidence, where they save the implementer a search. -->
49
+ <!-- Agent-populated during planning. Annotated paths prevent blind codebase searching. -->
50
50
 
51
51
  - `FILE` -- ROLE_OR_RELEVANCE
52
- - `FILE:LINE` -- ROLE_OR_RELEVANCE; reuse pointer or READ-ONLY evidence when relevant
52
+ - `FILE` -- ROLE_OR_RELEVANCE
53
53
 
54
54
  ## Tasks & Acceptance
55
55