@skathio/somi 1.2.0 → 2.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 (56) hide show
  1. package/.claude/settings.json +8 -8
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.copilot-extension/extension.json +1 -1
  5. package/.copilot-extension/marketplace.json +1 -1
  6. package/README.md +5 -0
  7. package/VERSION +1 -1
  8. package/commands/code-loop.md +12 -12
  9. package/commands/plan-loop.md +9 -9
  10. package/commands/pr.md +1 -1
  11. package/commands/release-readiness.md +3 -3
  12. package/commands/review-panel.md +1 -1
  13. package/commands/review.md +3 -3
  14. package/commands/ship-loop.md +2 -2
  15. package/commands/somi.md +1 -1
  16. package/commands/upgrade.md +1 -1
  17. package/hooks/hooks.json +8 -8
  18. package/hooks/lib/common.mjs +328 -0
  19. package/hooks/post-tool/audit-log.mjs +93 -0
  20. package/hooks/post-tool/lint-changed-files.mjs +212 -0
  21. package/hooks/pre-tool/block-dangerous-bash.mjs +382 -0
  22. package/hooks/pre-tool/block-secret-writes.mjs +96 -0
  23. package/hooks/pre-tool/gate-dep-install.mjs +229 -0
  24. package/hooks/pre-tool/guard-protected-paths.mjs +157 -0
  25. package/hooks/session-start/detect-repo-instructions.mjs +264 -0
  26. package/hooks/user-prompt-submit/inject-workflow-context.mjs +432 -0
  27. package/package.json +2 -2
  28. package/scripts/somi-check.mjs +243 -0
  29. package/scripts/somi-findings.mjs +307 -0
  30. package/scripts/somi-loop.mjs +354 -0
  31. package/scripts/validate.sh +21 -16
  32. package/skills/clean-code/SKILL.md +1 -1
  33. package/tests/hooks/cases/audit-log.json +21 -0
  34. package/tests/hooks/cases/block-dangerous-bash.json +90 -2
  35. package/tests/hooks/cases/block-secret-writes.json +1 -1
  36. package/tests/hooks/cases/detect-repo-instructions.json +84 -0
  37. package/tests/hooks/cases/gate-dep-install.json +6 -1
  38. package/tests/hooks/cases/guard-protected-paths.json +1 -1
  39. package/tests/hooks/cases/inject-workflow-context.json +126 -0
  40. package/tests/hooks/cases/lint-changed-files.json +120 -0
  41. package/tests/hooks/run.sh +280 -15
  42. package/tests/scripts/goldens/somi-findings.json +336 -0
  43. package/tests/scripts/goldens/somi-loop.json +168 -0
  44. package/tests/scripts/run.sh +251 -30
  45. package/hooks/lib/common.sh +0 -133
  46. package/hooks/post-tool/audit-log.sh +0 -40
  47. package/hooks/post-tool/lint-changed-files.sh +0 -80
  48. package/hooks/pre-tool/block-dangerous-bash.sh +0 -171
  49. package/hooks/pre-tool/block-secret-writes.sh +0 -83
  50. package/hooks/pre-tool/gate-dep-install.sh +0 -113
  51. package/hooks/pre-tool/guard-protected-paths.sh +0 -89
  52. package/hooks/session-start/detect-repo-instructions.sh +0 -73
  53. package/hooks/user-prompt-submit/inject-workflow-context.sh +0 -143
  54. package/scripts/somi-check.sh +0 -135
  55. package/scripts/somi-findings.sh +0 -173
  56. package/scripts/somi-loop.sh +0 -225
@@ -51,7 +51,7 @@
51
51
  "hooks": [
52
52
  {
53
53
  "type": "command",
54
- "command": "${SOMI_VENDOR_ROOT}/hooks/session-start/detect-repo-instructions.sh"
54
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/session-start/detect-repo-instructions.mjs"
55
55
  }
56
56
  ]
57
57
  }
@@ -62,11 +62,11 @@
62
62
  "hooks": [
63
63
  {
64
64
  "type": "command",
65
- "command": "${SOMI_VENDOR_ROOT}/hooks/pre-tool/block-dangerous-bash.sh"
65
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/pre-tool/block-dangerous-bash.mjs"
66
66
  },
67
67
  {
68
68
  "type": "command",
69
- "command": "${SOMI_VENDOR_ROOT}/hooks/pre-tool/gate-dep-install.sh"
69
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/pre-tool/gate-dep-install.mjs"
70
70
  }
71
71
  ]
