one-code-extension 0.4.1 → 0.5.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 (419) hide show
  1. package/README.md +16 -5
  2. package/agents/general-purpose.md +2 -2
  3. package/docs/guide/README.md +2 -1
  4. package/docs/guide/bring-your-claude-code-setup.md +60 -9
  5. package/docs/guide/configuration.md +48 -14
  6. package/docs/guide/differences-from-claude-code.md +32 -23
  7. package/docs/guide/doctor.md +20 -13
  8. package/docs/guide/hooks.md +18 -3
  9. package/docs/guide/installation.md +27 -4
  10. package/docs/guide/permissions-modes-and-auto-mode.md +225 -49
  11. package/docs/guide/providers-and-models.md +137 -54
  12. package/docs/guide/reference.md +27 -15
  13. package/docs/guide/sessions-and-context.md +69 -16
  14. package/docs/guide/skills-plugins-and-mcp.md +57 -20
  15. package/docs/guide/subagents-and-workflows.md +95 -29
  16. package/docs/guide/tasks-and-background-work.md +101 -26
  17. package/docs/guide/terminal-interface.md +24 -12
  18. package/docs/guide/tools.md +46 -5
  19. package/docs/guide/troubleshooting.md +13 -9
  20. package/docs/guide/windows.md +58 -31
  21. package/extensions/artifacts/gallery.ts +227 -0
  22. package/extensions/artifacts/index.ts +288 -0
  23. package/extensions/artifacts/store.ts +570 -0
  24. package/extensions/artifacts/viewer.ts +199 -0
  25. package/extensions/ask-user/description.ts +67 -0
  26. package/extensions/ask-user/dialogs.ts +80 -0
  27. package/extensions/ask-user/index.ts +37 -33
  28. package/extensions/ask-user/questions.ts +32 -7
  29. package/extensions/ask-user/widget.ts +45 -25
  30. package/extensions/auto-mode/actions.ts +6 -0
  31. package/extensions/auto-mode/cache.ts +88 -0
  32. package/extensions/auto-mode/classifier-prompt.ts +5 -4
  33. package/extensions/auto-mode/classifier.ts +290 -65
  34. package/extensions/auto-mode/config.ts +72 -20
  35. package/extensions/auto-mode/decision-log.ts +2 -0
  36. package/extensions/auto-mode/defaults.ts +1 -1
  37. package/extensions/auto-mode/denials.ts +123 -0
  38. package/extensions/auto-mode/git-checkout-programs.ts +187 -0
  39. package/extensions/auto-mode/git-status-meta.ts +159 -0
  40. package/extensions/auto-mode/history.ts +189 -0
  41. package/extensions/auto-mode/instructions.ts +58 -52
  42. package/extensions/auto-mode/model-select.ts +159 -134
  43. package/extensions/auto-mode/paths.ts +57 -5
  44. package/extensions/auto-mode/pause.ts +57 -2
  45. package/extensions/auto-mode/prompt.ts +37 -21
  46. package/extensions/auto-mode/read-only-options.ts +724 -0
  47. package/extensions/auto-mode/resolved-paths-meta.ts +133 -0
  48. package/extensions/auto-mode/rules.ts +18 -1
  49. package/extensions/auto-mode/safety-floor.ts +361 -18
  50. package/extensions/auto-mode/setup-run.ts +20 -14
  51. package/extensions/auto-mode/shell-analysis.ts +764 -490
  52. package/extensions/auto-mode/shell-parse.ts +885 -0
  53. package/extensions/auto-mode/system-note.ts +33 -0
  54. package/extensions/auto-mode/transcript.ts +80 -51
  55. package/extensions/background/cron.ts +515 -0
  56. package/extensions/background/index.ts +514 -236
  57. package/extensions/background/loop-fire.ts +136 -0
  58. package/extensions/background/loop-preamble.ts +59 -0
  59. package/extensions/background/loop-skill.ts +163 -0
  60. package/extensions/background/monitor-batch.ts +53 -0
  61. package/extensions/background/noop-fold.ts +128 -0
  62. package/extensions/background/switch-guard.ts +52 -0
  63. package/extensions/background/wakeup.ts +159 -55
  64. package/extensions/bash/background.ts +53 -17
  65. package/extensions/bash/child.ts +7 -0
  66. package/extensions/bash/description.ts +188 -0
  67. package/extensions/bash/guards.ts +15 -67
  68. package/extensions/bash/index.ts +88 -35
  69. package/extensions/branding/compaction-keep.ts +63 -0
  70. package/extensions/branding/declined.ts +22 -0
  71. package/extensions/branding/index.ts +133 -9
  72. package/extensions/branding/prompt-editor.ts +53 -6
  73. package/extensions/branding/queued-edit.ts +31 -0
  74. package/extensions/branding/replaced-builtins.ts +68 -0
  75. package/extensions/branding/startup.ts +33 -71
  76. package/extensions/btw/index.ts +229 -71
  77. package/extensions/btw/panel.ts +228 -100
  78. package/extensions/btw/prompt.ts +41 -4
  79. package/extensions/claude-compat/index.ts +7 -11
  80. package/extensions/claude-context/index.ts +446 -58
  81. package/extensions/compaction/cut.ts +157 -0
  82. package/extensions/compaction/index.ts +216 -75
  83. package/extensions/compaction/kept-thinking.ts +62 -0
  84. package/extensions/compaction/prompt.ts +15 -12
  85. package/extensions/context-budget/index.ts +24 -5
  86. package/extensions/context-management/index.ts +25 -0
  87. package/extensions/doctor/build.ts +59 -8
  88. package/extensions/doctor/builtins.ts +84 -0
  89. package/extensions/doctor/cli.ts +7 -1
  90. package/extensions/doctor/compat.ts +88 -23
  91. package/extensions/doctor/dependencies.ts +41 -5
  92. package/extensions/doctor/fix-prompt.ts +9 -2
  93. package/extensions/doctor/index.ts +102 -58
  94. package/extensions/doctor/models.ts +102 -63
  95. package/extensions/doctor/presets.ts +42 -27
  96. package/extensions/doctor/report.ts +19 -2
  97. package/extensions/doctor/viewer.ts +49 -27
  98. package/extensions/effort/index.ts +72 -19
  99. package/extensions/effort/settings.ts +21 -0
  100. package/extensions/effort/slider.ts +24 -20
  101. package/extensions/exit/index.ts +32 -1
  102. package/extensions/file-tracker/index.ts +337 -26
  103. package/extensions/file-tracker/replay.ts +96 -10
  104. package/extensions/file-tracker/restore.ts +63 -0
  105. package/extensions/file-tracker/results.ts +66 -0
  106. package/extensions/file-tracker/shell-reads.ts +211 -0
  107. package/extensions/file-tracker/tracker.ts +32 -15
  108. package/extensions/footer/footer-line.ts +45 -24
  109. package/extensions/footer/index.ts +47 -2
  110. package/extensions/footer/pr.ts +34 -5
  111. package/extensions/hooks/compaction.ts +7 -0
  112. package/extensions/hooks/executor.ts +32 -30
  113. package/extensions/hooks/index.ts +198 -31
  114. package/extensions/hooks/matcher.ts +3 -0
  115. package/extensions/hooks/protocol.ts +41 -3
  116. package/extensions/hooks/settings.ts +50 -19
  117. package/extensions/hooks/subagent-bridge.ts +2 -0
  118. package/extensions/hooks/trust.ts +13 -5
  119. package/extensions/idle-compact/index.ts +119 -0
  120. package/extensions/idle-compact/policy.ts +143 -0
  121. package/extensions/init/index.ts +11 -10
  122. package/extensions/init/prompt.ts +25 -32
  123. package/extensions/interrupted/index.ts +13 -1
  124. package/extensions/kept-thinking/index.ts +27 -0
  125. package/extensions/lib/agent-cron.ts +130 -0
  126. package/extensions/lib/agent-loader.ts +15 -1
  127. package/extensions/lib/agent-view.ts +85 -0
  128. package/extensions/lib/anthropic-payload.ts +82 -1
  129. package/extensions/lib/anthropic-server-call.ts +230 -0
  130. package/extensions/lib/anthropic-server-tools.ts +485 -0
  131. package/extensions/lib/app-launch.mjs +94 -0
  132. package/extensions/lib/argument-hints.ts +190 -0
  133. package/extensions/lib/atomic-write.ts +6 -2
  134. package/extensions/lib/auto-memory.ts +75 -0
  135. package/extensions/lib/bash-parser.ts +84 -0
  136. package/extensions/lib/btw-fork.ts +93 -0
  137. package/extensions/lib/child-extensions.ts +42 -0
  138. package/extensions/lib/child-writes.ts +45 -0
  139. package/extensions/lib/claude-context.ts +515 -100
  140. package/extensions/lib/claude-external-includes.ts +68 -0
  141. package/extensions/lib/claude-id.ts +22 -0
  142. package/extensions/lib/claude-rules.ts +323 -0
  143. package/extensions/lib/claude-settings.ts +76 -4
  144. package/extensions/lib/compaction-boundary.ts +36 -0
  145. package/extensions/lib/compaction-keep.mjs +83 -0
  146. package/extensions/lib/config-mode.ts +112 -0
  147. package/extensions/lib/consent-dialogs.ts +63 -0
  148. package/extensions/lib/consent-preview.ts +5 -1
  149. package/extensions/lib/consent-stores.ts +48 -0
  150. package/extensions/lib/context-facts.ts +78 -0
  151. package/extensions/lib/context-stack.ts +81 -0
  152. package/extensions/lib/deferred.ts +219 -25
  153. package/extensions/lib/dock-rows.ts +60 -0
  154. package/extensions/lib/empty-tool-result.ts +27 -0
  155. package/extensions/lib/environment-block.ts +76 -0
  156. package/extensions/lib/fetch-timeout.ts +24 -6
  157. package/extensions/{system-prompt → lib}/git-status.ts +51 -13
  158. package/extensions/lib/git.ts +75 -13
  159. package/extensions/lib/grammars/LICENSE-tree-sitter-bash +21 -0
  160. package/extensions/lib/grammars/README.md +2 -0
  161. package/extensions/lib/grammars/tree-sitter-bash.wasm +0 -0
  162. package/extensions/lib/guide-docs.ts +45 -0
  163. package/extensions/lib/headless-output.ts +46 -0
  164. package/extensions/lib/hook-gate.ts +7 -7
  165. package/extensions/lib/interrupt.ts +20 -4
  166. package/extensions/lib/key-input.ts +455 -0
  167. package/extensions/lib/keys.ts +14 -1
  168. package/extensions/lib/local-command.ts +47 -13
  169. package/extensions/lib/mcp-overrides.ts +1 -1
  170. package/extensions/lib/mcp-share.ts +46 -0
  171. package/extensions/lib/memory-content.ts +146 -0
  172. package/extensions/lib/memory-index.ts +18 -0
  173. package/extensions/lib/memory.ts +134 -123
  174. package/extensions/lib/model-catalog/huggingface.json +174 -0
  175. package/extensions/lib/model-catalog/models-dev.json +18297 -0
  176. package/extensions/lib/model-catalog/openrouter.json +5252 -0
  177. package/extensions/lib/model-catalog-data.ts +513 -0
  178. package/extensions/lib/model-catalog.ts +462 -0
  179. package/extensions/lib/model-choice-warnings.ts +137 -0
  180. package/extensions/lib/model-pairings.ts +152 -0
  181. package/extensions/{auto-mode → lib}/model-picker.ts +26 -43
  182. package/extensions/lib/model-policy.ts +112 -15
  183. package/extensions/lib/model-tier.ts +283 -355
  184. package/extensions/lib/model-unusable.ts +1 -1
  185. package/extensions/lib/newer-model.ts +100 -0
  186. package/extensions/lib/notices.ts +87 -0
  187. package/extensions/lib/notifications.ts +308 -64
  188. package/extensions/lib/one-code-settings.ts +74 -8
  189. package/extensions/lib/open-browser.ts +63 -0
  190. package/extensions/lib/openrouter-generation.ts +94 -0
  191. package/extensions/lib/operation-deadline.ts +30 -0
  192. package/extensions/lib/original-command.ts +4 -4
  193. package/extensions/lib/package-version.ts +1 -1
  194. package/extensions/lib/panel-focus.ts +134 -0
  195. package/extensions/lib/paths.ts +17 -2
  196. package/extensions/lib/permission-gate.ts +72 -6
  197. package/extensions/lib/persisted-output.ts +60 -8
  198. package/extensions/lib/pi-ai-estimate.ts +19 -3
  199. package/extensions/lib/pi-version.ts +21 -2
  200. package/extensions/lib/plan-mode-channels.ts +20 -5
  201. package/extensions/lib/plugins.ts +26 -17
  202. package/extensions/lib/powershell-parse-script.ts +208 -0
  203. package/extensions/lib/powershell-parser.ts +344 -0
  204. package/extensions/lib/process-tree.ts +131 -8
  205. package/extensions/lib/prompt-options.ts +82 -0
  206. package/extensions/lib/queued-delivery.ts +44 -0
  207. package/extensions/lib/reminders.ts +364 -58
  208. package/extensions/lib/replaced-builtins.mjs +199 -0
  209. package/extensions/lib/replay-call.ts +70 -0
  210. package/extensions/lib/request-replay.ts +439 -0
  211. package/extensions/lib/scratchpad.ts +81 -14
  212. package/extensions/lib/send-now-channel.ts +7 -0
  213. package/extensions/lib/session-model-tier.ts +51 -0
  214. package/extensions/lib/session-work.ts +64 -0
  215. package/extensions/lib/settings-channels.ts +4 -4
  216. package/extensions/lib/shell-exit-semantics.ts +170 -0
  217. package/extensions/lib/shell-quote.ts +11 -0
  218. package/extensions/lib/shell-result.ts +70 -0
  219. package/extensions/lib/shell-spawn.ts +70 -6
  220. package/extensions/lib/shell-tool.ts +75 -25
  221. package/extensions/lib/side-call-cache.ts +124 -0
  222. package/extensions/lib/side-call-run.ts +96 -0
  223. package/extensions/lib/side-call-usage.ts +38 -0
  224. package/extensions/lib/side-call.ts +13 -1
  225. package/extensions/lib/single-flight.ts +18 -0
  226. package/extensions/lib/skill-body.ts +42 -0
  227. package/extensions/lib/skill-scan.ts +63 -24
  228. package/extensions/lib/spill-file.ts +140 -0
  229. package/extensions/lib/subagent-handback.ts +113 -0
  230. package/extensions/lib/system-role.ts +156 -0
  231. package/extensions/lib/terminal-text.ts +114 -0
  232. package/extensions/lib/text-width.ts +47 -16
  233. package/extensions/lib/timer-ops.ts +20 -0
  234. package/extensions/lib/tool-additions.ts +149 -0
  235. package/extensions/lib/tool-call-corruption.ts +134 -0
  236. package/extensions/lib/tool-path.ts +66 -0
  237. package/extensions/lib/tool-variants.ts +69 -0
  238. package/extensions/lib/tui-render.ts +255 -27
  239. package/extensions/lib/turn-budget-layout.ts +143 -0
  240. package/extensions/lib/update-check.mjs +15 -2
  241. package/extensions/lib/usage-bus.ts +1 -1
  242. package/extensions/lib/user-denial.ts +38 -0
  243. package/extensions/lib/workspace-channel.ts +16 -0
  244. package/extensions/lib/worktree-channel.ts +31 -3
  245. package/extensions/lib/worktree-isolation.ts +40 -10
  246. package/extensions/lsp/client.ts +8 -9
  247. package/extensions/lsp/index.ts +70 -4
  248. package/extensions/lsp/keep-alive.ts +1 -1
  249. package/extensions/lsp/trust.ts +119 -0
  250. package/extensions/lsp/watcher.ts +1 -1
  251. package/extensions/mcp/announce.ts +87 -5
  252. package/extensions/mcp/client.ts +161 -48
  253. package/extensions/mcp/config.ts +132 -8
  254. package/extensions/mcp/discovery.ts +19 -0
  255. package/extensions/mcp/index.ts +209 -71
  256. package/extensions/mcp/oauth/browser.ts +38 -17
  257. package/extensions/mcp/oauth/flow.ts +25 -17
  258. package/extensions/mcp/oauth/provider.ts +14 -8
  259. package/extensions/mcp/oauth/store.ts +34 -16
  260. package/extensions/mcp/panel/keys.ts +12 -11
  261. package/extensions/mcp/panel/render.ts +9 -6
  262. package/extensions/mcp/schema.ts +104 -5
  263. package/extensions/mcp/trust.ts +151 -67
  264. package/extensions/memory/entries.ts +23 -14
  265. package/extensions/memory/index.ts +134 -28
  266. package/extensions/memory/open-external.ts +33 -18
  267. package/extensions/memory/panel.ts +135 -26
  268. package/extensions/newer-model/index.ts +31 -0
  269. package/extensions/notebook/description.ts +18 -0
  270. package/extensions/notebook/index.ts +6 -5
  271. package/extensions/notebook/notebook.ts +1 -1
  272. package/extensions/permissions/index.ts +1300 -381
  273. package/extensions/permissions/matcher.ts +425 -74
  274. package/extensions/permissions/modes.ts +6 -4
  275. package/extensions/permissions/panel/host.ts +130 -0
  276. package/extensions/permissions/panel/keys.ts +48 -0
  277. package/extensions/permissions/panel/render.ts +450 -0
  278. package/extensions/permissions/panel/state.ts +550 -0
  279. package/extensions/permissions/powershell-cmdlets.ts +198 -0
  280. package/extensions/permissions/powershell-paths.ts +197 -0
  281. package/extensions/permissions/powershell-rules.ts +207 -280
  282. package/extensions/permissions/powershell-tree.ts +557 -0
  283. package/extensions/permissions/project-trust.ts +27 -11
  284. package/extensions/permissions/protected-paths.ts +14 -2
  285. package/extensions/permissions/session-grant.ts +6 -0
  286. package/extensions/permissions/settings.ts +166 -31
  287. package/extensions/permissions/subagent-gate.ts +25 -0
  288. package/extensions/permissions/workspace.ts +78 -0
  289. package/extensions/plan-mode/index.ts +156 -69
  290. package/extensions/plan-mode/reminder.ts +89 -21
  291. package/extensions/plan-mode/texts.ts +177 -0
  292. package/extensions/plan-mode/viewer.ts +92 -27
  293. package/extensions/plugins/counts.ts +3 -3
  294. package/extensions/plugins/index.ts +61 -46
  295. package/extensions/plugins/install/install.ts +16 -0
  296. package/extensions/plugins/marketplace/sync.ts +9 -3
  297. package/extensions/plugins/marketplace/types.ts +3 -1
  298. package/extensions/plugins/panel/keys.ts +21 -24
  299. package/extensions/plugins/panel/render.ts +12 -6
  300. package/extensions/plugins/shell-expand.ts +107 -0
  301. package/extensions/plugins/template.ts +32 -15
  302. package/extensions/powershell/child.ts +7 -0
  303. package/extensions/powershell/description.ts +38 -6
  304. package/extensions/powershell/guards.ts +1 -1
  305. package/extensions/powershell/index.ts +12 -7
  306. package/extensions/recap/index.ts +65 -60
  307. package/extensions/recap/prompt.ts +2 -2
  308. package/extensions/recap/scheduler.ts +3 -5
  309. package/extensions/search-tools/grep-merge.ts +39 -0
  310. package/extensions/search-tools/index.ts +0 -0
  311. package/extensions/send-now/chord.ts +62 -0
  312. package/extensions/send-now/index.ts +133 -0
  313. package/extensions/session-title/index.ts +3 -0
  314. package/extensions/session-title/title.ts +4 -1
  315. package/extensions/skill/code-review.ts +97 -0
  316. package/extensions/skill/index.ts +421 -101
  317. package/extensions/skill/invoke.ts +128 -18
  318. package/extensions/skill/listing.ts +133 -9
  319. package/extensions/skill/panel/keys.ts +15 -16
  320. package/extensions/skill/panel/render.ts +5 -2
  321. package/extensions/skill/panel/state.ts +12 -1
  322. package/extensions/subagents/agent-args.ts +39 -0
  323. package/extensions/subagents/agent-description.ts +132 -0
  324. package/extensions/subagents/agents.ts +116 -23
  325. package/extensions/subagents/announce.ts +69 -0
  326. package/extensions/subagents/default-model.ts +2 -3
  327. package/extensions/subagents/delegation-steer.ts +4 -4
  328. package/extensions/subagents/fork-cache.ts +76 -0
  329. package/extensions/subagents/guide-agent.ts +189 -0
  330. package/extensions/subagents/hand-back-review.ts +3 -0
  331. package/extensions/subagents/index.ts +1493 -824
  332. package/extensions/subagents/live-runs.ts +26 -6
  333. package/extensions/subagents/model-select.ts +38 -25
  334. package/extensions/subagents/outcome.ts +2 -2
  335. package/extensions/subagents/panel-keys.ts +73 -31
  336. package/extensions/subagents/panel-render.ts +120 -96
  337. package/extensions/subagents/panel-widget.ts +60 -89
  338. package/extensions/subagents/runner.ts +108 -80
  339. package/extensions/subagents/runs.ts +39 -5
  340. package/extensions/subagents/send-to-main-tool.ts +1 -1
  341. package/extensions/subagents/session-turns.ts +32 -8
  342. package/extensions/subagents/shell-panel.ts +36 -178
  343. package/extensions/subagents/tasks-dialog.ts +170 -0
  344. package/extensions/subagents/viewport-mirror.ts +95 -0
  345. package/extensions/subagents/worktree.ts +57 -13
  346. package/extensions/system-prompt/environment.ts +19 -19
  347. package/extensions/system-prompt/idle-turn.ts +65 -0
  348. package/extensions/system-prompt/index.ts +131 -47
  349. package/extensions/system-prompt/template.ts +24 -50
  350. package/extensions/system-prompt/tiers/common.ts +23 -64
  351. package/extensions/system-prompt/tiers/frontier.ts +32 -11
  352. package/extensions/system-prompt/tiers/low.ts +67 -45
  353. package/extensions/system-prompt/tiers/mid.ts +96 -38
  354. package/extensions/system-reminder/index.ts +175 -13
  355. package/extensions/tasks/descriptions.ts +190 -0
  356. package/extensions/tasks/index.ts +120 -41
  357. package/extensions/tasks/store.ts +83 -16
  358. package/extensions/tool-call-corruption/child.ts +7 -0
  359. package/extensions/tool-call-corruption/index.ts +237 -0
  360. package/extensions/tool-search/announce.ts +16 -0
  361. package/extensions/tool-search/index.ts +189 -41
  362. package/extensions/tool-style/index.ts +68 -10
  363. package/extensions/tool-style/write-description.ts +40 -0
  364. package/extensions/tool-style/write-render.ts +237 -0
  365. package/extensions/turn-duration/index.ts +7 -3
  366. package/extensions/turn-duration/line.ts +47 -4
  367. package/extensions/web/backends.ts +6 -9
  368. package/extensions/web/description.ts +50 -0
  369. package/extensions/web/index.ts +118 -53
  370. package/extensions/web/native-call.ts +15 -0
  371. package/extensions/web/native-results.ts +41 -0
  372. package/extensions/web-fetch/description.ts +42 -0
  373. package/extensions/web-fetch/extract.ts +53 -6
  374. package/extensions/web-fetch/index.ts +125 -76
  375. package/extensions/web-fetch/page-content.ts +19 -0
  376. package/extensions/web-fetch/response.ts +49 -0
  377. package/extensions/web-fetch/summarize.ts +9 -10
  378. package/extensions/workflow/agent-session.ts +105 -18
  379. package/extensions/workflow/args.ts +24 -0
  380. package/extensions/workflow/description.ts +67 -0
  381. package/extensions/workflow/globals.ts +17 -3
  382. package/extensions/workflow/index.ts +145 -162
  383. package/extensions/workflow/records.ts +1 -0
  384. package/extensions/workflow/run-manager.ts +29 -6
  385. package/extensions/workflow/saved-workflows.ts +3 -2
  386. package/extensions/workflow/types.ts +22 -1
  387. package/extensions/workflow/viewer.ts +54 -24
  388. package/extensions/workflow/widget.ts +20 -0
  389. package/extensions/worktree/descriptions.ts +91 -0
  390. package/extensions/worktree/guards.ts +316 -54
  391. package/extensions/worktree/index.ts +121 -39
  392. package/extensions/worktree/powershell-guards.ts +167 -0
  393. package/extensions/worktree/rewrite.ts +14 -16
  394. package/package.json +18 -7
  395. package/skills/artifact-design/SKILL.md +85 -0
  396. package/skills/code-review/SKILL.md +20 -20
  397. package/skills/code-review/cells/arguments-and-flags.md +19 -0
  398. package/skills/code-review/cells/high-3x5-recall-verify.md +137 -0
  399. package/skills/code-review/cells/high-8-inline.md +122 -0
  400. package/skills/code-review/cells/low-1-pass-max4.md +27 -0
  401. package/skills/code-review/cells/low-1-pass-min-files-4.md +28 -0
  402. package/skills/code-review/cells/max-5x5-verify-sweep.md +162 -0
  403. package/skills/code-review/cells/medium-3x5-verify.md +132 -0
  404. package/skills/code-review/cells/minimal-prompt.md +32 -0
  405. package/skills/code-review/cells/xhigh-10-inline-sweep.md +149 -0
  406. package/skills/code-review/cells/xhigh-5x5-verify-sweep.md +162 -0
  407. package/skills/fewer-permission-prompts/SKILL.md +1 -1
  408. package/skills/loop/SKILL.md +11 -0
  409. package/skills/security-review/SKILL.md +2 -5
  410. package/skills/simplify/SKILL.md +7 -5
  411. package/skills/workflow-authoring/SKILL.md +143 -0
  412. package/themes/onecode-light.json +1 -1
  413. package/themes/onecode.json +1 -1
  414. package/types/app.d.ts +58 -0
  415. package/types/community-packages.d.ts +26 -1
  416. package/extensions/auto-mode/recoverability.ts +0 -229
  417. package/extensions/lib/capability-index.ts +0 -466
  418. package/extensions/lib/model-facts.generated.json +0 -2675
  419. package/extensions/lib/model-facts.ts +0 -162
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: artifact-design
3
+ description: Design guidance and fundamentals for Artifacts. Load before writing any page you will publish with the artifact tool.
4
+ ---
5
+
6
+ Work the way the design lead at a small, versatile studio would: give each client a visual identity at the level of treatment the task calls for. Make deliberate choices about palette, typography, and layout that are specific to this subject, and avoid templated designs.
7
+
8
+ ## Read the request first
9
+
10
+ Decide the treatment; designing is a given. A doc gets the same craft as a landing page; only the treatment differs. Format is a separate matter: author one self-contained HTML file. The artifact tool stores that one file, so the page's CSS, JS, data and images all live inside it.
11
+
12
+ Many requests call for a more utilitarian treatment: a plan, a memo, a demo. Make it polished, with real typographic hierarchy, considered spacing, and a proper palette, but avoid over-designing. Most pages don't need a flashy, gigantic hero. Keep flourishes tasteful and limited.
13
+
14
+ Some requests call for an editorial treatment: a landing page, a game, an app or tool they'll keep or share.
15
+
16
+ If unsure: a well-composed page is always acceptable; an over-designed visual identity sometimes isn't.
17
+
18
+ Fundamentals below apply to everything. Follow the editorial process after them only when that reading calls for it.
19
+
20
+ ## Fundamentals for every artifact
21
+
22
+ **Respect what already exists.** Look for an existing design system first: CLAUDE.md, a tokens or theme file, existing component styles. When one exists, apply it; everything below fills gaps and never overrides. Precedence is always the user's own words, then the project's existing system, then your choices.
23
+
24
+ **Ground it in the subject.** If the subject isn't already clear, define it: one concrete subject, its audience, and the page's single job. Distinctive choices come from the subject's own world: its materials, instruments, and vernacular. Whatever the treatment, include at least one detail only this subject would have (its real units and scales, its document conventions, its terms of art) as content rather than ornament; it costs nothing even on a plain page. Use real content throughout and never lorem ipsum.
25
+
26
+ **Pair typefaces.** Typography determines how the page reads even when the page isn't about typography. Load web fonts from Google Fonts by linking it directly (`<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=...&display=swap">`). A face from anywhere else must be inlined as a @font-face data URI. In both cases, declare a real fallback stack: it is what a viewer without a network connection sees. Keep running text near 65 characters wide. Set a type scale and keep to it. Give headings `text-wrap: balance`, give body text comfortable spacing, and give uppercase labels a little letter-spacing.
27
+
28
+ **Load libraries instead of inlining them.** When the page really needs a library (React, a charting or highlighting package), load its UMD build from cdnjs with one pinned `<script src="https://cdnjs.cloudflare.com/ajax/libs/...">` placed before the inline script that uses its global; don't inline the library's source or hand-write a substitute. cdn.jsdelivr.net is the one other script host to use. Only the script loads this way; inline a library's stylesheet. The page's own CSS and JS, its images (as data URIs), and its data ship inside the page. Most pages don't need any library; use one only when it does substantial work for the page.
29
+
30
+ **Choose neutrals deliberately.** A pure mid-grey looks unconsidered; a grey with a slight hue bias toward the page's accent looks intentional. Pure white and near-black are fine backgrounds when they suit the subject, as long as you chose the neutral deliberately instead of inheriting a default.
31
+
32
+ **Design both themes.** The page opens straight in the viewer's browser, which reports the operating system's theme through `prefers-color-scheme`. A page may also offer its own theme toggle, which sets `data-theme="dark"` or `data-theme="light"` on the root element; with no toggle used, there is *no* `data-theme` attribute. Structure the CSS at the token level for all three states. The bare `:root` block defines the complete light palette (for a deliberately dark-first design, swap light and dark consistently through this whole pattern); `@media (prefers-color-scheme: dark)` redefines only the tokens, guarded as `:root:not([data-theme="light"])` so an explicit light choice overrides a dark OS setting; `:root[data-theme="dark"]` redefines them again so the toggle also overrides in the other direction; set `color-scheme: light` on the bare `:root`, and wherever the dark palette applies - both dark blocks, or bare `:root` in a dark-first or single-dark design - set `color-scheme: dark`, so native form controls and scrollbars follow the palette. Style components through the tokens, never directly inside a media or `[data-theme]` block: a color defined only inside `[data-theme]` never applies when no `data-theme` attribute is set, and the page then shows one theme's text on the other theme's background. Two more rules keep each theme consistent. First, `body` must set an explicit `background` from a token; a transparent body shows the browser's default white under a dark palette, with no warning. Second, every element that sets a color takes it from the same token set as the surface behind it, never from a literal that works in only one theme. Declare every token in the bare `:root` block before any media or `[data-theme]` block redefines it; a color that exists only inside one of those blocks is the classic unreadable-artifact bug. Give the second theme the same care as the first: don't simply invert it; keep contrast legible and keep the accent working on both backgrounds. A design that deliberately commits to one visual world (a neon arcade screen, a letterpress invitation) may stay single-theme: then omit the media query and `[data-theme]` blocks entirely but still set the background and every color explicitly, so the page looks right whatever the viewer's theme; do this by choice, never by omission.
33
+
34
+ **Use layout for spacing.** Lay out sibling groups with flex or grid and `gap` instead of per-element margins, which collapse or double without warning. Keep a side gutter of at least 16px at every width: set it once as side padding on `body` or one outer wrapper, whose vertical padding uses `padding-block` and never a `padding` shorthand that zeroes the sides. Let rows wrap or stack to one column at phone width (about 400px). Give images and any `aspect-ratio` box `max-width: 100%`, and don't give anything a `min-width` wider than the screen. Only wide tables, code, and diagrams may exceed it; give each `overflow-x: auto` on its own container so the page body never scrolls sideways. The page is stored exactly as written, with no skeleton added around it, so write a complete document: `<!doctype html>`, `<meta charset="utf-8">`, and `<meta name="viewport" content="width=device-width, initial-scale=1">`. Size a one-screen app with `height: 100%` on `html` and `body` instead of `100vh`. Use `font-variant-numeric: tabular-nums` wherever digits line up in columns.
35
+
36
+ **Make repeated elements consistent.** For cards in a row, label/value pairs down a list, or badges on sibling items, use the same edges, baselines, and inner padding on each, and put any recurring element in the same place on each. Let content set a container's height and pick a column count the items fill, so nothing stretches over empty space or sits alone in a row. Make text that can outgrow its track wrap or scroll in its own container; clipped text is a bug.
37
+
38
+ **Use card styling selectively.** Border, fill, radius, and shadow each mark an element as a separate object. Apply them by role, to set off the one element that needs it; applying the same radius and shadow to every block flattens the hierarchy. Open with big-number tiles only when those figures are the point of the page.
39
+
40
+ **Draw charts to scale.** Place marks, ticks, and labels with one scale, and make every label name a value the chart actually reaches. Color chart text from the theme tokens so it is readable in both themes. Keep marks, labels, and edges clear of one another and inside the drawing's bounds; in SVG, leave room in the viewBox for the outermost labels and give every drawn shape an explicit fill.
41
+
42
+ **Make the page complete at rest.** Everything meant to be read is visible once the page has loaded, with no scrolling to trigger it; that first still frame is what a thumbnail, a shared link, and a skimming reader all see. A section may animate in, but from a visible resting state, never left at `opacity: 0` waiting for an observer. Size a hero to its content instead of to the viewport; a `100vh` opener pushes the rest of the page out of that first frame. A tool or app opens in a realistic working state: the user's real data where it exists, otherwise example rows, a loaded sample, or a plausibly filled form, clearly marked as examples and never presented as the user's own figures. The first view shows what the tool does; an empty shell waiting for input shows nothing.
43
+
44
+ **Avoid AI-generated design.** AI-generated design currently clusters around a few looks: warm cream (#F4F1EA) with a serif display and terracotta accent; near-black with a lone acid-green or vermilion pop; broadsheet hairline rules with dense columns; a purple-to-blue gradient hero on white; Inter or Space Grotesk as the "safe" face; emoji as section markers; everything centered; `rounded-lg` everywhere; accent bar/rail on rounded cards. When the user specifies a visual direction, follow it exactly; their words always win, including when they ask for one of these looks. When nothing is specified, don't use that freedom on one of these defaults.
45
+
46
+ **Build cleanly.** Watch for overlapping elements, cascade collisions, and silent font fallbacks. Close every non-void element, double-quote attributes, give keyboard focus a visible state, and respect `prefers-reduced-motion`. Give every form control a stable `id` and a label. For generative or decorative graphics, use Canvas or WebGL instead of hand-writing long SVG path data.
47
+
48
+ **CSS rules.** When writing the CSS, watch your selector specificity. It is easy to generate classes that cancel each other out, e.g. a type-based selector like `.section` and an element-based one like `.cta` both setting padding and margins between sections. Structure the cascade so it doesn't undo your spacing unnoticed.
49
+
50
+ **Writing the copy.** Treat words as design material and never as decoration. Write from the user's side of the screen: name things by what people recognize instead of how the system is built (a person manages *notifications*; they don't manage *webhook config*). Use active voice; a control states exactly what happens ("Publish", then a toast that says "Published"). Errors explain what went wrong and how to fix it, without apologies or vagueness. Prefer specific to clever. Write plainly, the way a knowledgeable person would talk. Avoid mannered devices: asides set off by em-dashes, "not X, but Y" framing, colon-then-reveal sentences, scare quotes around invented labels, and stock phrases such as "worth noting" or "honest caveat". Prefer short, direct sentences over compressed or clever phrasing.
51
+
52
+ **Name the page like a product; don't caption it.** The `<title>` is the artifact's name in the artifact gallery and the browser tab, and it gives the reader a first impression of the care taken. Give the page a real name: a short noun phrase, typically two to four words, specific to the subject; or, for a page that exists to answer one question, that question itself, which then is the page's name. Stop at the name; a title that adds its own explanation after a dash or colon reads as generated filler. The name must also identify the page among many: in the gallery it appears beside dozens of other artifacts, and a generic category label that could apply to any of them fails as a name just as an appended explanation does. When a candidate title combines the name with a generic word (a greeting, a category, a page-type label), keep the name; a trim that drops the identifying part and keeps the generic word produces a title that could apply to any page. This rule removes explanations and doesn't require brevity: a multi-word title that already reads as one specific name is finished, and shortening it further only makes it generic. Put the explanation in the one-sentence `description` you pass when publishing; the gallery shows it directly under the title.
53
+
54
+ **Structure is information.** Structural devices (numbering, eyebrows, dividers, labels) should encode something true about the content instead of decorating it. Many generic designs use numbered markers (01 / 02 / 03), but those fit only if the content actually is a sequence, such as a real process or a typed timeline where the order is information the reader needs. Before adding numbered markers or similar devices, check that they actually make sense.
55
+
56
+ **When the page is a UI (dashboard, tool).** It is scanned and operated instead of read top to bottom, so the craft shifts from typography to information design. Put the summary before the detail. Encode state in form as well as in numbers (a pill, a chip, a severity stripe) so that whatever needs attention is visible at a glance. Semantic color (good / warning / critical) is separate from the accent hue and doesn't count as your accent. Give sparklines and charts the same care as type: an area fill, a faint grid, an emphasized endpoint. Interactive elements should look interactive.
57
+
58
+ ## Process
59
+
60
+ Start from what the viewer should be able to do on the page, in addition to what they will read. A local artifact has no runtime API: it cannot call Claude, read the user's connected data, or share state between viewers. A page that takes input keeps it only in the viewer's own browser storage, and that storage can be shared with other local pages or unavailable, so wrap every read and write in try/catch and make the page work without it.
61
+
62
+ Before writing code, sketch a short design plan (a compact token system with color, type, and layout):
63
+ - **Color**: describe the palette as 4-6 named hex values.
64
+ - **Type**: typefaces for 2+ roles: a characterful display face used with restraint, a complementary body face, and a utility face for captions or data if needed.
65
+ - **Layout**: a layout concept in one or two sentences.
66
+
67
+ Then build, following the plan and deriving every color and type decision from it.
68
+
69
+ **Write, look once, publish.** Before publishing you may look at the rendered page once, where this session can take a screenshot of the local file. Then make one pass of edits for what it shows, without a second look. For a page that charts real numbers, do take that look instead of skipping it, and use it on the chart. Don't build a test loop around your own file: no repeated screenshots, no pulling the script out to run it through node, no scripts that probe the DOM. Such a loop spends the session re-checking what a careful write already got right, while the user waits for the page. Then publish. Review happens on the published page in the user's browser, and further polish is for the user to request. If the user reports something visibly broken (a clipped column, unreadable text, a control that does nothing), fix that and republish once.
70
+
71
+ **Updates.** Republishing the same file makes a new version at the same location and keeps the earlier ones. The browser tab does not reload by itself: tell the user to refresh it. If the page has state a viewer would miss on a refresh (a game, a long form), keep it in browser storage, guarded as above.
72
+
73
+ ## When the request is editorial
74
+
75
+ The stance changes here: the client has already rejected proposals that felt templated, and is paying for a distinctive point of view. Make opinionated decisions, and take one real aesthetic risk where it serves the work.
76
+
77
+ Review the design plan against the subject before building: if any part of it reads like the generic default you would produce for any similar page, revise that part, and note what you changed and why. Write the code only after confirming the plan is unique, following the revised plan exactly.
78
+
79
+ **Principles**
80
+
81
+ - The hero states the thesis: open with the most characteristic thing in the subject's world (headline, image, live demo, interactive moment).
82
+ - Typography sets the personality of the page. Pair the display and body faces deliberately, avoiding the families you would use on any other project, and set a clear type scale with intentional weights, widths, and spacing. Make the type treatment itself a memorable part of the design instead of a neutral container for the content.
83
+ - Use motion deliberately. Think about whether and where animation can serve the subject: a page-load sequence, hover micro-interactions, ambient atmosphere. One orchestrated moment is usually more effective than scattered effects; choose what the direction calls for. However, sometimes less is more, and extra animation adds to the impression that the design is AI-generated.
84
+ - Match complexity to the vision. Maximalist directions need elaborate execution; minimal directions need precision in spacing, type, and detail. Elegance is executing the chosen vision well.
85
+ - Put your boldness in one place; keep everything around it quiet. If the accent clashes with the background, shift it toward an analogous hue or desaturate it instead of replacing it.
@@ -2,19 +2,19 @@
2
2
  name: code-review
