@skathio/somi 4.1.1 → 5.0.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 (372) hide show
  1. package/.claude-plugin/icon.png +0 -0
  2. package/.claude-plugin/marketplace.json +8 -3
  3. package/.claude-plugin/plugin.json +9 -10
  4. package/.copilot-extension/extension.json +32 -40
  5. package/.copilot-extension/marketplace.json +8 -3
  6. package/README.md +83 -228
  7. package/VERSION +1 -1
  8. package/agents/somi-reviewer.md +21 -40
  9. package/agents/somi-security-reviewer.md +16 -90
  10. package/agents/somi-worker-high.md +11 -0
  11. package/agents/somi-worker-low.md +11 -0
  12. package/agents/somi-worker-medium.md +11 -0
  13. package/agents/somi.md +8 -75
  14. package/commands/somi-config.md +5 -14
  15. package/commands/somi-deliver.md +11 -0
  16. package/commands/somi-quality.md +10 -0
  17. package/commands/somi-review.md +10 -0
  18. package/commands/somi-status.md +11 -0
  19. package/commands/somi.md +10 -0
  20. package/hooks/hooks.json +28 -23
  21. package/hooks/lib/common.mjs +45 -34
  22. package/hooks/pre-tool/apply-tier.mjs +31 -0
  23. package/hooks/pre-tool/block-dangerous-bash.mjs +15 -0
  24. package/hooks/pre-tool/gate-dep-install.mjs +2 -2
  25. package/hooks/pre-tool/guard-protected-paths.mjs +9 -16
  26. package/hooks/pre-tool/guard-tier-config.mjs +17 -0
  27. package/hooks/pre-tool/reviewers-read-only.mjs +11 -0
  28. package/hooks/session-start/inject-digest.mjs +51 -0
  29. package/hooks/stop/review-due.mjs +40 -0
  30. package/hooks/user-prompt/capture-prompt.mjs +17 -0
  31. package/library/lenses/architecture.md +1 -0
  32. package/library/lenses/test-strategy.md +1 -0
  33. package/library/roles/accessibility.md +1 -0
  34. package/library/roles/answer.md +1 -0
  35. package/library/roles/atlas.md +1 -0
  36. package/library/roles/build.md +1 -0
  37. package/library/roles/debug.md +6 -0
  38. package/library/roles/design.md +1 -0
  39. package/library/roles/discover.md +1 -0
  40. package/library/roles/incident.md +1 -0
  41. package/library/roles/migrate.md +1 -0
  42. package/library/roles/perf.md +1 -0
  43. package/library/roles/plan.md +1 -0
  44. package/library/roles/refactor.md +1 -0
  45. package/library/roles/review.md +1 -0
  46. package/library/roles/security-review.md +1 -0
  47. package/library/roles/upgrade.md +1 -0
  48. package/library/skills/accessibility.md +16 -0
  49. package/library/skills/ci-infra-gotchas.md +12 -0
  50. package/library/skills/perf-method.md +10 -0
  51. package/library/skills/secure-coding.md +18 -0
  52. package/library/skills/testing-checklist.md +16 -0
  53. package/library/skills/threat-modeling.md +10 -0
  54. package/package.json +12 -17
  55. package/profiles/claude.json +21 -0
  56. package/profiles/copilot.json +5 -0
  57. package/rules/digest.md +40 -0
  58. package/scripts/check-links.mjs +65 -76
  59. package/scripts/lib/advisor.mjs +207 -0
  60. package/scripts/lib/check.mjs +165 -0
  61. package/scripts/lib/copilot-workflow.mjs +41 -0
  62. package/scripts/lib/doctor.mjs +91 -0
  63. package/scripts/lib/gates.mjs +69 -0
  64. package/scripts/lib/git-tree.mjs +201 -0
  65. package/scripts/lib/init.mjs +23 -0
  66. package/scripts/lib/ledger.mjs +38 -0
  67. package/scripts/lib/mcp-project-root.mjs +63 -67
  68. package/scripts/lib/migrate.mjs +73 -0
  69. package/scripts/lib/path-facts.mjs +2 -2
  70. package/scripts/lib/path-safety.mjs +6 -134
  71. package/scripts/lib/plan.mjs +69 -0
  72. package/scripts/lib/policy.mjs +103 -0
  73. package/scripts/lib/pr.mjs +28 -0
  74. package/scripts/lib/prompt.mjs +72 -0
  75. package/scripts/lib/quality/clones.mjs +76 -0
  76. package/scripts/lib/quality/css.mjs +43 -0
  77. package/scripts/lib/quality/gate.mjs +230 -0
  78. package/scripts/lib/quality/limits.mjs +73 -0
  79. package/scripts/lib/quality/metrics.mjs +159 -0
  80. package/scripts/lib/quality/parse.mjs +73 -0
  81. package/scripts/lib/quality/repo.mjs +69 -0
  82. package/scripts/lib/quality/run.mjs +38 -0
  83. package/scripts/lib/reviews.mjs +132 -0
  84. package/scripts/lib/routes.mjs +108 -0
  85. package/scripts/lib/setup.mjs +34 -0
  86. package/scripts/lib/shards.mjs +166 -0
  87. package/scripts/lib/signals.mjs +110 -0
  88. package/scripts/lib/state.mjs +42 -0
  89. package/scripts/lib/tiers.mjs +42 -0
  90. package/scripts/lib/update-notice.mjs +48 -0
  91. package/scripts/lib/views.mjs +62 -0
  92. package/scripts/lib/workflows.mjs +56 -0
  93. package/scripts/somi-mcp.mjs +181 -323
  94. package/scripts/somi.mjs +208 -0
  95. package/scripts/vendor/tree-sitter/LICENSE.vscode-tree-sitter-wasm +21 -0
  96. package/scripts/vendor/tree-sitter/LICENSE.web-tree-sitter +21 -0
  97. package/scripts/vendor/tree-sitter/cgmanifest.vscode-tree-sitter-wasm.json +16 -0
  98. package/scripts/vendor/tree-sitter/manifest.json +59 -0
  99. package/scripts/vendor/tree-sitter/package.json +3 -0
  100. package/scripts/vendor/tree-sitter/tree-sitter-css.wasm +0 -0
  101. package/scripts/vendor/tree-sitter/tree-sitter-javascript.wasm +0 -0
  102. package/scripts/vendor/tree-sitter/tree-sitter-tsx.wasm +0 -0
  103. package/scripts/vendor/tree-sitter/tree-sitter-typescript.wasm +0 -0
  104. package/scripts/vendor/tree-sitter/web-tree-sitter.js +4081 -0
  105. package/scripts/vendor/tree-sitter/web-tree-sitter.wasm +0 -0
  106. package/skills/somi-expertise/SKILL.md +6 -0
  107. package/workflows/deliver-stages.js +81 -0
  108. package/.claude/settings.json +0 -131
  109. package/agents/somi-architecture-reviewer.md +0 -101
  110. package/agents/somi-atlas.md +0 -100
  111. package/agents/somi-coder.md +0 -60
  112. package/agents/somi-designer.md +0 -36
  113. package/agents/somi-discovery-analyst.md +0 -57
  114. package/agents/somi-flow.md +0 -47
  115. package/agents/somi-general.md +0 -36
  116. package/agents/somi-impact.md +0 -95
  117. package/agents/somi-incident.md +0 -94
  118. package/agents/somi-plan-reviewer.md +0 -68
  119. package/agents/somi-planner.md +0 -57
  120. package/agents/somi-pr.md +0 -99
  121. package/agents/somi-refactor-designer.md +0 -81
  122. package/agents/somi-refactorer.md +0 -99
  123. package/agents/somi-sdlc-reviewer.md +0 -67
  124. package/agents/somi-test-strategist.md +0 -87
  125. package/commands/adopt.md +0 -14
  126. package/commands/architecture-review.md +0 -19
  127. package/commands/atlas.md +0 -19
  128. package/commands/code-loop.md +0 -19
  129. package/commands/code-parallel.md +0 -19
  130. package/commands/code.md +0 -19
  131. package/commands/debug.md +0 -19
  132. package/commands/design.md +0 -19
  133. package/commands/discover.md +0 -19
  134. package/commands/impact.md +0 -19
  135. package/commands/incident.md +0 -19
  136. package/commands/plan-loop.md +0 -19
  137. package/commands/plan.md +0 -19
  138. package/commands/pr.md +0 -19
  139. package/commands/refactor-design.md +0 -19
  140. package/commands/refactor.md +0 -19
  141. package/commands/release-readiness.md +0 -19
  142. package/commands/review-panel.md +0 -19
  143. package/commands/review.md +0 -19
  144. package/commands/security-review.md +0 -19
  145. package/commands/ship-loop.md +0 -19
  146. package/commands/ship.md +0 -19
  147. package/commands/test-strategy.md +0 -19
  148. package/commands/upgrade.md +0 -19
  149. package/examples/README.md +0 -19
  150. package/examples/code-review-example.md +0 -88
  151. package/examples/discovery-example.md +0 -200
  152. package/examples/feature-plan-example.md +0 -377
  153. package/examples/full-pipeline-example.md +0 -188
  154. package/examples/sample-consumer/.claude/settings.json +0 -29
  155. package/examples/sample-consumer/CLAUDE.md +0 -78
  156. package/examples/sample-consumer/README.md +0 -102
  157. package/hooks/post-tool/lint-changed-files.mjs +0 -209
  158. package/hooks/pre-tool/guard-cost-lowering.mjs +0 -192
  159. package/hooks/session-start/detect-repo-instructions.mjs +0 -287
  160. package/hooks/session-start/ensure-default-config.mjs +0 -113
  161. package/hooks/user-prompt-submit/inject-workflow-context.mjs +0 -580
  162. package/rules/00-priorities.md +0 -48
  163. package/rules/10-solid.md +0 -87
  164. package/rules/20-clean-code.md +0 -62
  165. package/rules/30-security-owasp.md +0 -83
  166. package/rules/40-engineering-practices.md +0 -65
  167. package/rules/50-collaboration.md +0 -114
  168. package/rules/99-overrides.md +0 -52
  169. package/rules/CLAUDE.md +0 -200
  170. package/scripts/check-session-artefacts.mjs +0 -149
  171. package/scripts/check-size-budget.mjs +0 -137
  172. package/scripts/generate-digest.mjs +0 -176
  173. package/scripts/lib/agent-info.mjs +0 -85
  174. package/scripts/lib/agent-registry.mjs +0 -92
  175. package/scripts/lib/cost-ceiling.mjs +0 -328
  176. package/scripts/lib/cost-config-edit.mjs +0 -102
  177. package/scripts/lib/cost-config.mjs +0 -64
  178. package/scripts/lib/cost-defaults.mjs +0 -53
  179. package/scripts/lib/cost-lowering.mjs +0 -89
  180. package/scripts/lib/cost-model.mjs +0 -110
  181. package/scripts/lib/dispatch-resolver.mjs +0 -243
  182. package/scripts/lib/escalation-facts.mjs +0 -146
  183. package/scripts/lib/escalation.mjs +0 -129
  184. package/scripts/lib/findings-ledger.mjs +0 -241
  185. package/scripts/lib/install-text.mjs +0 -97
  186. package/scripts/lib/loop-caps.mjs +0 -140
  187. package/scripts/lib/loop-diff.mjs +0 -38
  188. package/scripts/lib/loop-dispatch.mjs +0 -19
  189. package/scripts/lib/loop-engine.mjs +0 -227
  190. package/scripts/lib/loop-escalate.mjs +0 -49
  191. package/scripts/lib/loop-exit.mjs +0 -47
  192. package/scripts/lib/loop-notes-compact.mjs +0 -72
  193. package/scripts/lib/loop-notes.mjs +0 -282
  194. package/scripts/lib/loop-review.mjs +0 -395
  195. package/scripts/lib/loop-state.mjs +0 -44
  196. package/scripts/lib/loop-step-close.mjs +0 -75
  197. package/scripts/lib/loop-step-kit.mjs +0 -179
  198. package/scripts/lib/loop-step-review.mjs +0 -140
  199. package/scripts/lib/loop-step-tool.mjs +0 -89
  200. package/scripts/lib/loop-step.mjs +0 -303
  201. package/scripts/lib/run-budget.mjs +0 -28
  202. package/scripts/lib/run-card.mjs +0 -73
  203. package/scripts/lib/size-tier.mjs +0 -184
  204. package/scripts/lib/tier-record.mjs +0 -82
  205. package/scripts/size-budget-overrides.json +0 -58
  206. package/scripts/somi-card.mjs +0 -39
  207. package/scripts/somi-check.mjs +0 -237
  208. package/scripts/somi-config.mjs +0 -421
  209. package/scripts/somi-dispatch.mjs +0 -141
  210. package/scripts/somi-findings.mjs +0 -100
  211. package/scripts/somi-loop.mjs +0 -139
  212. package/scripts/somi-tier.mjs +0 -393
  213. package/scripts/validate.sh +0 -653
  214. package/skills/api-design/SKILL.md +0 -147
  215. package/skills/clean-code/SKILL.md +0 -142
  216. package/skills/flow-adopt/SKILL.md +0 -92
  217. package/skills/flow-architecture-review/SKILL.md +0 -94
  218. package/skills/flow-atlas/SKILL.md +0 -34
  219. package/skills/flow-code/SKILL.md +0 -167
  220. package/skills/flow-code-loop/SKILL.md +0 -263
  221. package/skills/flow-code-parallel/SKILL.md +0 -160
  222. package/skills/flow-debug/SKILL.md +0 -141
  223. package/skills/flow-design/SKILL.md +0 -170
  224. package/skills/flow-discover/SKILL.md +0 -204
  225. package/skills/flow-impact/SKILL.md +0 -35
  226. package/skills/flow-incident/SKILL.md +0 -49
  227. package/skills/flow-plan/SKILL.md +0 -254
  228. package/skills/flow-plan-loop/SKILL.md +0 -254
  229. package/skills/flow-pr/SKILL.md +0 -34
  230. package/skills/flow-refactor/SKILL.md +0 -58
  231. package/skills/flow-refactor-design/SKILL.md +0 -97
  232. package/skills/flow-release-readiness/SKILL.md +0 -82
  233. package/skills/flow-review/SKILL.md +0 -193
  234. package/skills/flow-review-panel/SKILL.md +0 -154
  235. package/skills/flow-security-review/SKILL.md +0 -83
  236. package/skills/flow-ship/SKILL.md +0 -125
  237. package/skills/flow-ship-loop/SKILL.md +0 -274
  238. package/skills/flow-somi-config/SKILL.md +0 -142
  239. package/skills/flow-status/SKILL.md +0 -43
  240. package/skills/flow-test-strategy/SKILL.md +0 -83
  241. package/skills/flow-upgrade/SKILL.md +0 -82
  242. package/skills/market-research/SKILL.md +0 -125
  243. package/skills/observability/SKILL.md +0 -133
  244. package/skills/owasp-defense/SKILL.md +0 -141
  245. package/skills/plan-review/SKILL.md +0 -83
  246. package/skills/reasoning-craft/SKILL.md +0 -213
  247. package/skills/requirements-engineering/SKILL.md +0 -137
  248. package/skills/role-coder/SKILL.md +0 -247
  249. package/skills/role-designer/SKILL.md +0 -172
  250. package/skills/role-discovery-analyst/SKILL.md +0 -288
  251. package/skills/role-planner/SKILL.md +0 -353
  252. package/skills/role-reviewer/SKILL.md +0 -218
  253. package/skills/rules/SKILL.md +0 -47
  254. package/skills/sdlc-process/SKILL.md +0 -74
  255. package/skills/solid-principles/SKILL.md +0 -143
  256. package/skills/somi-checkpoint/SKILL.md +0 -95
  257. package/skills/somi-dispatch/SKILL.md +0 -259
  258. package/skills/somi-routing/SKILL.md +0 -158
  259. package/skills/testing-playbook/SKILL.md +0 -133
  260. package/skills/threat-modeling/SKILL.md +0 -117
  261. package/templates/ADR.md.tmpl +0 -73
  262. package/templates/ATLAS.md.tmpl +0 -75
  263. package/templates/BRD.md.tmpl +0 -68
  264. package/templates/BRIEF.md.tmpl +0 -119
  265. package/templates/CONTEXT.md.tmpl +0 -74
  266. package/templates/DECISIONS.md.tmpl +0 -105
  267. package/templates/DESIGN.md.tmpl +0 -83
  268. package/templates/DIARY.md.tmpl +0 -70
  269. package/templates/DOD.md.tmpl +0 -90
  270. package/templates/FRD.md.tmpl +0 -64
  271. package/templates/PHASE.md.tmpl +0 -80
  272. package/templates/PROGRESS.md.tmpl +0 -63
  273. package/templates/RCA.md.tmpl +0 -53
  274. package/templates/RD-README.md.tmpl +0 -70
  275. package/templates/RESEARCH.md.tmpl +0 -96
  276. package/templates/REVIEW.md.tmpl +0 -82
  277. package/templates/SDD.md.tmpl +0 -82
  278. package/templates/SOMI-README.md.tmpl +0 -83
  279. package/templates/SPEC.md.tmpl +0 -123
  280. package/templates/SRS.md.tmpl +0 -85
  281. package/templates/TDD.md.tmpl +0 -77
  282. package/tests/hooks/cases/audit-log.json +0 -21
  283. package/tests/hooks/cases/block-dangerous-bash.json +0 -166
  284. package/tests/hooks/cases/block-secret-writes.json +0 -140
  285. package/tests/hooks/cases/detect-repo-instructions.json +0 -105
  286. package/tests/hooks/cases/gate-dep-install.json +0 -42
  287. package/tests/hooks/cases/guard-protected-paths.json +0 -222
  288. package/tests/hooks/cases/inject-workflow-context.json +0 -239
  289. package/tests/hooks/cases/lint-changed-files.json +0 -120
  290. package/tests/hooks/run.sh +0 -392
  291. package/tests/scripts/agent-model-frontmatter.sh +0 -38
  292. package/tests/scripts/agent-names.sh +0 -77
  293. package/tests/scripts/check-frontmatter.sh +0 -37
  294. package/tests/scripts/check-links.sh +0 -105
  295. package/tests/scripts/check-session-artefacts.sh +0 -60
  296. package/tests/scripts/check-size-budget.sh +0 -71
  297. package/tests/scripts/checkpoint-gate.sh +0 -131
  298. package/tests/scripts/convergence-runner.sh +0 -1514
  299. package/tests/scripts/cost-ceiling.sh +0 -255
  300. package/tests/scripts/cost-defaults.sh +0 -130
  301. package/tests/scripts/cost-hardcap.sh +0 -338
  302. package/tests/scripts/cost-lowering.sh +0 -261
  303. package/tests/scripts/cost-model.sh +0 -196
  304. package/tests/scripts/dispatch-guard.sh +0 -108
  305. package/tests/scripts/dispatch-line-gate.sh +0 -61
  306. package/tests/scripts/dispatch-reference-gate.sh +0 -173
  307. package/tests/scripts/ensure-default-config.sh +0 -162
  308. package/tests/scripts/escalation.sh +0 -409
  309. package/tests/scripts/eval-runner.sh +0 -3692
  310. package/tests/scripts/evals-packaging.sh +0 -224
  311. package/tests/scripts/fact-sheet.sh +0 -296
  312. package/tests/scripts/fixtures/legacy-shard-no-schema.json +0 -50
  313. package/tests/scripts/fixtures/mock-stdin-read-throw.cjs +0 -18
  314. package/tests/scripts/fixtures/size-tier-cases.json +0 -87
  315. package/tests/scripts/generate-digest.sh +0 -180
  316. package/tests/scripts/global-config.sh +0 -167
  317. package/tests/scripts/goldens/loop-state-breach.json +0 -1
  318. package/tests/scripts/goldens/loop-state-done.json +0 -1
  319. package/tests/scripts/goldens/somi-findings.json +0 -336
  320. package/tests/scripts/goldens/somi-loop.json +0 -168
  321. package/tests/scripts/lib/adr-shape.mjs +0 -41
  322. package/tests/scripts/lib/agent-registry-tests.mjs +0 -95
  323. package/tests/scripts/lib/brief-only-guard.mjs +0 -27
  324. package/tests/scripts/lib/checkpoint-gate.mjs +0 -91
  325. package/tests/scripts/lib/digest-marker-coupling.mjs +0 -52
  326. package/tests/scripts/lib/dispatch-reference-gate.mjs +0 -121
  327. package/tests/scripts/lib/escalation-facts-tests.mjs +0 -140
  328. package/tests/scripts/lib/escalation-tests.mjs +0 -154
  329. package/tests/scripts/lib/findings-ledger-tests.mjs +0 -118
  330. package/tests/scripts/lib/loop-engine-tests.mjs +0 -287
  331. package/tests/scripts/lib/loop-escalate-tests.mjs +0 -356
  332. package/tests/scripts/lib/loop-flow-gate.mjs +0 -173
  333. package/tests/scripts/lib/loop-notes-tests.mjs +0 -384
  334. package/tests/scripts/lib/loop-step-cli-tests.mjs +0 -156
  335. package/tests/scripts/lib/loop-step-close-tests.mjs +0 -351
  336. package/tests/scripts/lib/loop-step-lenient-tests.mjs +0 -114
  337. package/tests/scripts/lib/loop-step-state-tests.mjs +0 -127
  338. package/tests/scripts/lib/loop-step-tests.mjs +0 -499
  339. package/tests/scripts/lib/loop-step-unwritten-tests.mjs +0 -55
  340. package/tests/scripts/lib/multipass-dependence.mjs +0 -192
  341. package/tests/scripts/lib/multipass-source-identity.mjs +0 -243
  342. package/tests/scripts/lib/path-facts-tests.mjs +0 -198
  343. package/tests/scripts/lib/path-safety-tests.mjs +0 -201
  344. package/tests/scripts/lib/reference-pair.mjs +0 -61
  345. package/tests/scripts/lib/retirement-gate.mjs +0 -172
  346. package/tests/scripts/lib/run-suites.mjs +0 -139
  347. package/tests/scripts/lib/shell-embedded-js.mjs +0 -47
  348. package/tests/scripts/lib/ship-loop-sizing-guard.mjs +0 -52
  349. package/tests/scripts/lib/site-roadmap-gate.mjs +0 -64
  350. package/tests/scripts/lib/size-tier-drift.mjs +0 -74
  351. package/tests/scripts/lib/sizing-score-tests.mjs +0 -210
  352. package/tests/scripts/lib/sizing-set-tests.mjs +0 -131
  353. package/tests/scripts/lib/somi-mcp-client.mjs +0 -102
  354. package/tests/scripts/lib/somi-mcp-config-tests.mjs +0 -92
  355. package/tests/scripts/lib/somi-mcp-loop-tests.mjs +0 -226
  356. package/tests/scripts/lib/somi-mcp-tests.mjs +0 -491
  357. package/tests/scripts/lib/somi-mcp-tier-tests.mjs +0 -64
  358. package/tests/scripts/lib/somi-mcp-tool-schema.mjs +0 -38
  359. package/tests/scripts/loop-engine.sh +0 -22
  360. package/tests/scripts/loop-flow-gate.sh +0 -11
  361. package/tests/scripts/retirement-gate.sh +0 -306
  362. package/tests/scripts/review-panel-seats.sh +0 -32
  363. package/tests/scripts/run-card.sh +0 -57
  364. package/tests/scripts/run-suites.sh +0 -74
  365. package/tests/scripts/run.sh +0 -689
  366. package/tests/scripts/site-roadmap-gate.sh +0 -76
  367. package/tests/scripts/size-tier.sh +0 -562
  368. package/tests/scripts/somi-agent-dispatch-contract.sh +0 -224
  369. package/tests/scripts/somi-config.sh +0 -286
  370. package/tests/scripts/somi-dispatch.sh +0 -465
  371. package/tests/scripts/somi-mcp.sh +0 -15
  372. package/tests/scripts/suite-plan.json +0 -20