72
72
  },
@@ -75,11 +75,11 @@
75
75
  "hooks": [
76
76
  {
77
77
  "type": "command",
78
- "command": "${SOMI_VENDOR_ROOT}/hooks/pre-tool/block-secret-writes.sh"
78
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/pre-tool/block-secret-writes.mjs"
79
79
  },
80
80
  {
81
81
  "type": "command",
82
- "command": "${SOMI_VENDOR_ROOT}/hooks/pre-tool/guard-protected-paths.sh"
82
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/pre-tool/guard-protected-paths.mjs"
83
83
  }
84
84
  ]
85
85
  }
@@ -90,7 +90,7 @@
90
90
  "hooks": [
91
91
  {
92
92
  "type": "command",
93
- "command": "${SOMI_VENDOR_ROOT}/hooks/post-tool/lint-changed-files.sh"
93
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/post-tool/lint-changed-files.mjs"
94
94
  }
95
95
  ]
96
96
  },
@@ -99,7 +99,7 @@
99
99
  "hooks": [
100
100
  {
101
101
  "type": "command",
102
- "command": "${SOMI_VENDOR_ROOT}/hooks/post-tool/audit-log.sh"
102
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/post-tool/audit-log.mjs"
103
103
  }
104
104
  ]
105
105
  }
@@ -109,7 +109,7 @@
109
109
  "hooks": [
110
110
  {
111
111
  "type": "command",
112
- "command": "${SOMI_VENDOR_ROOT}/hooks/user-prompt-submit/inject-workflow-context.sh"
112
+ "command": "node ${SOMI_VENDOR_ROOT}/hooks/user-prompt-submit/inject-workflow-context.mjs"
113
113
  }
114
114
  ]
115
115
  }
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/skathio/somi.git"
14
14
  },
15
15
  "description": "MAX/ECO economy: discover/design (MAX) → plan / code / review (ECO) workflow system with SOLID, OWASP, and clean-code guardrails.",
16
- "version": "1.2.0",
16
+ "version": "2.0.0",
17
17
  "tags": ["workflow", "agents", "review", "security"],
18
18
  "homepage": "https://github.com/skathio/somi"
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "somi",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "displayName": "SoMi",
5
5
  "description": "Multi-agent engineering workflow system: plan, code, review — with SOLID/OWASP guardrails, deterministic hooks, and a global ruleset.",
6
6
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "somi",
3
3
  "displayName": "SoMi",
4
- "version": "1.2.0",
4
+ "version": "2.0.0",
5
5
  "description": "Multi-agent engineering workflow system: plan, code, review — with SOLID/OWASP guardrails, deterministic hooks, and a global ruleset.",
6
6
  "keywords": [
7
7
  "workflow",
@@ -11,7 +11,7 @@
11
11
  "name": "somi",
12
12
  "source": "github:skathio/somi",
13
13
  "description": "MAX/ECO economy: discover/design (MAX) → plan / code / review (ECO) workflow system with SOLID, OWASP, and clean-code guardrails.",
14
- "version": "1.2.0",
14
+ "version": "2.0.0",
15
15
  "tags": ["workflow", "agents", "review", "security"],
16
16
  "homepage": "https://github.com/skathio/somi"
17
17
  }
package/README.md CHANGED
@@ -48,6 +48,11 @@ the MAX→ECO model switch. Supporting MAX agents (by handoff): `security-review
48
48
 
49
49
  ## Install
50
50
 
51
+ > **Runtime**: a current Node (LTS) on `PATH` — no `bash`, no `jq` required. Both Claude Code and
52
+ > GitHub Copilot already bundle Node, so most installs need nothing extra; the Node runtime itself
53
+ > is Windows-native (no bash/jq to install). See [`docs/HOOKS.md`](docs/HOOKS.md) for one open
54
+ > caveat on Windows path-separator coverage in the path-matching guards.
55
+
51
56
  ### Option 1 — Claude Code plugin (marketplace)
52
57
 
53
58
  ```text
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 2.0.0
@@ -49,18 +49,18 @@ ask the user.
49
49
 