3
3
  description: >
4
4
  Review the current diff, or a PR number/branch/path target, for correctness
5
- bugs and reuse/simplification/efficiency cleanups. Pass --comment to post
6
- findings as inline PR comments, or --fix to apply the findings to the working
7
- tree after the review. Raise the reasoning effort (/effort) for broader,
8
- recall-biased coverage; lower it for fewer, high-confidence findings.
5
+ bugs (plus reuse/simplification/efficiency cleanups where the model's review
6
+ recipe covers them) at the given effort level (low/medium: fewer,
7
+ high-confidence findings; high→max: broader coverage, may include uncertain
8
+ findings); with no level given, it follows the session's effort (/effort).
9
+ Pass --comment to post findings as inline PR comments, or --fix to apply the
10
+ findings to the working tree after the review.
11
+ argument-hint: "[low|medium|high|xhigh|max] [--fix] [--comment] [<pr#>|<branch>|<path>]"
9
12
  ---
10
13
 
11
14
  `medium effort → 3+5 angles × 6 candidates → 1-vote verify → ≤8 findings`
12
15
 
13
- You are reviewing for **precision**: every finding you surface should be one a
14
- maintainer would act on. If the session is running at a higher reasoning effort,
15
- shift toward **recall** — catch every real bug a careful reviewer would catch in
16
- one sitting, err on the side of surfacing, and raise the finding cap and the
17
- number of finder angles accordingly.
16
+ You are reviewing for **precision** at medium effort: every finding you surface
17
+ should be one a maintainer would act on.
18
18
 
