continuous-improvement 3.9.2 → 3.12.3

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 (160) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +95 -0
  3. package/LICENSE +21 -21
  4. package/QUICKSTART.md +13 -8
  5. package/README.md +94 -162
  6. package/SKILL.md +1 -1
  7. package/bin/analyze.sh +161 -161
  8. package/bin/backfill.mjs +19 -19
  9. package/bin/check-docs-substrings.mjs +73 -0
  10. package/bin/check-scripts-citation-drift.mjs +210 -0
  11. package/bin/check-skill-count.mjs +110 -0
  12. package/bin/check-test-imports-only.mjs +126 -0
  13. package/bin/check-tool-count.mjs +129 -0
  14. package/bin/companion-preference-status.mjs +231 -0
  15. package/bin/gateguard-clear.mjs +53 -0
  16. package/bin/generate-plugin-manifests.mjs +8 -1
  17. package/bin/harvest-friction.mjs +1 -1
  18. package/bin/hook-stats.mjs +21 -21
  19. package/bin/install.mjs +185 -28
  20. package/bin/mcp-server.mjs +216 -3
  21. package/bin/refresh-third-party.mjs +315 -313
  22. package/commands/audit.md +34 -0
  23. package/commands/companion-preference.md +58 -0
  24. package/commands/continuous-improvement.md +115 -115
  25. package/commands/dashboard.md +56 -56
  26. package/commands/discipline.md +14 -0
  27. package/commands/distill.md +39 -0
  28. package/commands/goal-check.md +53 -0
  29. package/commands/grill-me.md +40 -0
  30. package/commands/grill-with-docs.md +38 -0
  31. package/commands/handoff.md +42 -0
  32. package/commands/harvest.md +1 -1
  33. package/commands/proceed-with-the-recommendation.md +20 -0
  34. package/commands/recall.md +49 -0
  35. package/commands/reconcile.md +47 -0
  36. package/commands/seven-laws.md +16 -16
  37. package/commands/superpowers.md +3 -3
  38. package/commands/verify-install.md +55 -0
  39. package/commands/workspace-surface-audit.md +77 -77
  40. package/hooks/companion-preference.mjs +190 -0
  41. package/hooks/gateguard.mjs +72 -25
  42. package/hooks/goal-drift-stop.mjs +183 -0
  43. package/hooks/observe.sh +15 -1
  44. package/hooks/recall-briefing.mjs +167 -0
  45. package/hooks/route-prompt.mjs +180 -0
  46. package/hooks/route-table.json +35 -0
  47. package/hooks/session.sh +106 -106
  48. package/hooks/three-section-close.mjs +134 -132
  49. package/instinct-packs/go.json +58 -58
  50. package/instinct-packs/meta.json +16 -16
  51. package/instinct-packs/python.json +58 -58
  52. package/instinct-packs/react.json +58 -58
  53. package/lib/gateguard-state.mjs +54 -2
  54. package/lib/goal-drift-gate.mjs +50 -0
  55. package/lib/goal-state.mjs +285 -0
  56. package/lib/plugin-metadata.mjs +134 -15
  57. package/lib/recall-briefing.mjs +57 -0
  58. package/lib/recall-index.mjs +175 -0
  59. package/lib/skill-distill.mjs +222 -0
  60. package/llms.txt +2 -2
  61. package/package.json +12 -7
  62. package/plugins/beginner.json +9 -4
  63. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
  64. package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
  65. package/plugins/continuous-improvement/LICENSE +21 -21
  66. package/plugins/continuous-improvement/agents/README.md +3 -3
  67. package/plugins/continuous-improvement/bin/backfill.mjs +19 -19
  68. package/plugins/continuous-improvement/bin/gateguard-clear.mjs +53 -0
  69. package/plugins/continuous-improvement/bin/mcp-server.mjs +216 -3
  70. package/plugins/continuous-improvement/commands/audit.md +34 -0
  71. package/plugins/continuous-improvement/commands/companion-preference.md +58 -0
  72. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -115
  73. package/plugins/continuous-improvement/commands/dashboard.md +56 -56
  74. package/plugins/continuous-improvement/commands/discipline.md +14 -0
  75. package/plugins/continuous-improvement/commands/distill.md +39 -0
  76. package/plugins/continuous-improvement/commands/goal-check.md +53 -0
  77. package/plugins/continuous-improvement/commands/grill-me.md +40 -0
  78. package/plugins/continuous-improvement/commands/grill-with-docs.md +38 -0
  79. package/plugins/continuous-improvement/commands/handoff.md +42 -0
  80. package/plugins/continuous-improvement/commands/harvest.md +1 -1
  81. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +20 -0
  82. package/plugins/continuous-improvement/commands/recall.md +49 -0
  83. package/plugins/continuous-improvement/commands/reconcile.md +47 -0
  84. package/plugins/continuous-improvement/commands/seven-laws.md +16 -16
  85. package/plugins/continuous-improvement/commands/superpowers.md +3 -3
  86. package/plugins/continuous-improvement/commands/verify-install.md +55 -0
  87. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -77
  88. package/plugins/continuous-improvement/hooks/companion-preference.mjs +190 -0
  89. package/plugins/continuous-improvement/hooks/gateguard.mjs +72 -25
  90. package/plugins/continuous-improvement/hooks/goal-drift-stop.mjs +183 -0
  91. package/plugins/continuous-improvement/hooks/hooks.json +23 -2
  92. package/plugins/continuous-improvement/hooks/observe.sh +15 -1
  93. package/plugins/continuous-improvement/hooks/recall-briefing.mjs +167 -0
  94. package/plugins/continuous-improvement/hooks/route-prompt.mjs +180 -0
  95. package/plugins/continuous-improvement/hooks/route-table.json +35 -0
  96. package/plugins/continuous-improvement/hooks/session.sh +106 -106
  97. package/plugins/continuous-improvement/hooks/three-section-close.mjs +134 -132
  98. package/plugins/continuous-improvement/instinct-packs/go.json +58 -58
  99. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -16
  100. package/plugins/continuous-improvement/instinct-packs/python.json +58 -58
  101. package/plugins/continuous-improvement/instinct-packs/react.json +58 -58
  102. package/plugins/continuous-improvement/lib/gateguard-state.mjs +137 -0
  103. package/plugins/continuous-improvement/lib/goal-drift-gate.mjs +50 -0
  104. package/plugins/continuous-improvement/lib/goal-state.mjs +285 -0
  105. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +134 -15
  106. package/plugins/continuous-improvement/lib/recall-briefing.mjs +57 -0
  107. package/plugins/continuous-improvement/lib/recall-index.mjs +175 -0
  108. package/plugins/continuous-improvement/lib/skill-distill.mjs +222 -0
  109. package/plugins/continuous-improvement/skills/README.md +8 -0
  110. package/plugins/continuous-improvement/skills/audit/SKILL.md +73 -0
  111. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +1 -1
  112. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +13 -17
  113. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +36 -17
  114. package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +81 -0
  115. package/plugins/continuous-improvement/skills/grill-me/SKILL.md +66 -0
  116. package/plugins/continuous-improvement/skills/grill-with-docs/SKILL.md +252 -0
  117. package/plugins/continuous-improvement/skills/handoff/SKILL.md +59 -0
  118. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +1 -1
  119. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +82 -6
  120. package/plugins/continuous-improvement/skills/ralph/SKILL.md +1 -0
  121. package/plugins/continuous-improvement/skills/recall/SKILL.md +50 -0
  122. package/plugins/continuous-improvement/skills/reconcile/SKILL.md +80 -0
  123. package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +1 -0
  124. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +1 -0
  125. package/plugins/continuous-improvement/skills/skill-distillation/SKILL.md +57 -0
  126. package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +1 -0
  127. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +1 -0
  128. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +77 -3
  129. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -411
  130. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +1 -1
  131. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +28 -20
  132. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +1 -0
  133. package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +1 -1
  134. package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +3 -2
  135. package/plugins/expert.json +28 -3
  136. package/skills/README.md +3 -0
  137. package/skills/audit.md +73 -0
  138. package/skills/deploy-receipt.md +13 -17
  139. package/skills/gateguard.md +36 -17
  140. package/skills/goal-monitor.md +81 -0
  141. package/skills/grill-me.md +66 -0
  142. package/skills/grill-with-docs.md +252 -0
  143. package/skills/handoff.md +59 -0
  144. package/skills/para-memory-files.md +1 -1
  145. package/skills/proceed-with-the-recommendation.md +82 -6
  146. package/skills/ralph.md +1 -0
  147. package/skills/recall.md +50 -0
  148. package/skills/reconcile.md +80 -0
  149. package/skills/recovery-classification.md +1 -0
  150. package/skills/safety-guard.md +1 -0
  151. package/skills/skill-distillation.md +57 -0
  152. package/skills/state-reconciliation.md +1 -0
  153. package/skills/strategic-compact.md +1 -0
  154. package/skills/superpowers.md +77 -3
  155. package/skills/tdd-workflow.md +411 -411
  156. package/skills/token-budget-advisor.md +1 -1
  157. package/skills/verification-loop.md +28 -20
  158. package/skills/wild-risa-balance.md +1 -0
  159. package/skills/workspace-surface-audit.md +1 -1
  160. package/skills/worktree-safety.md +3 -2