50
50
  The loop's arithmetic — pass counting, the diff baseline, cap checks, finding recurrence — is
51
51
  owned by two shipped scripts, **not** by you simulating a state machine in context:
52
- [`scripts/somi-loop.sh`](../scripts/somi-loop.sh) (state + caps) and
53
- [`scripts/somi-findings.sh`](../scripts/somi-findings.sh) (the findings ledger). State survives
52
+ [`scripts/somi-loop.mjs`](../scripts/somi-loop.mjs) (state + caps) and
53
+ [`scripts/somi-findings.mjs`](../scripts/somi-findings.mjs) (the findings ledger). State survives
54
54
  session death at `.claude/somi-state/loop/<slug>.<N>.<M>.json`.
55
55
 
56
- - **Resume check first:** `bash scripts/somi-loop.sh resume --slug <slug> --iteration <N>.<M>`
56
+ - **Resume check first:** `node scripts/somi-loop.mjs resume --slug <slug> --iteration <N>.<M>`
57
57
  (path relative to the SoMi install root). If it prints a `running` state, a previous session
58
58
  died mid-loop — **continue from its recorded pass and baseline** instead of starting over, and
59
59
  tell the user you resumed.
60
60
  - Otherwise initialize:
61
61
 
62
62
  ```bash
63
- bash scripts/somi-loop.sh init --slug <slug> --loop code --iteration <N>.<M> \
63
+ node scripts/somi-loop.mjs init --slug <slug> --loop code --iteration <N>.<M> \
64
64
  --files "<the iteration's 'Files (approx)' paths, space-separated>"
65
65
  ```
66
66
 
