@skathio/somi 1.2.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.claude/settings.json +9 -9
  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 +6 -1
  7. package/VERSION +1 -1
  8. package/commands/adopt.md +6 -4
  9. package/commands/code-loop.md +13 -13
  10. package/commands/plan-loop.md +10 -10
  11. package/commands/pr.md +1 -1
  12. package/commands/release-readiness.md +4 -4
  13. package/commands/review-panel.md +1 -1
  14. package/commands/review.md +3 -3
  15. package/commands/ship-loop.md +2 -2
  16. package/commands/somi.md +2 -2
  17. package/commands/upgrade.md +1 -1
  18. package/examples/sample-consumer/CLAUDE.md +5 -2
  19. package/examples/sample-consumer/README.md +20 -9
  20. package/hooks/hooks.json +8 -8
  21. package/hooks/lib/common.mjs +328 -0
  22. package/hooks/post-tool/audit-log.mjs +93 -0
  23. package/hooks/post-tool/lint-changed-files.mjs +212 -0
  24. package/hooks/pre-tool/block-dangerous-bash.mjs +382 -0
  25. package/hooks/pre-tool/block-secret-writes.mjs +96 -0
  26. package/hooks/pre-tool/gate-dep-install.mjs +229 -0
  27. package/hooks/pre-tool/guard-protected-paths.mjs +157 -0
  28. package/hooks/session-start/detect-repo-instructions.mjs +264 -0
  29. package/hooks/user-prompt-submit/inject-workflow-context.mjs +432 -0
  30. package/package.json +2 -2
  31. package/rules/CLAUDE.md +6 -5
  32. package/scripts/somi-check.mjs +243 -0
  33. package/scripts/somi-findings.mjs +307 -0
  34. package/scripts/somi-loop.mjs +354 -0
  35. package/scripts/validate.sh +21 -16
  36. package/skills/clean-code/SKILL.md +1 -1
  37. package/tests/hooks/cases/audit-log.json +21 -0
  38. package/tests/hooks/cases/block-dangerous-bash.json +90 -2
  39. package/tests/hooks/cases/block-secret-writes.json +1 -1
  40. package/tests/hooks/cases/detect-repo-instructions.json +84 -0
  41. package/tests/hooks/cases/gate-dep-install.json +6 -1
  42. package/tests/hooks/cases/guard-protected-paths.json +1 -1
  43. package/tests/hooks/cases/inject-workflow-context.json +126 -0
  44. package/tests/hooks/cases/lint-changed-files.json +120 -0
  45. package/tests/hooks/run.sh +280 -15
  46. package/tests/scripts/goldens/somi-findings.json +336 -0
  47. package/tests/scripts/goldens/somi-loop.json +168 -0
  48. package/tests/scripts/run.sh +251 -30
  49. package/hooks/lib/common.sh +0 -133
  50. package/hooks/post-tool/audit-log.sh +0 -40
  51. package/hooks/post-tool/lint-changed-files.sh +0 -80
  52. package/hooks/pre-tool/block-dangerous-bash.sh +0 -171
  53. package/hooks/pre-tool/block-secret-writes.sh +0 -83
  54. package/hooks/pre-tool/gate-dep-install.sh +0 -113
  55. package/hooks/pre-tool/guard-protected-paths.sh +0 -89
  56. package/hooks/session-start/detect-repo-instructions.sh +0 -73
  57. package/hooks/user-prompt-submit/inject-workflow-context.sh +0 -143
  58. package/scripts/somi-check.sh +0 -135
  59. package/scripts/somi-findings.sh +0 -173
  60. package/scripts/somi-loop.sh +0 -225
@@ -3,7 +3,7 @@
3
3
  "_comment": "Reference settings for somi when used VENDORED (copied into a project's .claude/ tree) instead of installed as a plugin. For the plugin install path, hooks/hooks.json is the source of truth and Claude Code merges it automatically using ${CLAUDE_PLUGIN_ROOT}. Vendored installs may copy this file (or merge its hooks block) into their own .claude/settings.json and adjust SOMI_VENDOR_ROOT to point at the hook scripts.",
4
4
  "env": {
5
5
  "SOMI_VENDOR_ROOT": "${CLAUDE_PROJECT_DIR}/.claude/plugins/somi",
6
- "SOMI_AUDIT_LOG": "${CLAUDE_PROJECT_DIR}/.claude/audit.log"
6
+ "SOMI_AUDIT_LOG": "${CLAUDE_PROJECT_DIR}/.somi/audit.log"
7
7
  },