@@ -65,7 +65,7 @@ Appended 12 instinct(s) to /Users/.../instincts/0af156594b39/instincts.jsonl
65
65
  If `tool_complete rows: 0`, the bash-fallback hook is active (no jq AND the Node observer is not on PATH) and only emits `tool_start` events. Two remediation paths:
66
66
 
67
67
  - **Install jq** — `winget install jqlang.jq` (Windows), `brew install jq` (macOS), `apt install jq` (Linux).
68
- - **Wire the Node observer** — ensure `hooks/bin/observe.mjs` is reachable from the active hook script.
68
+ - **Wire the Node observer** — ensure the installed observer shim `instincts/bin/observe.mjs` (copied from `bin/observe.mjs`) sits beside the active hook script.
69
69
 
70
70
  Both are documented in the WARNING the classifier prints on a thin-schema host.
71
71
 
@@ -18,6 +18,26 @@ Invoke immediately after the agent has offered a numbered list of recommendation
18
18
  - "execute the recommendations"
19
19
  - "yes do it" / "all of them"
20
20
 
21
+ ## Fast-path: `--once` mode
22
+
23
+ For a single-item, `safe`-tagged confirmation, append `--once` to skip P-MAG, Plan, Reflect, and the three-section close. Runs Phase 1 + Phase 3 + Phase 4 only and ends with one line: `Done: <item>. Verified: <check + output>.`
24
+
25
+ Trigger phrases:
26
+
27
+ - `/proceed-with-the-recommendation --once`
28
+ - `/proceed --once`
29
+ - "proceed once with that" / "just do that one"
30
+ - Any standard trigger phrase plus the literal `--once` suffix
31
+
32
+ Hard preconditions (the skill refuses `--once` and falls back to the full flow if any fail):
33
+
34
+ - Recommendation list has exactly one item
35
+ - Item is tagged `safe` (not `caution`, not `needs-approval`)
36
+ - Item touches ≤3 files, ≤150 LOC, and none of `.github/`, `bin/`, `lib/`, `src/`, `third-party/`
37
+ - Item is not destructive (no deploy, force-push, DB drop, secret rotation)
38
+
39
+ Full behavior is defined in [`skills/proceed-with-the-recommendation.md`](../skills/proceed-with-the-recommendation.md) under § "Fast-Path: `--once` Mode".
40
+
21
41
  ## What happens