19
19
  ## Phase 0 — Gather the diff
20
20
 
@@ -29,9 +29,7 @@ review that target instead. Treat this diff as the review scope.
29
29
 
30
30
  Run **8 independent finder angles** via the Agent tool. Each
31
31
  surfaces **up to 6 candidate findings** with `file`, `line`, a one-line
32
- `summary`, and a concrete `failure_scenario`. If the Agent tool is not available
33
- in your current tool set, do not error — perform each angle (and each
34
- verification) yourself, sequentially, in this context.
32
+ `summary`, and a concrete `failure_scenario`. If the Agent tool is not available in your current tool set, do not error — perform each angle (and each verification) yourself, sequentially, in this context.
35
33
 
36
34
  ### Angle A — line-by-line diff scan
37
35
 
@@ -81,10 +79,11 @@ alternative.
81
79
 
82
80
  ### Altitude
83
81
 
84
- Check that each change is implemented at the right depth, not as a fragile
85
- bandaid. Special cases layered on shared infrastructure are a sign the fix
86
- isn't deep enough — prefer generalizing the underlying mechanism over adding
87
- special cases.
82
+ Check that each change fixes the root cause at the right depth rather than
83
+ patching a symptom with a fragile bandaid. Special cases layered on shared
84
+ infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
85
+ general change to the underlying mechanism over adding special cases, and name
86
+ that change.
88
87
 