@@ -82,7 +82,7 @@ session death at `.claude/somi-state/loop/<slug>.<N>.<M>.json`.
82
82
  ```text
83
83
  while true:
84
84
  # 3a. Pass gate (deterministic)
85
- bash scripts/somi-loop.sh pass --slug <slug> --iteration <N>.<M>
85
+ node scripts/somi-loop.mjs pass --slug <slug> --iteration <N>.<M>
86
86
  exit 2 → STOP — write remaining ≥Major findings as progress.md follow-ups (by F-id),
87
87
  summarise, exit "max-passes-exceeded"
88
88
 
@@ -91,7 +91,7 @@ while true:
91
91
 
92
92
  # 3c. Diff & scope gate (deterministic — cumulative vs the recorded baseline, working tree
93
93
  # included, .somi/.claude excluded; out-of-scope lines count DOUBLE)
94
- bash scripts/somi-loop.sh check-diff --slug <slug> --iteration <N>.<M>
94
+ node scripts/somi-loop.mjs check-diff --slug <slug> --iteration <N>.<M>
95
95
  exit 3 → STOP — exit "diff-cap-exceeded"; if the printed JSON's out_of_scope is non-empty,
96
96
  report the stop as "scope-expansion" and name the files
97
97
 
@@ -104,10 +104,10 @@ while true:
104
104
  # 3e. Record the pass + findings. The ledger computes recurrence on a STABLE locus
105
105
  # (file + symbol + normalized title — never the raw line number, which drifts between
106
106
  # passes and would let coder and reviewer oscillate to the pass cap unnoticed).
107
- bash scripts/somi-loop.sh record-pass --slug <slug> --iteration <N>.<M> \
107
+ node scripts/somi-loop.mjs record-pass --slug <slug> --iteration <N>.<M> \
108
108
  --verdict <V> --blockers <B> --majors <MJ>
109
109
  echo '<review findings as a JSON array [{file, symbol, title, severity, confidence}, …]>' \
110
- | bash scripts/somi-findings.sh record --slug <slug> --review <review-file> \
110
+ | node scripts/somi-findings.mjs record --slug <slug> --review <review-file> \
111
111
  --run $RUN_ID --pass <current pass>
112
112
  exit 5 → STOP — the same finding recurred in two consecutive passes: coder and reviewer
113
113
  disagree; hand to human (circuit breaker). Also surface any finding the output
@@ -115,7 +115,7 @@ while true:
115
115
 
116
116
  # 3f. Verdict
117
117
  if verdict == "approve" or no finding at severity >= SEVERITY_FLOOR:
118
- somi-findings.sh resolve each finding this pass fixed ( --status fixed --by <review-file> )
118
+ somi-findings.mjs resolve each finding this pass fixed ( --status fixed --by <review-file> )
119
119
  DONE — proceed to §4
120
120
 
121
121
  # 3g. Next pass
@@ -125,7 +125,7 @@ while true:
125
125
 
126
126
  ### 4. On DONE (clean exit)
127
127
 
128
- - `bash scripts/somi-loop.sh finish --slug <slug> --iteration <N>.<M> --status done`.
128
+ - `node scripts/somi-loop.mjs finish --slug <slug> --iteration <N>.<M> --status done`.
129
129
  - Mark iteration `done` in `phases/<NN>-*.md`.
130
130
  - Update `progress.md` (phase row, "Last activity").
131
131
  - Append a diary entry (category `note`): `code-loop done at pass <P>; verdict <V>`.
@@ -133,7 +133,7 @@ while true:
133
133
 
134
134
  ### 5. On STOP (gate hit)
135
135
 
136
- - `bash scripts/somi-loop.sh finish --slug <slug> --iteration <N>.<M> --status stopped-<reason>`.
136
+ - `node scripts/somi-loop.mjs finish --slug <slug> --iteration <N>.<M> --status stopped-<reason>`.
137
137
  - Do **not** mark iteration `done`.
138
138
  - Append a diary entry (category `blocker` or `plan-change`): which gate fired, what's
139
139
  outstanding, what the user needs to decide.
@@ -146,7 +146,7 @@ while true:
146
146
 
147
147
  - Loop status: `done` | `max-passes-exceeded` | `diff-cap-exceeded` | `scope-expansion` |
148
148
  `circuit-breaker` | `user-stop`.
149
- - Passes used (out of `MAX_PASSES`) — from `somi-loop.sh stats` (also the run's telemetry:
149
+ - Passes used (out of `MAX_PASSES`) — from `somi-loop.mjs stats` (also the run's telemetry:
150
150
  per-pass verdicts, Blocker/Major counts, diff sizes).
151
151
  - Final verdict + count by severity.
152
152
  - Cumulative diff size and any out-of-scope files touched.
@@ -57,12 +57,12 @@ start of the run; record the effective values in the first diary entry of the lo
57
57
  ### 2. Initialize loop state (deterministic, resumable)
58
58
 
59
59
  Pass counting and finding recurrence are owned by the shipped scripts
60
- ([`scripts/somi-loop.sh`](../scripts/somi-loop.sh), [`scripts/somi-findings.sh`](../scripts/somi-findings.sh))
60
+ ([`scripts/somi-loop.mjs`](../scripts/somi-loop.mjs), [`scripts/somi-findings.mjs`](../scripts/somi-findings.mjs))
61
61
  — state survives session death at `.claude/somi-state/loop/<slug>.json`.
62
62
 
63
- - **Resume check first:** `bash scripts/somi-loop.sh resume --slug <slug>`. A `running` state
63
+ - **Resume check first:** `node scripts/somi-loop.mjs resume --slug <slug>`. A `running` state
64
64
  means a previous session died mid-loop — continue from its recorded pass (tell the user).
65
- - Otherwise: `bash scripts/somi-loop.sh init --slug <slug> --loop plan` (resolves `MAX_PASSES` /
65
+ - Otherwise: `node scripts/somi-loop.mjs init --slug <slug> --loop plan` (resolves `MAX_PASSES` /
66
66
  `SEVERITY_FLOOR` per the precedence above and prints the effective values). Set `RUN_ID` = the
67
67
  state's `started` timestamp for the findings-ledger calls.
68
68
  - Capture `initial_spec_signature` = SHA of `spec.md §1` + `decisions.md` (excluding superseded
@@ -80,7 +80,7 @@ Pass counting and finding recurrence are owned by the shipped scripts
80
80
  ```text
81
81
  while true:
82
82
  # 3a. Pass gate (deterministic)
83
- bash scripts/somi-loop.sh pass --slug <slug>
83
+ node scripts/somi-loop.mjs pass --slug <slug>
84
84
  exit 2 → STOP — summarise current best plan + remaining findings (by F-id),
85
85
  exit "max-passes-exceeded"
86
86
 
@@ -93,15 +93,15 @@ while true:
93
93
 
94
94
  # 3d. Record the pass + findings (locus file for a plan finding is the artifact —
95
95
  # e.g. spec.md / decisions.md / phases/02-…md — symbol is the section)
