@gobing-ai/spur 0.3.40 → 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,205 @@
1
+ # Deepening Signals
2
+
3
+ Reference for the five improvement signals used by `sp:code-improvement`. Each entry defines the
4
+ symptom, the diagnostic, the deepening direction, and a concrete example.
5
+
6
+ These signals are adapted from the deep-module principle (a module's interface should be narrower
7
+ than its implementation) and the seam/locality/test-surface heuristics for structural health.
8
+
9
+ ---
10
+
11
+ ## 1. Shallow Module
12
+
13
+ **Symptom:** A module whose interface is as complex as its implementation. The caller must
14
+ understand the module's internals to use it correctly — the abstraction leaks because there is no
15
+ abstraction, only a pass-through.
16
+
17
+ **Diagnostic:**
18
+
19
+ - Count the exported symbols. Count the non-exported implementation lines.
20
+ - If `exported_symbols / implementation_lines ≈ 1` (every line is exported, or the body is a
21
+ single delegation), the module is shallow.
22
+ - A wrapper that only forwards to another module is the classic case.
23
+
24
+ **Deepening direction:** Either collapse it into its caller (inline the delegation) or give it a
25
+ real body (move logic from the caller into the module so the interface narrows).
26
+
27
+ **Example:**
28
+
29
+ ```typescript
30
+ // shallow: the service just forwards to the DAO
31
+ export class UserService {
32
+ constructor(private dao: UserDao) {}
33
+ getUser(id: string) { return this.dao.findById(id); } // pass-through
34
+ createUser(data: UserInput) { return this.dao.insert(data); } // pass-through
35
+ updateUser(id: string, data: UserInput) { return this.dao.update(id, data); } // pass-through
36
+ }
37
+ ```
38
+
39
+ Deepening: move the validation and event emission (currently in the route handler) into the
40
+ service, so the service's interface (`createUser`) is narrower than its body (validate → insert →
41
+ emit event).
42
+
43
+ ---
44
+
45
+ ## 2. Tight Coupling
46
+
47
+ **Symptom:** Two modules that must change together. A change to module A forces a coordinated
48
+ change to module B. Often caused by shared mutable state, deep relative imports, or a shared
49
+ concrete class instead of an interface.
50
+
51
+ **Diagnostic:**
52
+
53
+ - Grep for imports of module B inside module A's directory and vice versa (bidirectional).
54
+ - Check `git log --oneline` for files in A and B that change in the same commits.
55
+ - Look for a concrete class shared across a package boundary (no interface seam).
56
+
57
+ **Deepening direction:** Introduce a seam — an interface, an event, or a DTO — so A depends on an
58
+ abstraction, not B's concrete implementation.
59
+
60
+ **Example:**
61
+
62
+ ```typescript
63
+ // tight: the route handler imports the concrete DAO
64
+ import { UserDao } from '@gobing-ai/spur-domain'; // deep relative import across package
65
+ router.post('/users', async (c) => {
66
+ const dao = new UserDao(c.env.db); // direct construction
67
+ const user = await dao.insert(c.body); // no seam
68
+ });
69
+ ```
70
+
71
+ Deepening: inject a `UserRepository` interface (owned by app, implemented by domain) so the route
72
+ handler depends on the abstraction, not the concrete DAO.
73
+
74
+ ---
75
+
76
+ ## 3. Wrong Seam
77
+
78
+ **Symptom:** The abstraction boundary is in the wrong place. Domain types leak across a transport
79
+ seam; a service imports a DAO directly instead of through a repository; config validation lives in
80
+ the HTTP layer instead of the config package.
81
+
82
+ **Diagnostic:**
83
+
84
+ - Draw the intended layer boundaries (e.g., `apps/server` → `packages/app` → `packages/domain`).
85
+ - Grep for imports that cross a boundary in the wrong direction (e.g., `packages/domain` importing
86
+ from `apps/server`, or transport DTOs in `packages/contracts` containing domain types).
87
+ - Check for a service that returns a domain entity instead of a DTO.
88
+
89
+ **Deepening direction:** Move responsibility across the seam so the boundary matches the
90
+ dependency direction. Domain types stay in domain; transport DTOs stay in contracts; services
91
+ map between them.
92
+
93
+ **Example:**
94
+
95
+ ```typescript
96
+ // wrong seam: a transport DTO contains a domain entity
97
+ // packages/contracts/src/users.ts
98
+ import { User } from '@gobing-ai/ts-db'; // domain type in transport contract
99
+ export interface UserDto {
100
+ user: User; // domain leak
101
+ }
102
+ ```
103
+
104
+ Deepening: define `UserDto` with primitive fields in `packages/contracts`; map `User → UserDto`
105
+ in the server handler. The contract no longer depends on domain.
106
+
107
+ ---
108
+
109
+ ## 4. Weak Locality
110
+
111
+ **Symptom:** Related logic is scattered across modules. A single responsibility (e.g., "user
112
+ creation") is spread across a route handler, a service, a DAO, a validator, an event emitter, and a
113
+ test factory — each with one line of the logic. Reading the feature requires opening six files.
114
+
115
+ **Diagnostic:**
116
+
117
+ - Pick a feature (a verb, e.g., "create user"). Grep for the feature name across the scope.
118
+ - If the implementation is spread across N files with no single module that owns the full
119
+ flow, locality is weak.
120
+ - Check for "co-located by layer" (all routes together, all services together) instead of
121
+ "co-located by feature."
122
+
123
+ **Deepening direction:** Co-locate by responsibility. Group the route, service, validator, and
124
+ event emitter for a feature into one module/directory so the full flow reads top-to-bottom.
125
+
126
+ **Example:**
127
+
128
+ ```
129
+ src/
130
+ routes/users.ts // 1 line of createUser
131
+ routes/orders.ts // 1 line of createOrder
132
+ services/users.ts // 1 line of createUser
133
+ services/orders.ts // 1 line of createOrder
134
+ dao/users.ts // 1 line of insert
135
+ dao/orders.ts // 1 line of insert
136
+ ```
137
+
138
+ Deepening: co-locate by feature —
139
+
140
+ ```
141
+ src/
142
+ users/
143
+ route.ts // full createUser flow
144
+ service.ts
145
+ dao.ts
146
+ orders/
147
+ route.ts
148
+ service.ts
149
+ dao.ts
150
+ ```
151
+
152
+ ---
153
+
154
+ ## 5. Poor Test Surface
155
+
156
+ **Symptom:** Core logic can only be tested by standing up a large stack — a real database, a server,
157
+ a full request cycle. The logic isn't pure; it's entangled with I/O.
158
+
159
+ **Diagnostic:**
160
+
161
+ - Try to write a unit test for the core logic (the business rule, not the I/O).
162
+ - If the test requires a database, a server, or a mock of a large dependency graph, the test
163
+ surface is poor.
164
+ - Look for a function that mixes pure logic with I/O (e.g., `async createUser` that both validates
165
+ AND inserts AND emits an event).
166
+
167
+ **Deepening direction:** Extract the pure logic into a function with no I/O, and test that. Inject
168
+ the I/O (database, event bus) at the boundary.
169
+
170
+ **Example:**
171
+
172
+ ```typescript
173
+ // poor surface: validate + insert + emit are entangled
174
+ export async function createUser(input: UserInput, db: Database, events: EventBus) {
175
+ if (!input.email.includes('@')) throw new Error('invalid email'); // pure logic
176
+ const user = await db.insert(input); // I/O
177
+ await events.emit('user.created', user); // I/O
178
+ }
179
+ ```
180
+
181
+ Deepening: extract the pure validator —
182
+
183
+ ```typescript
184
+ export function validateUser(input: UserInput): void {
185
+ if (!input.email.includes('@')) throw new Error('invalid email'); // pure, trivially testable
186
+ }
187
+ export async function createUser(input: UserInput, db: Database, events: EventBus) {
188
+ validateUser(input);
189
+ const user = await db.insert(input);
190
+ await events.emit('user.created', user);
191
+ }
192
+ ```
193
+
194
+ Now `validateUser` has a test surface independent of the stack.
195
+
196
+ ---
197
+
198
+ ## Applying the Signals
199
+
200
+ - **One module can hit multiple signals.** Record each as a separate candidate.
201
+ - **Signals compound.** A shallow module with tight coupling is worse than either alone; bump the
202
+ severity one level.
203
+ - **Severity is contextual.** A shallow module in a hot path is `major`; the same module in a
204
+ seldom-touched corner is `advisory`.
205
+ - **No signal hit is a good outcome.** Emit "No deepening candidates found in scope" — do not pad.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: code-review
3
+ description: "Pre-commit self-review checklist, structured review requests, and processing review findings into tasks. Triggers: \"review this\", \"self-review\", \"pre-commit check\", \"code review\", \"review my changes\", \"check before commit\"."
4
+ license: Apache-2.0
5
+ metadata:
6
+ author: spur
7
+ version: "1.0"
8
+ platforms: "claude-code,codex,openclaw,opencode,antigravity"
9
+ category: execution
10
+ interactions:
11
+ - technique
12
+ operations:
13
+ - self-review
14
+ - request-review
15
+ - process-findings
16
+ see_also:
17
+ - sp:code-verification
18
+ - sp:code-implementation
19
+ ---
20
+
21
+ # sp:code-review — Code Review Workflow
22
+
23
+ Two workflows: **pre-commit self-review** (catch issues before they leave your machine) and **requesting/receiving agent review** (structured context for deeper review). This skill owns the review *workflow*; `sp:code-verification` owns post-implementation SECUA review within the pipeline.
24
+
25
+ ## Workflow A — Pre-commit self-review
26
+
27
+ Run before `git commit`. Catches 60-80% of issues that a reviewer would flag.
28
+
29
+ 1. **Diff it:** `git diff --cached` (or `git diff` if unstaged). Read every changed line.
30
+ 2. **Checklist:** Walk the [self-review-checklist.md](references/self-review-checklist.md) — type-safety, null-handling, error-propagation, test-coverage, security-surface. Each category has diagnostic questions.
31
+ 3. **Fix:** Anything the checklist flags → fix before committing.
32
+ 4. **Commit:** Only when the checklist is clean.
33
+
34
+ ## Workflow B — Requesting agent review
35
+
36
+ When you want a deeper review (SECUA, architectural, or second-opinion):
37
+
38
+ 1. **Prepare a structured brief** and prefer a fresh reviewer context/subagent when available:
39
+
40
+ ```markdown
41
+ WHAT_WAS_IMPLEMENTED:
42
+ <one paragraph>
43
+
44
+ PLAN_OR_REQUIREMENTS:
45
+ <task WBS, requirements, AC, or design refs>
46
+
47
+ DIFF_RANGE:
48
+ <base sha>..<head sha> or "working tree"
49
+
50
+ FOCUS_HINTS:
51
+ <security | correctness | architecture | specific concern>
52
+ ```
53
+
54
+ 2. **Attach evidence:** include the relevant `git diff`, self-review results (Workflow A output), and
55
+ any verification commands already run.
56
+ 3. **Request:** Invoke `sp:code-review` directly or trigger via "review my changes", "review this diff".
57
+ 4. **Receive:** The reviewer produces a P1–P4 findings table.
58
+
59
+ ## Workflow C — Processing review findings
60
+
61
+ When you receive review findings:
62
+
63
+ 1. **Verify each finding against the codebase first.** A finding can be stale or based on a misread;
64
+ cite the file/line that proves it before changing code. Reasoned pushback is allowed.
65
+ 2. **Fix in priority order:** blockers first (P1), then simple P2 fixes, then complex P2 fixes. Keep
66
+ unrelated refactors out of the review-response diff.
67
+ 3. **Test each fix individually** with the narrowest command that proves it, then run the task gate.
68
+ 4. **Re-review:** After all P1/P2 fixes, request a follow-up review to confirm resolution.
69
+ 5. **File follow-up tasks** for deferred P3/P4 items via `spur task create --template review`.
70
+
71
+ ## Common Rationalizations
72
+
73
+ | Rationalization | Reality |
74
+ |---|---|
75
+ | "It looks good to me — approve." | "LGTM" with no specific findings is not a review; it's a rubber stamp. State what you checked and what you found, with anchors. |
76
+ | "It's a small diff, skim it." | Small diffs ship real bugs. Size does not lower the bar; run the same lenses regardless. |
77
+ | "The author knows this area better — trust them." | Deference is not review. Your job is the independent second pair of eyes; verify, don't assume. |
78
+ | "I'll soften this finding so it doesn't sound harsh." | Softening a real finding is dishonest and lets the defect through. State severity plainly; the diff, not the author, is under review. |
79
+ | "There's dead code — I'll just delete it." | Deleting code you don't fully understand is risky. Identify it, list it, and ask before removing (Chesterton's Fence). |
80
+ | "A new dependency is fine for this one helper." | Prefer stdlib / existing utilities. Flag every new dependency; a one-function import is rarely worth the supply-chain cost. |
81
+
82
+ ## Red Flags
83
+
84
+ - An approval with no specific, anchored findings.
85
+ - Findings phrased to spare feelings instead of stating severity and impact.
86
+ - Rubber-stamping because the author is senior or the diff is small.
87
+ - Proposing a rewrite far larger than the change under review (scope creep in the review itself).
88
+ - Deleting flagged dead code without confirming it is truly unreachable.
89
+ - Waving through a new third-party dependency without justification.
90
+
91
+ ## When to use
92
+
93
+ - Before committing changes.
94
+ - Before creating a PR or merge request.
95
+ - After receiving review feedback.
96
+ - The operator says "review this" or "check my changes before commit."
97
+
98
+ Do **not** use this skill for:
99
+ - Pipeline verification — that is `sp:code-verification` (`/sp:dev-verify`).
100
+ - SECUA review of a completed task — that is `sp:code-verification` (`/sp:dev-review`).
101
+ - Architectural review alone — that is `sp:sys-architecture`.
102
+
103
+ ## References
104
+
105
+ | Reference | Covers |
106
+ |-----------|--------|
107
+ | [self-review-checklist.md](references/self-review-checklist.md) | Pre-commit checklist: 6 categories with diagnostic questions |
108
+ | [review-lenses.md](references/review-lenses.md) | SECUA review lenses: correctness, security, efficiency, usability, architecture |
109
+
110
+ ## See also
111
+
112
+ - **`sp:code-implementation`** — the implement step that produces the changes being reviewed.
@@ -0,0 +1,70 @@
1
+ # Receiving Code Review
2
+
3
+ A behavioral guardrail for the **reviewee** — the agent whose code is under review. The review
4
+ specialist (`sp:super-reviewer`) and the review skills (`sp:code-verification`,
5
+ `sp:functional-review`, `sp:code-improvement`) produce findings; this reference governs how the
6
+ reviewee *receives* and acts on them.
7
+
8
+ ## The Contract
9
+
10
+ When review findings arrive:
11
+
12
+ 1. **Verify before implementing.** Each finding is a claim, not an order. Re-read the cited
13
+ `file:line` and confirm the finding is real before acting. A finding that misreads the code is
14
+ rejected with evidence, not silently ignored.
15
+ 2. **Technical rigor over performative agreement.** Do not agree with a finding just because a
16
+ reviewer said it. Do not disagree just because it's your code. Judge on the evidence.
17
+ 3. **Blind implementation is a failure mode.** Implementing every suggestion verbatim, without
18
+ assessing correctness, is as bad as ignoring the review. You are responsible for the merged
19
+ code, not the reviewer.
20
+ 4. **Challenge unclear findings.** If a finding lacks `file:line` evidence or the reasoning is
21
+ vague, ask for clarification — do not guess what the reviewer meant.
22
+ 5. **Push back once, then comply.** If a finding looks wrong (security theater, misread code,
23
+ conflicts with a stated goal), say so with evidence — once. If the reviewer confirms, comply;
24
+ their context may exceed yours.
25
+
26
+ ## Decision Table
27
+
28
+ | Finding quality | Reviewee action |
29
+ |-----------------|-----------------|
30
+ | Specific (`file:line`, clear reasoning) | Verify the code → implement the fix |
31
+ | Specific but wrong (misreads code) | Reject with evidence citing the actual code |
32
+ | Vague (no `file:line`, no reasoning) | Ask for clarification; do not guess |
33
+ | Correct but low-value (advisory) | Acknowledge; implement only if cheap or if it blocks |
34
+ | Conflicts with a stated goal | Push back once with the goal conflict; comply if confirmed |
35
+
36
+ ## Anti-Patterns
37
+
38
+ - **Agreeing reflexively:** "Good catch — I'll fix that" without re-reading the code. The finding
39
+ might misread the control flow.
40
+ - **Implementing verbatim:** Copy-pasting the reviewer's suggested code without understanding it.
41
+ The reviewer doesn't have the full context; their suggestion might break an invariant.
42
+ - **Silent rejection:** Disagreeing with a finding but not saying so, letting the review "pass"
43
+ without resolution. Either implement or reject with evidence — no silent drops.
44
+ - **Escalation theater:** "I'll let the operator decide" for a finding that's clearly wrong. Reject
45
+ it with evidence; save the operator's attention for genuine judgment calls.
46
+
47
+ ## When you are the reviewee under the pipeline
48
+
49
+ Under `task-pipeline.yaml`, the `review` step's findings are written to the task's `## Review`
50
+ section. As the reviewee (the implementer agent):
51
+
52
+ 1. Read the `## Review` section via `spur task show <wbs> --json`.
53
+ 2. For each finding, apply the Decision Table.
54
+ 3. Implement the accepted fixes; reject the wrong ones with evidence in the commit message or the
55
+ task's `## Solution` section.
56
+ 4. Do **not** edit the `## Review` section directly — it is the reviewer's record. Your response
57
+ goes in the implementation and the `## Solution` section.
58
+
59
+ ## Relationship to `sp:code-verification`'s Common Rationalizations
60
+
61
+ `sp:code-verification`'s Common Rationalizations table governs the *reviewer's* honesty —
62
+ rationalizations a reviewer uses to soften a finding. This reference governs the *reviewee's*
63
+ honesty — rationalizations a reviewee uses to dismiss a finding. Both must be resisted.
64
+
65
+ | Reviewer rationalization (code-verification) | Reviewee rationalization (this reference) |
66
+ |----------------------------------------------|------------------------------------------|
67
+ | "The code looks fine to me." | "The reviewer doesn't know my codebase." |
68
+ | "I'll skip that dimension." | "That's advisory — I'll skip it." |
69
+ | "PARTIAL is close enough." | "The finding is nitpicky — I'll ignore it." |
70
+ | "The implementer said it works." | "The reviewer is wrong — I'll silently ignore it." |
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: review-lenses
3
+ description: "SECUA review lenses — correctness, security, efficiency, usability, architecture — with per-lens diagnostic questions and finding-severity guidance."
4
+ see_also:
5
+ - code-review
6
+ - code-verification
7
+ ---
8
+
9
+ # Review Lenses (SECUA)
10
+
11
+ Five dimensions for structured code review. Each lens has diagnostic questions; answer them against the diff. Findings are severity-graded P1 (blocker) through P4 (advisory).
12
+
13
+ ## Correctness
14
+
15
+ **Question:** Does this code do what it claims to do?
16
+
17
+ - Does every code path produce the expected output for the given input?
18
+ - Are edge cases handled (empty, null, boundary, error)?
19
+ - Are invariants preserved across the changed functions?
20
+ - Is there a test that fails if the behavior is wrong?
21
+
22
+ **Severity guide:** Logic errors that produce wrong output → P1. Missing edge case that could cause wrong output → P2. Unclear control flow that might hide bugs → P3.
23
+
24
+ ## Security
25
+
26
+ **Question:** Can this code be exploited?
27
+
28
+ - Is user input validated, sanitized, and bounded?
29
+ - Are secrets, tokens, or credentials exposed (in logs, error messages, client code)?
30
+ - Are SQL queries parameterized? Is there any string-interpolated SQL?
31
+ - Does the change expand the auth/permission surface?
32
+ - Is there a path that bypasses authentication or authorization?
33
+
34
+ **Severity guide:** Exploitable vulnerability (injection, auth bypass, secret leak) → P1. Missing validation that could be exploited → P2. Hardcoded configuration that weakens security → P3.
35
+
36
+ ## Efficiency
37
+
38
+ **Question:** Will this code perform at scale?
39
+
40
+ - Are there N+1 queries or unnecessary loops?
41
+ - Is data transformed through unnecessary intermediate representations?
42
+ - Are large allocations bounded? Is there unbounded memory growth?
43
+ - Is there blocking I/O on a hot path?
44
+
45
+ **Severity guide:** O(n²) or worse on a hot path → P2. Unnecessary allocation on a cold path → P3. Minor optimization opportunity → P4.
46
+
47
+ ## Usability
48
+
49
+ **Question:** Can a developer understand and use this code?
50
+
51
+ - Are function and variable names self-documenting?
52
+ - Are error messages actionable (what failed, expected, path involved)?
53
+ - Is the API surface consistent with surrounding code?
54
+ - Are complex algorithms explained with a brief comment?
55
+
56
+ **Severity guide:** Misleading name that could cause bugs → P2. Missing error context → P3. Inconsistent naming → P4.
57
+
58
+ ## Architecture
59
+
60
+ **Question:** Does this code fit the system's design?
61
+
62
+ - Does it respect module boundaries? No cross-cutting imports that bypass the public API?
63
+ - Does it follow existing patterns, or introduce a new one with justification?
64
+ - Is the right separation of concerns maintained?
65
+ - Would this change make future changes harder (coupling, rigidity)?
66
+ - **Deep-module check:** does the new/changed module pass the deletion test (would inlining its one
67
+ caller make anything harder)? Is there a **seam** with only one **adapter** — i.e. speculative,
68
+ not yet justified by a second caller? Full vocabulary (module/interface/depth/seam/adapter/
69
+ leverage/locality) and the deletion test: `sp:sys-architecture`'s
70
+ [decision-method.md](../../sys-architecture/references/decision-method.md).
71
+
72
+ **Severity guide:** Violates module boundary or dependency rule → P1. Introduces a new pattern without justification → P2 (a seam with only one adapter and no stated second-caller plan is this severity). Minor boundary fuzziness → P3.
73
+
74
+ ## Structural Remedies
75
+
76
+ A finding is worth more when it carries the fix. Do not stop at "this is tangled" — propose the
77
+ restructuring: name the deeper module, the extracted seam, the guard-clause flattening, the
78
+ collapsed pass-through. State the before/after shape in prose so the author can act without a second
79
+ round-trip. A problem without a proposed remedy is half a review.
80
+
81
+ ## Change Sizing
82
+
83
+ Diff size is a reviewability signal. Flag oversized changes and propose a split:
84
+
85
+ | Size | Verdict | Action |
86
+ |---|---|---|
87
+ | ~100 lines | Good | Review normally. |
88
+ | ~300 lines | Acceptable | Review, but note if it bundles independent concerns. |
89
+ | ~1000 lines | Too large | Ask to split before deep review — a diff this size hides defects and cannot be reviewed honestly. |
90
+
91
+ **Split strategies:** separate refactor from feature (two commits); slice vertically by behavior, not
92
+ by layer; land a mechanical rename/move on its own; extract a shared helper in a preceding change so
93
+ the feature diff shrinks to the new logic.
94
+
95
+ ## Honesty in Review (anti-sycophancy)
96
+
97
+ The diff is under review, not the author. Do not rubber-stamp, do not soften a real finding to spare
98
+ feelings, do not pad with praise to cushion a criticism. Quantify impact ("this N+1 query runs once
99
+ per row"), state severity plainly, and push back when the change is wrong — once, with reasoning. A
100
+ review that makes everyone feel good and lets a defect through has failed. "LGTM" with no specific,
101
+ anchored findings is not a review.
102
+
103
+ ## Dead-Code Hygiene
104
+
105
+ When you spot unreachable branches, unused exports, commented-out blocks, or orphaned helpers:
106
+ **identify and list them** — do not silently delete them in the review. Deleting code you do not
107
+ fully understand is its own risk (Chesterton's Fence). Confirm it is truly unreachable, list each
108
+ item with its location, and ask before removal. Dead code called out and removed deliberately is
109
+ hygiene; dead code swept away mid-review is a landmine.
110
+
111
+ ## Dependency Discipline
112
+
113
+ Prefer the standard library and existing in-repo utilities over a new third-party dependency. Flag
114
+ every new dependency a diff introduces: a one-function import rarely justifies the supply-chain,
115
+ version-drift, and bundle cost it adds. Ask whether an existing helper covers the need, whether the
116
+ dependency is maintained, and whether its footprint matches the value. New top-level dependencies are
117
+ an operator decision, not a reviewer's silent pass-through.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: self-review-checklist
3
+ description: "Pre-commit self-review checklist — 6 categories with diagnostic questions. Catches 60-80% of issues before a reviewer sees them."
4
+ see_also:
5
+ - code-review
6
+ ---
7
+
8
+ # Self-Review Checklist
9
+
10
+ Run before `git commit`. For each category, answer the diagnostic questions. If any answer is "no" or "I don't know", fix before committing.
11
+
12
+ ## 1. Type Safety
13
+
14
+ - [ ] Are all function return types explicit (no inferred `any`)?
15
+ - [ ] Are `null`/`undefined` handled at every boundary (API responses, user input, DB queries)?
16
+ - [ ] Are type assertions (`as`, `!`) justified with a comment or guard, not used to silence the compiler?
17
+
18
+ ## 2. Null Handling
19
+
20
+ - [ ] Does every `?.` chain have a fallback or explicit null check at the consumer?
21
+ - [ ] Are optional parameters handled when `undefined` is passed?
22
+ - [ ] Do array accesses (`arr[i]`) guard against out-of-bounds?
23
+
24
+ ## 3. Error Propagation
25
+
26
+ - [ ] Are errors caught at system boundaries (API calls, file I/O, DB queries)?
27
+ - [ ] Do caught errors include context (what failed, what was expected, what path/identifier)?
28
+ - [ ] Are there any empty `catch {}` blocks? Each must have a comment justifying why the error is intentionally swallowed.
29
+
30
+ ## 4. Test Coverage
31
+
32
+ - [ ] Does the changed code have corresponding tests?
33
+ - [ ] Do the tests verify behavior, not implementation?
34
+ - [ ] Are edge cases covered (empty input, boundary values, error paths)?
35
+
36
+ ## 5. Security Surface
37
+
38
+ - [ ] Is user input validated and sanitized?
39
+ - [ ] Are secrets, tokens, or credentials hardcoded? (They must never be.)
40
+ - [ ] Are SQL queries parameterized? (Never string-interpolated.)
41
+ - [ ] Does the change touch auth, sessions, or permissions? If yes, re-audit the entire auth flow.
42
+
43
+ ## 6. Performance Regression
44
+
45
+ - [ ] Does the change add N+1 queries? (Check for queries inside loops.)
46
+ - [ ] Is there unnecessary data transformation (serialize → deserialize → serialize)?
47
+ - [ ] Are large allocations (buffers, arrays) bounded?
48
+
49
+ ## When to skip
50
+
51
+ - Docs-only changes → skip categories 1, 4, 5, 6.
52
+ - Test-only changes → skip categories 2, 3, 5, 6.
53
+ - Config-only changes → skip all except category 5.
@@ -0,0 +1,68 @@
1
+ # Verification Before Completion
2
+
3
+ A behavioral guardrail for **any agent claiming work is done**. This is the universal honesty gate:
4
+ no "done", "passing", "fixed", or "works" claim without fresh, pasted verification evidence run
5
+ this turn.
6
+
7
+ ## The Contract
8
+
9
+ Before reporting a task as complete, a test as passing, a bug as fixed, or a feature as working:
10
+
11
+ 1. **Run the verification command.** Not last session's output. Not the implementer's summary. Run
12
+ it now, this turn, and capture the output.
13
+ 2. **Paste the evidence.** The raw tail output (last 20+ lines for high-stakes changes), not a
14
+ one-line "green" summary. For doc-only changes, a one-liner is acceptable.
15
+ 3. **No claim without evidence.** If you cannot run the verification (tool unavailable, environment
16
+ missing), say so explicitly — do not claim success.
17
+ 4. **No skipped checks.** A test suite with `.skip`/`xfail`/`#[ignore]` is not green. Past the
18
+ raw output so the operator can see skips.
19
+
20
+ ## Evidence Standard
21
+
22
+ | Claim | Required evidence |
23
+ |-------|-------------------|
24
+ | "Tests pass" | Raw `bun test` / `pytest` / `cargo test` tail showing 0 failures, 0 skips |
25
+ | "Lint clean" | Raw `biome check . --error-on-warnings` / `eslint` / `clippy` exit 0 output |
26
+ | "Build succeeds" | Raw `bun run build` / `cargo build` / `go build` exit 0 output |
27
+ | "Bug fixed" | The failing test now passing (raw output) + the root-cause explanation |
28
+ | "Feature works" | The specific test or manual scenario that exercises the feature, run this turn |
29
+ | "Doc-only change" | One-liner acceptable; no gate evidence needed |
30
+
31
+ ## Anti-Patterns
32
+
33
+ - **Trust the summary:** "The implementer reported all tests pass — I'll trust it." The summary is a
34
+ claim, not evidence. Re-run the gate.
35
+ - **Stale evidence:** Paste last session's output. Gates must be run this turn, after the last
36
+ code change.
37
+ - **One-line green:** "All gates green ✓" without the raw output. Paste the tail; let the operator
38
+ see the actual numbers.
39
+ - **Silent skips:** "Test suite passes" with 3 `.skip`'d tests. Skips are not passes. Surface them.
40
+ - **Premature done:** "Done" with a known failing check, planning to fix it later. Done means done —
41
+ if a check fails, you are not done.
42
+
43
+ ## Under the pipeline
44
+
45
+ `task-pipeline.yaml`'s `verify` step (Phase 8) and `record` step enforce this gate. The `verify`
46
+ step runs `sp:code-verification` verify mode, which produces a `VerifyVerdict` artifact; the
47
+ `record` step transcribes it to the task's `## Testing` section. A `done` transition requires a
48
+ PASS verdict.
49
+
50
+ Under manual execution (no pipeline), the agent must still run the gates and paste the evidence.
51
+ "Manual" is not an exemption — it just means the agent, not the pipeline, runs the commands.
52
+
53
+ ## Relationship to `sp:code-verification` and `sp:functional-review`
54
+
55
+ Both review skills produce verdicts (PASS/PARTIAL/FAIL). A verdict is a completion claim — it
56
+ obeys this gate. The reviewer must have run the verification (read the code, run the tests, checked
57
+ the evidence) before emitting the verdict, not guess from the implementer's summary.
58
+
59
+ | Skill | Verdict artifact | This gate says |
60
+ |-------|-----------------|----------------|
61
+ | `sp:code-verification` | `VerifyVerdict` (SECUA + AC) | Run the SECUA review + AC check; paste evidence |
62
+ | `sp:functional-review` | `FunctionalVerdict` (requirements) | Map each R{n} to file:line evidence; no MET without a citation |
63
+ | `sp:code-improvement` | Candidate list (advisory) | Every candidate needs file:line evidence; no "looks shallow" without a location |
64
+
65
+ ## The one sentence
66
+
67
+ If you cannot paste the raw output of the verification command you just ran, you cannot claim
68
+ "done".