@gobing-ai/spur 0.3.41 → 0.3.42

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 (185) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/README.md +15 -1
  3. package/config/templates/AGENTS.md +5 -3
  4. package/config/workflows/task-pipeline.yaml +103 -12
  5. package/package.json +15 -12
  6. package/plugins/README.md +655 -0
  7. package/plugins/sp/README.md +621 -0
  8. package/plugins/sp/agents/expert-spur.md +109 -0
  9. package/plugins/sp/agents/super-coder.md +126 -0
  10. package/plugins/sp/agents/super-planner.md +283 -0
  11. package/plugins/sp/agents/super-reviewer.md +154 -0
  12. package/plugins/sp/commands/dev-arch.md +30 -0
  13. package/plugins/sp/commands/dev-brainstorm.md +40 -0
  14. package/plugins/sp/commands/dev-changelog.md +28 -0
  15. package/plugins/sp/commands/dev-daily.md +29 -0
  16. package/plugins/sp/commands/dev-debug.md +29 -0
  17. package/plugins/sp/commands/dev-dogfood.md +33 -0
  18. package/plugins/sp/commands/dev-featurechange.md +130 -0
  19. package/plugins/sp/commands/dev-find-conflict.md +51 -0
  20. package/plugins/sp/commands/dev-find-issue.md +76 -0
  21. package/plugins/sp/commands/dev-find-next.md +60 -0
  22. package/plugins/sp/commands/dev-fixall.md +33 -0
  23. package/plugins/sp/commands/dev-gitmsg.md +28 -0
  24. package/plugins/sp/commands/dev-gtd.md +97 -0
  25. package/plugins/sp/commands/dev-handover.md +26 -0
  26. package/plugins/sp/commands/dev-idea.md +50 -0
  27. package/plugins/sp/commands/dev-next.md +31 -0
  28. package/plugins/sp/commands/dev-parallel.md +30 -0
  29. package/plugins/sp/commands/dev-plan.md +46 -0
  30. package/plugins/sp/commands/dev-refine.md +48 -0
  31. package/plugins/sp/commands/dev-refineall.md +65 -0
  32. package/plugins/sp/commands/dev-refresh.md +32 -0
  33. package/plugins/sp/commands/dev-reverse.md +32 -0
  34. package/plugins/sp/commands/dev-review.md +31 -0
  35. package/plugins/sp/commands/dev-run.md +63 -0
  36. package/plugins/sp/commands/dev-runall.md +80 -0
  37. package/plugins/sp/commands/dev-simplify.md +39 -0
  38. package/plugins/sp/commands/dev-unit.md +29 -0
  39. package/plugins/sp/commands/dev-verify.md +48 -0
  40. package/plugins/sp/commands/dev-verifyall.md +72 -0
  41. package/plugins/sp/commands/dev-wrap.md +30 -0
  42. package/plugins/sp/commands/dev-wrapall.md +33 -0
  43. package/plugins/sp/commands/rule-add.md +18 -0
  44. package/plugins/sp/commands/rule-refine.md +18 -0
  45. package/plugins/sp/commands/rule-scan.md +18 -0
  46. package/plugins/sp/commands/spur-init.md +22 -0
  47. package/plugins/sp/commands/workflow-add.md +18 -0
  48. package/plugins/sp/commands/workflow-refine.md +18 -0
  49. package/plugins/sp/hooks/agent-hint.ts +60 -0
  50. package/plugins/sp/hooks/careful-guard.ts +147 -0
  51. package/plugins/sp/hooks/context-post-tool.ts +325 -0
  52. package/plugins/sp/hooks/context-session-start.ts +182 -0
  53. package/plugins/sp/hooks/context-session-stop.ts +95 -0
  54. package/plugins/sp/hooks/hooks.json +51 -0
  55. package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
  56. package/plugins/sp/hooks/task-write-guard.ts +84 -0
  57. package/plugins/sp/plugin.json +8 -0
  58. package/plugins/sp/scripts/batch-preflight.ts +204 -0
  59. package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
  60. package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
  61. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
  62. package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
  63. package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
  64. package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
  65. package/plugins/sp/scripts/task-size-precheck.ts +202 -0
  66. package/plugins/sp/scripts/validate-commands.ts +651 -0
  67. package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
  68. package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
  69. package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
  70. package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
  71. package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
  72. package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
  73. package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
  74. package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
  75. package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
  76. package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
  77. package/plugins/sp/skills/code-implementation/SKILL.md +176 -0
  78. package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
  79. package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
  80. package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
  81. package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
  82. package/plugins/sp/skills/code-review/SKILL.md +112 -0
  83. package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
  84. package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
  85. package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
  86. package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
  87. package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
  88. package/plugins/sp/skills/code-testing/SKILL.md +108 -0
  89. package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
  90. package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
  91. package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
  92. package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
  93. package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
  94. package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
  95. package/plugins/sp/skills/code-verification/SKILL.md +535 -0
  96. package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
  97. package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
  98. package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
  99. package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
  100. package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
  101. package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
  102. package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
  103. package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
  104. package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
  105. package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
  106. package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
  107. package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
  108. package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
  109. package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
  110. package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
  111. package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
  112. package/plugins/sp/skills/functional-review/SKILL.md +364 -0
  113. package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
  114. package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
  115. package/plugins/sp/skills/issue-finding/SKILL.md +424 -0
  116. package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
  117. package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
  118. package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
  119. package/plugins/sp/skills/issue-finding/references/session-formats.md +121 -0
  120. package/plugins/sp/skills/next-feature/SKILL.md +125 -0
  121. package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
  122. package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
  123. package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
  124. package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
  125. package/plugins/sp/skills/next-router/SKILL.md +181 -0
  126. package/plugins/sp/skills/next-router/references/messages.md +90 -0
  127. package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
  128. package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
  129. package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +100 -0
  130. package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
  131. package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
  132. package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
  133. package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
  134. package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
  135. package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
  136. package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
  137. package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
  138. package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
  139. package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
  140. package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
  141. package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
  142. package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
  143. package/plugins/sp/skills/spur-cli/references/features.md +234 -0
  144. package/plugins/sp/skills/spur-cli/references/init.md +119 -0
  145. package/plugins/sp/skills/spur-cli/references/message.md +98 -0
  146. package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
  147. package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
  148. package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
  149. package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
  150. package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
  151. package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
  152. package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
  153. package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
  154. package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
  155. package/plugins/sp/skills/spur-cli/references/tasks.md +278 -0
  156. package/plugins/sp/skills/spur-cli/references/team.md +133 -0
  157. package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
  158. package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
  159. package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
  160. package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
  161. package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
  162. package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
  163. package/plugins/sp/skills/spur-dev/references/cross-cutting.md +664 -0
  164. package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
  165. package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
  166. package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
  167. package/plugins/sp/skills/spur-dev/references/execution-batch.md +727 -0
  168. package/plugins/sp/skills/spur-dev/references/execution-workflow.md +350 -0
  169. package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
  170. package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
  171. package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
  172. package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
  173. package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
  174. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +88 -0
  175. package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
  176. package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
  177. package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
  178. package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
  179. package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
  180. package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
  181. package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
  182. package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
  183. package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
  184. package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
  185. package/spur.js +6093 -5180