22
42
 
23
43
  1. **Pre-flight (Law 1)** — restate the recommendation list in original order, tag each `safe` / `caution` / `needs-approval`
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: recall
3
+ description: Search past tool-call observations with BM25 ranking to answer "have I seen this before?" before re-deriving a fix or repeating a mistake. Enforces Law 1 (Research Before Executing).
4
+ ---
5
+
6
+ # /recall — Episodic Search Over Past Sessions
7
+
8
+ Search this project's observation history for relevant prior activity and return the most relevant past tool calls, ranked.
9
+
10
+ ## What it does
11
+
12
+ Builds an in-memory BM25 index over `~/.claude/instincts/<project-hash>/observations.jsonl` and returns the top matches with redacted snippets, relevance scores, and timestamps. Backed by the `ci_recall` MCP tool (expert mode) and the `recall` skill.
13
+
14
+ ## How to invoke
15
+
16
+ ```
17
+ ci_recall query="permission denied push" # top 5 matches
18
+ ci_recall query="jq command not found" k=3 # cap results
19
+ ci_recall query="auth login" since=7d # only the last 7 days
20
+ ```
21
+
22
+ `since` accepts an ISO timestamp or a relative window: `7d`, `24h`, `30m`.
23
+
24
+ ## Output shape
25
+
26
+ ```
27
+ ## Recall: "permission denied push"
28
+
29
+ 2 match(es), most relevant first:
30
+
31
+ - [2026-05-20T10:00:00Z] **Bash** (score 3.41)
32
+ …git push origin main Permission denied: harness blocked direct push to main…
33
+ - ...
34
+ ```
35
+
36
+ ## Privacy
37
+
38
+ Snippets are passed through a secret redactor (AWS keys, JWT-shaped triplets, bearer tokens, KEY/SECRET/TOKEN/PASSWORD assignments, long hex strings) before display.
39
+
40
+ ## Notes
41
+
42
+ - **Lexical, not semantic** — search with the vocabulary that actually appeared in the tool calls; try several phrasings if the first returns nothing.
43
+ - Searches the full captured history, not just the recent window.
44
+
45
+ ## Pairs with
46
+
47
+ - **`recall`** skill — the discipline this command runs.
48
+ - **`continuous-improvement`** (core SKILL.md, Law 1 — Research Before Executing).
49
+ - **`gateguard`** — recall a past failure before clearing a high-risk action.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: reconcile
3
+ description: Establish git ground truth (branch, status, stashes, worktrees, ahead/behind) before any mutation, halt on protected or destructive operations, and verify a push actually landed. Enforces Law 1 (Research Before Executing).
4
+ ---
5
+
6
+ # /reconcile — Ground-Truth Git State Before You Touch It
7
+
8
+ Read the repo's real state before acting on it: a branch that shifted, a push that did not land, or another session mid-merge will burn a whole session if you assume instead of check.
9
+
10
+ ## What it does
11
+
12
+ Snapshots the full git state in one pass, detects a concurrent writer, classifies the upstream relationship, then acts only on the known state — stopping at every operation that is hard to reverse. Backed by the `reconcile` skill.
13
+
14
+ ## Establish ground truth
15
+
16
+ ```
17
+ git branch --show-current
18
+ git status --porcelain=v1 # but trust git diff --stat for real drift (autocrlf)
19
+ git rev-list --left-right --count @{u}...HEAD # behind / ahead
20
+ git stash list
21
+ git worktree list
22
+ ls .git/MERGE_HEAD .git/rebase-merge .git/rebase-apply 2>/dev/null # in-progress op = another actor; do not race
23
+ ```
24
+
25
+ ## Then act, with gates
26
+
27
+ ```
28
+ even -> safe to branch (confirm local base == origin/base first)
29
+ ahead -> push or PR, AFTER the protected-op gate
30
+ behind -> git pull --ff-only
31
+ diverged -> rebase/merge deliberately; never blind --force
32
+ ```
33
+
34
+ STOP for authorization before: pushing to a protected branch (this repo = feature branch + PR, never direct push to main), `--force` / `--force-with-lease`, `reset --hard`, `clean -fd`, or removing a dirty worktree. Never stage with `git add -A` on a Windows autocrlf tree (it commits phantom line-ending-only changes) — stage by explicit filename.
35
+
36
+ ## Verify the push landed
37
+
38
+ ```
39
+ git ls-remote origin refs/heads/<branch> # remote tip must equal local HEAD, else it did not land
40
+ ```
41
+
42
+ ## Pairs with
43
+
44
+ - **`reconcile`** skill — the discipline this command runs.
45
+ - **`gateguard`** / **`safety-guard`** — runtime + destructive-op guardrails.
46
+ - **`recall`** — recall whether the same git op failed here before.
47
+ - **`audit`** — the loop that often produces the fix `reconcile` then ships.
@@ -1,16 +1,16 @@
1
- ---
2
- name: seven-laws
3
- description: "Brand-aligned alias for /continuous-improvement. Reflect on the current session, analyze observations for patterns, and show instinct status under the 7 Laws of AI Agent Discipline."
4
- ---
5
-
6
- # /seven-laws
7
-
8
- Brand-aligned alias for [`/continuous-improvement`](continuous-improvement.md). Both commands run the exact same three-step workflow under the 7 Laws of AI Agent Discipline:
9
-
10
- 1. **Reflect** (Law 5) — generate a reflection block for this session.
11
- 2. **Analyze** (Law 7) — process pending observations into instincts.
12
- 3. **Status** — show all instincts for the project + global with confidence and current level.
13
-
14
- Run the workflow defined in [`continuous-improvement.md`](continuous-improvement.md). Subcommands `weekly` and `always-on` work identically.
15
-
16
- `/continuous-improvement` remains supported indefinitely for backward compatibility. Prefer `/seven-laws` going forward — it matches the brand and the SKILL.md spec.
1
+ ---
2
+ name: seven-laws
3
+ description: "Brand-aligned alias for /continuous-improvement. Reflect on the current session, analyze observations for patterns, and show instinct status under the 7 Laws of AI Agent Discipline."
4
+ ---
5
+
6
+ # /seven-laws
7
+
8
+ Brand-aligned alias for [`/continuous-improvement`](continuous-improvement.md). Both commands run the exact same three-step workflow under the 7 Laws of AI Agent Discipline:
9
+
10
+ 1. **Reflect** (Law 5) — generate a reflection block for this session.
11
+ 2. **Analyze** (Law 7) — process pending observations into instincts.
12
+ 3. **Status** — show all instincts for the project + global with confidence and current level.
13
+
14
+ Run the workflow defined in [`continuous-improvement.md`](continuous-improvement.md). Subcommands `weekly` and `always-on` work identically.
15
+
16
+ `/continuous-improvement` remains supported indefinitely for backward compatibility. Prefer `/seven-laws` going forward — it matches the brand and the SKILL.md spec.
@@ -7,9 +7,9 @@ description: "Law activator and dispatcher — route the task to the right Law-a
7
7
 
