continuous-improvement 3.11.0 → 3.15.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 (76) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +65 -1
  3. package/QUICKSTART.md +1 -1
  4. package/README.md +39 -18
  5. package/SKILL.md +1 -1
  6. package/bin/check-skill-count.mjs +32 -1
  7. package/bin/check-test-imports-only.mjs +1 -1
  8. package/bin/check-tool-count.mjs +129 -0
  9. package/bin/generate-plugin-manifests.mjs +3 -1
  10. package/bin/harvest-friction.mjs +1 -1
  11. package/bin/install.mjs +77 -3
  12. package/bin/mcp-server.mjs +66 -9
  13. package/bin/plan-pack.mjs +77 -0
  14. package/bin/unified-cli.mjs +55 -410
  15. package/commands/harvest.md +1 -1
  16. package/commands/model-forward.md +13 -0
  17. package/commands/production-readiness-review.md +53 -0
  18. package/commands/ship.md +57 -0
  19. package/commands/superpowers.md +1 -1
  20. package/hooks/companion-preference.mjs +31 -19
  21. package/hooks/gateguard.mjs +59 -25
  22. package/hooks/hook-pack.mjs +110 -0
  23. package/hooks/recall-briefing.mjs +167 -0
  24. package/lib/gateguard-state.mjs +62 -13
  25. package/lib/goal-state.mjs +13 -9
  26. package/lib/hook-pack-gate.mjs +65 -0
  27. package/lib/install-targets.mjs +121 -0
  28. package/lib/plan-review-packet.mjs +96 -0
  29. package/lib/plugin-metadata.mjs +33 -7
  30. package/lib/recall-briefing.mjs +57 -0
  31. package/lib/recall-index.mjs +2 -2
  32. package/lib/skill-distill.mjs +141 -0
  33. package/llms.txt +2 -2
  34. package/package.json +6 -4
  35. package/plugins/beginner.json +3 -3
  36. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
  37. package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
  38. package/plugins/continuous-improvement/README.md +1 -1
  39. package/plugins/continuous-improvement/agents/README.md +3 -3
  40. package/plugins/continuous-improvement/bin/mcp-server.mjs +66 -9
  41. package/plugins/continuous-improvement/commands/harvest.md +1 -1
  42. package/plugins/continuous-improvement/commands/model-forward.md +13 -0
  43. package/plugins/continuous-improvement/commands/production-readiness-review.md +53 -0
  44. package/plugins/continuous-improvement/commands/ship.md +57 -0
  45. package/plugins/continuous-improvement/commands/superpowers.md +1 -1
  46. package/plugins/continuous-improvement/hooks/companion-preference.mjs +31 -19
  47. package/plugins/continuous-improvement/hooks/gateguard.mjs +59 -25
  48. package/plugins/continuous-improvement/hooks/hook-pack.mjs +110 -0
  49. package/plugins/continuous-improvement/hooks/hooks.json +16 -1
  50. package/plugins/continuous-improvement/hooks/recall-briefing.mjs +167 -0
  51. package/plugins/continuous-improvement/lib/gateguard-state.mjs +62 -13
  52. package/plugins/continuous-improvement/lib/goal-state.mjs +13 -9
  53. package/plugins/continuous-improvement/lib/hook-pack-gate.mjs +65 -0
  54. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +33 -7
  55. package/plugins/continuous-improvement/lib/recall-briefing.mjs +57 -0
  56. package/plugins/continuous-improvement/lib/recall-index.mjs +2 -2
  57. package/plugins/continuous-improvement/lib/skill-distill.mjs +141 -0
  58. package/plugins/continuous-improvement/skills/README.md +1 -1
  59. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +1 -1
  60. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +4 -4
  61. package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +1 -1
  62. package/plugins/continuous-improvement/skills/handoff/SKILL.md +0 -1
  63. package/plugins/continuous-improvement/skills/model-forward/SKILL.md +44 -0
  64. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +1 -1
  65. package/plugins/expert.json +6 -2
  66. package/skills/README.md +4 -2
  67. package/skills/gateguard.md +4 -4
  68. package/skills/goal-monitor.md +1 -1
  69. package/skills/handoff.md +0 -1
  70. package/skills/model-forward.md +44 -0
  71. package/skills/superpowers.md +1 -1
  72. package/lib/compound-engineering.mjs +0 -831
  73. package/lib/pm-skills.mjs +0 -1274
  74. package/lib/unified-plugin.mjs +0 -924
  75. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +0 -108
  76. package/skills/para-memory-files.md +0 -108