@@ -0,0 +1,535 @@
1
+ ---
2
+ name: code-verification
3
+ description: "Verify a task's implementation against requirements and AC; SECUA code review. Produces a PASS/PARTIAL/FAIL verdict with per-requirement evidence. Triggers: \"verify task\", \"verify this\", \"check the requirements\", \"code review\", \"SECUA review\", \"requirements traceability\", \"review the diff\"."
4
+ license: Apache-2.0
5
+ metadata:
6
+ author: spur
7
+ review_skills:
8
+ - functional-review
9
+ - code-improvement
10
+ version: "1.0"
11
+ platforms: "claude-code,codex,openclaw,opencode,antigravity"
12
+ interactions:
13
+ - reviewer
14
+ - pipeline
15
+ modes:
16
+ - verify
17
+ - review
18
+ verdicts:
19
+ - PASS
20
+ - PARTIAL
21
+ - FAIL
22
+ openclaw:
23
+ emoji: "🔍"
24
+ ---
25
+
26
+ # Spur Code Verification
27
+
28
+ The **verifier** in the Spur execution loop. A coding agent reports "done" with overconfidence;
29
+ this skill is the deterministic counterweight that proves — or disproves — the claim against the
30
+ task's own requirements and Acceptance Criteria, then writes the evidence back to the corpus
31
+ through CLI verbs.
32
+
33
+ It backs two commands:
34
+
35
+ | Command | Mode | Input | Output |
36
+ |---------|------|-------|--------|
37
+ | `/sp:dev-verify <wbs>` | **verify** | a task WBS | per-requirement verdict → `## Testing`; `.spur/run/<wbs>-verdict.json` |
38
+ | `/sp:dev-review <wbs>` | **review** | a task WBS (diff scope) | three-dimensional findings → `## Review` (functional + SECUA + architecture) |
39
+
40
+ The verify mode is the **completion gate's evidence source**: it emits a machine verdict the
41
+ `task-pipeline.yaml` workflow reads before allowing `record → done`. A `PASS` clears the gate; a
42
+ `PARTIAL`/`FAIL` blocks it. This is what makes "done" mean *verified*, not *self-reported*. The
43
+ three `testing → done` gate layers (strict-core + verdict artifact, provenance guard, Review L3)
44
+ and their per-layer remediation are owned by
45
+ [gate-checklists.md](../spur-dev/references/gate-checklists.md) § done-gate.
46
+
47
+ ## Why this skill exists (the gap it closes)
48
+
49
+ `spur task check` validates section **presence**, not content — it passes a hollow `## Testing`
50
+ heading. So presence-checking alone lets an agent march a task to `done` with empty evidence and an
51
+ implementation that doesn't match its AC. This skill supplies the missing **content** verdict:
52
+ it reads requirements and AC, maps each to evidence, and refuses to certify what isn't there. The
53
+ verdict artifact carries that signal to the pipeline gate (design §B).
54
+
55
+ ## Cross-cutting rules (inherited from sp:spur-dev)
56
+
57
+ The CLI-gated section-write contract (every mutation via `spur task update --section --from-file`,
58
+ never a legacy `tasks` CLI) is the SSOT in
59
+ [spur-dev/cross-cutting.md](../spur-dev/references/cross-cutting.md) — this skill adds one rule of
60
+ its own: **the verdict artifact is the contract.** `.spur/run/<wbs>-verdict.json` is the machine
61
+ signal the workflow guard reads; always write it last, after the verdict is final.
62
+
63
+ The universal honesty gate — **no "done / passing / fixed / works" claim without fresh, pasted
64
+ verification evidence run this turn** — lives in that same file:
65
+ [Verification Before Completion](../spur-dev/references/cross-cutting.md#verification-before-completion).
66
+ The verify step is where it is enforced hardest: a PASS verdict is a completion claim, so it obeys the gate.
67
+
68
+ ---
69
+
70
+ ## Mode: verify (`/sp:dev-verify`)
71
+
72
+ The task-oriented path: prove the implementation satisfies the task's requirements + AC.
73
+
74
+ ### Step 1 — Load the task and parse flags
75
+
76
+ ```bash
77
+ spur task show <wbs> --json
78
+ ```
79
+
80
+ The JSON carries `{ wbs, name, status, filePath, content, frontmatter }`. Parse from `content`:
81
+
82
+ - `## Requirements` — the R-items (the traceability targets).
83
+ - `## Acceptance Criteria` / `### Acceptance Criteria` — checklist items and Gherkin scenarios (the
84
+ AC targets). AC evaluation is mandatory when this section is non-empty; `--bdd` only tightens the
85
+ scenario-to-test requirement.
86
+
87
+ Flags: `--agent <inline|auto|name>` (execution surface — inline default, with named escalation triggers taking precedence — see [cross-cutting.md](../spur-dev/references/cross-cutting.md#inline-default-execution-surface)), `--auto` (no confirmations), `--force` (bypass the terminal-status guard), `--fix <none|blockers-first|all>` (post-verdict repair), `--focus <all|security|efficiency|correctness|usability|architecture>` (SECUA dimensions), `--bdd` (strict Gherkin scenario-to-test check), `--next` (on PASS, auto-transition `testing → done`; on PARTIAL/FAIL, stop), `--skip-shippable` (alias `--skip-shipable`) — disable the feature-level **Shippable readiness gate** that otherwise runs when `--fix all` and a feature context exists (see Step 13).
88
+
89
+ ### Step 2 — Status guard
90
+
91
+ If the task status is terminal (`done`, `cancelled`) **and** `--force` is not set, log the skip and
92
+ exit 0 (a deliberate non-error skip — re-verifying a `done` task without intent wastes tokens). With
93
+ `--force`, proceed regardless. (Under the pipeline the task is at `wip`/`testing`, so the guard is a
94
+ no-op there; `--force` matters for re-auditing completed tasks.)
95
+
96
+ ### Step 3 — Establish the change scope
97
+
98
+ Determine which files the task changed (the evidence surface):
99
+
100
+ ```bash
101
+ TASK_FILE=$(spur task show <wbs> --json | jq -r .filePath)
102
+ COMMIT=$(git log -1 --format=%H -- "$TASK_FILE")
103
+ git diff --name-only "${COMMIT}~1"..HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx'
104
+ # Fallback when the task file is uncommitted: use the working-tree diff.
105
+ git status --porcelain
106
+ ```
107
+
108
+ ### Step 4 — Requirements traceability gate (Phase 8)
109
+
110
+ For each `R{n}` in `## Requirements`, find implementation evidence in the changed files / tests and
111
+ assign a per-requirement status:
112
+
113
+ | Per-requirement status | Condition |
114
+ | ------------------------ | ----------- |
115
+ | **MET** | Concrete evidence (code + test) for the requirement exists in scope |
116
+ | **PARTIAL** | Evidence for part of the requirement only |
117
+ | **UNMET** | No implementation evidence found |
118
+
119
+ Record the evidence string (repo-relative path `file:line`, e.g. `packages/app/src/services/task-check.ts:42`, command, or test name) per requirement — this is what lands
120
+ in `## Testing`.
121
+
122
+ **Line-anchor verification (anti-stale-citation rule).** Every `file:line` evidence citation
123
+ written into the Testing table MUST be re-read at the cited lines this run, and the re-read content
124
+ MUST name the requirement's subject (the R-item's noun - not merely exist on disk) before a MET row
125
+ is written. A citation whose anchor resolves to another ticket's content, a stale line range, or a
126
+ heading/comment unrelated to the requirement fails the row to UNMET and surfaces the stale anchor as
127
+ a finding (severity >= P2). This closes the gap where a verify run certified a task `done` citing
128
+ `evidence:134` that was actually a sibling ticket's telemetry text (0299 R1, from the 0282 re-audit).
129
+
130
+ ### Step 5 — Acceptance Criteria guard
131
+
132
+ If the task has a non-empty Acceptance Criteria section, evaluate every checklist item and every
133
+ Gherkin scenario independently. This gate runs whether or not `--bdd` is set.
134
+
135
+ | Per-AC status | Condition |
136
+ | --------------- | ----------- |
137
+ | **MET** | The AC is satisfied by concrete evidence |
138
+ | **PARTIAL** | Some evidence exists, but a material condition is missing or only inferred |
139
+ | **UNMET** | No implementation evidence satisfies the AC, or a required scenario fails |
140
+ | **N/A** | The AC is explicitly non-applicable with a concrete reason |
141
+
142
+ Evidence is typed so weak proof is visible. Objective AC cannot be cleared by `llm-judge` alone —
143
+ pair qualitative judgment with deterministic or static evidence, or mark the row `PARTIAL`. Full
144
+ type list, the core-behavior executable-evidence requirement, and the CLI golden-path rule are the
145
+ contract in
146
+ [references/verdict-schema.md](references/verdict-schema.md#acceptance-criteria-evidence); apply it
147
+ here, don't re-derive it.
148
+
149
+ When `--bdd` is set, each Gherkin scenario must map to executable evidence (`test` or `command`) or
150
+ an explicitly reported missing-test condition. A missing executable mapping is `UNMET` when the
151
+ scenario is core to the task and `PARTIAL` only when the scenario is documented as advisory/deferred.
152
+
153
+ The answer file must include a stable AC table:
154
+
155
+ ```markdown
156
+ ### Acceptance Criteria Verification
157
+
158
+ | AC | Status | Evidence Type | Evidence |
159
+ |----|--------|---------------|----------|
160
+ | Scenario: CLI emits JSON | MET | test | `apps/cli/tests/foo.test.ts:42` |
161
+ ```
162
+
163
+ **Line-anchor verification applies to AC evidence too.** Every `file:line` citation in the AC
164
+ evidence column is subject to the Step 4 line-anchor rule - re-read at the cited lines this run and
165
+ confirm the content names the AC's subject before marking the row MET.
166
+
167
+ ### Step 6 — Design conformance (Phase 7a; Wave C / 0179 R1–R3)
168
+
169
+ Verify the implementation matches the **approved design**, not just the requirements. The `### Design`
170
+ section is the artifact the `refine` HITL gate approves; without this step, an implementation can
171
+ diverge completely from the chosen approach and still PASS requirements/AC.
172
+
173
+ **What to read.** Pull `### Design` from the task content (sub-bullets, chosen approach, invariants,
174
+ signatures, rejected alternatives, calibrated tradeoffs). The feature design satellite
175
+ `docs/design/<slug>.md` is consulted when one exists (calibration source for SECUA-A: patterns
176
+ blessed in DESIGN.md are not flagged).
177
+
178
+ **Classification.** For each non-trivial design claim, classify against the diff:
179
+
180
+ | Status | Condition |
181
+ | -------- | ----------- |
182
+ | **DONE** | The diff implements the claim exactly as written |
183
+ | **PARTIAL** | Some but not all sub-aspects of the claim are implemented |
184
+ | **NOT DONE** | The claim has no implementation in the diff |
185
+ | **CHANGED** | The implementation differs from the written claim |
186
+
187
+ **Rules.** A claim marked NOT DONE **without** a `### Solution` note is a silent deviation →
188
+ major finding, verdict drops to PARTIAL. A claim NOT DONE **with** a `### Solution` note asserting
189
+ goal-equivalent intent is a documented deviation → classify CHANGED, PASS-acceptable, no downgrade.
190
+ Diff hunks matching no Requirement/AC/Design/Plan item are scope-creep — surface a `scope-creep` row
191
+ in `checks[]`; SECUA-A escalates it to a major finding only past 50% of the diff. Patterns blessed in
192
+ DESIGN.md (or `docs/design/<slug>.md`) calibrate SECUA-A and are never flagged as drift.
193
+
194
+ Emit a `design-conformance` row into the verdict `checks[]`:
195
+
196
+ ```markdown
197
+ | Check | Status | Evidence |
198
+ |-------|--------|----------|
199
+ | design-conformance | pass | 4/5 claims DONE; 1 CHANGED (Solution §3) |
200
+ ```
201
+
202
+ ### Step 7 — SECUA + quality review (Phase 7)
203
+
204
+ Review the changed code across the `--focus` dimensions (default all): **S**ecurity (secrets,
205
+ injection, unsafe input), **E**fficiency, **C**orrectness (null/edge handling, logic), **U**sability
206
+ (API clarity, error messages), **A**rchitecture (module depth, seam placement, coupling, locality).
207
+ Rank findings by severity (blocker / major / minor). See
208
+ [references/secu-review.md](references/secu-review.md). For review *depth* — structural remedies,
209
+ change sizing, honesty/anti-sycophancy, dead-code hygiene, and dependency discipline — the SSOT is
210
+ [code-review/references/review-lenses.md](../code-review/references/review-lenses.md); apply it here
211
+ rather than restating it.
212
+
213
+ When review exposes broader architecture friction rather than a localized defect, use
214
+ [references/code-improvement.md](references/code-improvement.md) to frame follow-up candidates
215
+ instead of silently expanding the current fix. LLM-as-judge reasoning is useful as a blind-spot
216
+ finder, but actionable findings must cite files, severity, and verification feasibility.
217
+
218
+ ### Step 8 — Strict BDD scenario lens (if `--bdd`)
219
+
220
+ Apply the stricter mapping rules from Step 5 to Gherkin scenarios. Passed executable scenario →
221
+ MET; failed executable scenario → UNMET; no executable evidence → UNMET for core scenarios or
222
+ PARTIAL only when explicitly advisory/deferred. Fold the AC statuses into the aggregate verdict.
223
+
224
+ ### Step 9 — Aggregate the verdict
225
+
226
+ Apply the aggregation rule in
227
+ [references/verdict-schema.md](references/verdict-schema.md#aggregation-rule): core UNMET or a
228
+ blocker finding → FAIL; core PARTIAL or an unresolved major finding (no FAIL) → PARTIAL; everything
229
+ MET or justified N/A → PASS. Minor/advisory findings do not block. Only `PASS` clears the pipeline
230
+ completion gate (`PARTIAL`/`FAIL` route the pipeline to `failed`).
231
+
232
+ ### Step 10 — Write findings to the task
233
+
234
+ Assemble the evidence and write via CLI verbs (temp-file → `--section`):
235
+
236
+ ```bash
237
+ # Testing section: per-requirement and per-AC verdict tables + evidence
238
+ printf '...' > /tmp/<wbs>-testing.md
239
+ spur task update <wbs> --section Testing --from-file /tmp/<wbs>-testing.md
240
+ ```
241
+
242
+ > **Do not write `## Review` directly in verify mode.** The `## Review` section is owned by the
243
+ > `review` step (`/sp:dev-review`), which dispatches `functional-review` + `code-verification`
244
+ > review mode + `code-improvement`. The `record` step backfills `## Review` from the verdict
245
+ > artifact only if the section is bare (`sectionIsBare` guard, `task-service.ts:485`). Writing
246
+ > `## Review` here bypasses that guard and destroys the review step's three-dimensional findings.
247
+
248
+ Section bodies passed to `spur task update --section` must be **body-only**. Do not put a same-level
249
+ heading inside any section body; the task writer strips same-level headings to prevent phantom
250
+ sections. Concretely:
251
+
252
+ - **Testing section:** do not put `### Acceptance Criteria Verification`, `### Per-Requirement
253
+ Traceability`, or any `###` heading inside the Testing body. Use bold labels
254
+ (`**Acceptance Criteria Verification**`) or tables instead.
255
+
256
+ ### Step 11 — State the verdict and hand off (the gate contract)
257
+
258
+ End the verify output with an explicit, parseable verdict line so the pipeline can transport it
259
+ deterministically:
260
+
261
+ ```
262
+ Verdict: PASS (or PARTIAL / FAIL)
263
+ ```
264
+
265
+ **Answer-File Schema Contract (R2 / 0478).** The verify answer file (`.spur/run/<wbs>-verify-answer.txt`) MUST follow this exact structure so `spur task verdict --from-answer` can parse it:
266
+
267
+ ```markdown
268
+ Verdict: PASS
269
+
270
+ ### Per-Requirement Traceability
271
+ | Req | Status | Evidence |
272
+ | --- | --- | --- |
273
+ | R1 | MET | `packages/app/src/foo.ts:42` |
274
+
275
+ ### Acceptance Criteria Verification
276
+ | AC | Status | Evidence Type | Evidence |
277
+ | --- | --- | --- | --- |
278
+ | Scenario: CLI emits JSON | MET | test | `apps/cli/tests/foo.test.ts:42` |
279
+
280
+ ### SECUA Review
281
+ | Priority | Dimension | Location | Finding |
282
+ | --- | --- | --- | --- |
283
+ | P4 | — | — | No P1–P3 findings; verify verdict PASS |
284
+ ```
285
+
286
+ The per-requirement traceability table MUST use `| Req | Status | Evidence |` (exactly this header, no `R#`/`R`/`Requirement` variant, and no extra columns between Req and Status). The Acceptance Criteria table MUST use `| AC | Status | Evidence Type | Evidence |`.
287
+
288
+ **MUST NOT:** use `| R# | ... |` as the sole id header without `Status` in column 2.
289
+ **MUST NOT:** place a `Severity` column between `Req` and `Status` in the authoring contract.
290
+ The parser is tolerant of these variants (defense-in-depth), but the authoring contract is
291
+ canonical.
292
+
293
+ **Under the pipeline** (`task-pipeline.yaml`), `agent.run answerFile` captures this whole output to
294
+ `.spur/run/<wbs>-verify-answer.txt`. A deterministic shell step then derives
295
+ `.spur/run/<wbs>-verdict.json` from it plus an independent `spur task check` (R9; the agent
296
+ reporting PASS in prose is necessary but not sufficient — the artifact is never left to the agent's
297
+ discretion). The **record** step transcribes only `## Testing` from the verdict — verdict + per-
298
+ requirement/AC tables + evidence. `## Review` is owned by the review step (`/sp:dev-review`) and
299
+ the record step's `sectionIsBare` guard (`task-service.ts:485`) preserves any non-bare Review
300
+ content. Verify mode never writes `## Review`.
301
+
302
+ **Standalone** (`/sp:dev-verify` outside the pipeline — no answer-file capture exists), write the
303
+ artifact yourself; shape and field-by-field contract in
304
+ [references/verdict-schema.md](references/verdict-schema.md):
305
+
306
+ ```bash
307
+ mkdir -p .spur/run
308
+ jq -n --arg wbs "<wbs>" --arg v "<PASS|PARTIAL|FAIL>" \
309
+ '{wbs:$wbs, verdict:$v, requirements:[...], checks:[...]}' \
310
+ > .spur/run/<wbs>-verdict.json
311
+ ```
312
+
313
+ For documentation-only, configuration-only, or skill-doc verification where no runtime coverage
314
+ measurement applies, include an explicit coverage line in the Testing evidence
315
+ (`Coverage: N/A (documentation-only change; no runtime code path added).`) — this satisfies the task
316
+ checker without pretending a coverage percentage was measured.
317
+
318
+ ### Step 12 — Fix pass (if `--fix` ≠ `none`)
319
+
320
+ - `blockers-first` — repair only requirements/AC that are UNMET (the blockers), then re-run Steps 4-11.
321
+ - `all` — repair UNMET + PARTIAL requirements/AC and major SECUA findings, then re-run Steps 4-11.
322
+ - `none` — stop at the verdict; report and exit.
323
+
324
+ Loop is bounded — if a fix doesn't move a requirement to MET after one retry, report the residual
325
+ and stop (don't thrash).
326
+
327
+ **Follow-up task create — record-then-reuse discipline (0341 R4).** The CLI dedup guard is **on by
328
+ default** when `--feature <id>` is set: a second `spur task create` with an identical (case-insensitive)
329
+ title under the same feature within 300 seconds exits `3` with `duplicate-follow-up` and names the
330
+ existing WBS. This closes the dogfood double-create where an orphan skeleton + re-create produced
331
+ two task files seconds apart.
332
+
333
+ **On `duplicate-follow-up` (exit 3):** parse the existing WBS from the error and **reuse** it —
334
+ populate its sections with `spur task update <wbs> --section …`. Do not call `--allow-duplicate-name`
335
+ unless the operator explicitly authorizes a true second task.
336
+
337
+ **Per-run ledger (belt-and-suspenders).** Maintain `.spur/run/<wbs>-fix-created.json` (empty `[]` if
338
+ missing) as the fix pass's record of follow-ups minted. Before creating, check it for an identical
339
+ name under the same `feature_id`; if found, reuse that WBS. After a successful create (or the CLI
340
+ `duplicate-follow-up` reuse), append `{ wbs, name, feature_id, created_at }` to the ledger.
341
+
342
+ **Gitignored fix-pass writes (disclosure rule).** Artifacts written under `.spur/run/**` during a
343
+ fix pass are gitignored, so a `--fix all` pass can mutate deliverables invisibly to `git status` and
344
+ to drift guards. The Testing write-back MUST name the exact artifact path and line range the fix
345
+ pass touched (e.g. `.spur/run/0299-verdict.json:12-18 (re-evaluated R2 evidence after fix)`) so the
346
+ mutation is discoverable from the tracked task file alone, without diffing untracked directories.
347
+
348
+ ### Step 13 — Shippable readiness gate (feature-level)
349
+
350
+ Per-task PASS is **not** the same as “this feature is ready to ship.” After Steps 11–12, when the
351
+ gate is **active**, evaluate feature AC satisfaction via the existing CLI (do not invent a second
352
+ framework).
353
+
354
+ **When active**
355
+
356
+ | Condition | Gate |
357
+ | ----------- | ------ |
358
+ | `--fix all` **and** feature context **and** **not** `--skip-shippable` / `--skip-shipable` | **ON** |
359
+ | `--fix` is `none` or `blockers-first` | **OFF** (optional note: shippable not evaluated) |
360
+ | No feature context | **N/A** |
361
+
362
+ **Feature context**
363
+
364
+ - Single verify: task frontmatter `feature_id` (or `feature-id`).
365
+ - verifyall: `--feature <id>`, or every task in the frozen set shares the same non-empty `feature_id`.
366
+ - Otherwise: `Shippable: N/A (no feature context)` — do not fail.
367
+
368
+ **Procedure (must run when active)**
369
+
370
+ 1. Write verdicts only to **repo-root** `.spur/run/<wbs>-verdict.json` (CLI SSOT; never
371
+ `docs/.spur/run` or other nested `.spur` trees). Ephemeral scratch may use `/tmp` or
372
+ `/private/tmp`. Requirement / AC row `id`s in the verdict MUST match feature scenario titles
373
+ (or `AC-N` aliases) so satisfaction can mark MET.
374
+ 2. Run:
375
+
376
+ ```bash
377
+ spur feature check <featureId> --json
378
+ spur task list --feature <featureId> --json
379
+ ```
380
+
381
+ 3. Classify **Shippable: PASS** only if **all** of:
382
+ - No finding whose code/message indicates **linked but unverified** scenarios
383
+ (`L4_SCENARIO_UNVERIFIED` / “linked but unverified”).
384
+ - No **orphan / uncovered** feature scenarios (`L4_ORPHAN_SCENARIOS`,
385
+ `L4_UNCOVERED_FEATURE_SCENARIO` / no covering task).
386
+ - No **incomplete** linked tasks: every task with this `feature_id` is `done` or `cancelled`
387
+ (always under this gate — not only when the feature status is `verifying`).
388
+ 4. Emit a fixed block (answer file + operator summary). Examples:
389
+
390
+ ```
391
+ Shippable: PASS
392
+ Feature: I1
393
+ ```
394
+
395
+ ```
396
+ Shippable: FAIL
397
+ Feature: I1
398
+ Reasons:
399
+ - scenario "R1 — …" linked but unverified (covering 0360)
400
+ - incomplete tasks: 0364
401
+ Recovery:
402
+ - Graduate/implement work for unverified ship AC and re-verify those WBS, or
403
+ - Align task AC titles to feature scenarios + ensure PASS+MET verdict rows, or
404
+ - Use --skip-shippable only if this run is deliberately non-ship (research map only)
405
+ ```
406
+
407
+ 5. **Outcome folding**
408
+ - **FAIL shippable:** the run is **not clean**. verifyall batch rollup must be at least
409
+ **PARTIAL** (or **FAIL** if any task already FAIL). Include `"shippable": false` in `--json`
410
+ batch summaries. Single verify: keep the per-task `Verdict: PASS|…` line, but always print
411
+ `Shippable: FAIL` — do not present the session as feature-ready; if `--next` is set, state that
412
+ feature ship is still blocked.
413
+ - **PASS shippable:** print `Shippable: PASS`; per-task verdicts unchanged.
414
+ - **N/A / skipped:** print `Shippable: N/A …` or `Shippable: SKIPPED (--skip-shippable)`.
415
+
416
+ **`--fix all` may repair** verdict id mismatches and in-task Testing gaps for WBS already in the
417
+ set. It must **not** auto-create implement tasks for ship gaps — report Recovery instead.
418
+
419
+ **verifyall:** run this step **once** after all per-task verifies (and their fix passes), not once
420
+ per WBS.
421
+
422
+ Full flag matrix and ops notes: [spur-dev/references/dev-operations.md](../spur-dev/references/dev-operations.md)
423
+ § verify / verifyall.
424
+
425
+ ### Step 14 — Report
426
+
427
+ Show the per-task verdict, the per-requirement table, the gate outcome (cleared / blocked), and the
428
+ **Shippable:** line from Step 13 when applicable. Under the pipeline the task verdict is consumed by
429
+ the done-gate; for a direct `/sp:dev-verify` invocation the full report is the operator's summary.
430
+
431
+ **`--next` on an already-terminal task (no-op surfacing).** When `--next` is invoked on a task
432
+ already at `done` or `cancelled`, the transition cannot fire. The verify report line MUST state the
433
+ no-op itself (e.g. `--next: no-op - task already terminal (<status>)`) rather than relying solely
434
+ on the CLI print (documented in `dev-verify.md`'s `--next` chain section). The CLI print is the
435
+ machine signal; the report line is the operator-visible summary - both must agree so a terminal-task
436
+ re-audit cannot be misread as a successful `testing -> done` transition.
437
+
438
+ ---
439
+
440
+ ## Mode: review (`/sp:dev-review`)
441
+
442
+ The source-oriented path: SECUA review of a task's diff without the full traceability verdict. Runs
443
+ Steps 3 + 7 + 10 (Review section only) — no verdict artifact, no `done` gate. Use for a focused
444
+ quality/security audit of changes when the full verify isn't wanted.
445
+
446
+ Flags: `--agent <inline|auto|name>` (execution surface — inline default, with named escalation triggers taking precedence), `--auto` (no confirmations), `--fix <none|blockers-first|all>` (post-review repair), and `--focus <all|security|efficiency|correctness|usability|architecture>` (SECUA dimensions). Apply the [central contract](../spur-dev/references/cross-cutting.md#inline-default-execution-surface) before starting the review.
447
+
448
+ ---
449
+
450
+ ## Common Rationalizations
451
+
452
+ | Rationalization | Reality |
453
+ | --- | --- |
454
+ | "The AC is obviously met — I can see it in the diff." | Seeing code is not evidence. An AC is met only when a command or test tied to it exited 0 **this run**; paste it, or the AC is UNVERIFIED. |
455
+ | "All tests pass, so the verdict is PASS." | Green tests prove the suite's assertions, not that every AC has coverage. Map each AC to its evidence; an AC with no test is not covered by a passing suite. |
456
+ | "The implementer reported it works — I'll trust the summary." | A subagent success report is a claim, not a verdict. Verification **re-runs** the check; trusting the report is skipping the gate you were asked to be. |
457
+ | "It's a small diff, one AC — full traceability is overkill." | Diff size does not scale the honesty bar. Every AC gets a row in the traceability table regardless of diff size. |
458
+ | "This objective AC reads fine — `llm-judge` can clear it." | Objective AC (a test exists, a command exits 0, a file contains X) cannot be cleared by judgment alone; it needs the literal command evidence. |
459
+ | "PARTIAL is close enough to ship." | PARTIAL/FAIL leave the task at `testing` and surface to the operator. Rounding PARTIAL up to PASS is the exact dishonesty this gate exists to catch. |
460
+ | "All tasks PASS — the feature is shippable." | Per-task PASS can be research-only. Under `--fix all`, Step 13 must run `spur feature check`; missing implement cover ⇒ `Shippable: FAIL`. |
461
+ | "I'll skip feature check; the map looks done." | Without `--skip-shippable`, shippable is mandatory when `--fix all` + feature context. Omitting Step 13 is a gate skip. |
462
+
463
+ ## Red Flags
464
+
465
+ - A PASS verdict with no per-AC evidence column, or evidence that is a description rather than a pasted command + exit status.
466
+ - Clearing an objective AC (`file exists`, `command exits 0`, `test named X passes`) with `llm-judge` instead of the literal check.
467
+ - A requirements table using `| R# | ... |` or placing `Severity` between `Req` and `Status` — the authoring contract is `| Req | Status | Evidence |`.
468
+ - A verdict authored from the implementer's summary without independently re-running the gate.
469
+ - Softening a FAIL to PARTIAL, or PARTIAL to PASS, to avoid surfacing to the operator.
470
+ - Skipping `spur task check <wbs> --strict-core` because "it passed last run" — stale evidence is not evidence.
471
+ - Findings written as "looks good" with no `file:line` anchor.
472
+ - `verifyall --feature … --fix all` reporting all-task PASS without a `Shippable:` line.
473
+ - Treating research/grilling tickets as ship cover for feature AC scenarios they do not implement.
474
+
475
+ ## When to use
476
+
477
+ - **Verify a task before `done`** — the pipeline's `verify` step, or a manual `/sp:dev-verify`.
478
+ - **Audit completed work** — `--force` re-verifies a `done` task (compliance, post-merge).
479
+ - **Focused code review** — `/sp:dev-review` for SECUA findings on a diff.
480
+
481
+ Do **not** use this skill for:
482
+
483
+ - Driving the pipeline — that's `/sp:dev-run` → `sp:spur-dev` (execution half).
484
+ - Running tests / coverage — that's `/sp:dev-unit`.
485
+ - Constraint-rule gating — that's `sp:spur-cli` (deterministic, complementary).
486
+
487
+ ---
488
+
489
+ ## Gotchas
490
+
491
+ 1. **Presence ≠ content.** `spur task check` passing is **not** a PASS verdict. This skill is the
492
+ content gate; never conflate the two.
493
+ 2. **Write the verdict artifact last.** The workflow guard reads it; a stale/partial file fails the
494
+ gate misleadingly. Emit it only after the verdict is final (Step 11).
495
+ 3. **Never direct-write the task file.** All findings go through `spur task update --section`.
496
+ 4. **`PASS` is the only clear.** `PARTIAL` blocks the gate — there is no "good enough" pass.
497
+ 5. **Bounded fix loop.** `--fix` retries once per requirement, then reports residuals — don't loop
498
+ forever chasing a stubborn UNMET.
499
+ 6. **Task PASS ≠ feature shippable.** When Step 13 is active, emit `Shippable:` and fold FAIL into
500
+ batch cleanliness. Never auto-create implement tasks to clear shippable.
501
+
502
+ ---
503
+
504
+ ## Additional Resources
505
+
506
+ - [references/verdict-schema.md](references/verdict-schema.md) — the `VerifyVerdict` artifact shape
507
+ and the per-requirement aggregation rule.
508
+ - [references/secu-review.md](references/secu-review.md) — the SECUA dimensions and finding-severity
509
+ rubric.
510
+ - `.spur/workflows/task-pipeline.yaml` — the `verify → record` gate that consumes the verdict.
511
+ - **`sp:spur-dev`** — the execution-half umbrella that drives the pipeline this skill gates.
512
+ - [references/code-improvement.md](references/code-improvement.md) — architecture-improvement lens
513
+ for module depth, seam placement, locality, coupling, and testability.
514
+ - **`sp:functional-review`** — a peer review skill for requirements traceability (R{n} → file:line
515
+ evidence, per-requirement MET/PARTIAL/UNMET, `FunctionalVerdict`). When the `review` dimension
516
+ needs functional traceability (not just SECUA), dispatch this skill; see
517
+ [../functional-review/SKILL.md](../functional-review/SKILL.md).
518
+ - **`sp:code-improvement`** — a peer review skill for architectural deepening (5 signals: shallow
519
+ module, tight coupling, wrong seam, weak locality, poor test surface; severity
520
+ blocker/major/minor/advisory). When review findings expose structural friction rather than a
521
+ localized defect, dispatch this skill; see [../code-improvement/SKILL.md](../code-improvement/SKILL.md).
522
+
523
+ ---
524
+
525
+ ## Platform Notes
526
+
527
+ ### Claude Code
528
+
529
+ `spur` CLI via the Bash tool. Invoke via the `/sp:dev-verify` / `/sp:dev-review` commands, or
530
+ directly: `Skill(skill="sp:code-verification", args="verify <wbs> --fix all")`.
531
+
532
+ ### Codex / OpenClaw / OpenCode / Antigravity
533
+
534
+ Run `spur` CLI via Bash; parse `--json`. Invoke this skill directly for the verification logic — the
535
+ skill is the SSOT; the commands are thin wrappers.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: code-improvement
3
+ description: "Pointer to the sp:code-improvement skill — the SSOT for architectural deepening (5 signals, severity, candidate format). Retained as a reference for code-verification's Step 7 cross-link."
4
+ see_also:
5
+ - code-verification
6
+ - secu-review
7
+ - functional-review
8
+ ---
9
+
10
+ # Code Improvement (reference pointer)
11
+
12
+ > **SSOT moved.** The full architecture-deepening lens now lives in the
13
+ > [`sp:code-improvement` skill](../../code-improvement/SKILL.md) — 5 deepening signals (shallow
14
+ > module, tight coupling, wrong seam, weak locality, poor test surface), severity rubric
15
+ > (blocker/major/minor/advisory), the 5-step workflow, and the Candidate Format. This file is
16
+ > retained as a thin pointer so `code-verification`'s Step 7 cross-link stays resolvable.
17
+
18
+ ## When to use it (from code-verification Step 7)
19
+
20
+ When review findings expose broader architecture friction rather than a localized defect, dispatch
21
+ [`sp:code-improvement`](../../code-improvement/SKILL.md) to frame follow-up candidates instead of
22
+ silently expanding the current fix. In verify mode, improvement candidates are an advisory
23
+ LLM-as-judge lane unless they contradict a task requirement, core Acceptance Criteria, security
24
+ boundary, or correctness condition. Do not let a qualitative improvement candidate alone certify
25
+ objective completion; pair it with deterministic or static evidence, or mark the related
26
+ AC/requirement `PARTIAL`.
27
+
28
+ ## The 5 signals (quick reference)
29
+
30
+ | Signal | One-line diagnostic |
31
+ |--------|---------------------|
32
+ | Shallow module | Deleting the module removes indirection instead of moving complexity to callers |
33
+ | Tight coupling | One concept requires edits across many files; tests need excessive mocks |
34
+ | Wrong seam | Callers know implementation details, ordering rules, config keys, or persistence details |
35
+ | Weak locality | Bugs cannot be traced to one module because behavior is scattered |
36
+ | Poor test surface | Real behavior can only be tested through private methods or broad mocks |
37
+
38
+ For full diagnostics, deepening directions, code examples, severity guidance, and the Candidate
39
+ Format, read the [skill proper](../../code-improvement/SKILL.md).
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: secu-review
3
+ description: "The SECUA review dimensions and finding-severity rubric for verify/review modes"
4
+ see_also:
5
+ - sp:code-verification
6
+ ---
7
+
8
+ # SECUA Review
9
+
10
+ The code-quality lens applied in verify mode (Step 7) and review mode. Five dimensions, selected by
11
+ `--focus` (default `all`; comma-separated subset accepted).
12
+
13
+ | Dim | Name | What it checks |
14
+ |-----|------|----------------|
15
+ | **S** | Security | Hardcoded secrets/keys/tokens; injection (SQL, shell, path); unsanitized external input; unsafe deserialization; missing authz at boundaries |
16
+ | **E** | Efficiency | Needless O(n²) loops, N+1 queries, redundant I/O, unbounded growth, missing pagination |
17
+ | **C** | Correctness | Null/undefined handling, off-by-one, unhandled error paths, race conditions, wrong edge-case behavior, logic that contradicts the requirement; **type-fit** — every signature, field access, and "reuse X" claim resolves against the *actual* type's fields, not merely a capability assumed to exist |
18
+ | **U** | Usability | Vague error messages (no context), unclear API shapes, missing types, inconsistent naming vs. the surrounding code |
19
+ | **A** | Architecture | Shallow modules, misplaced seams, unnecessary coupling, duplicated orchestration, leaky abstractions, and changes that fight the repo's documented boundaries |
20
+
21
+ ## Focus parsing
22
+
23
+ Split `--focus` by comma, trim, lowercase. Keep only
24
+ `security|efficiency|correctness|usability|architecture`. A dimension absent from the focus set is
25
+ skipped entirely. `all` expands to all five.
26
+
27
+ ## Finding severity
28
+
29
+ | Severity | Meaning | Gate effect (verify mode) | `--fix all` repairs? |
30
+ |----------|---------|---------------------------|----------------------|
31
+ | **blocker** | Ships a vulnerability, breaks a requirement, or breaks core AC | FAIL | Yes |
32
+ | **major** | Real defect, unresolved architecture/correctness risk, or material test gap | PARTIAL unless explicitly deferred/N/A | Yes |
33
+ | **minor** | Style / polish / non-functional | Advisory only | No (left for the author) |
34
+
35
+ Each finding records: dimension, severity, `file:line`, one-line description, and a concrete
36
+ remediation. Findings land in the task's `## Review` section, ranked severity-first.
37
+
38
+ ## Architecture check
39
+
40
+ Architecture findings are review findings, not a separate refactor-planning workflow. Use them to
41
+ catch design damage introduced by the diff:
42
+
43
+ - **Depth / deletion test:** flag pass-through modules where deleting the new layer would remove
44
+ indirection rather than move real complexity to callers.
45
+ - **Seam placement:** flag behavior added on the wrong side of an existing interface, especially
46
+ when callers must now know implementation details.
47
+ - **Coupling and locality:** flag changes that make one concept require edits across many modules or
48
+ leak app-layer concerns into domain/config/contract packages.
49
+ - **Boundary drift:** flag violations of project docs, ADRs, package ownership, or established
50
+ dependency direction.
51
+ - **Test surface:** flag architecture that can only be tested through excessive mocks instead of
52
+ through the module's real interface.
53
+
54
+ Do not turn architecture review into speculative redesign. Findings must be tied to changed files
55
+ and must include a concrete remediation. If the issue needs a larger refactor than the current task,
56
+ recommend a follow-up task instead of broad in-place rewrites.
57
+
58
+ Architecture severity follows the same table: blocker when the diff violates a binding boundary or
59
+ will break a requirement; major when it creates meaningful change-cost or testability damage; minor
60
+ for localized depth/naming drift.
61
+
62
+ ## Type-fit check (Correctness)
63
+
64
+ When a design or plan says "reuse `X`" or types a signature as `f(arg: T)`, resolve `T` against its
65
+ **real definition** before accepting it — read the type's fields, not just its name. A capability
66
+ existing ("the dry-run walks transitions") does not mean its return type carries the data you need
67
+ (`WorkflowRunResult` is terminal — it has no step list). Verify the *fields you will read*, not that
68
+ the producer exists. This applies to pre-implementation design review as much as post-implementation
69
+ review: a signature that cannot be built against the actual type is a blocker, caught at review, not
70
+ at implementation.
71
+
72
+ ## Relationship to requirement traceability and AC
73
+
74
+ SECUA is the *quality* lens; requirement traceability (Step 4) and the Acceptance Criteria guard
75
+ (Step 5) are the *completeness* lenses. A change can be SECUA-clean yet `FAIL` (a requirement or
76
+ core AC is UNMET), or fully MET yet carry a blocker finding (insecure implementation of a satisfied
77
+ requirement). The aggregate verdict reflects requirement status, AC status, and gate-relevant
78
+ review findings. Blocker and major SECUA findings are surfaced in the `checks[]` array of the
79
+ verdict artifact so quality failures are not lost behind a requirements-only PASS.
80
+
81
+ ## Pre-Completion Verification
82
+
83
+ Before declaring a task `done`, run this lightweight checklist. It catches the most common oversights that survive the formal pipeline gates:
84
+
85
+ - [ ] All tests pass (`bun run test` exits 0).
86
+ - [ ] Lint clean (`bun run lint` exits 0).
87
+ - [ ] No `TODO` or `FIXME` without a linked task WBS.
88
+ - [ ] `git status` shows only intentional changes (no debug artifacts, no temp files).
89
+ - [ ] No `console.log` / `console.error` in production code (use the project logger).
90
+ - [ ] No `--no-verify`, `--force`, or new suppression comments added to bypass gates.
91
+ - [ ] Solution section contains `file:line` citations for every changed file.
92
+ - [ ] Review section has P1–P4 findings table (even if all rows are empty — the table itself proves review happened).
93
+
94
+ This checklist runs as part of the verify step when the task reaches `testing` status. It does not replace the formal gates — it augments them with between-pipeline hygiene checks.