@rune-kit/rune 2.1.1

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,354 @@
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.2.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: development
10
+ tools: "Read, Glob, Grep"
11
+ ---
12
+
13
+ # review
14
+
15
+ ## Purpose
16
+
17
+ 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.
18
+
19
+ <HARD-GATE>
20
+ A review that says "LGTM" or "code looks good" without specific file:line references is NOT a review.
21
+ Every review MUST cite at least one specific concern, suggestion, or explicit approval per file changed.
22
+ </HARD-GATE>
23
+
24
+ ## Triggers
25
+
26
+ - Called by `cook` Phase 5 REVIEW — after implementation complete
27
+ - Called by `fix` for self-review on complex fixes
28
+ - `/rune review` — manual code review
29
+ - Auto-trigger: when PR is created or significant code changes committed
30
+
31
+ ## Calls (outbound)
32
+
33
+ - `scout` (L2): find related code for fuller context during review
34
+ - `test` (L2): when untested edge cases found — write tests for them
35
+ - `fix` (L2): when bugs found during review — trigger fix
36
+ - `sentinel` (L2): when security-critical code detected (auth, input, crypto)
37
+ - `docs-seeker` (L3): verify API usage is current and correct
38
+ - `hallucination-guard` (L3): verify imports and API calls in reviewed code
39
+ - `design` (L2): when UI anti-patterns suggest missing design system — recommend design skill invocation
40
+ - `perf` (L2): when performance patterns detected in frontend diff
41
+ - `review-intake` (L2): structured intake for complex multi-file reviews
42
+ - `sast` (L3): static analysis security scan on reviewed code
43
+ - L4 extension packs: domain-specific review patterns when context matches (e.g., @rune/ui for frontend, @rune/security for auth code)
44
+
45
+ ## Called By (inbound)
46
+
47
+ - `cook` (L1): Phase 5 REVIEW — post-implementation quality check
48
+ - `fix` (L2): complex fix requests self-review
49
+ - User: `/rune review` direct invocation
50
+ - `surgeon` (L2): review refactored code quality
51
+ - `rescue` (L1): review refactored code quality
52
+
53
+ ## Cross-Hub Connections
54
+
55
+ - `review` → `test` — untested edge case found → test writes it
56
+ - `review` → `fix` — bug found during review → fix applies correction
57
+ - `review` → `scout` — needs more context → scout finds related code
58
+ - `review` ← `fix` — complex fix requests self-review
59
+ - `review` → `sentinel` — security-critical code → sentinel deep scan
60
+
61
+ ## Execution
62
+
63
+ ### Step 1: Scope
64
+
65
+ Determine what to review.
66
+
67
+ - If triggered by a commit or PR: use `Bash` with `git diff main...HEAD` or `git diff HEAD~1` to see exactly what changed
68
+ - If triggered by a specific file or feature: use `Read` on each named file
69
+ - If context is unclear: use `rune:scout` to identify all files touched by the change
70
+ - List every file in scope before proceeding — do not review files outside the stated scope
71
+
72
+ ### Step 2: Logic Check
73
+
74
+ Read each changed file and check for correctness.
75
+
76
+ - Use `Read` on every file in scope
77
+ - Check for: logic errors, off-by-one errors, incorrect conditionals, broken async/await patterns
78
+ - Check for: missing error handling, uncaught promise rejections, silent failures
79
+ - Check for: edge cases — empty input, null/undefined, zero, negative numbers, empty arrays
80
+ - Flag each finding with file path, line number, and severity
81
+
82
+ **Common patterns to flag:**
83
+
84
+ ```typescript
85
+ // BAD — missing await causes race condition
86
+ async function saveUser(data) {
87
+ db.users.create(data); // caller proceeds before save completes
88
+ return { success: true };
89
+ }
90
+ // GOOD
91
+ async function saveUser(data) {
92
+ await db.users.create(data);
93
+ return { success: true };
94
+ }
95
+ ```
96
+
97
+ ```typescript
98
+ // BAD — null deref crash
99
+ function getUsername(user) {
100
+ return user.profile.name.toUpperCase(); // crashes if profile or name is null
101
+ }
102
+ // GOOD — safe access
103
+ function getUsername(user) {
104
+ return user?.profile?.name?.toUpperCase() ?? 'Anonymous';
105
+ }
106
+ ```
107
+
108
+ ### Step 3: Pattern Check
109
+
110
+ Check consistency with project conventions.
111
+
112
+ - Compare naming against existing codebase patterns (use `Grep` to sample similar code)
113
+ - Check file structure: is it in the right layer/directory per project conventions?
114
+ - Check for mutations — all state changes should use immutable patterns
115
+ - Check for hardcoded values that should be constants or config
116
+ - Check TypeScript: no `any`, full type coverage, no non-null assertions without justification
117
+ - Flag inconsistencies as MEDIUM or LOW depending on impact
118
+
119
+ **Common patterns to flag:**
120
+
121
+ ```typescript
122
+ // BAD — mutation
123
+ function addItem(cart, item) {
124
+ cart.items.push(item); // mutates in place
125
+ return cart;
126
+ }
127
+ // GOOD — immutable
128
+ function addItem(cart, item) {
129
+ return { ...cart, items: [...cart.items, item] };
130
+ }
131
+ ```
132
+
133
+ ```typescript
134
+ // BAD — any defeats TypeScript's purpose
135
+ function process(data: any): any {
136
+ return data.items.map((i: any) => i.value);
137
+ }
138
+ // GOOD — typed
139
+ function process(data: { items: Array<{ value: string }> }): string[] {
140
+ return data.items.map(i => i.value);
141
+ }
142
+ ```
143
+
144
+ ### Step 4: Security Check
145
+
146
+ Check for security-relevant issues.
147
+
148
+ - Scan for: hardcoded secrets, API keys, passwords in code or comments
149
+ - Scan for: unvalidated user input passed to queries, file paths, or shell commands
150
+ - Scan for: missing authentication checks on new routes or functions
151
+ - Scan for: XSS vectors (unsanitized HTML output), CSRF exposure, open redirects
152
+ - If any security-sensitive code found (auth logic, input handling, crypto, payment): call `rune:sentinel` for deep scan
153
+ - Sentinel escalation is mandatory — do not skip it for auth or crypto code
154
+
155
+ ### Step 5: Test Coverage
156
+
157
+ Identify gaps in test coverage.
158
+
159
+ - Use `Bash` to check if a test file exists for each changed file
160
+ - Use `Glob` to find test files: `**/*.test.ts`, `**/*.spec.ts`, `**/__tests__/**`
161
+ - Read the test file and verify: are the new functions covered? are edge cases tested?
162
+ - If untested code found: call `rune:test` with specific instructions on what to test
163
+ - Flag as HIGH if business logic is untested, MEDIUM if utility code is untested
164
+
165
+ ### Step 6: Report
166
+
167
+ Produce a structured severity-ranked report.
168
+
169
+ **Before reporting, apply confidence filter:**
170
+ - Only report findings with >80% confidence it is a real issue
171
+ - Consolidate similar issues: "8 functions missing error handling in src/services/" — not 8 separate findings
172
+ - Skip stylistic preferences unless they violate conventions found in `.eslintrc`, `CLAUDE.md`, or `CONTRIBUTING.md`
173
+ - Adapt to project type: a `console.log` in a CLI tool is fine; in a production API handler it is not
174
+
175
+ - Group findings by severity: CRITICAL → HIGH → MEDIUM → LOW
176
+ - Include file path and line number for every finding
177
+ - Include a Positive Notes section (good patterns observed)
178
+ - Include a Verdict: APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
179
+
180
+ After reporting:
181
+ - If any CRITICAL findings: call `rune:fix` immediately with the finding details
182
+ - If any HIGH findings: call `rune:fix` with the finding details
183
+ - If untested code: call `rune:test` with specific coverage gaps identified
184
+
185
+ ## Framework-Specific Checks
186
+
187
+ Apply **only** if the framework is detected in the changed files. Skip if not relevant.
188
+
189
+ **React / Next.js** (detect: `import React` or `.tsx` files)
190
+ - `useEffect` with missing dependencies (stale closure) → flag HIGH
191
+ - List items using index as key on reorderable lists: `key={i}` → flag MEDIUM
192
+ - Props drilled through 3+ levels without Context or composition → flag MEDIUM
193
+ - Client-side hooks (`useState`, `useEffect`) in Server Components (Next.js App Router) → flag HIGH
194
+
195
+ **Node.js / Express** (detect: `import express` or `require('express')`)
196
+ - Missing rate limiting on public endpoints → flag MEDIUM
197
+ - `req.body` passed directly to DB without validation schema → flag HIGH
198
+ - Synchronous operations blocking the event loop inside async handlers → flag HIGH
199
+
200
+ **Python** (detect: `.py` files with `django`, `flask`, or `fastapi` imports)
201
+ - `except:` bare catch without specific exception type → flag MEDIUM
202
+ - Mutable default arguments: `def func(items=[])` → flag HIGH
203
+ - Missing type hints on public functions (if project uses mypy/pyright) → flag LOW
204
+
205
+ ## UI/UX Anti-Pattern Checks
206
+
207
+ Apply **only** when `.tsx`, `.jsx`, `.svelte`, `.vue`, or `.html` files are in the diff. Skip for backend-only changes.
208
+
209
+ These are the **"AI UI signature"** — patterns that make AI-generated frontends visually identifiable as non-human-designed. Flag each as MEDIUM severity.
210
+
211
+ **AI_ANTIPATTERN — Purple/indigo default accent with no domain justification:**
212
+ ```tsx
213
+ // BAD: LLM default color bias — signals "AI-generated" to experienced designers
214
+ className="bg-indigo-600 text-white" // every button/CTA is indigo
215
+ // GOOD: domain-appropriate — trading → neutral dark, healthcare → trust blue,
216
+ // e-commerce → conversion-optimized warm. Purple is only appropriate for
217
+ // AI-native tools and creative platforms.
218
+ ```
219
+
220
+ **AI_ANTIPATTERN — Card-grid monotony (every section is 3-col cards, zero layout variation):**
221
+ ```tsx
222
+ // BAD: every section uses the same grid pattern
223
+ <div className="grid grid-cols-3 gap-6"> // features
224
+ <div className="grid grid-cols-3 gap-6"> // testimonials
225
+ <div className="grid grid-cols-3 gap-6"> // pricing
226
+ // GOOD: mix layouts — split sections, bento grids, full-bleed hero, list+detail
227
+ ```
228
+
229
+ **AI_ANTIPATTERN — Centeritis (everything centered, no directional flow):**
230
+ ```tsx
231
+ // BAD: no visual tension, no reading direction
232
+ <div className="text-center flex flex-col items-center"> // hero
233
+ <div className="text-center"> // every feature section
234
+ // GOOD: left-align body copy, use centering intentionally for hero/CTAs only
235
+ ```
236
+
237
+ **AI_ANTIPATTERN — Numeric/financial values in non-monospace font:**
238
+ ```tsx
239
+ // BAD: prices, stats, metrics in Inter/Roboto
240
+ <span className="text-2xl font-bold">${price}</span>
241
+ // GOOD: monospace for all numbers that need alignment
242
+ <span className="font-mono text-2xl font-bold">${price}</span>
243
+ ```
244
+
245
+ **AI_ANTIPATTERN — Missing UI states (only happy path rendered):**
246
+ ```tsx
247
+ // BAD: data rendering without empty/error/loading states
248
+ {data.map(item => <Card key={item.id} {...item} />)}
249
+ // GOOD: all 4 states covered
250
+ {isLoading && <CardSkeleton />}
251
+ {error && <ErrorState message={error.message} />}
252
+ {!data.length && <EmptyState />}
253
+ {data.map(item => <Card key={item.id} {...item} />)}
254
+ ```
255
+
256
+ **Accessibility — flag as HIGH (these are WCAG 2.2 failures):**
257
+ ```tsx
258
+ // BAD: icon button with no accessible name
259
+ <button onClick={close}><XIcon /></button>
260
+ // GOOD
261
+ <button onClick={close} aria-label="Close dialog"><XIcon aria-hidden="true" /></button>
262
+
263
+ // BAD: placeholder as label
264
+ <input placeholder="Email address" type="email" />
265
+ // GOOD
266
+ <label htmlFor="email">Email address</label>
267
+ <input id="email" type="email" />
268
+
269
+ // BAD: removes focus ring without replacement
270
+ className="focus:outline-none"
271
+ // GOOD: must have focus-visible replacement
272
+ className="focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
273
+
274
+ // BAD: color as sole information conveyor
275
+ <span className="text-red-500">{errorMessage}</span>
276
+ // GOOD: icon + color + text
277
+ <span className="text-red-500 flex gap-1"><ErrorIcon aria-hidden />Error: {errorMessage}</span>
278
+ ```
279
+
280
+ **WCAG 2.2 New Rules — flag as MEDIUM:**
281
+ - `position: sticky` or `position: fixed` header/footer without `scroll-padding-top` → Focus Not Obscured (2.4.11)
282
+ - Interactive elements with `width < 24px` or `height < 24px` without 8px spacing → Target Size (2.5.8)
283
+ - Multi-step form re-asking for previously entered data → Redundant Entry (3.3.7)
284
+
285
+ **Platform-Specific — flag as MEDIUM when platform is detectable:**
286
+ - iOS target: solid-background cards (iOS 26 Liquid Glass deprecates this visual language) — should use translucent/blur surfaces
287
+ - Android target: hardcoded hex colors instead of `MaterialTheme.colorScheme` tokens → not adaptive to dynamic color
288
+
289
+ ## Severity Levels
290
+
291
+ ```
292
+ CRITICAL — security vulnerability, data loss risk, crash bug
293
+ HIGH — logic error, missing validation, broken edge case
294
+ MEDIUM — code smell, performance issue, missing error handling
295
+ LOW — style inconsistency, naming suggestion, minor refactor opportunity
296
+ ```
297
+
298
+ ## Output Format
299
+
300
+ ```
301
+ ## Code Review Report
302
+ - **Files Reviewed**: [count]
303
+ - **Findings**: [count by severity]
304
+ - **Overall**: APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
305
+
306
+ ### CRITICAL
307
+ - `path/to/file.ts:42` — [description of critical issue]
308
+
309
+ ### HIGH
310
+ - `path/to/file.ts:85` — [description of high-severity issue]
311
+
312
+ ### MEDIUM
313
+ - `path/to/file.ts:120` — [description of medium issue]
314
+
315
+ ### Positive Notes
316
+ - [good patterns observed]
317
+
318
+ ### Verdict
319
+ [Summary and recommendation]
320
+ ```
321
+
322
+ ## Constraints
323
+
324
+ 1. MUST read the full diff — not just the files the user pointed at
325
+ 2. MUST reference specific file:line for every finding
326
+ 3. MUST NOT rubber-stamp with generic praise ("well-structured", "clean code") without evidence
327
+ 4. MUST check: correctness, security, performance, conventions, test coverage
328
+ 5. MUST categorize findings: CRITICAL (blocks commit) / HIGH / MEDIUM / LOW
329
+ 6. MUST escalate to sentinel if auth/crypto/secrets code is touched
330
+ 7. MUST flag untested code paths and recommend tests via rune:test
331
+
332
+ ## Sharp Edges
333
+
334
+ | Failure Mode | Severity | Mitigation |
335
+ |---|---|---|
336
+ | Finding flood — 20+ findings overwhelm developer | MEDIUM | Confidence filter: only >80% confidence, consolidate similar issues per file |
337
+ | "LGTM" without file:line evidence | HIGH | HARD-GATE blocks this — cite at least one specific item per changed file |
338
+ | Expanding review scope beyond the diff | MEDIUM | Limit to `git diff` scope — do not creep into adjacent unchanged files |
339
+ | Security finding without sentinel escalation | HIGH | Any auth/crypto/payment code touched → MUST call rune:sentinel |
340
+ | Skipping UI anti-pattern checks for frontend changes | MEDIUM | Any .tsx/.jsx/.svelte/.vue in diff → MUST run UI/UX Anti-Pattern Checks section |
341
+ | Treating purple/indigo accent as "just a color choice" | MEDIUM | It is a documented AI-generated UI signature — always flag for domain justification |
342
+
343
+ ## Done When
344
+
345
+ - All changed files in the diff read and analyzed
346
+ - Every finding references specific file:line with severity label
347
+ - Security-critical code escalated to sentinel (or confirmed not present)
348
+ - Test coverage gaps identified and documented
349
+ - UI anti-pattern checks ran for any frontend files in diff (or confirmed not applicable)
350
+ - Structured report emitted with APPROVE / REQUEST CHANGES / NEEDS DISCUSSION verdict
351
+
352
+ ## Cost Profile
353
+
354
+ ~3000-6000 tokens input, ~1000-2000 tokens output. Sonnet default, opus for security-critical reviews. Runs once per implementation cycle.
@@ -0,0 +1,222 @@
1
+ ---
2
+ name: review-intake
3
+ description: Use when receiving code review feedback, PR comments, or external suggestions before implementing any changes. Prevents blind implementation, enforces verification-first discipline.
4
+ metadata:
5
+ author: runedev
6
+ version: "1.0.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: quality
10
+ tools: "Read, Glob, Grep"
11
+ ---
12
+
13
+ # review-intake
14
+
15
+ ## Purpose
16
+
17
+ The counterpart to `review`. While `review` finds issues in code, `review-intake` handles the response when someone finds issues in YOUR code. Enforces a verification-first discipline: understand fully, verify against codebase reality, then act. Prevents the common failure mode of blindly implementing suggestions that break things or don't apply.
18
+
19
+ ## Triggers
20
+
21
+ - `/rune review-intake` — manual invocation when processing feedback
22
+ - Auto-trigger: when `cook` or `fix` receives PR review comments
23
+ - Auto-trigger: when user pastes review feedback into session
24
+
25
+ ## Calls (outbound)
26
+
27
+ - `scout` (L3): verify reviewer claims against actual codebase
28
+ - `fix` (L2): apply verified changes
29
+ - `test` (L2): add tests for edge cases reviewers found
30
+ - `hallucination-guard` (L3): verify suggested APIs/packages exist
31
+ - `sentinel` (L2): re-check security if reviewer flagged concerns
32
+
33
+ ## Called By (inbound)
34
+
35
+ - `cook` (L1): Phase 5 quality gate when external review arrives
36
+ - `review` (L2): when self-review surfaces issues to address
37
+
38
+ ## Workflow
39
+
40
+ ### Phase 1 — ABSORB
41
+
42
+ Read ALL feedback items before reacting. Do not implement anything yet.
43
+
44
+ Classify each item:
45
+
46
+ | Type | Example | Priority |
47
+ |---|---|---|
48
+ | BLOCKING | Security vuln, data loss, broken build | P0 — fix now |
49
+ | BUG | Logic error, off-by-one, race condition | P1 — fix soon |
50
+ | IMPROVEMENT | Better pattern, cleaner API, perf gain | P2 — evaluate |
51
+ | STYLE | Naming, formatting, conventions | P3 — quick fix |
52
+ | OPINION | "I would do it differently" | P4 — evaluate |
53
+
54
+ ### Phase 2 — COMPREHEND
55
+
56
+ For each item, restate the technical requirement in your own words.
57
+
58
+ <HARD-GATE>
59
+ If ANY item is unclear → STOP entirely.
60
+ Do not implement clear items while unclear ones remain.
61
+ Items may be interconnected — partial understanding = wrong implementation.
62
+
63
+ Ask: "I understand items [X]. Need clarification on [Y] before proceeding."
64
+ </HARD-GATE>
65
+
66
+ ### Phase 3 — VERIFY
67
+
68
+ Before implementing ANY suggestion, verify it against the codebase:
69
+
70
+ ```
71
+ For each item:
72
+ 1. Does the file/function reviewer references actually exist?
73
+ 2. Is the reviewer's understanding of current behavior correct?
74
+ 3. Will this change break existing tests?
75
+ 4. Does it conflict with architectural decisions already made?
76
+ 5. If suggesting a package/API — does it actually exist? (hallucination-guard)
77
+ ```
78
+
79
+ Use `scout` to check claims. Use `grep` to find actual usage patterns.
80
+
81
+ ### Phase 4 — EVALUATE
82
+
83
+ For each verified item, decide:
84
+
85
+ | Verdict | Action |
86
+ |---|---|
87
+ | **CORRECT + APPLICABLE** | Queue for implementation |
88
+ | **CORRECT + ALREADY DONE** | Reply with evidence |
89
+ | **CORRECT + OUT OF SCOPE** | Acknowledge, defer to backlog |
90
+ | **INCORRECT** | Push back with technical reasoning |
91
+ | **YAGNI** | Check if feature is actually used — if unused, propose removal |
92
+
93
+ **YAGNI check:**
94
+ ```bash
95
+ # Reviewer says "implement this properly"
96
+ # First: is anyone actually using it?
97
+ grep -r "functionName" --include="*.{ts,tsx,js,jsx}" src/
98
+ # Zero results? → "This isn't called anywhere. Remove it (YAGNI)?"
99
+ ```
100
+
101
+ ### Phase 5 — RESPOND
102
+
103
+ **What to say:**
104
+ ```
105
+ CORRECT: "Fixed. [Brief description]." or "Good catch — [issue]. Fixed in [file]."
106
+ PUSHBACK: "[Technical reason]. Current impl handles [X] because [Y]."
107
+ UNCLEAR: "Need clarification on [specific aspect]."
108
+ ```
109
+
110
+ **What NEVER to say:**
111
+ ```
112
+ BANNED: "You're absolutely right!"
113
+ BANNED: "Great point!" / "Great catch!"
114
+ BANNED: "Thanks for catching that!"
115
+ BANNED: Any performative gratitude — actions speak, not words.
116
+ ```
117
+
118
+ When replying to GitHub PR comments, reply in the thread:
119
+ ```bash
120
+ gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies \
121
+ -f body="Fixed — [description]"
122
+ ```
123
+
124
+ ### Phase 6 — IMPLEMENT
125
+
126
+ Execute in priority order: P0 → P1 → P2 → P3 → P4.
127
+
128
+ For each fix:
129
+ 1. Apply change via `fix`
130
+ 2. Run tests — verify no regression
131
+ 3. If fix touches security → run `sentinel`
132
+ 4. Move to next item only after current passes
133
+
134
+ ## Source Trust Levels
135
+
136
+ | Source | Trust | Approach |
137
+ |---|---|---|
138
+ | **Project owner / user** | High | Implement after understanding. Still verify scope. |
139
+ | **Team member** | Medium | Verify against codebase. Implement if correct. |
140
+ | **External reviewer** | Low | Skeptical by default. Verify everything. Push back if wrong. |
141
+ | **AI-generated review** | Lowest | Double-check every suggestion. High hallucination risk. |
142
+
143
+ When external feedback conflicts with owner's prior architectural decisions → **STOP. Discuss with owner first.**
144
+
145
+ ## Pushback Framework
146
+
147
+ Push back when:
148
+ - Suggestion breaks existing functionality (show failing test)
149
+ - Reviewer lacks context on WHY current impl exists
150
+ - YAGNI — feature isn't used
151
+ - Technically incorrect for this stack/version
152
+ - Conflicts with owner's documented decisions
153
+
154
+ How to push back:
155
+ - Lead with technical evidence, not defensiveness
156
+ - Reference working tests, actual behavior, or docs
157
+ - Ask specific questions that reveal the gap
158
+ - If wrong after pushback → "Verified, you were right. [Reason]. Fixing."
159
+
160
+ ## Output Format
161
+
162
+ ```
163
+ ## Review Intake Report
164
+
165
+ ### Summary
166
+ - **Items received**: [count]
167
+ - **Blocking**: [count] | Bugs: [count] | Improvements: [count] | Style: [count]
168
+
169
+ ### Verdicts
170
+ | # | Item | Type | Verdict | Action |
171
+ |---|------|------|---------|--------|
172
+ | 1 | [description] | BUG | CORRECT | Fixed in [file] |
173
+ | 2 | [description] | IMPROVEMENT | YAGNI | Proposed removal |
174
+ | 3 | [description] | OPINION | PUSHBACK | [reason] |
175
+
176
+ ### Changes Applied
177
+ - `path/to/file.ts` — [description]
178
+
179
+ ### Verification
180
+ - Tests: PASS ([n] passed)
181
+ - Regressions: none
182
+ ```
183
+
184
+ ## Constraints
185
+
186
+ 1. MUST read ALL items before implementing ANY — partial processing causes rework
187
+ 2. MUST verify reviewer claims against actual codebase — never trust blindly
188
+ 3. MUST NOT use performative language ("Great point!", "You're right!") — just fix it
189
+ 4. MUST push back with technical reasoning when suggestion is wrong — correctness > comfort
190
+ 5. MUST run tests after each individual fix — not batch-and-pray
191
+ 6. MUST STOP and ask if any item is unclear — do not implement clear items while unclear ones remain
192
+
193
+ ## Mesh Gates
194
+
195
+ | Gate | Requires | If Missing |
196
+ |------|----------|------------|
197
+ | Comprehension | All items understood | Ask clarifying questions, block implementation |
198
+ | Verification | Claims checked against codebase | Run scout + grep before implementing |
199
+ | Test pass | Each fix passes tests individually | Revert fix, re-diagnose |
200
+
201
+ ## Sharp Edges
202
+
203
+ | Failure Mode | Severity | Mitigation |
204
+ |---|---|---|
205
+ | Implementing suggestion that breaks existing feature | CRITICAL | Phase 3 verify: check existing tests before changing |
206
+ | Blindly trusting external reviewer | HIGH | Source Trust Levels: external = skeptical by default |
207
+ | Implementing 4/6 items, leaving 2 unclear | HIGH | HARD-GATE: all-or-nothing comprehension |
208
+ | Performative agreement masking misunderstanding | MEDIUM | Banned phrases list + restate-in-own-words requirement |
209
+ | Fixing tests instead of code to make review pass | HIGH | Defer to `fix` constraints: fix CODE, not TESTS |
210
+
211
+ ## Done When
212
+
213
+ - All feedback items classified by type and priority
214
+ - Each item verified against codebase reality
215
+ - Verdicts assigned (correct/pushback/yagni/defer)
216
+ - Approved items implemented in priority order
217
+ - Tests pass after each individual fix
218
+ - Review Intake Report emitted
219
+
220
+ ## Cost Profile
221
+
222
+ ~2000-5000 tokens depending on feedback volume. Sonnet for evaluation logic, haiku for scout/grep verification.