96
- bash scripts/somi-loop.sh record-pass --slug <slug> --verdict <V> --blockers <B> --majors <MJ>
97
- echo '<findings JSON array>' | bash scripts/somi-findings.sh record --slug <slug> \
96
+ node scripts/somi-loop.mjs record-pass --slug <slug> --verdict <V> --blockers <B> --majors <MJ>
97
+ echo '<findings JSON array>' | node scripts/somi-findings.mjs record --slug <slug> \
98
98
  --review <review-file> --run $RUN_ID --pass <current pass>
99
99
  exit 5 → STOP — the same plan finding recurred in two consecutive passes; planner and
100
100
  reviewer disagree; hand to human
101
101
 
102
102
  # 3e. Verdict
103
103
  if verdict == "approve" or no finding at severity >= SEVERITY_FLOOR:
104
- somi-findings.sh resolve each finding this pass fixed; DONE — proceed to §4
104
+ somi-findings.mjs resolve each finding this pass fixed; DONE — proceed to §4
105
105
 
106
106
  # 3f. Divergence detector (judgment-side)
107
107
  current_finding_count = count(findings >= SEVERITY_FLOOR)
@@ -117,7 +117,7 @@ while true:
117
117
 
118
118
  ### 4. On DONE (clean exit)
119
119
 
120
- - `bash scripts/somi-loop.sh finish --slug <slug> --status done`.
120
+ - `node scripts/somi-loop.mjs finish --slug <slug> --status done`.
121
121
  - Set `progress.md` status to `awaiting-approval`.
122
122
  - Append a diary entry (category `note`): `plan-loop done at pass <P>; verdict <V>`.
123
123
  - Summarise (see §6) — explicitly call out that the user still owns the final go/no-go on the
@@ -125,7 +125,7 @@ while true:
125
125
 
126
126
  ### 5. On STOP (gate hit)
127
127
 
128
- - `bash scripts/somi-loop.sh finish --slug <slug> --status stopped-<reason>`.
128
+ - `node scripts/somi-loop.mjs finish --slug <slug> --status stopped-<reason>`.
129
129
  - Leave `progress.md` status as `planning`.
130
130
  - Append a diary entry (category `plan-change` or `blocker`): which gate fired, what's
131
131
  outstanding, what the user needs to decide.
package/commands/pr.md CHANGED
@@ -26,7 +26,7 @@ From `.somi/plans/<slug>/`:
26
26
  - `progress.md` — phases/iterations completed; follow-ups filed.
27
27
  - `diary.md` — plan-change entries only (the "what changed along the way" a reviewer needs).
28
28
  - `.somi/reviews/<slug>/` — the latest verdict per iteration; plus
29
- `bash scripts/somi-findings.sh open --slug <slug>` for anything still open.
29
+ `node scripts/somi-findings.mjs open --slug <slug>` for anything still open.
30
30
  - `git log` / `git diff` against the default branch for the actual change summary and test files.
31
31
 
32
32
  ### 2. Compose
@@ -22,14 +22,14 @@ For each in-scope work item, check mechanically and record pass/fail + evidence:
22
22
  | Check | Source |
23
23
  |---|---|
24
24
  | All phases/iterations `done` | `progress.md` tables |
25
- | No `open` Blocker/Major findings | `bash scripts/somi-findings.sh open --slug <slug>` |
25
+ | No `open` Blocker/Major findings | `node scripts/somi-findings.mjs open --slug <slug>` |
26
26
  | No decisions outstanding | `progress.md` "Decisions outstanding" |
27
27
  | Work-item DoD satisfiable | `spec.md` §12 checkboxes vs. reality (tests green? docs updated?) |
28
28
  | Rollout & rollback sections real | `spec.md` §10 — non-empty, names a flag/metric, rollback is executable not aspirational |
29
29
  | Security items landed, not deferred | `spec.md` §8 mitigations vs. the diffs; `security-reviewer` consulted where §8 gated it |
30
30
  | No interrupted loops | `.claude/somi-state/loop/*.json` with `status: running` for in-scope slugs |
31
31
  | Follow-ups triaged | `progress.md` follow-ups each either scheduled or explicitly accepted for post-release |
