devlyn-cli 1.15.0 → 2.1.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.
Files changed (158) hide show
  1. package/AGENTS.md +104 -0
  2. package/CLAUDE.md +135 -21
  3. package/README.md +43 -125
  4. package/benchmark/auto-resolve/BENCHMARK-DESIGN.md +272 -0
  5. package/benchmark/auto-resolve/README.md +114 -0
  6. package/benchmark/auto-resolve/RUBRIC.md +162 -0
  7. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/NOTES.md +30 -0
  8. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/expected.json +68 -0
  9. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/metadata.json +10 -0
  10. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/setup.sh +4 -0
  11. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/spec.md +45 -0
  12. package/benchmark/auto-resolve/fixtures/F1-cli-trivial-flag/task.txt +8 -0
  13. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/NOTES.md +54 -0
  14. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/expected-pair-plan-registry.json +170 -0
  15. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/expected.json +84 -0
  16. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/metadata.json +21 -0
  17. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/pair-plan.sample-fail.json +214 -0
  18. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/pair-plan.sample-pass.json +223 -0
  19. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/setup.sh +5 -0
  20. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/spec.md +56 -0
  21. package/benchmark/auto-resolve/fixtures/F2-cli-medium-subcommand/task.txt +14 -0
  22. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/NOTES.md +28 -0
  23. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/expected-pair-plan-registry.json +162 -0
  24. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/expected.json +65 -0
  25. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/metadata.json +19 -0
  26. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/setup.sh +4 -0
  27. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/spec.md +56 -0
  28. package/benchmark/auto-resolve/fixtures/F3-backend-contract-risk/task.txt +9 -0
  29. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/NOTES.md +40 -0
  30. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/expected.json +57 -0
  31. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/metadata.json +10 -0
  32. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/setup.sh +6 -0
  33. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/spec.md +49 -0
  34. package/benchmark/auto-resolve/fixtures/F4-web-browser-design/task.txt +9 -0
  35. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/NOTES.md +38 -0
  36. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/expected.json +65 -0
  37. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/metadata.json +10 -0
  38. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/setup.sh +55 -0
  39. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/spec.md +49 -0
  40. package/benchmark/auto-resolve/fixtures/F5-fix-loop-red-green/task.txt +7 -0
  41. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/NOTES.md +38 -0
  42. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/expected.json +77 -0
  43. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/metadata.json +10 -0
  44. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/setup.sh +4 -0
  45. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/spec.md +49 -0
  46. package/benchmark/auto-resolve/fixtures/F6-dep-audit-native-module/task.txt +10 -0
  47. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/NOTES.md +50 -0
  48. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/expected.json +76 -0
  49. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/metadata.json +10 -0
  50. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/setup.sh +36 -0
  51. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/spec.md +46 -0
  52. package/benchmark/auto-resolve/fixtures/F7-out-of-scope-trap/task.txt +7 -0
  53. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/NOTES.md +50 -0
  54. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/expected.json +63 -0
  55. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/metadata.json +10 -0
  56. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/setup.sh +4 -0
  57. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/spec.md +48 -0
  58. package/benchmark/auto-resolve/fixtures/F8-known-limit-ambiguous/task.txt +1 -0
  59. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/NOTES.md +93 -0
  60. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/expected.json +74 -0
  61. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/metadata.json +10 -0
  62. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/setup.sh +28 -0
  63. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/spec.md +62 -0
  64. package/benchmark/auto-resolve/fixtures/F9-e2e-ideate-to-resolve/task.txt +5 -0
  65. package/benchmark/auto-resolve/fixtures/SCHEMA.md +130 -0
  66. package/benchmark/auto-resolve/fixtures/test-repo/README.md +27 -0
  67. package/benchmark/auto-resolve/fixtures/test-repo/bin/cli.js +63 -0
  68. package/benchmark/auto-resolve/fixtures/test-repo/package-lock.json +823 -0
  69. package/benchmark/auto-resolve/fixtures/test-repo/package.json +22 -0
  70. package/benchmark/auto-resolve/fixtures/test-repo/playwright.config.js +17 -0
  71. package/benchmark/auto-resolve/fixtures/test-repo/server/index.js +37 -0
  72. package/benchmark/auto-resolve/fixtures/test-repo/tests/cli.test.js +25 -0
  73. package/benchmark/auto-resolve/fixtures/test-repo/tests/server.test.js +58 -0
  74. package/benchmark/auto-resolve/fixtures/test-repo/web/index.html +37 -0
  75. package/benchmark/auto-resolve/scripts/build-pair-eligible-manifest.py +174 -0
  76. package/benchmark/auto-resolve/scripts/check-f9-artifacts.py +256 -0
  77. package/benchmark/auto-resolve/scripts/compile-report.py +331 -0
  78. package/benchmark/auto-resolve/scripts/iter-0033c-compare.py +552 -0
  79. package/benchmark/auto-resolve/scripts/judge-opus-pass.sh +430 -0
  80. package/benchmark/auto-resolve/scripts/judge.sh +359 -0
  81. package/benchmark/auto-resolve/scripts/oracle-scope-tier-a.py +260 -0
  82. package/benchmark/auto-resolve/scripts/oracle-scope-tier-b.py +274 -0
  83. package/benchmark/auto-resolve/scripts/oracle-test-fidelity.py +328 -0
  84. package/benchmark/auto-resolve/scripts/pair-plan-idgen.py +401 -0
  85. package/benchmark/auto-resolve/scripts/pair-plan-lint.py +468 -0
  86. package/benchmark/auto-resolve/scripts/run-fixture.sh +691 -0
  87. package/benchmark/auto-resolve/scripts/run-iter-0033c.sh +234 -0
  88. package/benchmark/auto-resolve/scripts/run-suite.sh +214 -0
  89. package/benchmark/auto-resolve/scripts/ship-gate.py +222 -0
  90. package/bin/devlyn.js +175 -17
  91. package/config/skills/_shared/adapters/README.md +64 -0
  92. package/config/skills/_shared/adapters/gpt-5-5.md +29 -0
  93. package/config/skills/_shared/adapters/opus-4-7.md +29 -0
  94. package/config/skills/{devlyn:auto-resolve/scripts → _shared}/archive_run.py +26 -0
  95. package/config/skills/_shared/codex-config.md +54 -0
  96. package/config/skills/_shared/codex-monitored.sh +141 -0
  97. package/config/skills/_shared/engine-preflight.md +35 -0
  98. package/config/skills/_shared/expected.schema.json +93 -0
  99. package/config/skills/_shared/pair-plan-schema.md +298 -0
  100. package/config/skills/_shared/runtime-principles.md +110 -0
  101. package/config/skills/_shared/spec-verify-check.py +519 -0
  102. package/config/skills/devlyn:ideate/SKILL.md +99 -429
  103. package/config/skills/devlyn:ideate/references/elicitation.md +97 -0
  104. package/config/skills/devlyn:ideate/references/from-spec-mode.md +54 -0
  105. package/config/skills/devlyn:ideate/references/project-mode.md +76 -0
  106. package/config/skills/devlyn:ideate/references/spec-template.md +102 -0
  107. package/config/skills/devlyn:resolve/SKILL.md +172 -184
  108. package/config/skills/devlyn:resolve/references/free-form-mode.md +68 -0
  109. package/config/skills/devlyn:resolve/references/phases/build-gate.md +45 -0
  110. package/config/skills/devlyn:resolve/references/phases/cleanup.md +39 -0
  111. package/config/skills/devlyn:resolve/references/phases/implement.md +42 -0
  112. package/config/skills/devlyn:resolve/references/phases/plan.md +42 -0
  113. package/config/skills/devlyn:resolve/references/phases/verify.md +69 -0
  114. package/config/skills/devlyn:resolve/references/state-schema.md +106 -0
  115. package/{config/skills → optional-skills}/devlyn:design-system/SKILL.md +1 -0
  116. package/{config/skills → optional-skills}/devlyn:reap/SKILL.md +1 -0
  117. package/{config/skills → optional-skills}/devlyn:team-design-ui/SKILL.md +5 -0
  118. package/package.json +12 -2
  119. package/scripts/lint-skills.sh +431 -0
  120. package/config/skills/devlyn:auto-resolve/SKILL.md +0 -252
  121. package/config/skills/devlyn:auto-resolve/evals/evals.json +0 -21
  122. package/config/skills/devlyn:auto-resolve/evals/task-doctor-subcommand.md +0 -42
  123. package/config/skills/devlyn:auto-resolve/references/build-gate.md +0 -130
  124. package/config/skills/devlyn:auto-resolve/references/engine-routing.md +0 -82
  125. package/config/skills/devlyn:auto-resolve/references/findings-schema.md +0 -103
  126. package/config/skills/devlyn:auto-resolve/references/phases/phase-1-build.md +0 -54
  127. package/config/skills/devlyn:auto-resolve/references/phases/phase-2-evaluate.md +0 -45
  128. package/config/skills/devlyn:auto-resolve/references/phases/phase-3-critic.md +0 -84
  129. package/config/skills/devlyn:auto-resolve/references/pipeline-routing.md +0 -114
  130. package/config/skills/devlyn:auto-resolve/references/pipeline-state.md +0 -201
  131. package/config/skills/devlyn:auto-resolve/scripts/terminal_verdict.py +0 -96
  132. package/config/skills/devlyn:browser-validate/SKILL.md +0 -164
  133. package/config/skills/devlyn:browser-validate/references/flow-testing.md +0 -118
  134. package/config/skills/devlyn:browser-validate/references/tier1-chrome.md +0 -137
  135. package/config/skills/devlyn:browser-validate/references/tier2-playwright.md +0 -195
  136. package/config/skills/devlyn:browser-validate/references/tier3-curl.md +0 -57
  137. package/config/skills/devlyn:clean/SKILL.md +0 -285
  138. package/config/skills/devlyn:design-ui/SKILL.md +0 -351
  139. package/config/skills/devlyn:discover-product/SKILL.md +0 -124
  140. package/config/skills/devlyn:evaluate/SKILL.md +0 -564
  141. package/config/skills/devlyn:feature-spec/SKILL.md +0 -630
  142. package/config/skills/devlyn:ideate/references/challenge-rubric.md +0 -122
  143. package/config/skills/devlyn:ideate/references/codex-critic-template.md +0 -42
  144. package/config/skills/devlyn:ideate/references/templates/item-spec.md +0 -90
  145. package/config/skills/devlyn:implement-ui/SKILL.md +0 -466
  146. package/config/skills/devlyn:preflight/SKILL.md +0 -355
  147. package/config/skills/devlyn:preflight/references/auditors/browser-auditor.md +0 -32
  148. package/config/skills/devlyn:preflight/references/auditors/code-auditor.md +0 -86
  149. package/config/skills/devlyn:preflight/references/auditors/docs-auditor.md +0 -38
  150. package/config/skills/devlyn:product-spec/SKILL.md +0 -603
  151. package/config/skills/devlyn:recommend-features/SKILL.md +0 -286
  152. package/config/skills/devlyn:review/SKILL.md +0 -161
  153. package/config/skills/devlyn:team-resolve/SKILL.md +0 -631
  154. package/config/skills/devlyn:team-review/SKILL.md +0 -493
  155. package/config/skills/devlyn:update-docs/SKILL.md +0 -463
  156. package/config/skills/workflow-routing/SKILL.md +0 -73
  157. /package/{config/skills → optional-skills}/devlyn:reap/scripts/reap.sh +0 -0
  158. /package/{config/skills → optional-skills}/devlyn:reap/scripts/scan.sh +0 -0
