@rune-kit/rune 2.4.0 → 2.7.0
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.
- package/README.md +47 -17
- package/compiler/__tests__/executive-dashboards.test.js +285 -0
- package/compiler/__tests__/inject.test.js +128 -0
- package/compiler/__tests__/orchestrators.test.js +151 -0
- package/compiler/__tests__/org-templates.test.js +447 -0
- package/compiler/__tests__/pack-split.test.js +141 -1
- package/compiler/__tests__/parser.test.js +147 -1
- package/compiler/__tests__/scripts-bundling.test.js +10 -11
- package/compiler/__tests__/skill-index.test.js +218 -0
- package/compiler/__tests__/status.test.js +336 -0
- package/compiler/__tests__/templates.test.js +245 -0
- package/compiler/__tests__/visualizer.test.js +325 -0
- package/compiler/adapters/antigravity.js +18 -4
- package/compiler/bin/rune.js +90 -1
- package/compiler/doctor.js +283 -2
- package/compiler/emitter.js +490 -17
- package/compiler/parser.js +255 -4
- package/compiler/status.js +342 -0
- package/compiler/visualizer.js +622 -0
- package/hooks/hooks.json +12 -0
- package/hooks/intent-router/index.cjs +108 -0
- package/hooks/pre-tool-guard/index.cjs +177 -68
- package/package.json +63 -63
- package/skills/autopsy/SKILL.md +48 -1
- package/skills/brainstorm/SKILL.md +2 -0
- package/skills/completion-gate/SKILL.md +26 -1
- package/skills/context-engine/SKILL.md +93 -2
- package/skills/cook/SKILL.md +794 -648
- package/skills/debug/SKILL.md +409 -392
- package/skills/deploy/SKILL.md +2 -0
- package/skills/docs/SKILL.md +28 -3
- package/skills/fix/SKILL.md +284 -281
- package/skills/mcp-builder/SKILL.md +53 -1
- package/skills/onboard/SKILL.md +58 -1
- package/skills/perf/SKILL.md +34 -1
- package/skills/plan/SKILL.md +372 -342
- package/skills/preflight/SKILL.md +396 -360
- package/skills/retro/SKILL.md +95 -1
- package/skills/review/SKILL.md +535 -489
- package/skills/scope-guard/SKILL.md +1 -0
- package/skills/scout/SKILL.md +1 -0
- package/skills/sentinel/SKILL.md +353 -299
- package/skills/sentinel/references/policy-driven-constraints.md +424 -0
- package/skills/session-bridge/SKILL.md +58 -2
- package/skills/session-bridge/references/evolutionary-memory-patterns.md +312 -0
- package/skills/team/SKILL.md +16 -1
- package/skills/test/SKILL.md +587 -585
- package/skills/verification/SKILL.md +1 -0
- package/skills/watchdog/SKILL.md +2 -0
package/skills/review/SKILL.md
CHANGED
|
@@ -1,489 +1,535 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review
|
|
3
|
-
description: Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code.
|
|
4
|
-
metadata:
|
|
5
|
-
author: runedev
|
|
6
|
-
version: "0.
|
|
7
|
-
layer: L2
|
|
8
|
-
model: sonnet
|
|
9
|
-
group: development
|
|
10
|
-
tools: "Read, Glob, Grep"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- `
|
|
36
|
-
- `
|
|
37
|
-
- `
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
41
|
-
- `
|
|
42
|
-
- `
|
|
43
|
-
-
|
|
44
|
-
- `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
- `
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
- `review` → `
|
|
59
|
-
- `review`
|
|
60
|
-
- `review` → `
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- If
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
- **
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
- Check
|
|
140
|
-
- Check
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- Scan for:
|
|
175
|
-
- Scan for:
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
|
186
|
-
|
|
187
|
-
| **The
|
|
188
|
-
|
|
189
|
-
**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
[ ]
|
|
226
|
-
[ ]
|
|
227
|
-
[ ]
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
- Include
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- `
|
|
265
|
-
|
|
266
|
-
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
**
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
//
|
|
333
|
-
|
|
334
|
-
//
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
//
|
|
340
|
-
<
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
// BAD:
|
|
349
|
-
<
|
|
350
|
-
//
|
|
351
|
-
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
**
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
- **
|
|
409
|
-
|
|
410
|
-
###
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
-
|
|
421
|
-
|
|
422
|
-
###
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code.
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "0.6.0"
|
|
7
|
+
layer: L2
|
|
8
|
+
model: sonnet
|
|
9
|
+
group: development
|
|
10
|
+
tools: "Read, Glob, Grep"
|
|
11
|
+
emit: review.complete, review.issues
|
|
12
|
+
listen: code.changed
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# review
|
|
16
|
+
|
|
17
|
+
## Purpose
|
|
18
|
+
|
|
19
|
+
Code quality analysis. Review finds bugs, bad patterns, security issues, and untested code. It does NOT fix anything — it reports findings and delegates: bugs go to rune:fix, untested code goes to rune:test, security-critical code goes to rune:sentinel.
|
|
20
|
+
|
|
21
|
+
<HARD-GATE>
|
|
22
|
+
A review that says "LGTM" or "code looks good" without specific file:line references is NOT a review.
|
|
23
|
+
Every review MUST cite at least one specific concern, suggestion, or explicit approval per file changed.
|
|
24
|
+
</HARD-GATE>
|
|
25
|
+
|
|
26
|
+
## Triggers
|
|
27
|
+
|
|
28
|
+
- Called by `cook` Phase 5 REVIEW — after implementation complete
|
|
29
|
+
- Called by `fix` for self-review on complex fixes
|
|
30
|
+
- `/rune review` — manual code review
|
|
31
|
+
- Auto-trigger: when PR is created or significant code changes committed
|
|
32
|
+
|
|
33
|
+
## Calls (outbound)
|
|
34
|
+
|
|
35
|
+
- `scout` (L2): find related code for fuller context during review
|
|
36
|
+
- `test` (L2): when untested edge cases found — write tests for them
|
|
37
|
+
- `fix` (L2): when bugs found during review — trigger fix
|
|
38
|
+
- `sentinel` (L2): when security-critical code detected (auth, input, crypto)
|
|
39
|
+
- `docs-seeker` (L3): verify API usage is current and correct
|
|
40
|
+
- `hallucination-guard` (L3): verify imports and API calls in reviewed code
|
|
41
|
+
- `design` (L2): when UI anti-patterns suggest missing design system — recommend design skill invocation
|
|
42
|
+
- `perf` (L2): when performance patterns detected in frontend diff
|
|
43
|
+
- `review-intake` (L2): structured intake for complex multi-file reviews
|
|
44
|
+
- `sast` (L3): static analysis security scan on reviewed code
|
|
45
|
+
- L4 extension packs: domain-specific review patterns when context matches (e.g., @rune/ui for frontend, @rune/security for auth code)
|
|
46
|
+
- `neural-memory` | After review complete | Capture code quality insight
|
|
47
|
+
|
|
48
|
+
## Called By (inbound)
|
|
49
|
+
|
|
50
|
+
- `cook` (L1): Phase 5 REVIEW — post-implementation quality check
|
|
51
|
+
- `fix` (L2): complex fix requests self-review
|
|
52
|
+
- User: `/rune review` direct invocation
|
|
53
|
+
- `surgeon` (L2): review refactored code quality
|
|
54
|
+
- `rescue` (L1): review refactored code quality
|
|
55
|
+
|
|
56
|
+
## Cross-Hub Connections
|
|
57
|
+
|
|
58
|
+
- `review` → `test` — untested edge case found → test writes it
|
|
59
|
+
- `review` → `fix` — bug found during review → fix applies correction
|
|
60
|
+
- `review` → `scout` — needs more context → scout finds related code
|
|
61
|
+
- `review` ← `fix` — complex fix requests self-review
|
|
62
|
+
- `review` → `sentinel` — security-critical code → sentinel deep scan
|
|
63
|
+
|
|
64
|
+
## Execution
|
|
65
|
+
|
|
66
|
+
### Step 1: Scope
|
|
67
|
+
|
|
68
|
+
Determine what to review.
|
|
69
|
+
|
|
70
|
+
- If triggered by a commit or PR: use `Bash` with `git diff main...HEAD` or `git diff HEAD~1` to see exactly what changed
|
|
71
|
+
- If triggered by a specific file or feature: use `Read` on each named file
|
|
72
|
+
- If context is unclear: use `rune:scout` to identify all files touched by the change
|
|
73
|
+
- List every file in scope before proceeding — do not review files outside the stated scope
|
|
74
|
+
|
|
75
|
+
### Step 1.5: Blast Radius Assessment
|
|
76
|
+
|
|
77
|
+
For each modified function/class, estimate its blast radius before reviewing.
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Use Grep to count direct callers/importers of each modified symbol:
|
|
81
|
+
blast_radius = count(files importing or calling this symbol)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Blast Radius | Risk | Review Depth |
|
|
85
|
+
|-------------|------|-------------|
|
|
86
|
+
| 1-5 callers | Low | Standard review |
|
|
87
|
+
| 6-20 callers | Medium | Check all callers for compatibility |
|
|
88
|
+
| 21-50 callers | High | Thorough review + regression test check |
|
|
89
|
+
| 50+ callers | Critical | MUST escalate to adversarial analysis (rune:adversary) even in quick triage |
|
|
90
|
+
|
|
91
|
+
<HARD-GATE>
|
|
92
|
+
Modifying a symbol with 50+ callers + HIGH severity change (logic, types, behavior) → adversarial analysis REQUIRED. Quick review is NOT sufficient for high-blast-radius changes.
|
|
93
|
+
</HARD-GATE>
|
|
94
|
+
|
|
95
|
+
### Step 2: Logic Check (Production-Critical Focus)
|
|
96
|
+
|
|
97
|
+
Read each changed file. Prioritize bugs that **pass CI but break production** — these are the highest-value findings because linters and type checkers already catch the rest.
|
|
98
|
+
|
|
99
|
+
- Use `Read` on every file in scope
|
|
100
|
+
- **Race conditions**: async operations without proper sequencing, shared mutable state, missing locks
|
|
101
|
+
- **State corruption**: mutations that affect other consumers, cache invalidation gaps, stale closures
|
|
102
|
+
- **Silent failures**: caught errors that swallow context, empty catch blocks, promises without rejection handling
|
|
103
|
+
- **Data loss paths**: write operations without confirmation, delete without soft-delete, truncation without backup
|
|
104
|
+
- **Edge cases**: empty input, null/undefined, zero, negative numbers, empty arrays, Unicode, timezone boundaries
|
|
105
|
+
- Check for: logic errors, off-by-one errors, incorrect conditionals, broken async/await patterns
|
|
106
|
+
- Flag each finding with file path, line number, and severity
|
|
107
|
+
|
|
108
|
+
**Common patterns to flag:**
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
// BAD — missing await causes race condition
|
|
112
|
+
async function saveUser(data) {
|
|
113
|
+
db.users.create(data); // caller proceeds before save completes
|
|
114
|
+
return { success: true };
|
|
115
|
+
}
|
|
116
|
+
// GOOD
|
|
117
|
+
async function saveUser(data) {
|
|
118
|
+
await db.users.create(data);
|
|
119
|
+
return { success: true };
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
// BAD — null deref crash
|
|
125
|
+
function getUsername(user) {
|
|
126
|
+
return user.profile.name.toUpperCase(); // crashes if profile or name is null
|
|
127
|
+
}
|
|
128
|
+
// GOOD — safe access
|
|
129
|
+
function getUsername(user) {
|
|
130
|
+
return user?.profile?.name?.toUpperCase() ?? 'Anonymous';
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Step 3: Pattern Check
|
|
135
|
+
|
|
136
|
+
Check consistency with project conventions.
|
|
137
|
+
|
|
138
|
+
- Compare naming against existing codebase patterns (use `Grep` to sample similar code)
|
|
139
|
+
- Check file structure: is it in the right layer/directory per project conventions?
|
|
140
|
+
- Check for mutations — all state changes should use immutable patterns
|
|
141
|
+
- Check for hardcoded values that should be constants or config
|
|
142
|
+
- Check TypeScript: no `any`, full type coverage, no non-null assertions without justification
|
|
143
|
+
- Flag inconsistencies as MEDIUM or LOW depending on impact
|
|
144
|
+
|
|
145
|
+
**Common patterns to flag:**
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// BAD — mutation
|
|
149
|
+
function addItem(cart, item) {
|
|
150
|
+
cart.items.push(item); // mutates in place
|
|
151
|
+
return cart;
|
|
152
|
+
}
|
|
153
|
+
// GOOD — immutable
|
|
154
|
+
function addItem(cart, item) {
|
|
155
|
+
return { ...cart, items: [...cart.items, item] };
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
// BAD — any defeats TypeScript's purpose
|
|
161
|
+
function process(data: any): any {
|
|
162
|
+
return data.items.map((i: any) => i.value);
|
|
163
|
+
}
|
|
164
|
+
// GOOD — typed
|
|
165
|
+
function process(data: { items: Array<{ value: string }> }): string[] {
|
|
166
|
+
return data.items.map(i => i.value);
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Step 4: Security Check
|
|
171
|
+
|
|
172
|
+
Check for security-relevant issues.
|
|
173
|
+
|
|
174
|
+
- Scan for: hardcoded secrets, API keys, passwords in code or comments
|
|
175
|
+
- Scan for: unvalidated user input passed to queries, file paths, or shell commands
|
|
176
|
+
- Scan for: missing authentication checks on new routes or functions
|
|
177
|
+
- Scan for: XSS vectors (unsanitized HTML output), CSRF exposure, open redirects
|
|
178
|
+
- If any security-sensitive code found (auth logic, input handling, crypto, payment): call `rune:sentinel` for deep scan
|
|
179
|
+
- Sentinel escalation is mandatory — do not skip it for auth or crypto code
|
|
180
|
+
|
|
181
|
+
### Step 4.5: API Pit-of-Success Check
|
|
182
|
+
|
|
183
|
+
For code that exposes APIs, shared utilities, or reusable interfaces, evaluate through 3 adversary personas:
|
|
184
|
+
|
|
185
|
+
| Adversary | Mindset | What They Reveal |
|
|
186
|
+
|-----------|---------|-----------------|
|
|
187
|
+
| **The Scoundrel** | Malicious — controls config, crafts inputs, exploits edge cases | Security holes, privilege escalation, injection surfaces |
|
|
188
|
+
| **The Lazy Developer** | Copy-pastes from docs, skips error handling, uses defaults | Unsafe defaults, missing validation, footgun APIs |
|
|
189
|
+
| **The Confused Developer** | Misunderstands API semantics, passes wrong types, ignores return values | Ambiguous interfaces, poor naming, missing type safety |
|
|
190
|
+
|
|
191
|
+
**Pit-of-Success principle**: Secure, correct usage should be the path of least resistance. If the API makes it EASIER to use it wrong than right → WARN.
|
|
192
|
+
|
|
193
|
+
Check: Does the API have sensible defaults? Does misuse fail loudly (not silently)? Is the happy path obvious from the signature?
|
|
194
|
+
|
|
195
|
+
**Skip if**: Code is internal-only (no external consumers), single-use utility, or test-only.
|
|
196
|
+
|
|
197
|
+
### Step 5: Test Coverage
|
|
198
|
+
|
|
199
|
+
Identify gaps in test coverage.
|
|
200
|
+
|
|
201
|
+
- Use `Bash` to check if a test file exists for each changed file
|
|
202
|
+
- Use `Glob` to find test files: `**/*.test.ts`, `**/*.spec.ts`, `**/__tests__/**`
|
|
203
|
+
- Read the test file and verify: are the new functions covered? are edge cases tested?
|
|
204
|
+
- If untested code found: call `rune:test` with specific instructions on what to test
|
|
205
|
+
- Flag as HIGH if business logic is untested, MEDIUM if utility code is untested
|
|
206
|
+
|
|
207
|
+
### Step 5.5: Two-Stage Review Gate
|
|
208
|
+
|
|
209
|
+
Separate spec compliance from code quality. Most reviews conflate both — this gate forces the distinction.
|
|
210
|
+
|
|
211
|
+
**Stage 1 — Spec Compliance (check FIRST)**
|
|
212
|
+
|
|
213
|
+
Before evaluating code quality, verify the implementation matches what was asked:
|
|
214
|
+
|
|
215
|
+
- Load the originating plan, task, ticket, or `requirements.md` if available
|
|
216
|
+
- Does the implementation cover every acceptance criterion? Check each one explicitly
|
|
217
|
+
- Is there **under-engineering** — requirements stated but not implemented?
|
|
218
|
+
- Is there **over-engineering** — abstractions, generalization, or features beyond scope?
|
|
219
|
+
- Does the file/function structure match what the plan specified?
|
|
220
|
+
|
|
221
|
+
Flag spec deviations as HIGH — clean code that misses requirements ships broken products.
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
# Spec Compliance Checklist
|
|
225
|
+
[ ] All acceptance criteria from plan/ticket covered
|
|
226
|
+
[ ] No stated requirements missing from implementation
|
|
227
|
+
[ ] No unrequested features added (scope creep)
|
|
228
|
+
[ ] API surface matches what was specified (signatures, endpoints, return types)
|
|
229
|
+
[ ] File structure matches plan (no renamed or relocated files without justification)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
If spec violations found: document them separately from code quality findings in the report. Label as `SPEC-MISS` or `SPEC-CREEP`.
|
|
233
|
+
|
|
234
|
+
**Stage 2 — Code Quality**
|
|
235
|
+
|
|
236
|
+
Proceed to Step 6 only after Stage 1 passes. Code quality findings (bugs, patterns, security, coverage) are the existing Steps 2–5 above.
|
|
237
|
+
|
|
238
|
+
The review report MUST show both stages: spec compliance verdict first, then code quality findings.
|
|
239
|
+
|
|
240
|
+
### Step 6: Report
|
|
241
|
+
|
|
242
|
+
Produce a structured severity-ranked report.
|
|
243
|
+
|
|
244
|
+
**Before reporting, apply confidence filter:**
|
|
245
|
+
- Only report findings with >80% confidence it is a real issue
|
|
246
|
+
- Consolidate similar issues: "8 functions missing error handling in src/services/" — not 8 separate findings
|
|
247
|
+
- Skip stylistic preferences unless they violate conventions found in `.eslintrc`, `CLAUDE.md`, or `CONTRIBUTING.md`
|
|
248
|
+
- Adapt to project type: a `console.log` in a CLI tool is fine; in a production API handler it is not
|
|
249
|
+
|
|
250
|
+
- Group findings by severity: CRITICAL → HIGH → MEDIUM → LOW
|
|
251
|
+
- Include file path and line number for every finding
|
|
252
|
+
- Include a Positive Notes section (good patterns observed)
|
|
253
|
+
- Include a Verdict: APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
|
|
254
|
+
|
|
255
|
+
### Step 6.5: Fix-First Triage
|
|
256
|
+
|
|
257
|
+
> From gstack (garrytan/gstack, 50.9k★): "Reviews that produce 20 findings and delegate all to the user waste everyone's time."
|
|
258
|
+
|
|
259
|
+
Classify each finding as **AUTO-FIX** or **ASK** before reporting:
|
|
260
|
+
|
|
261
|
+
| Category | Auto-Fix? | Examples |
|
|
262
|
+
|----------|-----------|---------|
|
|
263
|
+
| Dead imports, unused variables | AUTO-FIX | `import { foo } from './bar'` where foo is never used |
|
|
264
|
+
| Missing error handling on obvious paths | AUTO-FIX | `await fetch()` without try/catch in production code |
|
|
265
|
+
| Console.log in production code | AUTO-FIX | Remove `console.log` from non-CLI production files |
|
|
266
|
+
| Architectural concern, trade-off | ASK | "This bypasses the auth middleware — intentional?" |
|
|
267
|
+
| Ambiguous intent | ASK | "Is this fallback behavior correct for null users?" |
|
|
268
|
+
| Style/convention disagreement | ASK | "Project uses camelCase but this file uses snake_case" |
|
|
269
|
+
|
|
270
|
+
**After classification:**
|
|
271
|
+
- Apply AUTO-FIX findings directly via `rune:fix` — include all in a single batch
|
|
272
|
+
- Collect ASK findings into ONE `AskUserQuestion` — not 5 separate questions
|
|
273
|
+
- Report both: "Auto-fixed 4 issues. 2 findings need your input: [...]"
|
|
274
|
+
|
|
275
|
+
**Rationalization prevention**: "This looks fine" is NOT acceptable without evidence. If you can't cite a specific file:line or convention that justifies the code, flag it as UNVERIFIED — don't rationalize away uncertainty.
|
|
276
|
+
|
|
277
|
+
### Step 6.6: Scope Drift Detection
|
|
278
|
+
|
|
279
|
+
> From gstack (garrytan/gstack, 50.9k★): "Intent vs diff catches scope creep that plan-based guards miss."
|
|
280
|
+
|
|
281
|
+
After reviewing code, compare **stated intent** vs **actual diff**:
|
|
282
|
+
|
|
283
|
+
1. Read the originating source: TODO list, PR description, commit messages, or plan file
|
|
284
|
+
2. Extract stated intent: "what was this change supposed to do?"
|
|
285
|
+
3. Run `git diff --stat` to see actual file changes
|
|
286
|
+
4. Compare:
|
|
287
|
+
|
|
288
|
+
| Result | Meaning | Action |
|
|
289
|
+
|--------|---------|--------|
|
|
290
|
+
| **CLEAN** | All changed files serve the stated intent | Note in report |
|
|
291
|
+
| **DRIFT** | 1-2 files changed that don't relate to stated intent | WARN — "These files were modified but aren't mentioned in the task: [list]" |
|
|
292
|
+
| **REQUIREMENTS_MISSING** | Stated intent mentions files/features not in the diff | WARN — "Task mentions X but it's not in the diff" |
|
|
293
|
+
|
|
294
|
+
**This is informational, not blocking.** Scope drift is common and sometimes intentional — but making it visible prevents silent creep.
|
|
295
|
+
|
|
296
|
+
After reporting:
|
|
297
|
+
- If any CRITICAL findings: call `rune:fix` immediately with the finding details
|
|
298
|
+
- If any HIGH findings: call `rune:fix` with the finding details
|
|
299
|
+
- If untested code: call `rune:test` with specific coverage gaps identified
|
|
300
|
+
- Call `neural-memory` (Capture Mode) to save any novel code quality patterns or recurring issues found.
|
|
301
|
+
|
|
302
|
+
## Framework-Specific Checks
|
|
303
|
+
|
|
304
|
+
Apply **only** if the framework is detected in the changed files. Skip if not relevant.
|
|
305
|
+
|
|
306
|
+
**React / Next.js** (detect: `import React` or `.tsx` files)
|
|
307
|
+
- `useEffect` with missing dependencies (stale closure) → flag HIGH
|
|
308
|
+
- List items using index as key on reorderable lists: `key={i}` → flag MEDIUM
|
|
309
|
+
- Props drilled through 3+ levels without Context or composition → flag MEDIUM
|
|
310
|
+
- Client-side hooks (`useState`, `useEffect`) in Server Components (Next.js App Router) → flag HIGH
|
|
311
|
+
|
|
312
|
+
**Node.js / Express** (detect: `import express` or `require('express')`)
|
|
313
|
+
- Missing rate limiting on public endpoints → flag MEDIUM
|
|
314
|
+
- `req.body` passed directly to DB without validation schema → flag HIGH
|
|
315
|
+
- Synchronous operations blocking the event loop inside async handlers → flag HIGH
|
|
316
|
+
|
|
317
|
+
**Python** (detect: `.py` files with `django`, `flask`, or `fastapi` imports)
|
|
318
|
+
- `except:` bare catch without specific exception type → flag MEDIUM
|
|
319
|
+
- Mutable default arguments: `def func(items=[])` → flag HIGH
|
|
320
|
+
- Missing type hints on public functions (if project uses mypy/pyright) → flag LOW
|
|
321
|
+
|
|
322
|
+
## UI/UX Anti-Pattern Checks
|
|
323
|
+
|
|
324
|
+
Apply **only** when `.tsx`, `.jsx`, `.svelte`, `.vue`, or `.html` files are in the diff. Skip for backend-only changes.
|
|
325
|
+
|
|
326
|
+
These are the **"AI UI signature"** — patterns that make AI-generated frontends visually identifiable as non-human-designed. Flag each as MEDIUM severity.
|
|
327
|
+
|
|
328
|
+
**AI_ANTIPATTERN — Purple/indigo default accent with no domain justification:**
|
|
329
|
+
```tsx
|
|
330
|
+
// BAD: LLM default color bias — signals "AI-generated" to experienced designers
|
|
331
|
+
className="bg-indigo-600 text-white" // every button/CTA is indigo
|
|
332
|
+
// GOOD: domain-appropriate — trading → neutral dark, healthcare → trust blue,
|
|
333
|
+
// e-commerce → conversion-optimized warm. Purple is only appropriate for
|
|
334
|
+
// AI-native tools and creative platforms.
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
**AI_ANTIPATTERN — Card-grid monotony (every section is 3-col cards, zero layout variation):**
|
|
338
|
+
```tsx
|
|
339
|
+
// BAD: every section uses the same grid pattern
|
|
340
|
+
<div className="grid grid-cols-3 gap-6"> // features
|
|
341
|
+
<div className="grid grid-cols-3 gap-6"> // testimonials
|
|
342
|
+
<div className="grid grid-cols-3 gap-6"> // pricing
|
|
343
|
+
// GOOD: mix layouts — split sections, bento grids, full-bleed hero, list+detail
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**AI_ANTIPATTERN — Centeritis (everything centered, no directional flow):**
|
|
347
|
+
```tsx
|
|
348
|
+
// BAD: no visual tension, no reading direction
|
|
349
|
+
<div className="text-center flex flex-col items-center"> // hero
|
|
350
|
+
<div className="text-center"> // every feature section
|
|
351
|
+
// GOOD: left-align body copy, use centering intentionally for hero/CTAs only
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**AI_ANTIPATTERN — Numeric/financial values in non-monospace font:**
|
|
355
|
+
```tsx
|
|
356
|
+
// BAD: prices, stats, metrics in Inter/Roboto
|
|
357
|
+
<span className="text-2xl font-bold">${price}</span>
|
|
358
|
+
// GOOD: monospace for all numbers that need alignment
|
|
359
|
+
<span className="font-mono text-2xl font-bold">${price}</span>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**AI_ANTIPATTERN — Missing UI states (only happy path rendered):**
|
|
363
|
+
```tsx
|
|
364
|
+
// BAD: data rendering without empty/error/loading states
|
|
365
|
+
{data.map(item => <Card key={item.id} {...item} />)}
|
|
366
|
+
// GOOD: all 4 states covered
|
|
367
|
+
{isLoading && <CardSkeleton />}
|
|
368
|
+
{error && <ErrorState message={error.message} />}
|
|
369
|
+
{!data.length && <EmptyState />}
|
|
370
|
+
{data.map(item => <Card key={item.id} {...item} />)}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Accessibility — flag as HIGH (these are WCAG 2.2 failures):**
|
|
374
|
+
```tsx
|
|
375
|
+
// BAD: icon button with no accessible name
|
|
376
|
+
<button onClick={close}><XIcon /></button>
|
|
377
|
+
// GOOD
|
|
378
|
+
<button onClick={close} aria-label="Close dialog"><XIcon aria-hidden="true" /></button>
|
|
379
|
+
|
|
380
|
+
// BAD: placeholder as label
|
|
381
|
+
<input placeholder="Email address" type="email" />
|
|
382
|
+
// GOOD
|
|
383
|
+
<label htmlFor="email">Email address</label>
|
|
384
|
+
<input id="email" type="email" />
|
|
385
|
+
|
|
386
|
+
// BAD: removes focus ring without replacement
|
|
387
|
+
className="focus:outline-none"
|
|
388
|
+
// GOOD: must have focus-visible replacement
|
|
389
|
+
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
|
|
390
|
+
|
|
391
|
+
// BAD: color as sole information conveyor
|
|
392
|
+
<span className="text-red-500">{errorMessage}</span>
|
|
393
|
+
// GOOD: icon + color + text
|
|
394
|
+
<span className="text-red-500 flex gap-1"><ErrorIcon aria-hidden />Error: {errorMessage}</span>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**WCAG 2.2 New Rules — flag as MEDIUM:**
|
|
398
|
+
- `position: sticky` or `position: fixed` header/footer without `scroll-padding-top` → Focus Not Obscured (2.4.11)
|
|
399
|
+
- Interactive elements with `width < 24px` or `height < 24px` without 8px spacing → Target Size (2.5.8)
|
|
400
|
+
- Multi-step form re-asking for previously entered data → Redundant Entry (3.3.7)
|
|
401
|
+
|
|
402
|
+
**Platform-Specific — flag as MEDIUM when platform is detectable:**
|
|
403
|
+
- iOS target: solid-background cards (iOS 26 Liquid Glass deprecates this visual language) — should use translucent/blur surfaces
|
|
404
|
+
- Android target: hardcoded hex colors instead of `MaterialTheme.colorScheme` tokens → not adaptive to dynamic color
|
|
405
|
+
|
|
406
|
+
## Weighted Composite Scoring
|
|
407
|
+
|
|
408
|
+
When a review is part of a recurring quality-gate cycle (e.g., sprint review, pre-release gate), produce a **composite quality score** alongside the findings list. This makes review output numeric and comparable across runs.
|
|
409
|
+
|
|
410
|
+
### Formula
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
Quality Score = (Correctness × 0.35) + (Security × 0.30) + (Test Coverage × 0.20) + (Conventions × 0.15)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Each dimension is scored 0–100 based on findings count and severity:
|
|
417
|
+
- 0 CRITICAL/HIGH findings → 100 for that dimension
|
|
418
|
+
- 1 CRITICAL → dimension capped at 40
|
|
419
|
+
- 1 HIGH → dimension capped at 70
|
|
420
|
+
- Each additional MEDIUM → subtract 5 (floor: 50)
|
|
421
|
+
|
|
422
|
+
### Grade Thresholds
|
|
423
|
+
|
|
424
|
+
| Score | Grade | Verdict |
|
|
425
|
+
|-------|-------|---------|
|
|
426
|
+
| 90–100 | Excellent | APPROVE |
|
|
427
|
+
| 75–89 | Good | APPROVE with notes |
|
|
428
|
+
| 60–74 | Fair | REQUEST CHANGES (MEDIUM issues) |
|
|
429
|
+
| 40–59 | Poor | REQUEST CHANGES (HIGH issues present) |
|
|
430
|
+
| 0–39 | Critical | REQUEST CHANGES (CRITICAL present) |
|
|
431
|
+
|
|
432
|
+
**When to include**: Only when `mode: "scored"` is passed by the caller, or when invoked by `audit`. Default review output uses the standard severity-ranked report without the score.
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
## Severity Levels
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
CRITICAL — security vulnerability, data loss risk, crash bug
|
|
439
|
+
HIGH — logic error, missing validation, broken edge case
|
|
440
|
+
MEDIUM — code smell, performance issue, missing error handling
|
|
441
|
+
LOW — style inconsistency, naming suggestion, minor refactor opportunity
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Output Format
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
## Code Review Report
|
|
448
|
+
- **Files Reviewed**: [count]
|
|
449
|
+
- **Findings**: [count by severity]
|
|
450
|
+
- **Review Commit**: [git hash at time of review]
|
|
451
|
+
- **Overall**: APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
|
|
452
|
+
|
|
453
|
+
### Spec Compliance
|
|
454
|
+
- [PASS/FAIL]: [acceptance criteria coverage]
|
|
455
|
+
|
|
456
|
+
### CRITICAL
|
|
457
|
+
- `path/to/file.ts:42` — [description of critical issue]
|
|
458
|
+
|
|
459
|
+
### HIGH
|
|
460
|
+
- `path/to/file.ts:85` — [description of high-severity issue]
|
|
461
|
+
|
|
462
|
+
### MEDIUM
|
|
463
|
+
- `path/to/file.ts:120` — [description of medium issue]
|
|
464
|
+
|
|
465
|
+
### Blast Radius
|
|
466
|
+
- [High-impact symbols with caller counts]
|
|
467
|
+
|
|
468
|
+
### Positive Notes
|
|
469
|
+
- [good patterns observed]
|
|
470
|
+
|
|
471
|
+
### Verdict
|
|
472
|
+
[Summary and recommendation]
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### Review Staleness Detection
|
|
476
|
+
|
|
477
|
+
Track the git commit hash at review time. If code changes after review → review is STALE.
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
Review commit: abc123 → Code changed to def456 → Review is STALE, re-review required
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
When `cook` or `ship` checks review status: compare review commit hash with current HEAD. If different → WARN: "Review is stale — code changed since last review."
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
## Constraints
|
|
487
|
+
|
|
488
|
+
1. MUST read the full diff — not just the files the user pointed at
|
|
489
|
+
2. MUST reference specific file:line for every finding
|
|
490
|
+
3. MUST NOT rubber-stamp with generic praise ("well-structured", "clean code") without evidence
|
|
491
|
+
4. MUST check: correctness, security, performance, conventions, test coverage
|
|
492
|
+
5. MUST categorize findings: CRITICAL (blocks commit) / HIGH / MEDIUM / LOW
|
|
493
|
+
6. MUST escalate to sentinel if auth/crypto/secrets code is touched
|
|
494
|
+
7. MUST flag untested code paths and recommend tests via rune:test
|
|
495
|
+
|
|
496
|
+
## Returns
|
|
497
|
+
|
|
498
|
+
| Artifact | Format | Location |
|
|
499
|
+
|----------|--------|----------|
|
|
500
|
+
| Code review report | Markdown | inline (chat output) |
|
|
501
|
+
| Severity-ranked findings | Markdown table | inline |
|
|
502
|
+
| Spec compliance verdict | Markdown | inline |
|
|
503
|
+
| Composite quality score | Markdown table | inline (when `mode: "scored"`) |
|
|
504
|
+
| Blast radius assessment | Markdown table | inline |
|
|
505
|
+
|
|
506
|
+
## Sharp Edges
|
|
507
|
+
|
|
508
|
+
| Failure Mode | Severity | Mitigation |
|
|
509
|
+
|---|---|---|
|
|
510
|
+
| Finding flood — 20+ findings overwhelm developer | MEDIUM | Confidence filter: only >80% confidence, consolidate similar issues per file |
|
|
511
|
+
| "LGTM" without file:line evidence | HIGH | HARD-GATE blocks this — cite at least one specific item per changed file |
|
|
512
|
+
| Expanding review scope beyond the diff | MEDIUM | Limit to `git diff` scope — do not creep into adjacent unchanged files |
|
|
513
|
+
| Security finding without sentinel escalation | HIGH | Any auth/crypto/payment code touched → MUST call rune:sentinel |
|
|
514
|
+
| Skipping UI anti-pattern checks for frontend changes | MEDIUM | Any .tsx/.jsx/.svelte/.vue in diff → MUST run UI/UX Anti-Pattern Checks section |
|
|
515
|
+
| Skipping spec compliance check (Step 5.5 Stage 1) | HIGH | Code quality without spec check ships clean code that does the wrong thing — always load the plan/ticket before reviewing quality |
|
|
516
|
+
| Treating purple/indigo accent as "just a color choice" | MEDIUM | It is a documented AI-generated UI signature — always flag for domain justification |
|
|
517
|
+
| Suggesting "add X" without checking if X is used | MEDIUM | YAGNI pushback: grep codebase for the suggested feature → if uncalled anywhere → respond "Not called anywhere. Remove? (YAGNI)". Valid pushback, not laziness |
|
|
518
|
+
| Adding abstractions "for future flexibility" | MEDIUM | Three similar lines > premature abstraction. Only abstract when there are 3+ concrete callers today |
|
|
519
|
+
| Missing cross-phase integration check at phase boundary | MEDIUM | When reviewing a phase completion: check orphaned exports, uncalled routes, auth gaps, E2E flow continuity. Delegate to completion-gate Step 4.5 |
|
|
520
|
+
| Review loop exceeds 3 iterations without resolution | MEDIUM | Cap at 3 review loops. After 3rd iteration with unresolved findings → surface to user with "these findings persist after 3 fix attempts — needs human decision" |
|
|
521
|
+
| Auto-fixing something that should have been ASK | HIGH | When in doubt, ASK. AUTO-FIX only for mechanical issues (dead imports, console.log). Anything involving intent or trade-offs = ASK |
|
|
522
|
+
| Scope drift flagged on intentional refactoring | LOW | Scope drift is informational, not blocking. User can override with "intentional" — don't re-flag after override |
|
|
523
|
+
|
|
524
|
+
## Done When
|
|
525
|
+
|
|
526
|
+
- All changed files in the diff read and analyzed
|
|
527
|
+
- Every finding references specific file:line with severity label
|
|
528
|
+
- Security-critical code escalated to sentinel (or confirmed not present)
|
|
529
|
+
- Test coverage gaps identified and documented
|
|
530
|
+
- UI anti-pattern checks ran for any frontend files in diff (or confirmed not applicable)
|
|
531
|
+
- Structured report emitted with APPROVE / REQUEST CHANGES / NEEDS DISCUSSION verdict
|
|
532
|
+
|
|
533
|
+
## Cost Profile
|
|
534
|
+
|
|
535
|
+
~3000-6000 tokens input, ~1000-2000 tokens output. Sonnet default, opus for security-critical reviews. Runs once per implementation cycle.
|