8
8
  `/superpowers` is **the dispatcher**, not a peer skill. It does not do work itself; it routes each user task to the correct Law-aligned specialist so the right discipline fires automatically instead of the agent skipping a step.
9
9
 
10
- The 7 Laws define *what* discipline must be applied. `/superpowers` decides *which specialist* enforces it for this specific task, across five sources installed from this marketplace.
10
+ The 7 Laws define *what* discipline must be applied. `/superpowers` decides *which specialist* enforces it for this specific task, across four sources installed from this marketplace.
11
11
 
12
- ## Routing surface (five sources)
12
+ ## Routing surface (four sources)
13
13
 
14
14
  | Source | Where it lives | Examples of what it routes to |
15
15
  |---|---|---|
@@ -17,7 +17,7 @@ The 7 Laws define *what* discipline must be applied. `/superpowers` decides *whi
17
17
  | `obra/superpowers` (Jesse Vincent) | vendored at `third-party/superpowers/`, pinned SHA `f2cbfbe` (v5.1.0) | `superpowers:brainstorming`, `:writing-plans`, `:executing-plans`, `:test-driven-development`, `:systematic-debugging`, `:requesting-code-review`, `:receiving-code-review`, `:verification-before-completion`, `:dispatching-parallel-agents`, `:using-git-worktrees`, `:finishing-a-development-branch`, `:subagent-driven-development`, `:writing-skills`, `:using-superpowers` |