@@ -1,97 +0,0 @@
1
- ---
2
- name: flow-refactor-design
3
- description: The /refactor-design procedure, loaded by the /refactor-design command and by the somi-flow runner.
4
- user-invocable: false
5
- ---
6
-
7
- # /refactor-design — Large-refactor scope design
8
-
9
- You are running the **refactor-designer** workflow of somi — the front-loaded, expensive-reasoning
10
- step for a refactor too big for one safe diff: it spans many modules, needs a migration, or changes
11
- a shared shape. Rather than editing, this command **designs the refactor scope** and compiles it
12
- into a [`brief.md`](../../templates/BRIEF.md.tmpl) that the cheaper tier executes via
13
- [`/plan-loop`](../flow-plan-loop/SKILL.md) → [`/code-loop`](../flow-code-loop/SKILL.md).
14
-
15
- > **The judgment-heavy core runs at the most capable tier — on the agent, not the command**, like
16
- > [`/design`](../flow-design/SKILL.md). This command declares no `cost:` and no `model:` of its own; it runs on
17
- > whatever model this session is already using, and Tasks the
18
- > [`somi-refactor-designer`](../../agents/somi-refactor-designer.md) agent for the judgment-heavy core of the
19
- > work (naming the destination shape, mapping seams and risks, confirming test-coverage gaps); its
20
- > `brief.md` anchors the whole refactor, so the agent defaults to `high` with no lower member.
21
- > This command still does real work of its own — scaffolding the artifact set and owning the
22
- > crossroads conversation with the user, which can't live inside a single `Task` call because a
23
- > Tasked run can't pause to converse — but that work has no `cost:` of its own to declare. Split
24
- > out from [`/refactor`](../flow-refactor/SKILL.md) because mode
25
- > selection (surgical vs. scope design) and tier selection (`medium` vs. `high`) are two different
26
- > decisions — one unit naming both let one tier become a claim its own procedure could
27
- > contradict (a large refactor under a `medium` ceiling would have entered scope-design work at a
28
- > tier its own text called insufficient). [`/refactor`](../flow-refactor/SKILL.md) stays the default for a
29
- > small, named smell that fits one safe diff; use this command when the destination needs more
30
- > than one reviewable diff.
31
-
32
- The user's refactor target: **$ARGUMENTS**
33
-
34
- ## What to do
35
-
36
- ### 1. Validate scope
37
-
38
- If the target is genuinely small enough for one safe diff, say so and recommend
39
- [`/refactor`](../flow-refactor/SKILL.md) instead — don't manufacture a design pass for a surgical change.
40
-
41
- ### 2. Pick the slug and scaffold
42
-
43
- Derive a short, plain-language kebab-case slug (e.g., `untangle-order-service`); confirm with the
44
- user. Create `.somi/plans/<slug>/` with the same artifact set [`/design`](../flow-design/SKILL.md) uses, from
45
- [`templates/`](../../templates/): `design.md` (destination shape + seam/risk map), `decisions.md`
46
- (ADR-style, user-verified), `brief.md` (the load-bearing design→execution handoff), `diary.md`.
47
- `context.md`, `spec.md`, `phases/`, and `progress.md` are **the planner's** to create when
48
- [`/plan`](../flow-plan/SKILL.md) runs. If `.somi/README.md` does not yet exist at the repo root, also write it
49
- from [`templates/SOMI-README.md.tmpl`](../../templates/SOMI-README.md.tmpl), same as `/design`.
50
-
51
- ### 3. Invoke the `somi-refactor-designer` agent
52
-
53
- Before this `Task`, call `somi_resolve` for `somi-refactor-designer` (with `project_dir`), pass its `model`, start it as its `agent_type`, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
54
- (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Brief
55
- [`agents/somi-refactor-designer.md`](../../agents/somi-refactor-designer.md) via the Task tool with: the
56
- refactor target, the slug and paths, and a reminder to name the destination shape, map the seams
57
- and risks (`file:line`), confirm or raise test-coverage gaps, and compile the brief.
58
-
59
- ### 4. Repo-awareness (respect as context)
60
-
61
- Same as [`/design`](../flow-design/SKILL.md) §5: read the repo's own instruction files once, distil into the
62
- brief's **"Repo conventions in force"** section, never auto-invoke the repo's own agents.
63
-
64
- ### 5. Verification protocol (the batch round-trip)
65
-
66
- Surface the destination shape and migration approach to the user before handing off — the shared
67
- batch round-trip ([`skills/flow-plan/SKILL.md`](../flow-plan/SKILL.md) §5): the research pass returns a
68
- `DECISIONS-NEEDED` block, this command presents it, and re-invokes the agent with a
69
- `VERIFIED-DECISIONS` block appended before it records `decisions.md` and compiles the brief. That
70
- re-invocation resolves fresh too — call `somi_resolve` for `somi-refactor-designer` again before it, the
71
- same as the first Task (full rules: the `somi-dispatch` skill).
72
-
73
- ### 6. The brief is the deliverable
74
-
75
- Same bar as `/design`'s: dense, bounded per [`templates/BRIEF.md.tmpl`](../../templates/BRIEF.md.tmpl),
76
- reference-not-inline, with a concrete "What execution does NOT need to re-research" section. For a
77
- high-stakes refactor, review
78
- it at `high` via [`/review`](../flow-review/SKILL.md) `design <slug>` (fresh context, bounded) first.
79
-
80
- ### 7. Summarise back
81
-
82
- - One-paragraph framing of the destination shape.
83
- - The seam/risk map (`file:line`) and any test-coverage gaps confirmed or raised.
84
- - A pointer to `.somi/plans/<slug>/brief.md`.
85
- - Next step: "Review `brief.md`, then run `/plan <slug>` (default `medium`)."
86
-
87
- ## Guardrails
88
-
89
- - **Do not edit code.** This command designs scope only; execution runs via `/plan-loop` → `/code-loop`.
90
- - **No behavior changes designed in.** If the destination requires one, that's a feature, not a refactor — stop and say so.
91
- - **Do not skip verification** for the destination shape and the migration approach.
92
- - **No artifact outside `.somi/plans/<slug>/`.**
93
-
94
- ## Quality bar
95
-
96
- See [`agents/somi-refactor-designer.md`](../../agents/somi-refactor-designer.md). The brief alone must let a
97
- planner sequence the work and a coder execute it without re-deriving the seam/risk map.
@@ -1,82 +0,0 @@
1
- ---
2
- name: flow-release-readiness
3
- description: The /release-readiness procedure, loaded by the /release-readiness command and by the somi-flow runner.
4
- user-invocable: false
5
- ---
6
-
7
- # /release-readiness — The pre-release gate
8
-
9
- > **Scripts.** Every `node scripts/...` below runs from SoMi's install root, `${CLAUDE_PLUGIN_ROOT}`
10
- > (Claude Code fills in the real path when it loads this skill). Where that still reads as a variable, use
11
- > the root you already know; never search the disk for it.
12
-
13
- You are running the **release-readiness check**: is this set of work actually ready to ship?
14
- Most of this is **deterministic aggregation over artifacts that already exist** — the model
15
- spend goes to exactly one place: a fresh-eyes review of the *integration surface*, which
16
- per-iteration reviews structurally miss.
17
-
18
- > **No `cost:` of its own, and no `model:` either — it runs on whatever model this session is
19
- > already using.** Stages 1 and 3 read and write
20
- > directly, inline, at whatever tier is already running this command. Stage 2, the one expensive
21
- > step, Tasks the [`somi-reviewer`](../../agents/somi-reviewer.md) agent, which defaults to `high`
22
- > on its own account and resolves against the session ceiling independently of this command.
23
-
24
- Scope: **$ARGUMENTS** (one or more work-item slugs, or a milestone description; empty = every
25
- work item in `.somi/plans/` not marked `done`+merged).
26
-
27
- ## Stage 1 — Deterministic checklist (no judgment, no model spend)
28
-
29
- For each in-scope work item, check mechanically and record pass/fail + evidence:
30
-
31
- | Check | Source |
32
- |---|---|
33
- | All phases/iterations `done` | `progress.md` tables |
34
- | No `open` Blocker/Major findings | `node scripts/somi-findings.mjs open --slug <slug>` |
35
- | No decisions outstanding | `progress.md` "Decisions outstanding" |
36
- | Work-item DoD satisfiable | `spec.md` §12 checkboxes vs. reality (tests green? docs updated?) |
37
- | Rollout & rollback sections real | `spec.md` §10 — non-empty, names a flag/metric, rollback is executable not aspirational |
38
- | Security items landed, not deferred | `spec.md` §8 mitigations vs. the diffs; `somi-security-reviewer` consulted where §8 gated it |
39
- | No interrupted loops | `.somi/somi-state/loop/*.json` with `status: running` for in-scope slugs |
40
- | Follow-ups triaged | `progress.md` follow-ups each either scheduled or explicitly accepted for post-release |
41
- | Working tree honest | `node scripts/somi-check.mjs --all` (secrets, lockfile hand-edits, loose ends) |
42
-
43
- Any hard failure here (open Blocker, red tests, unexecutable rollback) → the verdict is already
44
- `not-ready`; finish the checklist anyway so the report is complete, but say it early.
45
-
46
- ## Stage 2 — High-cost integration review (the one expensive step)
47
-
48
- Per-iteration reviews saw each diff in isolation. Task the [`somi-reviewer`](../../agents/somi-reviewer.md)
49
- (defaults to `high`; it runs at the session ceiling unless `cost.agents` pins it; pin it
50
- to `high` for the fresh-context depth this stage wants). Before this `Task`, call `somi_resolve` for
51
- `somi-reviewer` (with `project_dir`), pass its `model`, start it as its `agent_type`, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`, or `somi:somi-dispatch` on Claude
52
- Code). Task it on the **cumulative release diff** (merge-base of
53
- the release scope vs. the default branch) with an explicit integration framing: interactions **between** the work
54
- items, contract mismatches across independently-reviewed changes, migration ordering across
55
- items, config/flag interactions, and observability of the release as a whole ("when this ships
56
- and something degrades, what tells us which work item did it?"). Skip only if the release is a
57
- single already-panel-reviewed work item.
58
-
59
- Record its findings into the ledger(s) (`somi-findings.mjs record`) like any review.
60
-
61
- ## Stage 3 — Verdict + release notes
62
-
63
- Write `.somi/reviews/_ad-hoc/<YYYY-MM-DD>-release-<verdict>.md` (or under the single slug when
64
- scope is one work item) using [`templates/REVIEW.md.tmpl`](../../templates/REVIEW.md.tmpl) framing:
65
-
66
- - **Verdict**: `ready` / `ready-with-conditions` (name them — each with an owner) / `not-ready`
67
- (the blocking list, each with its fastest path to green).
68
- - The Stage 1 table with evidence, and Stage 2's findings.
69
- - **Draft release notes**, generated from the work items' spec §1 framings and diary
70
- plan-change entries — what shipped, what changed along the way, migration/operator notes
71
- (from spec §10). Mark it a draft for human editing.
72
-
73
- Summarise back: verdict first, then the two or three load-bearing facts behind it, pointers.
74
-
75
- ## Guardrails
76
-
77
- - **The checklist cannot be argued green.** A failed deterministic check is a fact; the model
78
- doesn't soften it to `ready-with-conditions` without a named human owner for each condition.
79
- - **Read-only against the release** — this command gates, it doesn't fix. Fixes go through
80
- `/code` / `/debug` on the owning work item.
81
- - **One high-cost pass, deliberately.** The economics of this command are the checklist doing 90%
82
- of the work for free; don't Task a panel per work item — the per-iteration reviews already ran.
@@ -1,193 +0,0 @@
1
- ---
2
- name: flow-review
3
- description: The /review procedure, loaded by the /review command and by the somi-flow runner.
4
- user-invocable: false
5
- ---
6
-
7
- # /review — Reviewing workflow
8
-
9
- > **Scripts.** Every `node scripts/...` below runs from SoMi's install root, `${CLAUDE_PLUGIN_ROOT}`
10
- > (Claude Code fills in the real path when it loads this skill). Where that still reads as a variable, use
11
- > the root you already know; never search the disk for it.
12
-
13
- You are running the **reviewing workflow** of somi.
14
-
15
- The user's review target: **$ARGUMENTS** (empty = the current working-tree diff vs. the default
16
- branch, scoped to the single in-progress work item if exactly one exists).
17
-
18
- > **Note:** plan-level review is part of this command. Use `plan <slug>` (or pass an `.somi/plans/`
19
- > path) to review a spec/decisions/phases set instead of a diff. Use `design <slug>` to review a
20
- > `cost: high` design + `brief.md` (from [`/design`](../flow-design/SKILL.md), [`/discover`](../flow-discover/SKILL.md), or
21
- > [`/refactor-design`](../flow-refactor-design/SKILL.md)) before it hands off to execution. There is no separate
22
- > `/plan-review` or `/design-review` command — this is the single deepest review surface.
23
-
24
- > **Fresh-context review (bias avoidance).** The `somi-reviewer` (and any consultant) is **always** Tasked
25
- > on a **cold context** — given the artifacts to review (diff, plan, or design/brief) and the spec,
26
- > **not** the producing agent's reasoning or conversation. A reviewer that inherits the author's
27
- > chain of thought rationalizes the author's choices instead of testing them. The subagent boundary
28
- > gives this for free; preserve it — never paste the planner's/coder's/designer's transcript into the
29
- > reviewer's brief. (It also keeps the model-scoped prompt cache clean and trims tokens.)
30
-
31
- ## What to do
32
-
33
- ### 1. Resolve the target
34
-
35
- - **A work-item slug** (e.g. `rate-limiting-webhooks`) → review the latest iteration's diff against
36
- the spec/phases for that work item.
37
- - **Empty / "working tree"** → `git diff` and `git status`. If exactly one work item has
38
- `status: in-progress` in `.somi/plans/`, scope the review to it.
39
- - **A revision range** (e.g. `main..feature-x`) → use that range.
40
- - **A PR number** (e.g. `#1234`) → fetch via `gh pr view --json` / `gh pr diff`; otherwise ask
41
- the user for the diff.
42
- - **`plan <slug>`** → review the spec/decisions/phases for that work item, not its code. If
43
- exactly one work item has `status: awaiting-approval` or `planning` in `.somi/plans/` and the
44
- user typed bare `plan`, use it.
45
- - **`design <slug>`** → review a `cost: high` design + handoff: `design.md` (or the
46
- `.somi/rd/<slug>/` doc set for discovery), `decisions.md`, and especially **`brief.md`**. This is
47
- the "high cost reviewed at high cost" pass — calibrate as a plan review (cheaper to fix here), and
48
- additionally check the brief is **dense, bounded, reference-not-inline**, and that its **"What
49
- execution does NOT need to re-research"** section is concrete enough to actually save execution
50
- the research.
51
- - **A file path** → review the file (typically an ADR or design doc outside `.somi/`).
52
-
53
- ### 2. Read for intent first
54
-
55
- Find the relevant work item's `spec.md`, the iteration's `phases/<NN>-*.md`, recent diary entries,
56
- and commit messages. If you can't tell what the change is for, that's finding #1.
57
-
58
- **Check the findings ledger before reviewing** (when scoped to a work item):
59
- `node scripts/somi-findings.mjs open --slug <slug>` lists the still-open findings from previous
60
- reviews (`.somi/reviews/<slug>/findings.json`). Pass them to the reviewer with the instruction to
61
- **verify each one's resolution first** — confirmed fixed, still present, or accepted — before
62
- hunting new findings. A re-review that rediscovers a known finding from scratch wastes the ledger;
63
- one that silently drops a still-open finding is worse.
64
-
65
- For **plan reviews**, read the plan in full — don't skim. The point of plan review is to catch
66
- errors that are cheaper to fix here than after code is written.
67
-
68
- ### 3. Brief the `somi-reviewer` agent
69
-
70
- Before this `Task`, call `somi_resolve` for `somi-reviewer` (with `project_dir`), pass its `model`, start it as its `agent_type`, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill (`somi_skill`,
71
- or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
72
-
73
- - The target (diff, file, or plan-artifact set).
74
- - The work-item paths (`spec.md`, the iteration phase file, recent `diary.md` entries,
75
- `context.md`) so the reviewer can check for scope drift and plan-vs-code divergence.
76
- - An explicit framing: code review **or** plan review (severity calibration differs — see §4).
77
- - An instruction to **return** (not write) the full review body and any proposed diary entry;
78
- the command owns all writes.
79
-
80
- The `somi-reviewer` agent is read-only **by contract, not by platform restriction** — it holds Write/Edit
81
- but is forbidden from using them, so the command owns every write. If the target crosses the triggers
82
- below, **also invoke** the relevant consultant via a separate Task call — call `somi_resolve` for it
83
- first, like any other (full rules: the `somi-dispatch` skill) — and merge its findings
84
- into the review under a dedicated section:
85
-
86
- | Trigger | Consultant agent | When |
87
- |---|---|---|
88
- | Auth / crypto / input validation / file upload / deserialization / template rendering / SSRF surface | `somi-security-reviewer` | Both code and plan |
89
- | New module / service / public contract / dependency-direction change / public interface | `somi-architecture-reviewer` | Both code and plan |
90
- | Mock-heavy diff, new flaky tests, e2e-only coverage of risky code, untestable seams | `somi-test-strategist` | Code review |
91
-
92
- Skipping a triggered consultant is itself a **finding** in the meta-review. A triggered
93
- consultant runs at the session ceiling unless `cost.agents` pins it, so it may run below its
94
- default tier. That is not a skip to absorb quietly: say so in the meta-review (the dispatch
95
- skill prints a degraded line), and for `somi-security-reviewer` name `cost.agents` as the way to keep
96
- the strong pass.
97
-
98
- ### 4. Aggregate findings
99
-
100
- A single severity-graded report (Blocker / Major / Minor / Nit, each with High / Medium / Low
101
- confidence). Use [`templates/REVIEW.md.tmpl`](../../templates/REVIEW.md.tmpl). When consultants
102
- contributed, attribute findings (`[security] [Blocker / High] …`, `[arch] [Major / Medium] …`).
103
-
104
- **Severity calibration — code review:**
105
- - **Blocker** — correctness/security defect, broken contract, design lock-in.
106
- - **Major** — significant maintainability or risk concern; requires explicit sign-off to merge.
107
- - **Minor** — localized smell, can be follow-up.
108
- - **Nit** — style/taste, no obligation.
109
-
110
- **Severity calibration — plan review (be more skeptical here; plans are cheaper to fix):**
111
- - **Blocker** — plan as written will produce a wrong or unsafe outcome.
112
- - **Major** — plan will produce excessive rework, missed risk, or design lock-in.
113
- - **Minor** — section is weak but plan is roughly right.
114
- - **Nit** — taste/preference, no rework.
115
-
116
- ### 5. Write the review under `.somi/reviews/<slug>/`
117
-
118
- Filename patterns:
119
-
120
- - Code review: `<YYYY-MM-DD>-<phase>.<iter>-<verdict>.md` (e.g.,
121
- `2026-05-21-iteration-1-2-request-changes.md`).
122
- - Plan review: `<YYYY-MM-DD>-plan-review-<verdict>.md`.
123
- - Ad-hoc (no work item): `.somi/reviews/_ad-hoc/<YYYY-MM-DD>-<slug>.md`.
124
-
125
- ### 6. Update work-item state (if scoped)
126
-
127
- The command (not the agent) writes these:
128
-
129
- - **The findings ledger** — record this review's findings so they have durable identity:
130
-
131
- ```bash
132
- echo '<findings as JSON array [{file, symbol, title, severity, confidence}, …]>' \
133
- | node scripts/somi-findings.mjs record --slug <slug> --review <review-filename>
134
- ```
135
-
136
- Reference the returned `F-<n>` ids in the review file's findings. For each previously-open
137
- finding the reviewer confirmed resolved:
138
- `node scripts/somi-findings.mjs resolve --slug <slug> --id F-<n> --status fixed --by <review-filename>`
139
- (`accepted` / `wontfix` when the human signed off on not fixing). The markdown review file is
140
- the human view; the ledger is the machine view — same command, same step, no drift.
141
- - In `progress.md`: set the reviewed iteration's `Reviewed` cell to the verdict (there is no activity log).
142
- - If the reviewer returned a proposed `review-feedback` diary entry (because a Blocker/Major
143
- points at the plan rather than the code, or a plan-review finding requires plan changes),
144
- append it to `.somi/plans/<slug>/diary.md`. The follow-up `/code` (or next `/plan` revision)
145
- will then apply changes via the plan-change protocol.
146
-
147
- ### 7. Summarise back
148
-
149
- - **Verdict** (`approve` / `approve-with-comments` / `request-changes` / `reject`).
150
- - **Counts** by severity (attribute consultant findings separately if any).
151
- - **Top 3 findings**, one line each, with severity.
152
- - Pointer to the full review file under `.somi/reviews/<slug>/`.
153
- - Next step:
154
- - `approve` / `approve-with-comments`: proceed to next iteration (`/code <slug>`) or merge.
155
- - `request-changes`: `/code <slug>` will pick up the findings (for code) or user revises
156
- the plan (for plan review).
157
- - `reject`: discuss with the user — usually means re-plan, not re-code.
158
-
159
- ## What to look for in a plan (when target is `plan <slug>`)
160
-
161
- - **Restatement mismatch** — does `spec.md` §1 match the user's actual problem?
162
- - **Missing non-goals** — vague non-goals breed scope creep.
163
- - **Unstated assumptions** — beliefs the plan depends on that aren't called out in `context.md`.
164
- - **Decision quality** — are entries in `decisions.md` real choices (with rejected alternatives
165
- carrying reasons), or did the agent pick without thinking?
166
- - **Phase shapes** — coherent, reviewable, reversible? Or pseudo-phases ("implement / test /
167
- deploy")?
168
- - **Iteration sizes** — is each ~1 PR? If not, split.
169
- - **Risk realism** — specific failure modes with specific mitigations, or generic platitudes?
170
- - **Security blind spots** — does `spec.md` §8 acknowledge auth/crypto/PII surfaces? Does it
171
- gate `somi-security-reviewer` invocation in the right phase?
172
- - **Test strategy** — risk-driven or coverage-worship?
173
- - **Rollout & rollback** — flag plan, deployment, rollback steps?
174
- - **Definition of Done** — measurable, not vibes-based?
175
- - **Verification gaps** — decisions in `decisions.md` that should have been verified with the
176
- user but weren't.
177
-
178
- ## Guardrails
179
-
180
- - **Do not rubber-stamp.** If the target is genuinely clean, say so with evidence (you read X,
181
- you traced Y).
182
- - **Cite locations** with `path/to/file.ext:line-range` for every finding.
183
- - **Grade honestly.** A long list of Nits is worse than one well-stated Blocker.
184
- - **Reject when warranted.** Some changes shouldn't merge in any form — the right output is
185
- "reject" with the reason.
186
- - **Plan-vs-code divergence is a finding**, even if the divergent code is technically fine.
187
- - **Be more skeptical during plan review.** A plan with a beautifully filled-in template but no
188
- real choices is **worse** than a plan with blunt decisions and visible tradeoffs.
189
-
190
- ## Quality bar
191
-
192
- See [`agents/somi-reviewer.md`](../../agents/somi-reviewer.md). Findings must include where, what,
193
- why-it-matters, and a concrete suggested fix. Vague platitudes are not findings.
@@ -1,154 +0,0 @@
1
- ---
2
- name: flow-review-panel
3
- description: The /review-panel procedure, loaded by the /review-panel command and by the somi-flow runner.
4
- user-invocable: false
5
- ---
6
-
7
- # /review-panel — Parallel multi-lens review
8
-
9
- > **Scripts.** Every `node scripts/...` below runs from SoMi's install root, `${CLAUDE_PLUGIN_ROOT}`
10
- > (Claude Code fills in the real path when it loads this skill). Where that still reads as a variable, use
11
- > the root you already know; never search the disk for it.
12
-
13
- You are running the **review panel** of somi: several independent review lenses on the **same change
14
- at the same time**, merged into one verdict. Each lens is read-only **by contract** — it holds
15
- Write/Edit and is forbidden from using them.
16
-
17
- The user's target: **$ARGUMENTS** (a work-item slug, optionally `phase N, iteration M`, or a diff
18
- target such as a PR / commit range / working tree).
19
-
20
- The orchestrator (this command) has no `cost:` of its own — nor a `model:` of its own; it runs on
21
- whatever model this session is already using — and runs entirely inline. Each lens it Tasks
22
- resolves its model through the dispatch skill: its `cost.agents` entry if the config has
23
- one, otherwise the session ceiling itself. `somi-reviewer`, `somi-architecture-reviewer`, `somi-test-strategist`,
24
- `somi-plan-reviewer`, and `somi-sdlc-reviewer` default to `high`; pin them to `high` under
25
- `cost.agents` for the fresh-eyes depth a panel wants. `somi-security-reviewer` defaults to `high`
26
- alone — a missed vulnerability outweighs a lighter generalist pass — so pin it to `high` too (see
27
- its own `> **Cost:**` callout); an unpinned lens runs at the ceiling and is reported as degraded.
28
- The lenses are read-only **by contract, not by platform
29
- restriction** — they return findings; this command owns every write (the merged review file,
30
- `progress.md`, `diary.md`). The session ceiling is a hard cap that sets each lens's tier and never
31
- refuses one.
32
-
33
- > **Why this exists.** A single reviewer carries one set of priorities at a time; running the
34
- > specialist lenses *in parallel* on one diff catches what a sequential, escalation-only pass misses
35
- > — and parallelizing is safe because **this command is the sole writer**: every lens returns
36
- > findings as text and none is given a write to perform, so there is nothing for them to contend
37
- > over. **Concurrency does not weaken this**: zero writers is zero writers whether one lens runs or
38
- > six, so parallelism adds no contention risk the sequential case lacks. Note it rests on the
39
- > lenses honouring their contract — each carries a `## Write discipline` section — not on a platform
40
- > restriction; they do hold Write/Edit. Parallelism does raise the *cost* if that contract breaks:
41
- > concurrent violating writes race, where a sequential one would merely be last-write-wins.
42
- > This is the panel for a change you want scrutinized hard before merge. For a quick single-lens
43
- > pass, use [`/review`](../flow-review/SKILL.md).
44
-
45
- ## When to use this vs. `/review`
46
-
47
- - **`/review`** — the default. One skeptical reviewer; fast; right for most iterations.
48
- - **`/review-panel`** — when the change is high-stakes, crosses several concerns at once (touches
49
- auth *and* a new contract *and* the test shape), or is about to merge to a protected branch. More
50
- model spend; broader coverage.
51
-
52
- ## What to do
53
-
54
- ### 1. Resolve the target and the diff
55
-
56
- Same resolution as [`/review`](../flow-review/SKILL.md): if a `<slug>` (and optional `phase N, iteration M`) is
57
- given, read the work-item artifact set and scope to that iteration's diff; otherwise scope to the
58
- given diff target (PR, commit range, or working tree). Capture the diff once and reuse it for every
59
- lens so they all review the identical change.
60
-
61
- ### 2. Select the lenses (which panelists sit for this review)
62
-
63
- Always seat **`somi-reviewer`** (the generalist). Seat a specialist **only when the diff actually engages
64
- its domain** — seating an irrelevant lens is wasted spend and dilutes signal:
65
-
66
- | Lens | Seat it when the diff… |
67
- |---|---|
68
- | `somi-reviewer` | always |
69
- | `somi-security-reviewer` | touches auth/authz, crypto, secrets, input validation, deserialization, file uploads, third-party data, templating, or user-controlled input reaching a sink |
70
- | `somi-architecture-reviewer` | adds/splits a module or service, changes a public contract, or changes dependency direction |
71
- | `somi-test-strategist` | adds/changes meaningful test surface, or the diff's risk is concentrated where tests are thin/over-mocked/flaky |
72
- | `somi-plan-reviewer` | the review target is a plan or design (a `.somi/plans/<slug>/` artifact set, a `brief.md`, or an ADR), or the diff changes `spec.md` / `decisions.md` / `phases/` / `brief.md` — the plan's shape is what is under review, not only the code |
73
- | `somi-sdlc-reviewer` | a work-item `<slug>` was given, or the diff touches `progress.md` / `diary.md` / the findings ledger — so the planning record can be checked against what the diff actually did |
74
-
75
- Record which lenses you seated and **why each unseated one was skipped** — that record is part of
76
- the panel's value (it shows the surface was considered, not ignored).
77
-
78
- ### 3. Run the panel **in parallel**
79
-
80
- Issue the seated lenses as **multiple `Task` calls in a single turn** so they run concurrently —
81
- call `somi_resolve` for each lens back-to-back immediately before the batch (each with its own
82
- `project_dir`); for each, pass its `model`, start it as its `agent_type`, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`) — in that lens's own briefing; this is the
83
- concurrent-batch case the `somi-dispatch` skill's §5 names explicitly). Give each the *same* scoped
84
- diff and work-item context, and each its own briefing:
85
-
86
- ```text
87
- Task somi-reviewer (= /review <target>, scope = this diff)
88
- Task somi-security-reviewer (= security lens on this diff) # if seated
89
- Task somi-architecture-reviewer (= structural lens on this diff) # if seated
90
- Task somi-test-strategist (= test-shape lens on this diff) # if seated
91
- Task somi-plan-reviewer (= plan lens on the plan artifacts) # if seated
92
- Task somi-sdlc-reviewer (= process lens on the planning record) # if seated
93
- ```
94
-
95
- > **Copilot / sequential fallback.** Parallel sub-agent execution is a Claude Code capability. Where
96
- > the host can't run sub-agents concurrently (e.g. the GitHub Copilot extension), seat the same
97
- > lenses and run them **one after another** — the merged result is identical, only slower. Never drop
98
- > a lens to save a round trip.
99
-
100
- ### 4. Merge and de-duplicate the findings
101
-
102
- Collect every lens's findings into one list, then reconcile:
103
-
104
- - **De-duplicate** findings that multiple lenses raise. Two findings are the same when they share a
105
- locus (file + symbol/function, **not** raw line number — lines drift) and the same underlying
106
- problem. Collapse them into one entry and **credit every lens that raised it** ("flagged by
107
- reviewer + security-reviewer") — independent agreement is signal; surface it.
108
- - **Reconcile severity** to the **highest** any lens assigned (a security `Blocker` wins over a
109
- generalist `Minor` on the same issue). Reconcile confidence to the highest.
110
- - **Surface disagreement** explicitly. If one lens approves an area another flags as a Blocker, that
111
- conflict is itself a finding — present both positions; do not average them away.
112
- - **Order** by severity then confidence. Lead with Blockers. Don't let fifteen Nits bury one Blocker.
113
-
114
- ### 5. Compute the panel verdict
115
-
116
- The merged verdict is the **most severe** lens verdict (any `reject` → `reject`; else any
117
- `request-changes` → `request-changes`; else `approve-with-comments` if any comments; else
118
- `approve`). A security or architecture Blocker sets the verdict regardless of how clean the other
119
- lenses found the change.
120
-
121
- ### 6. Write the merged review and update state
122
-
123
- - Write the merged review to
124
- `.somi/reviews/<slug>/<YYYY-MM-DD>-<phase>.<iter>-panel-<verdict>.md` (work-item-scoped) using
125
- [`templates/REVIEW.md.tmpl`](../../templates/REVIEW.md.tmpl), with a **Panel** header noting which
126
- lenses sat and which were skipped (and why).
127
- - Record the **merged, de-duplicated** findings in the ledger
128
- (`echo '<findings JSON array>' | node scripts/somi-findings.mjs record --slug <slug> --review
129
- <review-filename>`) and resolve any previously-open findings the panel confirmed fixed — same
130
- protocol as [`/review`](../flow-review/SKILL.md) §6. Record each finding once (post-merge), crediting the
131
- lenses in the markdown, not as duplicate ledger entries.
132
- - Update `progress.md` (the iteration's `Reviewed` column → `panel:<verdict>`) and append a
133
- `diary.md` entry (category `review-feedback`) naming the verdict, the seated lenses, and the top
134
- finding. The lenses write nothing by contract; these writes are yours.
135
- - If any lens surfaced a **plan** issue (not just code), include its proposed diary entry and
136
- recommend `/plan` (or the `/code` plan-change protocol) per [`/review`](../flow-review/SKILL.md).
137
-
138
- ### 7. Summarise back
139
-
140
- - **Verdict** + count by severity (merged, de-duplicated).
141
- - **Lenses seated** and **skipped (with reason)**.
142
- - **Top findings** — lead with any Blocker; note which were raised by more than one lens.
143
- - **Disagreements** between lenses, if any.
144
- - Pointer to the merged review file. Next step (usually: address Blockers/Majors via `/code`, or
145
- merge if clean).
146
-
147
- ## Guardrails
148
-
149
- - **Same diff for every lens.** Capture it once; don't let lenses review drifting working trees.
150
- - **Read-only lenses; orchestrator writes.** Identical to `/review` — the agents return text, this
151
- command persists. Never let a lens write the review file.
152
- - **Don't seat irrelevant lenses.** Coverage is seating the *right* panel, not the *largest* one.
153
- - **Don't average away a Blocker.** Highest severity wins; disagreement is surfaced, not smoothed.
154
- - **De-dupe on locus, not line number.** The same issue at a shifted line is one finding.
@@ -1,83 +0,0 @@
1
- ---
2
- name: flow-security-review
3
- description: The /security-review procedure, loaded by the /security-review command and by the somi-flow runner.
4
- user-invocable: false
5
- ---
6
-
7
- # /security-review — Targeted security review
8
-
9
- You are running a **security-only** review using somi.
10
-
11
- Target: **$ARGUMENTS** (empty = current working-tree diff vs. default branch, scoped to a single
12
- in-progress work item if exactly one exists).
13
-
14
- ## What to do
15
-
16
- ### 1. Resolve the target
17
-
18
- Use the same resolution logic as [`/review`](../flow-review/SKILL.md):
19
-
20
- - **A work-item slug** → review the latest iteration's diff, scoped to security.
21
- - **Empty / range / PR / file** → resolve as in `/review`.
22
-
23
- ### 2. Brief the `somi-security-reviewer` agent
24
-
25
- Before this `Task`, call `somi_resolve` for `somi-security-reviewer` (with `project_dir`), pass its `model`, start it as its `agent_type`, and put the cost line in the briefing (`dispatched at cost: <tier>` only when `enforced` is true, else `requested cost: <tier> (not enforced: no mapped model)`); full rules: the `somi-dispatch` skill
26
- (`somi_skill`, or `somi:somi-dispatch` on Claude Code). Via the Task tool, pass:
27
-
28
- - The diff and the relevant repo context.
29
- - The work-item paths (`spec.md` §8 security considerations, the iteration phase file, recent
30
- `diary.md` entries) when scoped.
31
- - The expectation: walk trust boundaries to sinks, produce **attack-path-grounded** findings.
32
- - The expectation that it **returns** its findings as text rather than writing them. The
33
- `somi-security-reviewer` agent is read-only **by contract, not by platform restriction** — it holds
34
- Write/Edit and its `## Write discipline` section forbids using them, so this command owns every
35
- write (the review file, `progress.md`, `diary.md`).
36
-
37
- `somi-security-reviewer` defaults to `high` alone. It runs at the session ceiling (`medium` by
38
- default) unless `cost.agents` in `.somi/config.json` pins it, and the dispatch skill prints a
39
- degraded line when that is below `high`. The config is respected: there is no floor in code. Say
40
- plainly in the review that it ran below its default tier, and that setting
41
- `"somi-security-reviewer": "high"` under `cost.agents` is how to keep the strong pass.
42
-
43
- ### 3. Findings must include
44
-
45
- - **Attack path** — end-to-end, in plain language (entrypoint → intermediate steps → sink).
46
- - **Preconditions** — what the attacker needs (auth, network access, specific input shape).
47
- - **Mitigation** — concrete code/config change, not a homily.
48
- - **Defense-in-depth** — a second layer if the primary fails.
49
-
50
- ### 4. Write the review
51
-
52
- Filename pattern: `<YYYY-MM-DD>-security-<phase>.<iter>-<verdict>.md` under
53
- `.somi/reviews/<slug>/` when scoped to a work item, or `.somi/reviews/_ad-hoc/` otherwise.
54
-
55
- Use [`templates/REVIEW.md.tmpl`](../../templates/REVIEW.md.tmpl) with security framing.
56
-
57
- ### 5. Update work-item state (if scoped)
58
-
59
- - `progress.md`: set the iteration's `Reviewed` cell to the verdict (there is no activity log).
60
- - If a Blocker / Major finding requires a plan change (e.g., reveals a missing mitigation in
61
- `spec.md` §8), append a diary entry with category `review-feedback`. The follow-up `/code`
62
- invocation will pick up the changes via the plan-change protocol.
63
-
64
- ### 6. Summarise back
65
-
66
- - **Verdict** (`approve` / `request-changes` / `reject`).
67
- - Count of Blockers / Majors / Minors.
68
- - Top 3 findings with their attack paths.
69
- - Pointer to the review file.
70
-
71
- ## When to invoke
72
-
73
- Always when the change touches: authentication, authorization, cryptography, secrets, input
74
- validation at trust boundaries, deserialization, file uploads, template rendering, outbound HTTP
75
- triggered by user input, or third-party SDK calls with user-controlled arguments.
76
-
77
- ## Guardrails
78
-
79
- - **Concrete attack paths only.** "X could be vulnerable to injection" is not a finding. "An
80
- unauthenticated user can POST `{...}` to `/api/...`, which reaches sink `S` because of code path
81
- `P`" is.
82
- - **Verify against the codebase.** Don't recite CVEs without tracing them in this code.
83
- - **Don't bury Blockers in a list of Nits.** RCEs go at the top.