89
88
  ### Conventions (CLAUDE.md)
90
89
 
@@ -127,8 +126,7 @@ Keep candidates where the vote is CONFIRMED or PLAUSIBLE.
127
126
 
128
127
  ## Output
129
128
 
130
- Return findings as a JSON array of at most 8 objects (raise the cap when running
131
- at higher effort):
129
+ Return findings as a JSON array of at most 8 objects:
132
130
 
133
131
  ```json
134
132
  [
@@ -141,8 +139,10 @@ at higher effort):
141
139
  ]
142
140
  ```
143
141
 
144
- Ranked most-severe first. If more than the cap survive, keep the most severe. If
145
- nothing survives verification, return `[]`.
142
+ Ranked most-severe first. If more than 8 survive, keep the 8 most
143
+ severe. If nothing survives verification, return `[]`. Do not call the
144
+ ReportFindings tool even if it is available - this review's
145
+ output contract is the JSON block above.
146
146
 
147
147
  ## Arguments and flags
148
148
 
@@ -0,0 +1,19 @@
1
+ ## Arguments and flags
2
+
3
+ Read the invocation arguments and adjust accordingly:
4
+
5
+ - **A target** (`<pr#>`, `<branch>`, or `<path>`) replaces "the current diff" as
6
+ the review scope in Phase 0.
7
+ - **`--comment`** — after producing the findings list, if the review target is a
8
+ GitHub PR, post each finding as an inline PR comment (one call per finding;
9
+ include a suggestion block only when it fully fixes the issue). Prefer a
10
+ GitHub inline-comment MCP tool if one is connected this session; otherwise use
11
+ `gh api repos/{owner}/{repo}/pulls/{pr}/comments`. If the target is not a PR,
12
+ print the findings to the terminal and note that `--comment` was ignored.
13
+ - **`--fix`** — after producing the findings list, apply the findings to the
14
+ working tree instead of stopping at the report: fix each one directly —
15
+ correctness bugs and reuse/simplification/efficiency cleanups alike. Skip any
16
+ finding whose fix would change intended behavior, require changes well outside
17
+ the reviewed diff, or that you judge to be a false positive — note the skip
18
+ rather than arguing with it. Finish with a brief summary of what was fixed and
19
+ what was skipped.
@@ -0,0 +1,137 @@
1
+ `high effort → 3+5 angles × 6 candidates → 1-vote verify (recall-biased) → ≤10 findings`
2
+
3
+ You are reviewing for **recall** at high effort: catch every real bug a careful
4
+ reviewer would catch in one sitting. At this level, catching real bugs matters
5
+ more than avoiding false positives. Err on the side of surfacing.
6
+
7
+ ## Phase 0 — Gather the diff
8
+
9
+ Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
10
+ if there's no upstream) to get the unified diff under review. If there are
11
+ uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
12
+ include the working-tree changes in scope — the review often runs before the
13
+ commit. If a PR number, branch name, or file path was passed as an argument,
14
+ review that target instead. Treat this diff as the review scope.
15
+
16
+ ## Phase 1 — Find candidates (3 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle, up to 6 each)
17
+
18
+ Run **8 independent finder angles** via the Agent tool. Each
19
+ surfaces **up to 6 candidate findings** with `file`, `line`, a one-line
20
+ `summary`, and a concrete `failure_scenario`. If the Agent tool is not available in your current tool set, do not error — perform each angle (and each verification) yourself, sequentially, in this context.
21
+
22
+ ### Angle A — line-by-line diff scan
23
+
24
+ Read every hunk in the diff, line by line. Then Read the enclosing function for
25
+ each hunk — bugs in unchanged lines of a touched function are in scope (the PR
26
+ re-exposes or fails to fix them). For every line ask: what input, state, timing,
27
+ or platform makes this line wrong? Look for inverted/wrong conditions,
28
+ off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
29
+ wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
30
+
31
+ ### Angle B — removed-behavior auditor
32
+
33
+ For every line the diff DELETES or replaces, name the invariant or behavior it
34
+ enforced, then search the new code for where that invariant is re-established.
35
+ If you can't find it, that's a candidate: a removed guard, a dropped error
36
+ path, a narrowed validation, a deleted test that was covering a real case.
37
+
38
+ ### Angle C — cross-file tracer
39
+
40
+ For each function the diff changes, find its callers (Grep for the symbol) and
41
+ check whether the change breaks any call site: a new precondition, a changed
42
+ return shape, a new exception, a timing/ordering dependency. Also check callees:
43
+ does a parallel change in the same PR make a call unsafe?
44
+
45
+ ### Reuse
46
+
47
+ The angles above hunt for bugs; this one and the next two hunt for cleanup in
48
+ the changed code. Flag new code that re-implements something the codebase
49
+ already has — Grep shared/utility modules and files adjacent to the change,
50
+ and name the existing helper to call instead.
51
+
52
+ ### Simplification
53
+
54
+ Flag unnecessary complexity the diff adds: redundant or derivable state,
55
+ copy-paste with slight variation, deep nesting, dead code left behind. Name
56
+ the simpler form that does the same job.
57
+
58
+ ### Efficiency
59
+
60
+ Flag wasted work the diff introduces: redundant computation or repeated I/O,
61
+ independent operations run sequentially, blocking work added to startup or
62
+ hot paths. Also flag long-lived objects built from closures or captured
63
+ environments — they keep the entire enclosing scope alive for the object's
64
+ lifetime (a memory leak when that scope holds large values); prefer a
65
+ class/struct that copies only the fields it needs. Name the cheaper
66
+ alternative.
67
+
68
+ ### Altitude
69
+
70
+ Check that each change fixes the root cause at the right depth rather than
71
+ patching a symptom with a fragile bandaid. Special cases layered on shared
72
+ infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
73
+ general change to the underlying mechanism over adding special cases, and name
74
+ that change.
75
+
76
+ ### Conventions (CLAUDE.md)
77
+
78
+ Find the CLAUDE.md files that govern the changed code: the user-level
79
+ ~/.claude/CLAUDE.md, the repo-root CLAUDE.md, plus any CLAUDE.md or
80
+ CLAUDE.local.md in a directory that is an ancestor of a changed file (a
81
+ directory's CLAUDE.md only applies to files at or below it). Read each one
82
+ that exists, then check the diff for clear violations of the rules they state.
83
+
84
+ Only flag a violation when you can quote the exact rule and the exact line
85
+ that breaks it — no style preferences, no vague "spirit of the doc"
86
+ inferences. In the finding, name the CLAUDE.md path and quote the rule so the
87
+ report can cite it. If no CLAUDE.md applies, return nothing for this angle.
88
+
89
+ Cleanup, altitude, and conventions candidates use the same
90
+ `file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
91
+ cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
92
+ is broken) instead of a crash. Correctness bugs always outrank cleanup,
93
+ altitude, and conventions findings when the output cap forces a cut.
94
+
95
+ Pass every candidate with a nameable failure scenario through — finders that
96
+ silently drop half-believed candidates bypass the verify step and are the
97
+ dominant cause of misses.
98
+
99
+ ## Phase 2 — Verify (1-vote, recall-biased)
100
+
101
+ Dedup near-duplicates (same defect, same location, same reason → keep one). For
102
+ each remaining candidate, run **one verifier** via the Agent tool:
103
+ give it the diff, the relevant file(s), and the candidate; it returns exactly
104
+ one of **CONFIRMED / PLAUSIBLE / REFUTED**.
105
+
106
+ **PLAUSIBLE by default** — do not refute a candidate for being "speculative" or
107
+ "depends on runtime state" when the state is realistic: concurrency races,
108
+ nil/undefined on a rare-but-reachable path (error handler, cold cache, missing
109
+ optional field), falsy-zero treated as missing, off-by-one on a boundary the
110
+ code does not exclude, retry storms / partial failures, regex/allowlist that
111
+ lost an anchor. These are PLAUSIBLE.
112
+
113
+ **REFUTED** only when constructible from the code: factually wrong (quote the
114
+ actual line); provably impossible (type/constant/invariant — show it); already
115
+ handled in this diff (cite the guard); or pure style with no observable effect.
116
+
117
+ Keep **CONFIRMED and PLAUSIBLE**. Drop REFUTED.
118
+
119
+ ## Output
120
+
121
+ Return findings as a JSON array of at most 10 objects:
122
+
123
+ ```json
124
+ [
125
+ {
126
+ "file": "path/to/file.ext",
127
+ "line": 123,
128
+ "summary": "one-sentence statement of the bug",
129
+ "failure_scenario": "concrete inputs/state → wrong output/crash"
130
+ }
131
+ ]
132
+ ```
133
+
134
+ Ranked most-severe first. If more than 10 survive, keep the 10 most
135
+ severe. If nothing survives verification, return `[]`. Do not call the
136
+ ReportFindings tool even if it is available - this review's
137
+ output contract is the JSON block above.
@@ -0,0 +1,122 @@
1
+ `high effort → 8 inline angles → dedup (no verify) → ≤10 findings`
2
+
3
+ You are reviewing for **recall** at high effort: catch every real bug a careful
4
+ reviewer would catch in one sitting. At this level, catching real bugs matters
5
+ more than avoiding false positives. Err on the side of surfacing.
6
+
7
+ ## Phase 0 — Gather the diff
8
+
9
+ Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
10
+ if there's no upstream) to get the unified diff under review. If there are
11
+ uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
12
+ include the working-tree changes in scope — the review often runs before the
13
+ commit. If a PR number, branch name, or file path was passed as an argument,
14
+ review that target instead. Treat this diff as the review scope.
15
+
16
+ ## Phase 1 — Find candidates (3 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle, up to 6 each)
17
+
18
+ Run **8 independent finder angles** in sequence yourself, in THIS context — do NOT spawn subagents for them. Each
19
+ surfaces **up to 6 candidate findings** with `file`, `line`, a one-line
20
+ `summary`, and a concrete `failure_scenario`.
21
+
22
+ ### Angle A — line-by-line diff scan
23
+
24
+ Read every hunk in the diff, line by line. Then Read the enclosing function for
25
+ each hunk — bugs in unchanged lines of a touched function are in scope (the PR
26
+ re-exposes or fails to fix them). For every line ask: what input, state, timing,
27
+ or platform makes this line wrong? Look for inverted/wrong conditions,
28
+ off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
29
+ wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
30
+
31
+ ### Angle B — removed-behavior auditor
32
+
33
+ For every line the diff DELETES or replaces, name the invariant or behavior it
34
+ enforced, then search the new code for where that invariant is re-established.
35
+ If you can't find it, that's a candidate: a removed guard, a dropped error
36
+ path, a narrowed validation, a deleted test that was covering a real case.
37
+
38
+ ### Angle C — cross-file tracer
39
+
40
+ For each function the diff changes, find its callers (Grep for the symbol) and
41
+ check whether the change breaks any call site: a new precondition, a changed
42
+ return shape, a new exception, a timing/ordering dependency. Also check callees:
43
+ does a parallel change in the same PR make a call unsafe?
44
+
45
+ ### Reuse
46
+
47
+ The angles above hunt for bugs; this one and the next two hunt for cleanup in
48
+ the changed code. Flag new code that re-implements something the codebase
49
+ already has — Grep shared/utility modules and files adjacent to the change,
50
+ and name the existing helper to call instead.
51
+
52
+ ### Simplification
53
+
54
+ Flag unnecessary complexity the diff adds: redundant or derivable state,
55
+ copy-paste with slight variation, deep nesting, dead code left behind. Name
56
+ the simpler form that does the same job.
57
+
58
+ ### Efficiency
59
+
60
+ Flag wasted work the diff introduces: redundant computation or repeated I/O,
61
+ independent operations run sequentially, blocking work added to startup or
62
+ hot paths. Also flag long-lived objects built from closures or captured
63
+ environments — they keep the entire enclosing scope alive for the object's
64
+ lifetime (a memory leak when that scope holds large values); prefer a
65
+ class/struct that copies only the fields it needs. Name the cheaper
66
+ alternative.
67
+
68
+ ### Altitude
69
+
70
+ Check that each change fixes the root cause at the right depth rather than
71
+ patching a symptom with a fragile bandaid. Special cases layered on shared
72
+ infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
73
+ general change to the underlying mechanism over adding special cases, and name
74
+ that change.
75
+
76
+ ### Conventions (CLAUDE.md)
77
+
78
+ Find the CLAUDE.md files that govern the changed code: the user-level
79
+ ~/.claude/CLAUDE.md, the repo-root CLAUDE.md, plus any CLAUDE.md or
80
+ CLAUDE.local.md in a directory that is an ancestor of a changed file (a
81
+ directory's CLAUDE.md only applies to files at or below it). Read each one
82
+ that exists, then check the diff for clear violations of the rules they state.
83
+
84
+ Only flag a violation when you can quote the exact rule and the exact line
85
+ that breaks it — no style preferences, no vague "spirit of the doc"
86
+ inferences. In the finding, name the CLAUDE.md path and quote the rule so the
87
+ report can cite it. If no CLAUDE.md applies, return nothing for this angle.
88
+
89
+ Cleanup, altitude, and conventions candidates use the same
90
+ `file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
91
+ cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
92
+ is broken) instead of a crash. Correctness bugs always outrank cleanup,
93
+ altitude, and conventions findings when the output cap forces a cut.
94
+
95
+ Pass every candidate with a nameable failure scenario through — finders that
96
+ silently drop half-believed candidates are the dominant cause of misses.
97
+
98
+ ## Phase 2 — Dedup only (no verify)
99
+
100
+ Pool all candidates. Dedup near-duplicates only (same defect, same location, same reason → keep one). Do NOT run verifiers; do NOT re-judge. Sort by severity.
101
+
102
+ ## Output
103
+
104
+ Target **at least 5 findings**. If fewer genuine findings exist, emit what you have — do not invent to hit the floor.
105
+
106
+ Return findings as a JSON array of at most 10 objects:
107
+
108
+ ```json
109
+ [
110
+ {
111
+ "file": "path/to/file.ext",
112
+ "line": 123,
113
+ "summary": "one-sentence statement of the bug",
114
+ "failure_scenario": "concrete inputs/state → wrong output/crash"
115
+ }
116
+ ]
117
+ ```
118
+
119
+ Ranked most-severe first. If more than 10 survive, keep the 10 most
120
+ severe. If nothing survives, return `[]`. Do not call the
121
+ ReportFindings tool even if it is available - this review's
122
+ output contract is the JSON block above.
@@ -0,0 +1,27 @@
1
+ `low effort → 1 diff pass → no verify → ≤4 findings`
2
+
3
+ ## Turn 1 — read
4
+
5
+ One tool call: read the unified diff (`git diff @{upstream}...HEAD; git diff HEAD`
6
+ to cover both committed and uncommitted changes, or `git diff main...HEAD` /
7
+ the target passed as an argument). Skip test/fixture
8
+ hunks (`test/`, `spec/`, `__tests__/`, `*_test.*`, `*.test.*`,
9
+ `fixtures/`, `testdata/`) — test-file changes are not reviewed at this level.
10
+ No subagents, no full-file reads.
11
+
12
+ ## Turn 2 — findings
13
+
14
+ Flag runtime-correctness bugs visible from the hunk alone: inverted/wrong
15
+ condition, off-by-one, null/undefined deref where adjacent lines show the value
16
+ can be absent, removed guard, falsy-zero check, missing `await`,
17
+ wrong-variable copy-paste, error swallowed in a catch that should propagate.
18
+ Also flag — still from the hunk alone — new code that duplicates an existing
19
+ helper visible in the diff context, and dead code the diff leaves behind.
20
+
21
+ Do **not** flag style, naming, perf, missing tests, or anything outside the
22
+ hunk.
23
+
24
+ Output at most **4 findings**, most-severe first, one line each:
25
+ `path/to/file.ext:123 — what's wrong and the concrete failure`. If nothing
26
+ qualifies, output exactly `(none)`. Do not call the
27
+ ReportFindings tool even if it is available.
@@ -0,0 +1,28 @@
1
+ `low effort → 1 diff pass → no verify → ≥min(files,4) findings`
2
+
3
+ ## Turn 1 — read
4
+
5
+ One tool call: read the unified diff (`git diff @{upstream}...HEAD; git diff HEAD`
6
+ to cover both committed and uncommitted changes, or `git diff main...HEAD` /
7
+ the target passed as an argument). Skip test/fixture
8
+ hunks (`test/`, `spec/`, `__tests__/`, `*_test.*`, `*.test.*`,
9
+ `fixtures/`, `testdata/`) — test-file changes are not reviewed at this level.
10
+ No subagents, no full-file reads.
11
+
12
+ ## Turn 2 — findings
13
+
14
+ Flag runtime-correctness bugs visible from the hunk alone: inverted/wrong
15
+ condition, off-by-one, null/undefined deref where adjacent lines show the value
16
+ can be absent, removed guard, falsy-zero check, missing `await`,
17
+ wrong-variable copy-paste, error swallowed in a catch that should propagate.
18
+ Also flag — still from the hunk alone — new code that duplicates an existing
19
+ helper visible in the diff context, and dead code the diff leaves behind.
20
+
21
+ Do **not** flag style, naming, perf, missing tests, or anything outside the
22
+ hunk.
23
+
24
+ Target **min(files_changed, 4) findings**, most-severe first, one
25
+ line each: `path/to/file.ext:123 — what's wrong and the concrete failure`.
26
+ If you have fewer, do one more pass focused on the largest changed file
27
+ and on any **removed** code blocks. Output `(none)` only if the diff is
28
+ trivially correct after that pass.