18
18
  | `addyosmani/agent-skills` | vendored at `third-party/addy-agent-skills/`, pinned SHA `742dca5` (v1.0.0) | `spec-driven-development`, `source-driven-development`, `context-engineering`, `idea-refine`, `incremental-implementation`, `code-review-and-quality`, `code-simplification`, `security-and-hardening`, `debugging-and-error-recovery`, `performance-optimization`, `api-and-interface-design`, `frontend-ui-engineering`, `browser-testing-with-devtools`, `ci-cd-and-automation`, `deprecation-and-migration`, `documentation-and-adrs`, `git-workflow-and-versioning`, `planning-and-task-breakdown`, `shipping-and-launch` |
19
19
  | `ruflo-swarm` (ruvnet) | vendored at `third-party/ruflo-swarm/`, pinned SHA `addb5cd` (v0.2.0) | `swarm-init`, `monitor-stream`; `swarm_*` and `agent_*` MCP tools; `/swarm`, `/watch` |
20
- | `oh-my-claudecode` (Yeachan-Heo) | vendored at `third-party/oh-my-claudecode/`, pinned SHA `aacde3e` (v4.13.6) | 39 skills + 19 agents — `release`, `ultrawork`, `ultraqa`, `team`, `trace`, `visual-verdict`, `debug`, `deep-dive`, `deep-interview`, `autopilot`, `autoresearch`, plus a separate `ralph` (overlaps with our `/ralph` — see "Distinct variants" below) |
20
+ | `oh-my-claudecode` (Yeachan-Heo) | vendored at `third-party/oh-my-claudecode/`, pinned SHA `aacde3e` (v4.13.6) | 38 skills + 19 agents — `release`, `ultrawork`, `ultraqa`, `team`, `trace`, `visual-verdict`, `debug`, `deep-dive`, `deep-interview`, `autopilot`, `autoresearch`, plus a separate `ralph` (overlaps with our `/ralph` — see "Distinct variants" below) |
21
21
 