8
8
  "permissions": {
9
9
  "allow": [
@@ -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.1",
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.1",
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.1",
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.1",
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
@@ -201,7 +206,7 @@ ready to merge, `/pr <slug>` turns its artifacts into the pull-request descripti
201
206
 
202
207
  - **Consistency** — every repo gets the same review bar, the same security posture, the same plan shape.
203
208
  - **Upgrade once** — update the plugin; every project benefits.
204
- - **Override locally** — projects keep their own `CLAUDE.md` and `rules/99-overrides.md`; SoMi never silently overrides them.
209
+ - **Override locally** — projects keep their own `CLAUDE.md` and `.somi/rules/99-overrides.md`; SoMi never silently overrides them.
205
210
  - **Auditable** — hooks log denied actions; reviewers can see what the system blocked vs. what humans approved.
206
211
 
207
212
  ---
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 2.0.1
package/commands/adopt.md CHANGED
@@ -26,9 +26,11 @@ first `/design`.
26
26
  ## Stage 2 — Confirm conventions into `99-overrides.md`
27
27
 
28
28
  From the atlas §4 digest (and the instruction files it lists), draft the project's
29
- `rules/99-overrides.md` scaffold **pre-filled with the detected conventions** — each as a
29
+ `.somi/rules/99-overrides.md` scaffold **pre-filled with the detected conventions** — each as a
30
30
  `## Convention:` block, plus a `## Override:` block for anything that contradicts a SoMi default
31
- (name the rule file it overrides and a removal condition).
31
+ (name the rule file it overrides and a removal condition). `.somi/` is the neutral location
32
+ regardless of which host (Claude Code, GitHub Copilot) is consuming SoMi — never write this under
33
+ `.claude/` or `.github/`, and never at the project root.
32
34
 
33
35
  **Present the draft to the user for confirmation before writing** — detected ≠ intended; the
34
36
  team may be tolerating practices they don't want codified. Apply their edits, then write the
@@ -55,7 +57,7 @@ From the atlas plus targeted checks, produce a short **gap report** (in-chat, pl
55
57
  Recommend one **small, real** feature or fix from the team's actual backlog shape (ask if none
56
58
  is obvious) to run as `/ship` — the calibration exercise from
57
59
  [GOVERNANCE.md](../docs/GOVERNANCE.md): it exercises plan → code-loop → review end-to-end, and
58
- disagreements it surfaces belong in `99-overrides.md` while they're fresh. For a bug, recommend
60
+ disagreements it surfaces belong in `.somi/rules/99-overrides.md` while they're fresh. For a bug, recommend
59
61
  `/debug` instead.
60
62
 
61
63
  ## Summarise back
@@ -70,7 +72,7 @@ disagreements it surfaces belong in `99-overrides.md` while they're fresh. For a
70
72
 
71
73
  - **Stage 2 writes nothing without confirmation.** Codifying conventions is a team decision;
72
74
  you draft, they decide (this is the batch verification protocol applied to onboarding).
73
- - **Never clobber** an existing `99-overrides.md`, `CLAUDE.md`, or atlas — propose additions.
75
+ - **Never clobber** an existing `.somi/rules/99-overrides.md`, `CLAUDE.md`, or atlas — propose additions.
74
76
  - **The gap report is descriptive.** No unsolicited refactoring, no "fixing" anything during
75
77
  adoption. The output is knowledge + a recommended first exercise, not diffs.
76
78
  - **Once per repo, roughly.** Re-running is safe (atlas refresh + report regeneration) but the
@@ -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
54
- session death at `.claude/somi-state/loop/<slug>.<N>.<M>.json`.
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
+ session death at `.somi/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))
61
- — state survives session death at `.claude/somi-state/loop/<slug>.json`.
60
+ ([`scripts/somi-loop.mjs`](../scripts/somi-loop.mjs), [`scripts/somi-findings.mjs`](../scripts/somi-findings.mjs))
61
+ — state survives session death at `.somi/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
- | No interrupted loops | `.claude/somi-state/loop/*.json` with `status: running` for in-scope slugs |
30
+ | No interrupted loops | `.somi/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,8 +24,8 @@ 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).
28
- 4. **Interrupted loops** — any `.claude/somi-state/loop/*.json` with `"status": "running"`: a
27
+ `node scripts/somi-findings.mjs open --slug <slug>` (count + worst severity).
28
+ 4. **Interrupted loops** — any `.somi/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
 
31
31
  Render a compact table:
@@ -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.
@@ -7,11 +7,14 @@ ruleset with project-specific instructions that you add below.
7
7
 
8
8
  ## SOMI global ruleset (do not edit)
9
9
 
10
- The composed SOMI ruleset is included from [`.claude/rules/CLAUDE.md`](.claude/rules/CLAUDE.md). When
10
+ The composed SOMI ruleset is included from
11
+ [`.claude/plugins/somi/rules/CLAUDE.md`](.claude/plugins/somi/rules/CLAUDE.md). When
11
12
  this `CLAUDE.md` is loaded, Claude Code follows both the SOMI rules and any project rules below.
12
13
 
13
14
  > If you want to override a SOMI default, edit
14
- > [`.claude/rules/99-overrides.md`](.claude/rules/99-overrides.md) — SOMI will never touch that file.
15
+ > [`.somi/rules/99-overrides.md`](.somi/rules/99-overrides.md) — SOMI will never touch that file.
16
+ > This lives under `.somi/`, not `.claude/` or `.github/`, so it stays the same regardless of
17
+ > which host (Claude Code, GitHub Copilot) is consuming SoMi.
15
18
 
16
19
  ---
17
20
 
@@ -16,8 +16,10 @@ files SoMi's plugin runtime places.
16
16
  ```
17
17
  <your project>/
18
18
  ├── CLAUDE.md # composed from rules/CLAUDE.md
19
- ├── .somi/ # workflow artifacts (created when /discover or /plan runs)
19
+ ├── .somi/ # workflow artifacts + project-local SoMi state
20
20
  │ ├── README.md
21
+ │ ├── rules/
22
+ │ │ └── 99-overrides.md # your project escape hatch (created by /adopt or by hand)
21
23
  │ ├── rd/ # discovery initiatives (created when /discover runs)
22
24
  │ │ └── <slug>/ # research-report, brd, srs, frd, sdd, tdd, decisions, diary
23
25
  │ ├── plans/
@@ -28,8 +30,10 @@ files SoMi's plugin runtime places.
28
30
  │ │ ├── progress.md
29
31
  │ │ ├── diary.md
30
32
  │ │ └── phases/
31
- │ └── reviews/
32
- │ └── <slug>/ # reviews keyed by work-item slug
33
+ │ ├── reviews/
34
+ │ │ └── <slug>/ # reviews keyed by work-item slug
35
+ │ ├── somi-state/ # runtime state (loop resume, context-injection signature); gitignored
36
+ │ └── audit.log # append-only tool-call log; gitignored
33
37
  └── .claude/
34
38
  ├── settings.json # SoMi hooks wired up (merged with yours if it existed)
35
39
  └── plugins/
@@ -38,7 +42,7 @@ files SoMi's plugin runtime places.
38
42
  ├── agents/ # discovery-analyst, planner, coder, reviewer + support
39
43
  ├── commands/ # /discover, /plan, /code, /review, /ship + support
40
44
  ├── skills/ # market-research, requirements-engineering, OWASP, SOLID, ...
41
- ├── rules/ # global ruleset
45
+ ├── rules/ # global ruleset (00-50 + the 99-overrides.md starter template)
42
46
  ├── templates/ # context, spec, decisions, phase, progress, diary, review, ADR, DoD; R&D: RD-README, RESEARCH, BRD, SRS, FRD, SDD, TDD
43
47
  └── hooks/ # guardrail scripts settings.json points at
44
48
  ```
@@ -52,15 +56,21 @@ files SoMi's plugin runtime places.
52
56
  - **`settings.json` is the merge of your existing settings + SoMi hooks/permissions**. Your
53
57
  existing `permissions.allow` is preserved; SoMi hook entries are appended; SoMi deny rules are
54
58
  added (union-merge).
59
+ - **All SoMi-written runtime state lives under `.somi/`, never `.claude/`.** `audit.log`,
60
+ `somi-state/` (loop resume, context-injection signature), and `rules/99-overrides.md` are all
61
+ project-local and host-neutral — the same regardless of whether the consumer is Claude Code or
62
+ GitHub Copilot. Only the plugin's own *installed code* (agents/commands/skills/rules/hooks) lives
63
+ under `.claude/plugins/somi/`.
55
64
 
56
65
  ## What stays yours after install
57
66
 
58
67
  - `CLAUDE.md` — the plugin runtime does not overwrite a hand-edited `CLAUDE.md`. Add
59
- project-specific instructions in [`rules/99-overrides.md`](../../rules/99-overrides.md)
60
- (which SoMi never touches) or directly in your `CLAUDE.md`.
68
+ project-specific instructions in [`.somi/rules/99-overrides.md`](.somi/rules/99-overrides.md)
69
+ (which SoMi never touches, and which survives `/plugin update somi`) or directly in your
70
+ `CLAUDE.md`.
61
71
  - All your existing `settings.json` keys outside of `hooks`, `permissions`, and `env`.
62
- - Everything under `.somi/` — workflow artifacts, not SoMi internals. Work items persist
63
- indefinitely; only you delete from there.
72
+ - Everything under `.somi/` — workflow artifacts and SoMi's own project-local state. Work items
73
+ persist indefinitely; only you delete from there.
64
74
 
65
75
  ## Updating
66
76
 
@@ -74,4 +84,5 @@ files SoMi's plugin runtime places.
74
84
  /plugin uninstall somi
75
85
  ```
76
86
 
77
- Removes the plugin. Leaves your `CLAUDE.md`, `.somi/` artifacts, and `audit.log` alone.
87
+ Removes the plugin. Leaves your `CLAUDE.md` and everything under `.somi/` (including `audit.log`
88
+ and `rules/99-overrides.md`) alone.
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
  }