32
- | Working tree honest | `bash scripts/somi-check.sh --all` (secrets, lockfile hand-edits, loose ends) |
32
+ | Working tree honest | `node scripts/somi-check.mjs --all` (secrets, lockfile hand-edits, loose ends) |
33
33
 
34
34
  Any hard failure here (open Blocker, red tests, unexecutable rollback) → the verdict is already
35
35
  `not-ready`; finish the checklist anyway so the report is complete, but say it early.
@@ -44,7 +44,7 @@ items, config/flag interactions, and observability of the release as a whole ("w
44
44
  and something degrades, what tells us which work item did it?"). Skip only if the release is a
45
45
  single already-panel-reviewed work item.
46
46
 
47
- Record its findings into the ledger(s) (`somi-findings.sh record`) like any review.
47
+ Record its findings into the ledger(s) (`somi-findings.mjs record`) like any review.
48
48
 
49
49
  ## Stage 3 — Verdict + release notes
50
50
 
@@ -99,7 +99,7 @@ lenses found the change.
99
99
  [`templates/REVIEW.md.tmpl`](../templates/REVIEW.md.tmpl), with a **Panel** header noting which
100
100
  lenses sat and which were skipped (and why).
101
101
  - Record the **merged, de-duplicated** findings in the ledger
102
- (`echo '<findings JSON array>' | bash scripts/somi-findings.sh record --slug <slug> --review
102
+ (`echo '<findings JSON array>' | node scripts/somi-findings.mjs record --slug <slug> --review
103
103
  <review-filename>`) and resolve any previously-open findings the panel confirmed fixed — same
104
104
  protocol as [`/review`](./review.md) §6. Record each finding once (post-merge), crediting the
105
105
  lenses in the markdown, not as duplicate ledger entries.
@@ -52,7 +52,7 @@ Find the relevant work item's `spec.md`, the iteration's `phases/<NN>-*.md`, rec
52
52
  and commit messages. If you can't tell what the change is for, that's finding #1.
53
53
 
54
54
  **Check the findings ledger before reviewing** (when scoped to a work item):
55
- `bash scripts/somi-findings.sh open --slug <slug>` lists the still-open findings from previous
55
+ `node scripts/somi-findings.mjs open --slug <slug>` lists the still-open findings from previous
56
56
  reviews (`.somi/reviews/<slug>/findings.json`). Pass them to the reviewer with the instruction to
57
57
  **verify each one's resolution first** — confirmed fixed, still present, or accepted — before
58
58
  hunting new findings. A re-review that rediscovers a known finding from scratch wastes the ledger;
@@ -119,12 +119,12 @@ The command (not the agent) writes these:
119
119
 
120
120
  ```bash
121
121
  echo '<findings as JSON array [{file, symbol, title, severity, confidence}, …]>' \
122
- | bash scripts/somi-findings.sh record --slug <slug> --review <review-filename>
122
+ | node scripts/somi-findings.mjs record --slug <slug> --review <review-filename>
123
123
  ```
124
124
 
125
125
  Reference the returned `F-<n>` ids in the review file's findings. For each previously-open
126
126
  finding the reviewer confirmed resolved:
127
- `bash scripts/somi-findings.sh resolve --slug <slug> --id F-<n> --status fixed --by <review-filename>`
127
+ `node scripts/somi-findings.mjs resolve --slug <slug> --id F-<n> --status fixed --by <review-filename>`
128
128
  (`accepted` / `wontfix` when the human signed off on not fixing). The markdown review file is
129
129
  the human view; the ledger is the machine view — same command, same step, no drift.
130
130
  - In `progress.md`: append a line under "Recent activity" referencing the review file and verdict.
@@ -117,7 +117,7 @@ brief; they do not approve every iteration.
117
117
  ### Cross-layer circuit breaker
118
118
 
119
119
  The findings ledger (`.somi/reviews/<slug>/findings.json`, maintained by the inner loops via
120
- [`scripts/somi-findings.sh`](../scripts/somi-findings.sh)) computes this mechanically: every
120
+ [`scripts/somi-findings.mjs`](../scripts/somi-findings.mjs)) computes this mechanically: every
121
121
  `record` call classifies each finding, and a **`recurring_cross_run: true`** means the same locus
122
122
  (file + nearest symbol + title; for plan-level: artifact + section + topic) was already seen by a
123
123
  *different* loop run — a `/plan-loop` review then a `/code-loop` review, or two separate
@@ -131,7 +131,7 @@ another automated pass. (Because the ledger is durable, this breaker also works
131
131
  ### Global budget
132
132
 
133
133
  Sum passes across all `/plan-loop` and `/code-loop` invocations in this run — read each loop's
134
- `pass` from `bash scripts/somi-loop.sh stats --slug <slug> [--iteration <N>.<M>]` rather than
134
+ `pass` from `node scripts/somi-loop.mjs stats --slug <slug> [--iteration <N>.<M>]` rather than
135
135
  recounting from memory. If `GLOBAL_BUDGET_PASSES` is hit, STOP — even if individual layers
136
136
  haven't tripped their own caps.
137
137
 
package/commands/somi.md CHANGED
@@ -24,7 +24,7 @@ Assemble the state of the world **from the artifacts only** — read, never writ
24
24
  2. **Discoveries** — for every `.somi/rd/<slug>/README.md`: status (`researching` /
25
25
  `awaiting-verification` / `ready-for-planning`).
26
26
  3. **Open findings** — for every `.somi/reviews/<slug>/findings.json`:
27
- `bash scripts/somi-findings.sh open --slug <slug>` (count + worst severity).
27
+ `node scripts/somi-findings.mjs open --slug <slug>` (count + worst severity).
28
28
  4. **Interrupted loops** — any `.claude/somi-state/loop/*.json` with `"status": "running"`: a
29
29
  session died mid-loop; `/code-loop` / `/plan-loop` on that slug will **resume** it.
30
30
 
@@ -51,7 +51,7 @@ Classify: used-and-breaking (must migrate), used-but-compatible, unused. The
51
51
  Write `.somi/plans/<slug>/brief.md` ([`templates/BRIEF.md.tmpl`](../templates/BRIEF.md.tmpl)) —
52
52
  decisions in force = the upgrade + cited breaking changes; file map = the usage scan; "what ECO
53
53
  does NOT need to re-research" = the changelog findings. **This brief is the dep-decision record**
54
- the [`gate-dep-install`](../hooks/pre-tool/gate-dep-install.sh) hook's policy asks for — note in
54
+ the [`gate-dep-install`](../hooks/pre-tool/gate-dep-install.mjs) hook's policy asks for — note in
55
55
  it that the human approved the version change.
56
56
 
57
57
  **Gate (human):** present the breaking-change list, the usage counts, and the migration shape.
package/hooks/hooks.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "hooks": [
8
8
  {
9
9
  "type": "command",
10
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start/detect-repo-instructions.sh"
10
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-start/detect-repo-instructions.mjs"
11
11
  }
12
12
  ]
13
13
  }
@@ -18,11 +18,11 @@
18
18
  "hooks": [
19
19
  {
20
20
  "type": "command",
21
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/block-dangerous-bash.sh"
21
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/block-dangerous-bash.mjs"
22
22
  },
23
23
  {
24
24
  "type": "command",
25
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/gate-dep-install.sh"
25
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/gate-dep-install.mjs"
26
26
  }
27
27
  ]
28
28
  },
@@ -31,11 +31,11 @@
31
31
  "hooks": [
32
32
  {
33
33
  "type": "command",
34
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/block-secret-writes.sh"
34
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/block-secret-writes.mjs"
35
35
  },
36
36
  {
37
37
  "type": "command",
38
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/guard-protected-paths.sh"
38
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool/guard-protected-paths.mjs"
39
39
  }
40
40
  ]
41
41
  }
@@ -46,7 +46,7 @@
46
46
  "hooks": [
47
47
  {
48
48
  "type": "command",
49
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool/lint-changed-files.sh"
49
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/post-tool/lint-changed-files.mjs"
50
50
  }
51
51
  ]
52
52
  },
@@ -55,7 +55,7 @@
55
55
  "hooks": [
56
56
  {
57
57
  "type": "command",
58
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool/audit-log.sh"
58
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/post-tool/audit-log.mjs"
59
59
  }
60
60
  ]
61
61
  }
@@ -65,7 +65,7 @@
65
65
  "hooks": [
66
66
  {
67
67
  "type": "command",
68
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit/inject-workflow-context.sh"
68
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit/inject-workflow-context.mjs"
69
69
  }
70
70
  ]
71
71
  }