22
22
  PM coverage (product-management skills) lives **outside** this marketplace. If you need it, install [`phuryn/pm-skills`](https://github.com/phuryn/pm-skills) separately via Claude Code's host marketplace; the dispatcher names it as a routing target without pre-resolving the namespace. See [docs/THIRD_PARTY.md § Routing in /superpowers](../docs/THIRD_PARTY.md#routing-in-superpowers).
23
23
 
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: verify-install
3
+ description: Walk the post-install verification in one shot — confirm slash commands loaded, the gateguard runtime hook fires, and observation capture is recording — then print a single ✓ wired / ✗ missing line.
4
+ ---
5
+
6
+ # /verify-install
7
+
8
+ Replaces the manual post-install dance (restart, run `/discipline`, hand-write a
9
+ hostile prompt, eyeball `/dashboard`) with one command that runs all three
10
+ checks and reports a single line.
11
+
12
+ Run the three checks **in order**. Do not skip a check because an earlier one
13
+ passed — each proves a different layer.
14
+
15
+ ## Check 1 — slash commands loaded
16
+
17
+ If this command is executing, the marketplace did pick the plugin up and the
18
+ command registry loaded it. Record `commands: ✓`.
19
+
20
+ If you are reading this file directly rather than running it as `/verify-install`,
21
+ stop — the command is not registered. The fix is a Claude Code session restart
22
+ (slash commands load on session start). Record `commands: ✗ (restart the session)`.
23
+
24
+ ## Check 2 — gateguard runtime hook fires
25
+
26
+ The runtime gate ships as a PreToolUse hook (`hooks/gateguard.mjs`). Probe it:
27
+ attempt to `Write` a throwaway file at a sandbox path (`./.ci-verify-install-probe.txt`
28
+ with the text `probe`) **without presenting any research first**.
29
+
30
+ - If the hook **blocks** the write with a fact-list reason — the runtime layer is
31
+ wired. Record `gateguard: ✓`. Do not retry the write; the block is the pass.
32
+ - If the write **goes through** with no pause — the hook did not load. Record
33
+ `gateguard: ✗ (hooks/gateguard.mjs not wired — see README → Troubleshooting install)`.
34
+ Delete the probe file if it was created.
35
+
36
+ ## Check 3 — observation capture recording
37
+
38
+ The observation hook appends one row per tool call to
39
+ `~/.claude/instincts/<project-hash>/observations.jsonl`. Read that file (resolve
40
+ `<project-hash>` from the current repo, or check `~/.claude/instincts/global/`).
41
+
42
+ - If it exists and has at least one row — capture is recording. Record `observe: ✓`.
43
+ - If it is missing or empty — record `observe: ✗ (observation hook not recording —
44
+ on Windows confirm Git Bash / WSL is installed, then re-run the installer)`.
45
+
46
+ ## Report
47
+
48
+ Emit exactly one summary line, nothing else after it:
49
+
50
+ - All three passed: `✓ wired — commands, gateguard, observe all confirmed.`
51
+ - Any failed: `✗ <comma-separated failing checks with their fix hints>.`
52
+
53
+ Do not claim "should be fine" for a check you could not actually run. If a check
54
+ is genuinely unrunnable (e.g. no repo context for the project hash), mark it
55
+ `unverified` with the reason rather than `✓`.
@@ -1,77 +1,77 @@
1
- ---
2
- name: workspace-surface-audit
3
- description: "Audit workspace capabilities and recommend continuous-improvement-native skills, hooks, and workflows"
4
- ---
5
-
6
- # /workspace-surface-audit
7
-
8
- Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup. Returns a 5-section report with specific next moves.
9
-
10
- ## Usage
11
-
12
- ```
13
- /workspace-surface-audit
14
- ```
15
-
16
- ## What It Checks
17
-
18
- 1. **Repo surface** — `package.json`, lockfiles, framework config, `.mcp.json`, `.claude/settings*.json`, `AGENTS.md`
19
- 2. **Environment surface** — `.env*` files (key names only, no secrets)
20
- 3. **Connected tools** — installed plugins, MCP servers, LSPs, app integrations
21
- 4. **continuous-improvement surface** — existing skills, commands, hooks, agents
22
-
23
- ## Output Format
24
-
25
- ```
26
- === Workspace Surface Audit ===
27
-
28
- ## Current Surface
29
- - [What is usable right now]
30
-
31
- ## Parity
32
- - [Where continuous-improvement matches or exceeds benchmarks]
33
-
34
- ## Primitive-Only Gaps
35
- - [Tools exist, but continuous-improvement lacks clean operator skills]
36
-
37
- ## Missing Integrations
38
- - [Capabilities not available yet]
39
-
40
- ## Top 3-5 Next Moves
41
- 1. [Concrete continuous-improvement-native addition]
42
- 2. [Ordered by impact]
43
- ```
44
-
45
- ## Rules
46
-
47
- - **Never print secrets** — only provider names, capability names, file paths
48
- - **Prefer continuous-improvement** over generic "install another plugin" advice
49
- - **Organize by workflows**, not API brands
50
- - **Specific recommendations** — concrete enough to implement without another discovery pass
51
-
52
- ## Example Output
53
-
54
- ```
55
- ## Current Surface
56
- - MCP: filesystem, github, playwright
57
- - Plugins: beginner, expert (continuous-improvement)
58
- - Env: STRIPE_API_KEY, FAL_KEY configured
59
- - Framework: Next.js 15, React 19, TypeScript
60
-
61
- ## Parity
62
- - Continuous improvement: covered (native)
63
- - Testing discipline: covered (TDD workflows)
64
-
65
- ## Primitive-Only Gaps
66
- - Stripe connected but no billing-operator skill
67
- - GitHub MCP available but no issue-triage workflow
68
-
69
- ## Missing Integrations
70
- - No Linear connector detected
71
- - No Slack webhook configured
72
-
73
- ## Top 3-5 Next Moves
74
- 1. Create billing-operator skill (Stripe integration)
75
- 2. Create github-ops workflow for issue triage
76
- 3. Add Linear connector skill for project management
77
- ```
1
+ ---
2
+ name: workspace-surface-audit
3
+ description: "Audit workspace capabilities and recommend continuous-improvement-native skills, hooks, and workflows"
4
+ ---
5
+
6
+ # /workspace-surface-audit
7
+
8
+ Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup. Returns a 5-section report with specific next moves.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /workspace-surface-audit
14
+ ```
15
+
16
+ ## What It Checks
17
+
18
+ 1. **Repo surface** — `package.json`, lockfiles, framework config, `.mcp.json`, `.claude/settings*.json`, `AGENTS.md`
19
+ 2. **Environment surface** — `.env*` files (key names only, no secrets)
20
+ 3. **Connected tools** — installed plugins, MCP servers, LSPs, app integrations
21
+ 4. **continuous-improvement surface** — existing skills, commands, hooks, agents
22
+
23
+ ## Output Format
24
+
25
+ ```
26
+ === Workspace Surface Audit ===
27
+
28
+ ## Current Surface
29
+ - [What is usable right now]
30
+
31
+ ## Parity
32
+ - [Where continuous-improvement matches or exceeds benchmarks]
33
+
34
+ ## Primitive-Only Gaps
35
+ - [Tools exist, but continuous-improvement lacks clean operator skills]
36
+
37
+ ## Missing Integrations
38
+ - [Capabilities not available yet]
39
+
40
+ ## Top 3-5 Next Moves
41
+ 1. [Concrete continuous-improvement-native addition]
42
+ 2. [Ordered by impact]
43
+ ```
44
+
45
+ ## Rules
46
+
47
+ - **Never print secrets** — only provider names, capability names, file paths
48
+ - **Prefer continuous-improvement** over generic "install another plugin" advice
49
+ - **Organize by workflows**, not API brands
50
+ - **Specific recommendations** — concrete enough to implement without another discovery pass
51
+
52
+ ## Example Output
53
+
54
+ ```
55
+ ## Current Surface
56
+ - MCP: filesystem, github, playwright
57
+ - Plugins: beginner, expert (continuous-improvement)
58
+ - Env: STRIPE_API_KEY, FAL_KEY configured
59
+ - Framework: Next.js 15, React 19, TypeScript
60
+
61
+ ## Parity
62
+ - Continuous improvement: covered (native)
63
+ - Testing discipline: covered (TDD workflows)
64
+
65
+ ## Primitive-Only Gaps
66
+ - Stripe connected but no billing-operator skill
67
+ - GitHub MCP available but no issue-triage workflow
68
+
69
+ ## Missing Integrations
70
+ - No Linear connector detected
71
+ - No Slack webhook configured
72
+
73
+ ## Top 3-5 Next Moves
74
+ 1. Create billing-operator skill (Stripe integration)
75
+ 2. Create github-ops workflow for issue triage
76
+ 3. Add Linear connector skill for project management
77
+ ```
@@ -0,0 +1,190 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Runtime PreToolUse companion-preference hook.
4
+ *
5
+ * Reads ~/.claude/settings.json → continuous_improvement.companion_preference
6
+ * and enforces the Companion-Preference Override contract documented in
7
+ * skills/superpowers.md for `Skill` tool calls.
8
+ *
9
+ * ci-first (default): no-op, allow.
10
+ * companions-first : advisory stderr on mapped CI→companion pair; allow.
11
+ * strict-companions : block mapped CI route. Reason names the companion
12
+ * (when installed) or the install hint (when not).
13
+ *
14
+ * Fail-open: any unexpected error reading stdin / parsing settings / probing
15
+ * the filesystem → emit { decision: "allow" } and exit 0. The hook never
16
+ * blocks on its own bugs.
17
+ *
18
+ * Stdin : JSON { tool_name, tool_input }
19
+ * Stdout : JSON { decision: "allow" | "block", reason?: string }
20
+ * Exit : 0 always — decision lives in stdout, never in the exit code.
21
+ *
22
+ * OVERRIDES map must stay row-aligned with skills/superpowers.md
23
+ * § "Which rows the override affects" — drift will surface when the test
24
+ * suite or a follow-up audit walks the table against this map.
25
+ */
26
+ import { execFileSync } from "node:child_process";
27
+ import { createHash } from "node:crypto";
28
+ import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
29
+ import { homedir } from "node:os";
30
+ import { join } from "node:path";
31
+ const OVERRIDES = {
32
+ "tdd-workflow": {
33
+ companion: "superpowers:test-driven-development",
34
+ plugin: "superpowers",
35
+ },
36
+ "verification-loop": {
37
+ companion: "superpowers:verification-before-completion",
38
+ plugin: "superpowers",
39
+ },
40
+ "context-budget": {
41
+ companion: "agent-skills:context-engineering",
42
+ plugin: "agent-skills",
43
+ },
44
+ ralph: {
45
+ companion: "oh-my-claudecode:ultrawork",
46
+ plugin: "oh-my-claudecode",
47
+ },
48
+ "learn-eval": {
49
+ companion: "oh-my-claudecode:retrospective",
50
+ plugin: "oh-my-claudecode",
51
+ },
52
+ };
53
+ function emitAndExit(d) {
54
+ process.stdout.write(`${JSON.stringify(d)}\n`);
55
+ process.exit(0);
56
+ }
57
+ function readStdin() {
58
+ try {
59
+ return readFileSync(0, "utf8");
60
+ }
61
+ catch {
62
+ return "";
63
+ }
64
+ }
65
+ function readMode(home) {
66
+ try {
67
+ const raw = readFileSync(join(home, ".claude", "settings.json"), "utf8");
68
+ const settings = JSON.parse(raw);
69
+ const mode = settings.continuous_improvement?.companion_preference;
70
+ if (mode === "companions-first" || mode === "strict-companions")
71
+ return mode;
72
+ return "ci-first";
73
+ }
74
+ catch {
75
+ return "ci-first";
76
+ }
77
+ }
78
+ function isCompanionInstalled(home, plugin) {
79
+ try {
80
+ return existsSync(join(home, ".claude", "plugins", plugin));
81
+ }
82
+ catch {
83
+ return false;
84
+ }
85
+ }
86
+ function normalizeSkill(skill) {
87
+ return skill.startsWith("ci:") ? skill.slice(3) : skill;
88
+ }
89
+ function resolveHome() {
90
+ return process.env.HOME ?? process.env.USERPROFILE ?? homedir();
91
+ }
92
+ function resolveProjectRoot() {
93
+ const fromEnv = process.env.CLAUDE_PROJECT_DIR;
94
+ if (fromEnv)
95
+ return fromEnv;
96
+ try {
97
+ const root = execFileSync("git", ["rev-parse", "--show-toplevel"], {
98
+ encoding: "utf8",
99
+ stdio: ["ignore", "pipe", "ignore"],
100
+ }).trim();
101
+ if (root)
102
+ return root;
103
+ }
104
+ catch {
105
+ // not in a git repo
106
+ }
107
+ return "global";
108
+ }
109
+ function telemetryPath(home) {
110
+ const hash = createHash("sha256")
111
+ .update(resolveProjectRoot())
112
+ .digest("hex")
113
+ .slice(0, 12);
114
+ return join(home, ".claude", "instincts", hash, "companion-preference.jsonl");
115
+ }
116
+ /**
117
+ * Append one JSONL line per hook decision. Wrapped to fail open: any write
118
+ * error (read-only dir, disk full, race on mkdir) is swallowed and the hook
119
+ * decision proceeds. Telemetry must never block tool calls.
120
+ */
121
+ function writeTelemetry(home, event) {
122
+ try {
123
+ const path = telemetryPath(home);
124
+ const dir = join(path, "..");
125
+ if (!existsSync(dir))
126
+ mkdirSync(dir, { recursive: true });
127
+ appendFileSync(path, `${JSON.stringify(event)}\n`);
128
+ }
129
+ catch {
130
+ // fail-open — telemetry failure never changes the decision
131
+ }
132
+ }
133
+ function main() {
134
+ const raw = readStdin();
135
+ let payload;
136
+ try {
137
+ payload = JSON.parse(raw);
138
+ }
139
+ catch {
140
+ emitAndExit({ decision: "allow" });
141
+ }
142
+ if (payload.tool_name !== "Skill") {
143
+ emitAndExit({ decision: "allow" });
144
+ }
145
+ const skill = payload.tool_input?.skill;
146
+ if (typeof skill !== "string" || skill.length === 0) {
147
+ emitAndExit({ decision: "allow" });
148
+ }
149
+ const normalized = normalizeSkill(skill);
150
+ const override = OVERRIDES[normalized];
151
+ if (!override) {
152
+ emitAndExit({ decision: "allow" });
153
+ }
154
+ const home = resolveHome();
155
+ const mode = readMode(home);
156
+ const installed = isCompanionInstalled(home, override.plugin);
157
+ const baseEvent = {
158
+ ts: new Date().toISOString(),
159
+ hook: "companion-preference",
160
+ ci_skill: normalized,
161
+ companion: override.companion,
162
+ plugin: override.plugin,
163
+ companion_installed: installed,
164
+ };
165
+ if (mode === "ci-first") {
166
+ // Shadow row: what companions-first would have done. This is the data
167
+ // set that earns a future default-flip decision.
168
+ writeTelemetry(home, { ...baseEvent, mode, action: "observation" });
169
+ emitAndExit({ decision: "allow" });
170
+ }
171
+ if (mode === "companions-first") {
172
+ process.stderr.write(`[continuous-improvement] companion_preference=companions-first → prefer \`${override.companion}\` over \`ci:${normalized}\`.\n`);
173
+ writeTelemetry(home, { ...baseEvent, mode, action: "advisory" });
174
+ emitAndExit({ decision: "allow" });
175
+ }
176
+ // strict-companions: always block; reason depends on install state.
177
+ if (installed) {
178
+ writeTelemetry(home, { ...baseEvent, mode, action: "block" });
179
+ emitAndExit({
180
+ decision: "block",
181
+ reason: `companion_preference=strict-companions: route to \`${override.companion}\` instead of \`ci:${normalized}\`. The CI fallback is suppressed by your setting.`,
182
+ });
183
+ }
184
+ writeTelemetry(home, { ...baseEvent, mode, action: "block-not-installed" });
185
+ emitAndExit({
186
+ decision: "block",
187
+ reason: `companion_preference=strict-companions: companion plugin \`${override.plugin}\` is not installed. Install with \`/plugin install ${override.plugin}@continuous-improvement\` or relax the setting to \`companions-first\` or \`ci-first\` in ~/.claude/settings.json.`,
188
+ });
189
+ }
190
+ main();