@@ -7,8 +7,8 @@
7
7
  "plugins": [
8
8
  {
9
9
  "name": "continuous-improvement",
10
- "description": "Stops Claude Code from skipping research, claiming 'done' without verifying, and repeating yesterday's mistakes. The 7 Laws of AI Agent Discipline 25 bundled skills, gating hooks, the Mulahazah auto-leveling instinct engine, and a GitHub Action transcript linter.",
11
- "version": "3.11.0",
10
+ "description": "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as 25 bundled skills, instinct-aware hooks, an MCP toolset for recall and reflection, and a GitHub Action transcript linter that feeds real work history back into sharper instincts.",
11
+ "version": "3.15.0",
12
12
  "source": "./plugins/continuous-improvement",
13
13
  "author": {
14
14
  "name": "naimkatiman"
@@ -53,7 +53,7 @@
53
53
  },
54
54
  {
55
55
  "name": "oh-my-claudecode",
56
- "description": "Multi-agent orchestration system for Claude Code — 39 skills + 19 agents covering audit, plan, build, verify, ship, release, retrospective, and ops. Includes ralph (autonomous PRD loop), release, ultrawork, ultraqa, team, trace, visual-verdict, debug, deep-dive, deep-interview, autopilot, autoresearch. Vendored snapshot at third-party/oh-my-claudecode/ pinned to upstream SHA aacde3e (v4.13.6). Heavy overlap with continuous-improvement /ralph and /superpowers — pick per task.",
56
+ "description": "Multi-agent orchestration system for Claude Code — 38 skills + 19 agents covering audit, plan, build, verify, ship, release, retrospective, and ops. Includes ralph (autonomous PRD loop), release, ultrawork, ultraqa, team, trace, visual-verdict, debug, deep-dive, deep-interview, autopilot, autoresearch. Vendored snapshot at third-party/oh-my-claudecode/ pinned to upstream SHA aacde3e (v4.13.6). Heavy overlap with continuous-improvement /ralph and /superpowers — pick per task.",
57
57
  "version": "4.13.6",
58
58
  "source": "./third-party/oh-my-claudecode",
59
59
  "author": {
package/CHANGELOG.md CHANGED
@@ -4,7 +4,71 @@ All notable changes to this skill are documented here.
4
4
 
5
5
  ---
6
6
 
7
- ## [Unreleased]
7
+ ## [3.15.0] — 2026-06-21
8
+
9
+ ### Added
10
+
11
+ - **`/ship` cuts one defect from audit to an open PR** — a single-concern fast path that routes `reconcile` → `tdd-workflow` → `verification-loop` → `commit-push-pr` → `deploy-receipt` for one fix, then stops at PR-open. Never auto-merges or deploys. Command-only; `/release-train` remains the multi-PR path. Plan: `docs/plans/2026-06-17-ship-command.md`. (#246)
12
+ - **`/production-readiness-review` fans a blind multi-agent review into one punch-list** — parallel reviewers across performance, security, UI/UX, and test coverage, each grounding findings in real code/logs/live data, reconciled into a deduplicated, severity-ranked list. Report-only; never fixes, merges, or deploys. Plan: `docs/plans/2026-06-17-production-readiness-review-command.md`. (#247)
13
+ - **`hook-pack` enforces push-to-main and commit-size at the tool boundary** — a warn-default PreToolUse hook (Bash-matched so the non-Bash hot path stays cheap; gateguard stays first) that flags a direct `git push` to a protected branch (`main`/`master`/`release/*`) and a `git commit` staging more than 15 files. Mode `CLAUDE_CI_HOOKPACK_GATE=warn|block|off`; warn never blocks, so zero disruption until you opt into `block`. Pure logic in `lib/hook-pack-gate`. Plan: `docs/plans/2026-06-17-enforcing-hook-pack.md`. (#248)
14
+ - **`/plan-pack` turns a plan doc into a commentable review packet for colleague review** — converts a `docs/plans/` doc into a structured packet a colleague can comment on before implementation. (#244)
15
+ - **How-to-best-use guide** mapping the agentic-engineering workflow to the plugin's skills, commands, and hooks (`docs/using-this-plugin.md`). (#245)
16
+
17
+ ## [3.14.0] — 2026-06-14
18
+
19
+ ### Fixed
20
+
21
+ - **Gateguard clearance cap no longer bleeds across concurrent sessions and self-heals instead of needing a manual `rm`** — the per-session clearance state was keyed on the project hash only, so every Claude session on a repo (sequential or concurrent) shared one 50-file counter that only grew; on a multi-Claude host later sessions inherited a near-full gate, and the "start a new session to reset" message did nothing because a new session resolved to the same file. State is now scoped to `~/.claude/instincts/<projectHash>/sessions/<sessionId>/` (the hook reads `session_id` from stdin; ids are sanitized against path traversal), a 12h TTL self-heals a stale state file to empty on load, and the MCP `ci_gateguard_clear` route accepts a `state_path` so it writes to the session-scoped file. The `MAX_CLEARED_FILES` rogue-loop cap still bounds a single session. Plan: `docs/plans/2026-06-14-gateguard-session-scoped-cap.md`. (#242)
22
+
23
+ ## [3.13.0] — 2026-06-10
24
+
25
+ ### Added
26
+
27
+ - **model-forward ships as a default tier-1 skill** — the standing stance that skills are scaffolding which merges into the model over time; durable core = goal-driven execution + guardrails. (#229)
28
+ - **`distill` turns a verified Workflow run into a draft instinct** — the ultracode-to-memory bridge: a completed multi-agent Workflow's verified trajectory becomes a reviewable instinct draft instead of evaporating with the session. (#226)
29
+
30
+ ### Fixed
31
+
32
+ - **PreToolUse hooks no longer flood every session with `Hook JSON output validation failed — (root): Invalid input` errors (twice per tool call)** — `gateguard.mjs` and `companion-preference.mjs` emitted `{"decision":"allow"}` on every allowed call, which was never schema-valid PreToolUse output (the deprecated `decision` enum is `approve | block`), and current Claude Code clients surface the validation failure instead of silently discarding it. Allow is now empty stdout + exit 0; block uses the documented `hookSpecificOutput.permissionDecision: "deny"` shape. (#230)
33
+ - **goal-state keyword extraction works for Korean goals** — a script-aware minimum keyword length (2 for Hangul tokens, 4 elsewhere) stops Korean goal statements from extracting zero keywords and scoring all work as drift.
34
+
35
+ ### Removed
36
+
37
+ - **`ci` toolkit slimmed to CLI-Anything only — Compound Engineering + PM-Skills removed (breaking)** — the published `ci` command dropped its `compound`, `pm`, `learnings`, and `init`/`workflow`/`research`/`planning`/`execution`/`review` subcommands. Compound Engineering overlapped the Mulahazah instinct engine and PM-Skills overlapped the out-of-band `phuryn/pm-skills` marketplace install, so both were tree-shaken; the vestigial `unified-plugin` orchestrator was deleted and `unified-cli` rewritten as a thin front-end over the retained CLI-Anything library (`ci generate <repo>` / `ci list` / `ci config`). Removes ~4,500 LOC of source + tests; `cli-anything` and the build-critical `pm-marketplace` are unchanged. Plan: `docs/plans/2026-06-08-slim-ci-to-cli-anything.md`.
38
+
39
+ ## [3.12.3] — 2026-06-08
40
+
41
+ ### Fixed
42
+
43
+ - **Completed the OIDC trusted-publishing pipeline by restoring setup-node `registry-url`** — #211 had removed it to kill the dummy-token `.npmrc`, but that left npm with no registry anchor for the OIDC token exchange (`ENEEDAUTH` on 3.12.1/3.12.2). With `registry-url` back, Node 22 (#213), npm ≥ 11.5.1, and a configured trusted publisher, npm mints and uses the OIDC token. **3.12.3 is the first version actually published to npm** carrying the 3.12.0 changes (#198 positioning, #199 recall hook, #202 OIDC, #203 doc-drift, #204 tool-count); 3.12.0–3.12.2 were never published. (#215)
44
+
45
+ ## [3.12.2] — 2026-06-08
46
+
47
+ ### Fixed
48
+
49
+ - **Release workflow now runs on Node 22 so OIDC trusted publishing actually authenticates** — npm trusted publishing requires npm ≥ 11.5.1 **and Node ≥ 22.14.0** ([docs.npmjs.com/trusted-publishers](https://docs.npmjs.com/trusted-publishers)). `release.yml` ran on Node 20, below the floor, so the OIDC token exchange never engaged: the `v3.12.0` publish fell back to setup-node's dummy `.npmrc` token (`E404`) and `v3.12.1` had no auth at all (`ENEEDAUTH`). Bumping `setup-node` to Node 22 (plus #211 dropping the token-bearing `.npmrc`) completes the OIDC pipeline. **3.12.2 is the first npm artifact to carry the 3.12.0 changes** (#198 positioning, #199 recall hook, #202 OIDC pipeline, #203 doc-drift, #204 tool-count invariant); `3.12.0` and `3.12.1` were never published to npm. (#211, #213)
50
+
51
+ ## [3.12.1] — 2026-06-08
52
+
53
+ ### Fixed
54
+
55
+ - **npm release pipeline now authenticates via OIDC instead of a dummy token** — the `v3.12.0` tag publish failed with `E404` on the registry PUT: `actions/setup-node` with `registry-url` wrote an `.npmrc` carrying `_authToken=${NODE_AUTH_TOKEN}` set to its placeholder value, so npm used that dummy token for the publish instead of OIDC trusted publishing (provenance still signed, since the sigstore OIDC token is separate). Dropping `registry-url` from `release.yml` lets `npm publish --provenance` fall back to OIDC as intended. **3.12.1 is the first npm artifact to carry the 3.12.0 changes** (intelligence-amplifier positioning #198, recall-briefing hook #199, OIDC pipeline #202, doc-drift fixes #203, `verify:tool-count` invariant #204); the `3.12.0` version was never published to npm. (#211)
56
+
57
+ ## [3.12.0] — 2026-06-07
58
+
59
+ ### Added
60
+
61
+ - **Proactive recall-briefing hook (opt-in episodic memory)** — `hooks/recall-briefing.mjs` runs on `UserPromptSubmit`, queries the BM25 observation index in-process, and surfaces the most relevant prior corrections as a briefing before the agent acts. First capability increment of the intelligence-amplifier reframe: a lesson learned once is recalled automatically on the next related prompt instead of being re-taught. Opt-in — disabled unless wired into the hook config.
62
+ - **`verify:tool-count` content invariant (12th in `verify:all`)** — `bin/check-tool-count.mjs` pins MCP tool-count claims in docs and source to the generated `plugins/{expert,beginner}.json` `tools[].length`, so a count can't drift when a tool is added — the gap that let "12 tools" pass `verify:all` green in the 2026-06-07 audit. Pins four claims across `docs/skills.md`, `README.md`, `QUICKSTART.md`, and the `mcp-server` banner. Follow-up to #203 (PR #204).
63
+
64
+ ### Changed
65
+
66
+ - **Positioning reframed from "seatbelt" to intelligence amplifier across every user-facing surface** — the 7 Laws of AI Agent Discipline keep their names but each is reframed from a restriction into a capability the agent gains. README h1 "A seatbelt for Claude Code" → "Claude Code that gets sharper every session"; landing page title/hero/CTA, `SHARED_PLUGIN_DESCRIPTION` (the source of truth that propagates to `package.json` + all generated manifests + `llms.txt`), SKILL.md, and CONTRIBUTING.md all reframed from "Stops Claude Code from…" loss-framing to capability-led copy. Honesty held: recall stays lexical/BM25, instincts decay, GateGuard still blocks (framed as forced grounding) — no over-claiming. Plan: `docs/plans/2026-06-07-intelligence-amplifier-reframe.md`.
67
+ - **npm release now publishes via OIDC trusted publishing instead of `NPM_TOKEN`** — the account enforces 2FA-on-writes, which makes long-lived granular tokens hit EOTP in CI. `release.yml` upgrades npm to ≥ 11.5.1 and publishes with `npm publish --access public --provenance` (signed provenance from the OIDC claims); the `NPM_TOKEN` secret dependency is gone. See `docs/RELEASING.md` for the one-time trusted-publisher setup.
68
+
69
+ ### Fixed
70
+
71
+ - **Doc/count drift surfaced by a post-merge audit** — corrected prose/count claims that drifted from the v3.11.0 implementation and that no `verify:all` invariant covers: MCP expert surface is 18 tools (not 12); the CONTRIBUTING release checklist now defers to `docs/RELEASING.md` instead of describing the retired manual publish flow; `agents/README.md` repointed off a non-existent reference doc; the oh-my-claudecode vendored snapshot count corrected to 38 skills; `harvest` observe-path corrected to `instincts/bin/observe.mjs`; and reports/update-card test counts synced to 793.
8
72
 
9
73
  ## [3.11.0] — 2026-06-07
10
74
 
package/QUICKSTART.md CHANGED
@@ -130,7 +130,7 @@ Corrections drop instinct confidence. Unused instincts decay. The system self-co
130
130
 
131
131
  ## Expert (npx) — only if you want MCP, hooks, or instinct packs
132
132
 
133
- The Beginner path above is enough for most users. Pick this only if you want the MCP tools (12 of them, including `ci_plan_init` / `ci_plan_status` for `task_plan.md`-style planning), the session hooks that feed Mulahazah, or the starter instinct packs.
133
+ The Beginner path above is enough for most users. Pick this only if you want the MCP tools (19 of them, including `ci_plan_init` / `ci_plan_status` for `task_plan.md`-style planning), the session hooks that feed Mulahazah, or the starter instinct packs.
134
134
 
135
135
  Do not run both paths against the same `~/.claude/` — that produces duplicated state. Pick one and stick with it.
136
136
 
package/README.md CHANGED
@@ -4,14 +4,14 @@
4
4
  <img src="assets/combined.gif" alt="Before vs After — The 7 Laws of AI Agent Discipline" width="700" />
5
5
  </p>
6
6
 
7
- <h1 align="center">A seatbelt for Claude Code</h1>
7
+ <h1 align="center">Claude Code that gets sharper every session</h1>
8
8
 
9
9
  <p align="center">
10
- <b>Research first. Edit safely. Verify before done. Remember what worked.</b>
10
+ <b>Remembers what it already solved. Grounds every edit in facts. Verifies before "done". Carries every lesson into the next session.</b>
11
11
  </p>
12
12
 
13
13
  <p align="center">
14
- <i>The 7 Laws of AI Agent Discipline — runtime hooks, enforcement skills, and project memory.</i>
14
+ <i>The 7 Laws of AI Agent Discipline — runtime hooks, instinct memory, and skills that compound what it learns.</i>
15
15
  </p>
16
16
 
17
17
  <p align="center">
@@ -26,17 +26,17 @@
26
26
  <b>New here?</b> → <a href="QUICKSTART.md">QUICKSTART.md</a> (2 minutes) · <a href="https://continuous-improvement.dev">continuous-improvement.dev</a>
27
27
  </p>
28
28
 
29
- > **What this is *not*:** a prompt template, a `CLAUDE.md`, or a vibes-based reminder. It is a runtime hook (`hooks/gateguard.mjs`) plus a bundled skill set that physically blocks `Edit` / `Write` / destructive `Bash` until the agent has done the work.
29
+ > **What this is *not*:** a prompt template, a `CLAUDE.md`, or a vibes-based reminder. It is a runtime hook (`hooks/gateguard.mjs`) plus a bundled skill set that makes the agent ground every change in real facts — it physically blocks `Edit` / `Write` / destructive `Bash` until the investigation is done, so edits land on understanding instead of guesses.
30
30
 
31
31
  ---
32
32
 
33
33
  ## What this does
34
34
 
35
- Claude Code is powerful but skips the boring discipline: it edits before reading, guesses instead of checking, stacks five concerns into one commit, and says "done" without running tests. Continuous Improvement adds three layers that stop that:
35
+ Claude Code is powerful but leaves intelligence on the table: it edits before reading, guesses instead of checking, stacks five concerns into one commit, and says "done" without running tests. Continuous Improvement adds three layers that make it sharper:
36
36
 
37
37
  1. **Before an edit** — [`gateguard`](skills/gateguard.md) ships as a `PreToolUse` hook (`hooks/gateguard.mjs`) that physically blocks `Edit` / `Write` / `MultiEdit` and destructive `Bash` until the agent presents a fact-list investigation.
38
38
  2. **During work** — bundled skills enforce planning, one-thing-at-a-time execution, TDD ([`tdd-workflow`](skills/tdd-workflow.md)), and a six-phase verification ladder ([`verification-loop`](skills/verification-loop.md)) before "done".
39
- 3. **After work** — `/seven-laws` reflection plus the Mulahazah instinct engine capture lessons so the same mistake does not repeat next session.
39
+ 3. **After work** — `/seven-laws` reflection plus the Mulahazah instinct engine capture lessons, and the opt-in [`recall-briefing`](hooks/recall-briefing.mjs) hook resurfaces the most relevant past fix on the next related prompt, so the same mistake does not repeat next session.
40
40
 
41
41
  Beginner install is two slash commands inside Claude Code (no Node, no bash). Expert install adds MCP tools, observation hooks, instinct packs, and a GitHub Action transcript linter for CI.
42
42
 
@@ -52,7 +52,7 @@ With Continuous Improvement, the same prompt is forced through the gate:
52
52
 
53
53
  > `gateguard` blocks the first `Edit` until Claude presents a fact list. Claude reads `useAuth.ts`, finds the existing `redirectAfterLogin` helper, traces *why* the redirect loops (a stale `from` query param), and edits one line in one file. `verification-loop` runs the tests. The reply names the file, the line, the cause.
54
54
 
55
- Same agent. Same model. Different discipline.
55
+ Same agent. Same model. Different intelligence.
56
56
 
57
57
  ---
58
58
 
@@ -86,7 +86,7 @@ You have used Claude Code (or any agentic coding tool) long enough to recognize
86
86
  | 2 | **No shared language** | The agent uses 20 words where 1 would do; jargon decoded fresh every session; variable names drift from domain terms | Law 2 (Plan), Law 7 (Learn) | [`grill-with-docs`](skills/grill-with-docs.md) (writes & maintains `CONTEXT.md`), [`token-budget-advisor`](skills/token-budget-advisor.md), [`strategic-compact`](skills/strategic-compact.md) |
87
87
  | 3 | **No feedback loop** | The code doesn't work — agent claims "done" without running build, tests, or healthcheck | Law 4 (Verify) | [`tdd-workflow`](skills/tdd-workflow.md), [`verification-loop`](skills/verification-loop.md), [`deploy-receipt`](skills/deploy-receipt.md) |
88
88
  | 4 | **Design rot** | Ball-of-mud accelerates — agent bundles three concerns into one PR, stacks untested changes, ignores prior architectural decisions | Law 2 (Plan), Law 3 (One Thing) | [`superpowers:writing-plans`](https://github.com/obra/superpowers/blob/main/skills/writing-plans/SKILL.md), [`safety-guard`](skills/safety-guard.md), [`worktree-safety`](skills/worktree-safety.md), [`wild-risa-balance`](skills/wild-risa-balance.md) |
89
- | 5 | **Forgotten lessons** | Next session starts from zero — prior corrections, decisions, instincts are lost; the same mistake repeats next week | Law 5 (Reflect), Law 7 (Learn) | [`handoff`](skills/handoff.md), [`para-memory-files`](skills/para-memory-files.md), Mulahazah instinct engine |
89
+ | 5 | **Forgotten lessons** | Next session starts from zero — prior corrections, decisions, instincts are lost; the same mistake repeats next week | Law 5 (Reflect), Law 7 (Learn) | [`handoff`](skills/handoff.md), Mulahazah instinct engine |
90
90
 
91
91
  Three of those alignment + reflection skills (`grill-me`, `grill-with-docs`, `handoff`) are MIT-licensed ports from mattpocock/skills; the rest are continuous-improvement-native. Every failure mode has at least one runtime hook or model-side skill that catches it before it lands in the diff.
92
92
 
@@ -138,7 +138,7 @@ V1 honest limitations: the runtime gate is honor-system once the agent flips `_g
138
138
 
139
139
  ### Expert — adds MCP server, observation hooks, and instinct packs
140
140
 
141
- Pick this if you want the MCP tools (12 of them, including `ci_plan_init` / `ci_plan_status` for `task_plan.md`-style planning), the session hooks that feed Mulahazah, and starter packs.
141
+ Pick this if you want the MCP tools (19 of them, including `ci_plan_init` / `ci_plan_status` for `task_plan.md`-style planning), the session hooks that feed Mulahazah, and starter packs.
142
142
 
143
143
  Preconditions: Node 18 / 20 / 22, plus bash on Windows (Git Bash or WSL — `hooks/observe.sh` is a bash script and silently no-ops without it). **`jq` is no longer required**: as of v3.6.0, `observe.sh` prefers the Node observer (`bin/observe.mjs`) which writes the rich event schema natively without external dependencies. The bash thin-schema path is kept as a two-phase shim, so legacy installs that have not re-run `npx continuous-improvement install` since v3.5.x will still degrade silently without `jq` (`winget install jqlang.jq` on Windows, `brew install jq` on macOS, `apt install jq` on Debian/Ubuntu) — re-running the installer is the cleaner fix and removes the dependency entirely. See [CHANGELOG.md](CHANGELOG.md) `[3.6.0]` for the migration details.
144
144
 
@@ -171,20 +171,41 @@ The framework has documented operator-level modes that change hook behavior with
171
171
  |---|---|---|
172
172
  | `CLAUDE_THREE_SECTION_CLOSE_DISABLED=1` | `three-section-close.mjs` short-circuits before any enforcement or telemetry. Use when end-of-turn reflection should run as internal thinking rather than visible "What has been done / What is next / Recommendation" sections. Public default unchanged — the rule still fires for everyone else. | bash/zsh: `export CLAUDE_THREE_SECTION_CLOSE_DISABLED=1` in `~/.bashrc` / `~/.zshrc`. PowerShell: `$env:CLAUDE_THREE_SECTION_CLOSE_DISABLED=1` (session) or `[Environment]::SetEnvironmentVariable('CLAUDE_THREE_SECTION_CLOSE_DISABLED','1','User')` (persistent). |
173
173
  | `CLAUDE_GOAL_DRIFT_GATE` | `goal-drift-stop.mjs` (a `Stop` hook) scores each turn's activity against the `## Goal` in `task_plan.md` and acts on drift. `warn` (default) prints a one-line stderr notice and never blocks; `block` re-prompts a substantive wrap-up that has drifted off-goal so the goal gates the close; `off` disables it. Reads the same observation feed as Mulahazah; fails open on any error. | bash/zsh: `export CLAUDE_GOAL_DRIFT_GATE=block` in `~/.bashrc` / `~/.zshrc`. PowerShell: `$env:CLAUDE_GOAL_DRIFT_GATE='block'` (session) or `[Environment]::SetEnvironmentVariable('CLAUDE_GOAL_DRIFT_GATE','block','User')` (persistent). |
174
+ | `CLAUDE_RECALL_BRIEFING=1` | `hooks/recall-briefing.mjs` (a UserPromptSubmit hook) makes episodic memory proactive: on the first substantive prompt of a session it searches this project's past observations (BM25) and injects a one-time `<system-reminder>` with the most relevant prior activity, so the agent reuses a past fix instead of re-deriving it. Opt-in and default off; it is an amplifier, never a gate — it cannot block a prompt and fails open. The `ci_recall` MCP tool stays available for explicit, deeper searches. | bash/zsh: `export CLAUDE_RECALL_BRIEFING=1` in `~/.bashrc` / `~/.zshrc`. PowerShell: `$env:CLAUDE_RECALL_BRIEFING=1` (session) or `[Environment]::SetEnvironmentVariable('CLAUDE_RECALL_BRIEFING','1','User')` (persistent). |
175
+
176
+ ### Works with other agents
177
+
178
+ Claude Code gets the full install (hooks, MCP server, instinct learning). Every other agent platform can still run the 7 Laws as a rules file — one flag writes the skill text into the file that platform reads, at your project root:
179
+
180
+ ```bash
181
+ npx continuous-improvement install --target gemini,codex
182
+ ```
183
+
184
+ | Target | File written |
185
+ |---|---|
186
+ | `gemini` | `GEMINI.md` (Gemini CLI context file) |
187
+ | `codex` | `AGENTS.md` (agents.md standard — also read by opencode, Jules, Cursor ≥0.50) |
188
+ | `cursor` | `.cursor/rules/continuous-improvement.mdc` (`alwaysApply: true`) |
189
+ | `windsurf` | `.windsurf/rules/continuous-improvement.md` |
190
+ | `zed` | `.rules` |
191
+ | `aider` | `CONVENTIONS.md` + a minimal `.aider.conf.yml` if none exists |
192
+ | `copilot` | `.github/copilot-instructions.md` |
193
+
194
+ Shared files (`GEMINI.md`, `AGENTS.md`, `.rules`, `CONVENTIONS.md`, `copilot-instructions.md`) are merged through a managed marker block — your existing content is preserved and reinstalls are idempotent. Targets can be combined freely (`--target claude,gemini,codex` runs the full Claude Code install plus the rules files).
174
195
 
175
196
  ---
176
197
 
177
198
  ## The 7 Laws
178
199
 
179
- | # | Law | Without it, agents... |
200
+ | # | Law | What it gives the agent |
180
201
  |---|-----|----------------------|
181
- | 1 | **Research Before Executing** | reinvent what already exists |
182
- | 2 | **Plan Is Sacred** | scope-creep and overbuild |
183
- | 3 | **One Thing at a Time** | stack untested changes |
184
- | 4 | **Verify Before Reporting** | lie about being "done" |
185
- | 5 | **Reflect After Sessions** | repeat the same failures |
186
- | 6 | **Iterate One Change** | debug 5 changes at once |
187
- | 7 | **Learn From Every Session** | lose knowledge when context ends |
202
+ | 1 | **Research Before Executing** | builds on what already exists instead of reinventing it |
203
+ | 2 | **Plan Is Sacred** | lands effort on the goal with success defined up front |
204
+ | 3 | **One Thing at a Time** | ships each change on a known-good base |
205
+ | 4 | **Verify Before Reporting** | backs every "done" with evidence you can trust |
206
+ | 5 | **Reflect After Sessions** | turns each session into a captured lesson |
207
+ | 6 | **Iterate One Change** | keeps debugging isolated and the signal clean |
208
+ | 7 | **Learn From Every Session** | compounds knowledge so next week's agent is sharper |
188
209
 
189
210
  ```
190
211
  Research -> Plan -> Execute (one thing) -> Verify -> Reflect -> Learn -> Iterate
@@ -298,7 +319,7 @@ Authored end-to-end with `/superpowers` and `/proceed-with-the-recommendation`:
298
319
 
299
320
  - [QUICKSTART.md](QUICKSTART.md) — 2-minute setup
300
321
  - [SKILL.md](SKILL.md) — full 7 Laws spec
301
- - [docs/skills.md](docs/skills.md) — full 25-skill catalog
322
+ - [docs/skills.md](docs/skills.md) — full 26-skill catalog
302
323
  - [examples/](examples/) — bug fix, feature build, refactor walkthroughs
303
324
  - [templates/insights-claude-md.md](templates/insights-claude-md.md) — paste-in CLAUDE.md blocks for verification discipline, environment notes, think-before-acting, and git/deploy workflow (sourced from the 28-day usage report)
304
325
  - [CONTRIBUTING.md](CONTRIBUTING.md) — architecture, repo internals, adding a new skill
package/SKILL.md CHANGED
@@ -6,7 +6,7 @@ description: "Install structured self-improvement loops with instinct-based lear
6
6
 
7
7
  # continuous-improvement
8
8
 
9
- You follow the continuous-improvement framework. These 7 laws govern all your work.
9
+ You follow the continuous-improvement framework. These 7 laws make every task sharper — each is a capability that compounds: research deeper, plan tighter, verify with evidence, reflect, and learn so the same lesson is never re-taught.
10
10
 
11
11
  ## Law 1: Research Before Executing
12
12
 
@@ -24,6 +24,11 @@
24
24
  * - plugins/continuous-improvement/.claude-plugin/plugin.json
25
25
  * - package.json
26
26
  * - llms.txt
27
+ * - .cloudplugin/marketplace.json (hand-maintained, not generator-owned)
28
+ *
29
+ * Stat-block files (count lives in a split HTML stat, not the phrase):
30
+ * - docs/landing/index.html — `<span class="v">N</span><span class="k">Bundled skills</span>`
31
+ * (PR #229 found this surface stale at 25 while every phrase file said 26)
27
32
  *
28
33
  * Usage:
29
34
  * node bin/check-skill-count.mjs # Check the current repo
@@ -42,7 +47,9 @@ const CHECKED_FILES = [
42
47
  "plugins/continuous-improvement/.claude-plugin/plugin.json",
43
48
  "package.json",
44
49
  "llms.txt",
50
+ ".cloudplugin/marketplace.json",
45
51
  ];
52
+ const STAT_CHECKED_FILES = ["docs/landing/index.html"];
46
53
  export function countSkills(repoRoot) {
47
54
  const skillsDir = join(repoRoot, BUNDLE_SKILLS_DIR);
48
55
  const entries = readdirSync(skillsDir);
@@ -75,6 +82,24 @@ function checkFile(repoRoot, relPath, expected) {
75
82
  found: staleMatch ? staleMatch[0] : undefined,
76
83
  };
77
84
  }
85
+ function checkStatFile(repoRoot, relPath, expected) {
86
+ let content;
87
+ try {
88
+ content = readFileSync(join(repoRoot, relPath), "utf8");
89
+ }
90
+ catch {
91
+ return { file: relPath, reason: "missing" };
92
+ }
93
+ const expectedPattern = new RegExp(`class="v">${expected}</span><span class="k">Bundled skills`);
94
+ if (expectedPattern.test(content))
95
+ return null;
96
+ const staleMatch = content.match(/class="v">(\d+)<\/span><span class="k">Bundled skills/);
97
+ return {
98
+ file: relPath,
99
+ reason: staleMatch ? "stale" : "missing",
100
+ found: staleMatch ? `${staleMatch[1]} Bundled skills (stat block)` : undefined,
101
+ };
102
+ }
78
103
  function main() {
79
104
  const repoRoot = argv[2] ?? cwd();
80
105
  const expected = countSkills(repoRoot);
@@ -84,8 +109,14 @@ function main() {
84
109
  if (v)
85
110
  violations.push(v);
86
111
  }
112
+ for (const file of STAT_CHECKED_FILES) {
113
+ const v = checkStatFile(repoRoot, file, expected);
114
+ if (v)
115
+ violations.push(v);
116
+ }
117
+ const totalChecked = CHECKED_FILES.length + STAT_CHECKED_FILES.length;
87
118
  if (violations.length === 0) {
88
- console.log(`OK skill-count: all ${CHECKED_FILES.length} description string(s) state "${expected} bundled skills" (matches skills/ source-of-truth).`);
119
+ console.log(`OK skill-count: all ${totalChecked} description string(s) state "${expected} bundled skills" (matches skills/ source-of-truth).`);
89
120
  exit(0);
90
121
  }
91
122
  console.error(`FAIL skill-count: ${violations.length} description string(s) do not state the actual bundled-skill count of ${expected}.`);
@@ -12,7 +12,7 @@
12
12
  * - reach-through into `hooks/`, `scripts/`, `src/`, or deeper paths under
13
13
  * `bin/` or `lib/`
14
14
  *
15
- * Baseline: all 50 `src/test/*.test.mts` files pass today.
15
+ * Baseline: all 56 `src/test/*.test.mts` files pass today.
16
16
  *
17
17
  * Usage:
18
18
  * node bin/check-test-imports-only.mjs # Check the current repo
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Tool Count Check
4
+ *
5
+ * Docs and source comments claim the size of the MCP tool surface
6
+ * ("N tools"). Those numbers drift every time a tool is added without the
7
+ * claim being bumped — exactly what the 2026-06-07 post-merge audit (PR #203)
8
+ * found: docs/skills.md said "12 tools" and src/bin/mcp-server.mts said
9
+ * "beginner (3 tools)" while the catalog had grown to 18 expert / 4 beginner,
10
+ * and `verify:all` stayed green because no invariant covered those strings.
11
+ *
12
+ * Source of truth: the GENERATED, committed manifests
13
+ * - plugins/expert.json tools[].length (expert mode = all tools)
14
+ * - plugins/beginner.json tools[].length (beginner mode)
15
+ * Both are generated from src/lib/plugin-metadata.mts by `npm run build` and
16
+ * pinned against drift by `verify:generated`, so they are the honest count.
17
+ *
18
+ * Each ASSERTION names a file, a capture regex around its tool-count claim, and
19
+ * which mode's count the captured integer must equal. Precise per-claim regexes
20
+ * avoid false positives on historical CHANGELOG or vendored "N tools" strings.
21
+ * The installer banner is intentionally NOT listed: PR #203 made it derive the
22
+ * count from getToolNames("expert") at runtime, so it can never drift.
23
+ *
24
+ * Usage:
25
+ * node bin/check-tool-count.mjs # Check the current repo
26
+ * node bin/check-tool-count.mjs <repo-root> # Check a specific repo root
27
+ *
28
+ * Exit codes:
29
+ * 0 — every claim matches the manifest count
30
+ * 1 — at least one claim is stale or missing
31
+ */
32
+ import { readFileSync } from "node:fs";
33
+ import { join } from "node:path";
34
+ import { argv, cwd, exit } from "node:process";
35
+ const MANIFEST = {
36
+ expert: "plugins/expert.json",
37
+ beginner: "plugins/beginner.json",
38
+ };
39
+ const ASSERTIONS = [
40
+ {
41
+ file: "docs/skills.md",
42
+ pattern: /MCP server \((\d+) tools\)/,
43
+ mode: "expert",
44
+ label: "expert MCP tool count",
45
+ },
46
+ {
47
+ file: "README.md",
48
+ pattern: /MCP tools \((\d+) of them/,
49
+ mode: "expert",
50
+ label: "expert MCP tool count (README)",
51
+ },
52
+ {
53
+ file: "QUICKSTART.md",
54
+ pattern: /MCP tools \((\d+) of them/,
55
+ mode: "expert",
56
+ label: "expert MCP tool count (QUICKSTART)",
57
+ },
58
+ {
59
+ file: "src/bin/mcp-server.mts",
60
+ pattern: /beginner \((\d+) tools\)/,
61
+ mode: "beginner",
62
+ label: "beginner mode tool count",
63
+ },
64
+ ];
65
+ export function countTools(repoRoot, mode) {
66
+ const raw = readFileSync(join(repoRoot, MANIFEST[mode]), "utf8");
67
+ const parsed = JSON.parse(raw);
68
+ if (!Array.isArray(parsed.tools)) {
69
+ throw new Error(`${MANIFEST[mode]} has no "tools" array`);
70
+ }
71
+ return parsed.tools.length;
72
+ }
73
+ function checkAssertion(repoRoot, a, expected) {
74
+ let content;
75
+ try {
76
+ content = readFileSync(join(repoRoot, a.file), "utf8");
77
+ }
78
+ catch {
79
+ return { file: a.file, label: a.label, reason: "missing", expected };
80
+ }
81
+ const m = content.match(a.pattern);
82
+ if (!m)
83
+ return { file: a.file, label: a.label, reason: "missing", expected };
84
+ if (Number(m[1]) === expected)
85
+ return null;
86
+ return { file: a.file, label: a.label, reason: "stale", found: m[0], expected };
87
+ }
88
+ export function checkToolCount(repoRoot) {
89
+ const counts = {
90
+ expert: countTools(repoRoot, "expert"),
91
+ beginner: countTools(repoRoot, "beginner"),
92
+ };
93
+ const violations = [];
94
+ for (const a of ASSERTIONS) {
95
+ const v = checkAssertion(repoRoot, a, counts[a.mode]);
96
+ if (v)
97
+ violations.push(v);
98
+ }
99
+ return { violations, counts };
100
+ }
101
+ function main() {
102
+ const repoRoot = argv[2] ?? cwd();
103
+ const { violations, counts } = checkToolCount(repoRoot);
104
+ if (violations.length === 0) {
105
+ console.log(`OK tool-count: all ${ASSERTIONS.length} claim(s) match the generated manifests ` +
106
+ `(expert=${counts.expert}, beginner=${counts.beginner}).`);
107
+ exit(0);
108
+ }
109
+ console.error(`FAIL tool-count: ${violations.length} claim(s) do not match the generated tool manifests ` +
110
+ `(expert=${counts.expert}, beginner=${counts.beginner}).`);
111
+ console.error("");
112
+ for (const v of violations) {
113
+ if (v.reason === "stale") {
114
+ console.error(` ${v.file} — ${v.label}: states "${v.found}", expected ${v.expected}`);
115
+ }
116
+ else {
117
+ console.error(` ${v.file} — ${v.label}: no matching tool-count claim found (expected ${v.expected})`);
118
+ }
119
+ }
120
+ console.error("");
121
+ console.error("Fix: bump the claim to match plugins/{expert,beginner}.json tools[].length, or add the");
122
+ console.error("tool to BEGINNER_TOOL_ENTRIES/EXPERT_TOOL_ENTRIES in src/lib/plugin-metadata.mts and");
123
+ console.error("re-run `npm run build` to regenerate the manifests.");
124
+ exit(1);
125
+ }
126
+ const invokedDirectly = argv[1] !== undefined && import.meta.url.endsWith(argv[1].replace(/\\/g, "/"));
127
+ if (invokedDirectly || argv[1]?.endsWith("check-tool-count.mjs")) {
128
+ main();
129
+ }
@@ -107,7 +107,7 @@ async function writePluginBundleReadme() {
107
107
  "- `tdd-workflow` — RED/GREEN/REFACTOR + 80% coverage gate",
108
108
  "- `workspace-surface-audit` — environment + capability audit",
109
109
  "- Tier-1/Tier-2 enforcement skills (`gateguard`, `verification-loop`,",
110
- " `para-memory-files`, `safety-guard`, `token-budget-advisor`,",
110
+ " `safety-guard`, `token-budget-advisor`,",
111
111
  " `strategic-compact`, `wild-risa-balance`)",
112
112
  "",
113
113
  "**Optional companions the orchestrator routes to (install separately if",
@@ -152,7 +152,9 @@ async function writePluginBundle() {
152
152
  copyFileTo(join(REPO_ROOT, "lib", "observe-event.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "observe-event.mjs")),
153
153
  copyFileTo(join(REPO_ROOT, "lib", "goal-state.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "goal-state.mjs")),
154
154
  copyFileTo(join(REPO_ROOT, "lib", "goal-drift-gate.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "goal-drift-gate.mjs")),
155
+ copyFileTo(join(REPO_ROOT, "lib", "hook-pack-gate.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "hook-pack-gate.mjs")),
155
156
  copyFileTo(join(REPO_ROOT, "lib", "recall-index.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "recall-index.mjs")),
157
+ copyFileTo(join(REPO_ROOT, "lib", "recall-briefing.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "recall-briefing.mjs")),
156
158
  copyFileTo(join(REPO_ROOT, "lib", "skill-distill.mjs"), join(PLUGIN_BUNDLE_DIR, "lib", "skill-distill.mjs")),
157
159
  copyFileTo(join(REPO_ROOT, "LICENSE"), join(PLUGIN_BUNDLE_DIR, "LICENSE")),
158
160
  writePluginBundleReadme(),
@@ -248,7 +248,7 @@ function main() {
248
248
  console.log(" the Node observer is not on PATH — never tool_complete with output_summary,");
249
249
  console.log(" which is what the classifier needs.");
250
250
  console.log(" Install jq (winget install jqlang.jq | brew install jq | apt install jq)");
251
- console.log(" OR ensure hooks/bin/observe.mjs is reachable from the hook script.");
251
+ console.log(" OR ensure instincts/bin/observe.mjs is reachable from the hook script.");
252
252
  }
253
253
  else if (result.thinSchemaRows > 0 && result.classifiedRows === 0) {
254
254
  console.log("");
package/bin/install.mjs CHANGED
@@ -6,6 +6,7 @@
6
6
  * npx continuous-improvement install # beginner mode (default)
7
7
  * npx continuous-improvement install --mode expert # + MCP server + session hooks
8
8
  * npx continuous-improvement install --pack react # load starter instinct pack
9
+ * npx continuous-improvement install --target gemini,codex # skill into other agents' rules files
9
10
  * npx continuous-improvement install --uninstall # remove everything
10
11
  */
11
12
  import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync, } from "node:fs";
@@ -14,6 +15,8 @@ import { homedir } from "node:os";
14
15
  import { dirname, join } from "node:path";
15
16
  import { fileURLToPath } from "node:url";
16
17
  import { createHash } from "node:crypto";
18
+ import { getToolNames } from "../lib/plugin-metadata.mjs";
19
+ import { TARGET_IDS, planTargetWrites, resolveTargets } from "../lib/install-targets.mjs";
17
20
  const __filename = fileURLToPath(import.meta.url);
18
21
  const __dirname = dirname(__filename);
19
22
  const SKILL_SOURCE = join(__dirname, "..", "SKILL.md");
@@ -492,6 +495,17 @@ Options for 'install':
492
495
  beginner — hooks + skill + commands (default)
493
496
  expert — beginner + MCP server + session hooks
494
497
  --pack <name> Load a starter instinct pack (react, python, go, meta)
498
+ --target <names> Comma-separated platform list (default: claude):
499
+ claude — full install: hooks + skill + commands
500
+ gemini — GEMINI.md (Gemini CLI)
501
+ codex — AGENTS.md (Codex CLI / agents.md standard)
502
+ cursor — .cursor/rules/continuous-improvement.mdc
503
+ windsurf — .windsurf/rules/continuous-improvement.md
504
+ zed — .rules
505
+ aider — CONVENTIONS.md + .aider.conf.yml
506
+ copilot — .github/copilot-instructions.md
507
+ Non-claude targets write the 7-Laws skill text into the
508
+ current project; hooks/MCP/instincts stay Claude Code-only.
495
509
  --help Show this help
496
510
 
497
511
  Options for 'backfill':
@@ -502,6 +516,7 @@ Examples:
502
516
  npx continuous-improvement install # beginner (default)
503
517
  npx continuous-improvement install --mode expert # full power
504
518
  npx continuous-improvement install --pack react # load React instincts
519
+ npx continuous-improvement install --target gemini,codex # other agents' rules files
505
520
  npx continuous-improvement backfill --dry-run # report thin/rich row counts
506
521
  npx continuous-improvement backfill # tag rows in place
507
522
  npx continuous-improvement install --uninstall # remove everything
@@ -509,7 +524,12 @@ Examples:
509
524
  }
510
525
  function getProjectHashSync() {
511
526
  try {
512
- const root = execSync("git rev-parse --show-toplevel 2>/dev/null", { encoding: "utf8" }).trim();
527
+ // No shell redirect `2>/dev/null` breaks under cmd.exe (tries to open a
528
+ // file literally named /dev/null); ignore stderr via stdio instead.
529
+ const root = execSync("git rev-parse --show-toplevel", {
530
+ encoding: "utf8",
531
+ stdio: ["ignore", "pipe", "ignore"],
532
+ }).trim();
513
533
  const hash = createHash("sha256").update(root).digest("hex").slice(0, 12);
514
534
  return { root, hash };
515
535
  }
@@ -546,6 +566,60 @@ if (args.includes("--uninstall")) {
546
566
  uninstallAll();
547
567
  process.exit(0);
548
568
  }
569
+ // --target <names>: comma-separated platform list, default claude-only.
570
+ // Non-claude targets receive the skill text in their platform's rules file
571
+ // (project-level); the full hook/MCP/instinct install stays Claude Code-only.
572
+ const targetFlagIndex = rawArgs.indexOf("--target");
573
+ let requestedTargets = ["claude"];
574
+ if (targetFlagIndex !== -1) {
575
+ const targetCsv = rawArgs[targetFlagIndex + 1];
576
+ if (!targetCsv || targetCsv.startsWith("--")) {
577
+ console.error(`--target requires a value. Valid targets: ${TARGET_IDS.join(", ")}`);
578
+ process.exit(1);
579
+ }
580
+ const resolved = resolveTargets(targetCsv);
581
+ if (resolved.unknown.length > 0) {
582
+ console.error(`Unknown --target name(s): ${resolved.unknown.join(", ")}. Valid targets: ${TARGET_IDS.join(", ")}`);
583
+ process.exit(1);
584
+ }
585
+ if (resolved.targets.length === 0) {
586
+ console.error(`--target requires at least one name. Valid targets: ${TARGET_IDS.join(", ")}`);
587
+ process.exit(1);
588
+ }
589
+ requestedTargets = resolved.targets;
590
+ }
591
+ function installNonClaudeTargets(targetIds) {
592
+ const skillMd = readFileSync(SKILL_SOURCE, "utf8");
593
+ const project = getProjectHashSync();
594
+ const projectRoot = project.root === "global" ? process.cwd() : project.root;
595
+ const readExisting = (relPath) => {
596
+ const absPath = join(projectRoot, relPath);
597
+ return existsSync(absPath) ? readFileSync(absPath, "utf8") : null;
598
+ };
599
+ const notes = new Set();
600
+ for (const targetId of targetIds) {
601
+ const plan = planTargetWrites(targetId, skillMd, readExisting);
602
+ for (const write of plan.writes) {
603
+ const absPath = join(projectRoot, write.relPath);
604
+ mkdirSync(dirname(absPath), { recursive: true });
605
+ writeFileSync(absPath, write.content);
606
+ console.log(` ✓ ${targetId} → ${write.relPath}`);
607
+ }
608
+ for (const note of plan.notes)
609
+ notes.add(note);
610
+ }
611
+ for (const note of notes)
612
+ console.log(` ℹ ${note}`);
613
+ }
614
+ const nonClaudeTargets = requestedTargets.filter((targetId) => targetId !== "claude");
615
+ if (nonClaudeTargets.length > 0) {
616
+ console.log("\ncontinuous-improvement multi-platform install\n");
617
+ installNonClaudeTargets(nonClaudeTargets);
618
+ if (!requestedTargets.includes("claude")) {
619
+ console.log("\nDone. Claude Code install skipped (not in --target list).");
620
+ process.exit(0);
621
+ }
622
+ }
549
623
  console.log(`
550
624
  continuous-improvement (mode: ${INSTALL_MODE})
551
625
  Research → Plan → Execute → Verify → Reflect → Learn → Iterate
@@ -556,7 +630,7 @@ console.log("Installing to Claude Code...\n");
556
630
  const installed = installSkill() ? 1 : 0;
557
631
  const modeInfo = {
558
632
  beginner: "Hooks are capturing silently. System auto-levels as you use it.",
559
- expert: "Full plugin active: hooks + MCP server + session hooks. 12 tools available.",
633
+ expert: `Full plugin active: hooks + MCP server + session hooks. ${getToolNames("expert").length} tools available.`,
560
634
  };
561
635
  const packIndex = rawArgs.indexOf("--pack");
562
636
  if (packIndex !== -1 && rawArgs[packIndex + 1]) {
@@ -617,6 +691,6 @@ Next steps:
617
691
  3. If a task needs persistent planning, run: /planning-with-files
618
692
  4. After your first task, run: /continuous-improvement
619
693
  5. Try: /discipline for quick reference, /dashboard for instinct health
620
- ${INSTALL_MODE === "expert" ? "\nMCP tools available: ci_status, ci_instincts, ci_reflect, ci_reinforce,\n ci_create_instinct, ci_observations, ci_export, ci_import, ci_plan_init,\n ci_plan_status, ci_dashboard, ci_load_pack" : ""}
694
+ ${INSTALL_MODE === "expert" ? `\nMCP tools available (${getToolNames("expert").length}): ${getToolNames("expert").join(", ")}` : ""}
621
695
  Available instinct packs: npx continuous-improvement install --pack react|python|go|meta
622
696
  `);