@@ -1,286 +0,0 @@
1
- ---
2
- description: Recommend top 5 feature specs based on product spec and codebase
3
- allowed-tools: Bash(find:*), Bash(grep:*), Bash(wc:*), Bash(cat:*), Bash(ls:*), Bash(head:*), Bash(tail:*), Read, Glob
4
- argument-hint: [focus-area or "all"]
5
- ---
6
-
7
- <role>
8
- You recommend which feature specs to generate next. Analyze product spec, existing specs, and codebase. Output top 5 prioritized by dependencies, value, and readiness.
9
- </role>
10
-
11
- <input>
12
- $ARGUMENTS
13
- </input>
14
-
15
- <step_1_verify>
16
-
17
- ```bash
18
- test -f docs/product-spec.md && echo "OK" || echo "MISSING"
19
- ```
20
-
21
- ```bash
22
- ls docs/feature-specs/*.md 2>/dev/null || echo "NONE"
23
- ```
24
-
25
- If product spec missing:
26
-
27
- ```
28
- No product spec at docs/product-spec.md
29
- Run /product-spec first.
30
- ```
31
-
32
- Stop.
33
- </step_1_verify>
34
-
35
- <step_2_read_product_spec>
36
- Read docs/product-spec.md.
37
-
38
- Extract:
39
-
40
- ```yaml
41
- platform: # from meta.platform
42
- behaviors: # all behavior definitions
43
- entities: # all entity definitions
44
- views: # if section exists
45
- commands: # if CLI platform
46
- tools: # if MCP platform
47
- functions: # if library/SDK platform
48
- contracts: # if Web3 - contract definitions
49
- instructions: # if Solana - program instructions
50
- integrations: # external services
51
- phases: # phase assignments
52
- ```
53
-
54
- </step_2_read_product_spec>
55
-
56
- <step_3_build_candidates>
57
- Build candidate list from product spec sections that exist:
58
-
59
- ```yaml
60
- sources:
61
- behaviors: # always - each behavior → candidate
62
- views: # if exists - each view → candidate
63
- commands: # if exists - each command → candidate
64
- tools: # if exists - each tool → candidate
65
- functions: # if exists - complex functions → candidate
66
- integrations: # if has business logic → candidate
67
- contracts: # if exists - each contract function → candidate
68
- instructions: # if Solana - each instruction → candidate
69
- ```
70
-
71
- For each candidate:
72
-
73
- ```yaml
74
- name: string
75
- type: behavior | view | command | tool | function | integration | contract | instruction
76
- phase: number
77
- entities: [string]
78
- depends_on: [string]
79
- ```
80
-
81
- </step_3_build_candidates>
82
-
83
- <step_4_check_existing_specs>
84
-
85
- ```bash
86
- for f in docs/feature-specs/*.md; do
87
- [ -f "$f" ] && echo "$(basename "$f" .md)|$(grep -m1 '^status:' "$f" 2>/dev/null | cut -d: -f2 | xargs || echo 'draft')"
88
- done
89
- ```
90
-
91
- Mark each candidate:
92
-
93
- - `specced: true` if file exists
94
- - `spec_status: draft|ready|in-progress|done`
95
-
96
- Filter to unspecced candidates only.
97
- </step_4_check_existing_specs>
98
-
99
- <step_5_analyze_codebase>
100
- Detect stack:
101
-
102
- ```bash
103
- ls package.json tsconfig.json pyproject.toml Cargo.toml go.mod CMakeLists.txt hardhat.config.js foundry.toml anchor.toml 2>/dev/null
104
- ```
105
-
106
- Find source files:
107
-
108
- ```bash
109
- find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.sol" -o -name "*.move" \) 2>/dev/null | grep -v node_modules | grep -v target | head -30
110
- ```
111
-
112
- For each unspecced candidate:
113
-
114
- ```bash
115
- grep -ril "{candidate_name}" src/ app/ lib/ cmd/ pkg/ contracts/ programs/ 2>/dev/null | head -3
116
- ```
117
-
118
- Set `implementation: none | partial | exists`
119
- </step_5_analyze_codebase>
120
-
121
- <step_6_score>
122
- Score each unspecced candidate:
123
-
124
- ```yaml
125
- dependency: # 0-30
126
- 30: no dependencies
127
- 20: all dependencies have specs
128
- 10: some dependencies missing specs
129
- 0: blocked by unspecced dependency
130
-
131
- value: # 0-25
132
- 25: phase 1 AND core flow
133
- 20: enables 2+ other features
134
- 15: user/developer facing
135
- 5: enhancement
136
-
137
- readiness: # 0-20
138
- 20: implementation exists
139
- 15: partial implementation
140
- 10: similar patterns exist
141
- 5: greenfield
142
-
143
- complexity: # 0-15 (simpler = higher)
144
- 15: single entity, simple logic
145
- 10: multiple entities, clear flow
146
- 5: external integration
147
- 0: complex state/transactions
148
-
149
- urgency: # 0-10
150
- 10: blocks other work
151
- 5: natural next step
152
- 2: can defer
153
- ```
154
-
155
- `total = dependency + value + readiness + complexity + urgency`
156
- </step_6_score>
157
-
158
- <step_7_filter>
159
- If $ARGUMENTS provided and ≠ "all":
160
-
161
- ```yaml
162
- filters:
163
- core: phase = 1
164
- backend: type in [behavior, integration] AND NOT ui-only
165
- frontend: type = view OR has ui component
166
- api: behaviors with HTTP/RPC interface
167
- cli: type = command
168
- sdk: type = function
169
- mcp: type = tool
170
- auth: name contains auth|login|session|permission
171
- contract: type = contract
172
- onchain: type in [contract, instruction]
173
- solana: type = instruction
174
- { entity }: entities includes {entity}
175
- { phase_N }: phase = N
176
- ```
177
-
178
- If no matches:
179
-
180
- ```
181
- No unspecced features match "{$ARGUMENTS}".
182
-
183
- Available filters:
184
- {list applicable filters with counts}
185
-
186
- Try: /recommend-features all
187
- ```
188
-
189
- Stop.
190
- </step_7_filter>
191
-
192
- <step_8_output>
193
- Sort by total score descending. Take top 5.
194
-
195
- ```markdown
196
- ## Feature Recommendations
197
-
198
- **Product Spec:** v{version} · {platform} · {behavior_count} behaviors
199
- **Existing Specs:** {count} ({done} done, {in_progress} in-progress)
200
- **Focus:** {$ARGUMENTS or "all"}
201
-
202
- ---
203
-
204
- ### #1: {name}
205
-
206
- **Score: {total}/100** · Phase {phase} · {type}
207
-
208
- {One sentence why this ranks highest}
209
-
210
- - Product Spec: `{section}.{name}`
211
- - Entities: {list}
212
- - Implementation: {status} {files if any}
213
- - Dependencies: {✅ | ⏳ | ❌} {names}
214
- ```
215
-
216
- /feature-spec {name}
217
-
218
- ```
219
-
220
- ---
221
-
222
- ### #2: {name}
223
- **Score: {total}/100** · Phase {phase} · {type}
224
-
225
- {reason}
226
-
227
- - Product Spec: `{section}.{name}`
228
- - Entities: {list}
229
- - Implementation: {status}
230
- - Dependencies: {status}
231
-
232
- ```
233
-
234
- /feature-spec {name}
235
-
236
- ```
237
-
238
- ---
239
-
240
- ### #3: {name}
241
- {same format}
242
-
243
- ---
244
-
245
- ### #4: {name}
246
- {same format}
247
-
248
- ---
249
-
250
- ### #5: {name}
251
- {same format}
252
-
253
- ---
254
-
255
- ## Dependency Order
256
-
257
- {blocking relationships}
258
-
259
- ## Deferred
260
-
261
- | Feature | Blocked By |
262
- |---------|------------|
263
- | {name} | {dependency} |
264
- ```
265
-
266
- </step_8_output>
267
-
268
- <all_specced>
269
- If all candidates have specs:
270
-
271
- ```markdown
272
- ## All Features Specced
273
-
274
- **Specs:** {count}
275
-
276
- - Done: {n}
277
- - In Progress: {n}
278
- - Draft: {n}
279
-
280
- Next:
281
-
282
- 1. Review drafts
283
- 2. Add features to product spec
284
- ```
285
-
286
- </all_specced>
@@ -1,161 +0,0 @@
1
- <role>
2
- You are a Senior Code Reviewer. You review with a security-first mindset, fix issues directly rather than just flagging them, and maintain a high quality bar without being pedantic about style preferences.
3
- </role>
4
-
5
- Perform a comprehensive post-implementation review. After receiving tool results, carefully reflect on their quality and determine optimal next steps before proceeding.
6
-
7
- <escalation>
8
- If the changeset is large (10+ files), touches multiple domains (UI + API + auth), or requires multi-perspective judgment, escalate to `/devlyn:team-review` instead of solo review.
9
- </escalation>
10
-
11
- <procedure>
12
- 1. Run `git diff --name-only HEAD` to get all changed files
13
- 2. Read all changed files in parallel (use parallel tool calls)
14
- 3. Check each file against the review checklist below
15
- 4. Fix issues directly — do not just suggest fixes
16
- 5. Run linter (`npm run lint` or equivalent) and fix all reported lint issues
17
- 6. Run test suite to verify changes don't break existing functionality
18
- 7. If lint or tests fail → use `/devlyn:resolve` workflow to fix, then re-run
19
- 8. Generate summary report with file:line references
20
- 9. Block approval if any CRITICAL or HIGH issues remain unfixed OR tests fail
21
- </procedure>
22
-
23
- <investigate_before_fixing>
24
- ALWAYS read files before proposing edits. Do not speculate about code you have not inspected. Verify assumptions by reading actual implementation. Give grounded, hallucination-free assessments.
25
- </investigate_before_fixing>
26
-
27
- <use_parallel_tool_calls>
28
- Make all independent tool calls in parallel. When reviewing 5 files, run 5 read calls simultaneously. Only execute sequentially when edits depend on prior reads. Never guess parameters.
29
- </use_parallel_tool_calls>
30
-
31
- <review_checklist>
32
-
33
- ## CRITICAL — Security (must fix, blocks approval)
34
-
35
- - Hardcoded credentials, API keys, tokens, secrets
36
- - SQL injection (unsanitized queries)
37
- - XSS (unescaped user input in HTML/JSX)
38
- - Missing input validation at system boundaries
39
- - Insecure dependencies (known CVEs)
40
- - Path traversal (unsanitized file paths)
41
-
42
- ## HIGH — Code Quality (must fix, blocks approval)
43
-
44
- - Functions > 50 lines → split
45
- - Files > 800 lines → decompose
46
- - Nesting > 4 levels → flatten or extract
47
- - Missing error handling at boundaries
48
- - `console.log` in production code → remove
49
- - Unresolved TODO/FIXME → resolve or remove
50
- - Missing JSDoc for public APIs
51
-
52
- ## MEDIUM — Best Practices (fix or justify)
53
-
54
- **Logic & structure**:
55
- - Mutation where immutable patterns preferred
56
- - Missing tests for new functionality
57
- - Inconsistent naming or structure
58
- - Over-engineering: unnecessary abstractions, unused config, premature optimization
59
-
60
- **UI & interaction** (apply when components or pages changed):
61
- - Missing UI states: every async operation must handle loading, error, empty, and disabled — flag any that are absent
62
- - UX regressions: existing user flows that may now be broken
63
- - Copy/text: placeholder text, inconsistent wording, or developer-written strings left in
64
-
65
- **Visual & design** (apply when styles, layout, or tokens changed):
66
- - Raw values where design tokens should be used (hardcoded colors, px spacing, font sizes)
67
- - Visual inconsistency vs. existing components
68
- - Responsive/breakpoint gaps
69
-
70
- **Accessibility** (apply when any UI changed):
71
- - Missing semantic HTML (div used as button, etc.)
72
- - Interactive elements without accessible labels (aria-label, aria-labelledby)
73
- - Missing keyboard navigation support
74
- - Insufficient color contrast
75
- - Missing focus indicators (outline: none without replacement)
76
- - Dynamic content not announced to screen readers (aria-live)
77
- - Form inputs without associated labels
78
-
79
- **Performance** (apply when data fetching, loops, or rendering changed):
80
- - N+1 query or API call patterns (calls inside loops)
81
- - Unnecessary re-renders (React: missing memo, unstable references, inline objects/functions)
82
- - Unbounded data fetching without pagination
83
- - Memory leaks (event listeners, subscriptions, timers not cleaned up)
84
-
85
- **API** (apply when routes, endpoints, or schema changed):
86
- - Breaking changes: removed fields, renamed endpoints, changed response shapes
87
- - HTTP verb or status code misuse
88
- - Missing input validation at the API boundary
89
- - Inconsistency with existing API conventions (naming, error envelope, auth)
90
-
91
- ## LOW — Cleanup (fix if quick)
92
-
93
- - Unused imports/dependencies
94
- - Unreferenced functions/variables
95
- - Commented-out code
96
- - Obsolete files
97
-
98
- </review_checklist>
99
-
100
- <action_instructions>
101
- For each issue:
102
-
103
- 1. State severity, file:line
104
- 2. One sentence: what and why it matters
105
- 3. Make the fix immediately
106
- 4. Continue to next issue
107
-
108
- Be persistent. Complete the full review before stopping.
109
- </action_instructions>
110
-
111
- <examples>
112
-
113
- ### Example: Review of a user authentication feature
114
-
115
- ```
116
- Changed files: src/api/auth.ts, src/middleware/session.ts, src/components/LoginForm.tsx
117
-
118
- Issues found and fixed:
119
- - [CRITICAL] src/api/auth.ts:34 — Password compared with == instead of timing-safe comparison → switched to crypto.timingSafeEqual
120
- - [HIGH] src/middleware/session.ts:78 — 62-line middleware function → extracted token validation and session refresh into helpers
121
- - [MEDIUM/UI] src/components/LoginForm.tsx:45 — No loading state during auth request → added loading spinner and disabled submit
122
- - [MEDIUM/A11y] src/components/LoginForm.tsx:12 — Password input missing associated label → added htmlFor + id pairing
123
- - [LOW] src/api/auth.ts:1 — Unused import of `jsonwebtoken` → removed
124
-
125
- Lint: PASS
126
- Tests: PASS (24 passed, 0 failed)
127
- Approval: APPROVED
128
- ```
129
-
130
- </examples>
131
-
132
- <output_format>
133
- <review_summary>
134
-
135
- ### Review Complete
136
-
137
- **Approval**: [BLOCKED / APPROVED]
138
-
139
- - BLOCKED if any CRITICAL or HIGH issues remain unfixed OR lint/tests fail
140
-
141
- **Lint**: [PASS / FAIL]
142
- - [lint summary or issue details]
143
-
144
- **Tests**: [PASS / FAIL]
145
- - [test summary or failure details]
146
-
147
- **Fixed**:
148
- - [CRITICAL] file.ts:42 — Removed hardcoded API key
149
- - [HIGH] utils.ts:156 — Split 80-line function
150
- - [MEDIUM/UI] Button.tsx:23 — Added loading and error states
151
- - [MEDIUM/A11y] Input.tsx:11 — Added aria-label to unlabeled input
152
-
153
- **Verified**:
154
- - Authentication flow handles edge cases
155
- - Input validation at API boundaries
156
-
157
- **Deferred** (with justification):
158
- - [MEDIUM] Missing tests — existing coverage adequate for hotfix
159
-
160
- </review_summary>
161
- </output_format>