continuous-improvement 3.1.0 → 3.9.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 (136) hide show
  1. package/.claude-plugin/marketplace.json +66 -0
  2. package/CHANGELOG.md +216 -0
  3. package/QUICKSTART.md +79 -12
  4. package/README.md +229 -349
  5. package/SKILL.md +87 -9
  6. package/action.yml +1 -1
  7. package/bin/analyze.sh +9 -1
  8. package/bin/backfill.mjs +172 -0
  9. package/bin/check-doc-runtime-claims.mjs +120 -0
  10. package/bin/check-docs-substrings.mjs +333 -0
  11. package/bin/check-everything-mirror.mjs +145 -0
  12. package/bin/check-routing-targets.mjs +151 -0
  13. package/bin/check-skill-law-tag.mjs +128 -0
  14. package/bin/check-skill-mirror.mjs +119 -0
  15. package/bin/check-skill-tiers.mjs +116 -0
  16. package/bin/check-third-party-shape.mjs +202 -0
  17. package/bin/generate-plugin-manifests.mjs +171 -0
  18. package/bin/harvest-friction.mjs +279 -0
  19. package/bin/hook-stats.mjs +258 -0
  20. package/bin/install.mjs +407 -499
  21. package/bin/lint-transcript.mjs +182 -210
  22. package/bin/mcp-server.mjs +834 -608
  23. package/bin/observe.mjs +148 -0
  24. package/bin/pre-commit-block-strays.sh +49 -0
  25. package/bin/refresh-third-party.mjs +416 -0
  26. package/bin/unified-cli.mjs +533 -0
  27. package/commands/continuous-improvement.md +43 -2
  28. package/commands/discipline.md +14 -0
  29. package/commands/harvest.md +76 -0
  30. package/commands/learn-eval.md +117 -0
  31. package/commands/planning-with-files.md +66 -0
  32. package/commands/proceed-with-the-recommendation.md +62 -0
  33. package/commands/ralph.md +103 -0
  34. package/commands/release-train.md +81 -0
  35. package/commands/seven-laws.md +16 -0
  36. package/commands/superpowers.md +180 -0
  37. package/commands/swarm.md +101 -0
  38. package/commands/workspace-surface-audit.md +77 -0
  39. package/hooks/gateguard.mjs +172 -0
  40. package/hooks/observe.sh +42 -4
  41. package/hooks/session.sh +3 -3
  42. package/hooks/three-section-close.mjs +181 -0
  43. package/instinct-packs/meta.json +16 -0
  44. package/lib/cli-anything.mjs +401 -0
  45. package/lib/compound-engineering.mjs +831 -0
  46. package/lib/gateguard-state.mjs +85 -0
  47. package/lib/observe-event.mjs +128 -0
  48. package/lib/plugin-metadata.mjs +435 -0
  49. package/lib/pm-marketplace.mjs +61 -0
  50. package/lib/pm-skills.mjs +1274 -0
  51. package/lib/resolve-home-dir.mjs +43 -0
  52. package/lib/skill-tiers.mjs +137 -0
  53. package/lib/unified-plugin.mjs +924 -0
  54. package/llms.txt +32 -7
  55. package/package.json +29 -19
  56. package/plugins/beginner.json +17 -6
  57. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
  58. package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
  59. package/plugins/continuous-improvement/LICENSE +21 -0
  60. package/plugins/continuous-improvement/README.md +57 -0
  61. package/plugins/continuous-improvement/agents/README.md +120 -0
  62. package/plugins/continuous-improvement/agents/code-reviewer.md +97 -0
  63. package/plugins/continuous-improvement/agents/security-auditor.md +101 -0
  64. package/plugins/continuous-improvement/agents/test-engineer.md +95 -0
  65. package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
  66. package/plugins/continuous-improvement/bin/mcp-server.mjs +889 -0
  67. package/plugins/continuous-improvement/bin/observe.mjs +148 -0
  68. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
  69. package/plugins/continuous-improvement/commands/dashboard.md +56 -0
  70. package/plugins/continuous-improvement/commands/discipline.md +51 -0
  71. package/plugins/continuous-improvement/commands/harvest.md +76 -0
  72. package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
  73. package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
  74. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
  75. package/plugins/continuous-improvement/commands/ralph.md +103 -0
  76. package/plugins/continuous-improvement/commands/release-train.md +81 -0
  77. package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
  78. package/plugins/continuous-improvement/commands/superpowers.md +180 -0
  79. package/plugins/continuous-improvement/commands/swarm.md +101 -0
  80. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
  81. package/plugins/continuous-improvement/hooks/gateguard.mjs +172 -0
  82. package/plugins/continuous-improvement/hooks/hooks.json +65 -0
  83. package/plugins/continuous-improvement/hooks/observe.sh +172 -0
  84. package/plugins/continuous-improvement/hooks/session.sh +106 -0
  85. package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
  86. package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
  87. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
  88. package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
  89. package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
  90. package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
  91. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +435 -0
  92. package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
  93. package/plugins/continuous-improvement/skills/README.md +37 -0
  94. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
  95. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +178 -0
  96. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +163 -0
  97. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
  98. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +447 -0
  99. package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
  100. package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +73 -0
  101. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
  102. package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +63 -0
  103. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
  104. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +219 -0
  105. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
  106. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
  107. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +224 -0
  108. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
  109. package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
  110. package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +66 -0
  111. package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
  112. package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
  113. package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
  114. package/plugins/expert.json +26 -5
  115. package/skills/README.md +79 -0
  116. package/skills/deploy-receipt.md +178 -0
  117. package/skills/gateguard.md +163 -0
  118. package/skills/para-memory-files.md +108 -0
  119. package/skills/proceed-with-the-recommendation.md +447 -0
  120. package/skills/ralph.md +221 -0
  121. package/skills/recovery-classification.md +73 -0
  122. package/skills/safety-guard.md +76 -0
  123. package/skills/state-reconciliation.md +63 -0
  124. package/skills/strategic-compact.md +104 -0
  125. package/skills/superpowers.md +219 -0
  126. package/skills/tdd-workflow.md +411 -0
  127. package/skills/token-budget-advisor.md +136 -0
  128. package/skills/verification-loop.md +224 -0
  129. package/skills/wild-risa-balance.md +191 -0
  130. package/skills/workspace-surface-audit.md +147 -0
  131. package/skills/worktree-safety.md +66 -0
  132. package/templates/insights-claude-md.md +91 -0
  133. package/templates/planning-with-files/findings.md +8 -0
  134. package/templates/planning-with-files/progress.md +7 -0
  135. package/templates/planning-with-files/task_plan.md +23 -0
  136. package/templates/verify-ladder.example.json +60 -0
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: workspace-surface-audit
3
+ tier: companion
4
+ description: "Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Audits the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommends the highest-value continuous-improvement-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment."
5
+ origin: continuous-improvement
6
+ ---
7
+
8
+ # Workspace Surface Audit
9
+
10
+ Read-only audit skill for answering the question "what can this workspace and machine actually do right now, and what should we add or enable next?"
11
+
12
+ This is the continuous-improvement answer to setup-audit plugins. It does not modify files unless the user explicitly asks for follow-up implementation.
13
+
14
+ ## When to Use
15
+
16
+ - User says "set up Claude Code", "recommend automations", "what plugins or MCPs should I use?", or "what am I missing?"
17
+ - Auditing a machine or repo before installing more skills, hooks, or connectors
18
+ - Comparing official marketplace plugins against continuous-improvement coverage
19
+ - Reviewing `.env`, `.mcp.json`, plugin settings, or connected-app surfaces to find missing workflow layers
20
+ - Deciding whether a capability should be a skill, hook, agent, MCP, or external connector
21
+
22
+ ## Non-Negotiable Rules
23
+
24
+ - Never print secret values. Surface only provider names, capability names, file paths, and whether a key or config exists.
25
+ - Prefer continuous-improvement workflows over generic "install another plugin" advice when continuous-improvement can reasonably own the surface.
26
+ - Treat external plugins as benchmarks and inspiration, not authoritative product boundaries.
27
+ - Separate three things clearly:
28
+ - already available now
29
+ - available but not wrapped well in continuous-improvement
30
+ - not available and would require a new integration
31
+
32
+ ## Audit Inputs
33
+
34
+ Inspect only the files and settings needed to answer the question well:
35
+
36
+ 1. **Repo surface**
37
+ - `package.json`, lockfiles, language markers, framework config, `README.md`
38
+ - `.mcp.json`, `.lsp.json`, `.claude/settings*.json`, `.codex/*`
39
+ - `AGENTS.md`, `CLAUDE.md`, install manifests, hook configs
40
+ 2. **Environment surface**
41
+ - `.env*` files in the active repo and obvious adjacent continuous-improvement workspaces
42
+ - Surface only key names such as `STRIPE_API_KEY`, `TWILIO_AUTH_TOKEN`, `FAL_KEY`
43
+ 3. **Connected tool surface**
44
+ - Installed plugins, enabled connectors, MCP servers, LSPs, and app integrations
45
+ 4. **continuous-improvement surface**
46
+ - Existing skills, commands, hooks, agents, and install modules that already cover the need
47
+
48
+ ## Audit Process
49
+
50
+ ### Phase 1: Inventory What Exists
51
+
52
+ Produce a compact inventory:
53
+
54
+ - active harness targets
55
+ - installed plugins and connected apps
56
+ - configured MCP servers
57
+ - configured LSP servers
58
+ - env-backed services implied by key names
59
+ - existing continuous-improvement skills already relevant to the workspace
60
+
61
+ If a surface exists only as a primitive, call that out. Example:
62
+
63
+ - "Stripe is available via connected app, but continuous-improvement lacks a billing-operator skill"
64
+ - "Google Drive is connected, but there is no continuous-improvement-native Google Workspace operator workflow"
65
+
66
+ #### Environment Grain
67
+
68
+ Before any tool-class advice, capture the per-host facts that make commands either run or fail. The 28-day usage report's recurring "command failed / wrong approach" friction class roots almost entirely in this grain being unrecorded at session start — the agent reaches for `jq`, finds it missing, retries; reaches for bash chaining, hits PowerShell parser errors, retries; trusts a stale `pwd` after `tsc`, runs verification from the wrong directory, retries.
69
+
70
+ Probe and record (no destructive commands; quote results inline):
71
+
72
+ - **Shell flavor.** `echo $SHELL` on POSIX or `$PSVersionTable.PSEdition` on Windows; detect `bash`, `zsh`, `pwsh`, or `cmd`. PowerShell on Windows treats `&&`, `2>&1`, and quoting differently from bash; Git Bash on Windows is bash-shaped but lacks several POSIX utilities by default.
73
+ - **OS family + line endings.** `uname -s` (or PowerShell `$IsWindows`) plus `git config --get core.autocrlf`. On Windows with `core.autocrlf=true`, `git status` reports phantom modifications on every checked-out file — `git diff --stat` is the reliable change-set view.
74
+ - **jq availability.** `command -v jq` (or `Get-Command jq`). When jq is missing, observation-pipeline hooks fall back to a thin schema and curl/JSON one-liners need a node/python rewrite.
75
+ - **Case-sensitive filesystem.** Test by creating two paths differing only in case in a tempdir. NTFS (Windows) and APFS (macOS default) are case-insensitive; Linux ext4 and case-sensitive APFS are case-sensitive. Affects `CLAUDE.md` vs `claude.md` resolution and import paths.
76
+ - **CWD baseline.** `pwd` (or `Get-Location`) recorded at session start. `tsc`, build scripts, and some test runners change CWD as a side effect; subsequent commands run from the wrong directory return "deps not installed" or "config not found" misreads.
77
+ - **Parallel-actor expectation.** Document whether a second Claude / Codex / Maulana session may operate on the same working tree. If yes, the `gateguard` Parallel-Actor Gate must baseline `git rev-parse HEAD` + `git status --porcelain` + upstream before the first mutation, and re-check on every subsequent mutation.
78
+
79
+ Output the recorded grain as a single fenced block so it survives context compaction and any later phase can reference it without re-probing:
80
+
81
+ ```
82
+ shell-flavor: pwsh
83
+ os: windows-11 / autocrlf=true
84
+ jq: missing
85
+ case-sensitive: false
86
+ cwd-baseline: D:/Ai/continuous-improvement
87
+ parallel-actor: yes
88
+ ```
89
+
90
+ The fenced block is the contract surface — keep the field names stable so downstream skills (`gateguard`, `verification-loop`, future autonomous-release-train) can parse it without per-host special-casing.
91
+
92
+ ### Phase 2: Benchmark Against Official and Installed Surfaces
93
+
94
+ Compare the workspace against:
95
+
96
+ - official Claude plugins that overlap with setup, review, docs, design, or workflow quality
97
+ - locally installed plugins in Claude or Codex
98
+ - the user's currently connected app surfaces
99
+
100
+ Do not just list names. For each comparison, answer:
101
+
102
+ 1. what they actually do
103
+ 2. whether continuous-improvement already has parity
104
+ 3. whether continuous-improvement only has primitives
105
+ 4. whether continuous-improvement is missing the workflow entirely
106
+
107
+ ### Phase 3: Turn Gaps Into continuous-improvement Decisions
108
+
109
+ For every real gap, recommend the correct continuous-improvement-native shape:
110
+
111
+ | Gap Type | Preferred continuous-improvement Shape |
112
+ |----------|---------------------|
113
+ | Repeatable operator workflow | Skill |
114
+ | Automatic enforcement or side-effect | Hook |
115
+ | Specialized delegated role | Agent |
116
+ | External tool bridge | MCP server or connector |
117
+ | Install/bootstrap guidance | Setup or audit skill |
118
+
119
+ Default to user-facing skills that orchestrate existing tools when the need is operational rather than infrastructural.
120
+
121
+ ## Output Format
122
+
123
+ Return five sections in this order:
124
+
125
+ 1. **Current surface** — what is already usable right now
126
+ 2. **Parity** — where continuous-improvement already matches or exceeds the benchmark
127
+ 3. **Primitive-only gaps** — tools exist, but continuous-improvement lacks a clean operator skill
128
+ 4. **Missing integrations** — capability not available yet
129
+ 5. **Top 3-5 next moves** — concrete continuous-improvement-native additions, ordered by impact
130
+
131
+ ## Recommendation Rules
132
+
133
+ - Recommend at most 1-2 highest-value ideas per category.
134
+ - Favor skills with obvious user intent and business value:
135
+ - setup audit
136
+ - billing/customer ops
137
+ - issue/program ops
138
+ - Google Workspace ops
139
+ - deployment/ops control
140
+ - If a connector is company-specific, recommend it only when it is genuinely available or clearly useful to the user's workflow.
141
+ - If continuous-improvement already has a strong primitive, propose a wrapper skill instead of inventing a brand-new subsystem.
142
+
143
+ ## Good Outcomes
144
+
145
+ - The user can immediately see what is connected, what is missing, and what continuous-improvement should own next.
146
+ - Recommendations are specific enough to implement in the repo without another discovery pass.
147
+ - The final answer is organized around workflows, not API brands.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: worktree-safety
3
+ tier: "2"
4
+ description: "Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Pre-dispatch invariant: validate worktree root before any source-writing tool call. Catches missing .git, fallback path-only creation, stale leases, foreign-session ownership, and non-worktree git operations before they corrupt history."
5
+ origin: continuous-improvement
6
+ ---
7
+
8
+ # Worktree Safety Skill
9
+
10
+ A pre-dispatch invariant. Before any tool call that writes source files or runs git, validate that the current working directory is a registered worktree with a healthy `.git`, owned by this session, on the expected branch.
11
+
12
+ ## When to Use
13
+
14
+ - Before every Edit / Write / Bash that touches source code in a multi-worktree session.
15
+ - Before any `git` command in an auto-loop.
16
+ - After any pause/resume — CWD may have drifted, the worktree may have been pruned, the lease may have expired.
17
+ - When the verification ladder reports a class-`worktree` failure (see `recovery-classification`).
18
+
19
+ ## Why This Skill Exists
20
+
21
+ GSD-2's [CONTEXT.md](https://github.com/gsd-build/gsd-2/blob/main/CONTEXT.md) names "Worktree Safety" as one of four runtime invariant modules. Common failure modes it catches:
22
+
23
+ - **Units dispatch into ghost / invalid worktree roots** — `.git` missing, fallback path-only creation, the worktree was pruned but the loop kept its handle.
24
+ - **Health checks unit-specific instead of lifecycle-wide** — earlier units (sketch, plan) write into invalid roots before any check runs.
25
+ - **Brittle exit / merge signals** — relying on artifact presence instead of authoritative branch and commit state.
26
+ - **Parallel actors mutating the working tree of a worktree they don't own** — a known hazard on this host (see `feedback_parallel_actor.md`).
27
+
28
+ The continuous-improvement repo runs on Windows + Git Bash with `autocrlf=true` and a parallel-actor expectation, both of which make weak worktree handling expensive.
29
+
30
+ ## The Five-Check Envelope
31
+
32
+ Before any source-writing call, verify all five. Fail closed on any miss.
33
+
34
+ 1. **Root validity** — `git rev-parse --show-toplevel` resolves; the resolved path matches CWD after symlink-safe canonicalization.
35
+ 2. **`.git` presence** — `.git` exists (file pointer for worktrees, directory for primary checkout). A missing or unreadable `.git` is an immediate stop.
36
+ 3. **Worktree registration** — `git worktree list` includes the resolved root with no `prunable` flag. Prunable worktrees can be deleted by another process at any moment.
37
+ 4. **Branch alignment** — current branch matches the lease ledger; `HEAD` is not detached unless the unit explicitly asked for detached state.
38
+ 5. **Lease ownership** — the session ID in `.git/worktrees/<name>/lease` (or your equivalent ledger) matches this session. Stale or foreign leases block the call.
39
+
40
+ Output a single fenced block before any source-writing dispatch:
41
+
42
+ ```
43
+ worktree-safety (resolved):
44
+ root: d:/Ai/ci-wt-skill-trio (matches CWD, canonicalized)
45
+ .git: file pointer → /shared/.git/worktrees/skill-trio (present)
46
+ registration: listed in `git worktree list` (not prunable)
47
+ branch: feat/verification-ladder-skill-trio (matches lease)
48
+ lease: owned by session 4f2a (this session) → CLEAR
49
+ ```
50
+
51
+ If any line is non-`CLEAR`, dispatch is blocked and the failure routes to `recovery-classification` as class `worktree`.
52
+
53
+ ## Anti-Patterns
54
+
55
+ - **Per-tool checks, not lifecycle checks.** Validating only at execute-task lets sketch / plan / research units write into invalid roots first.
56
+ - **Trusting CWD.** A `process.chdir` (or operator `cd`) in another loop iteration can leave CWD pointing at a pruned worktree. Re-resolve every time; do not cache.
57
+ - **Fallback-to-primary on worktree miss.** Silently writing to the primary checkout when the worktree is broken is the worst recovery — it corrupts the wrong branch with no audit trail.
58
+ - **Skipping lease ownership.** Two sessions in the same worktree race on every commit. The lease is the authoritative single-writer signal; do not skip it because "it's only one session" — that assumption breaks the moment a parallel actor appears.
59
+ - **Allowing detached HEAD silently.** A detached HEAD is sometimes legitimate (bisect, snapshot read), but every check must name whether detached is expected for this unit.
60
+
61
+ ## Pairs With
62
+
63
+ - [verification-loop](verification-loop.md) — runs as a pre-Phase-0 invariant; the resolved-safety block fires before the resolved-ladder block.
64
+ - [state-reconciliation](state-reconciliation.md) — both fire before dispatch; safety runs first because reconciliation depends on a valid worktree root.
65
+ - [recovery-classification](recovery-classification.md) — any non-`CLEAR` line routes here as class `worktree`.
66
+ - [gateguard](gateguard.md) — gateguard fires at the tool boundary; worktree-safety is the lifecycle counterpart that runs before tool dispatch is even considered.
@@ -0,0 +1,8 @@
1
+ # Findings
2
+
3
+ ## Research Notes
4
+ - Created on {{date}}.
5
+ - Record source links, code references, and synthesized findings here.
6
+
7
+ ## Sources
8
+ - Add links and short summaries here.
@@ -0,0 +1,7 @@
1
+ # Progress
2
+
3
+ ## Session Log
4
+ - {{date}}: Initialized planning files.
5
+
6
+ ## Verification Notes
7
+ - Record commands, tests, outputs, and checkpoints here.
@@ -0,0 +1,23 @@
1
+ # Task Plan
2
+
3
+ ## Goal
4
+ {{goal}}
5
+
6
+ ## Status
7
+ {{status}}
8
+
9
+ ## Phases
10
+ {{phases}}
11
+
12
+ ## Key Questions
13
+ - [ ] What existing implementation or context should be reviewed first?
14
+ - [ ] What constraints or risks need validation before execution?
15
+ - [ ] What verification proves the task is complete?
16
+
17
+ ## Decisions Made
18
+ - None yet.
19
+
20
+ ## Errors Encountered
21
+ | Error | Attempt | Resolution |
22
+ | --- | --- | --- |
23
+ | None yet | - | - |
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "continuous-improvement",
3
- "version": "3.1.0",
3
+ "version": "3.9.0",
4
4
  "mode": "expert",
5
- "description": "Full plugin: 10 tools including instinct management, import/export, observation viewer, dashboard, and instinct packs.",
5
+ "description": "Expert mode: tune confidence, manage instincts, and persist plans on disk. Adds safety, token-budget, and strategic-compact skills plus the /learn-eval command so long sessions stay disciplined and learnings survive context resets.",
6
6
  "tools": [
7
7
  {
8
8
  "name": "ci_status",
@@ -36,6 +36,14 @@
36
36
  "name": "ci_import",
37
37
  "what": "Import instincts from JSON (skip duplicates)"
38
38
  },
39
+ {
40
+ "name": "ci_plan_init",
41
+ "what": "Create project-root planning files for persistent task memory"
42
+ },
43
+ {
44
+ "name": "ci_plan_status",
45
+ "what": "Summarize task_plan.md, findings.md, and progress.md status"
46
+ },
39
47
  {
40
48
  "name": "ci_dashboard",
41
49
  "what": "Visual dashboard showing instinct health, confidence distribution, and learning progress"
@@ -50,7 +58,11 @@
50
58
  "mcpServers": {
51
59
  "continuous-improvement": {
52
60
  "command": "node",
53
- "args": ["<install-path>/bin/mcp-server.mjs", "--mode", "expert"]
61
+ "args": [
62
+ "<install-path>/bin/mcp-server.mjs",
63
+ "--mode",
64
+ "expert"
65
+ ]
54
66
  }
55
67
  }
56
68
  },
@@ -58,13 +70,22 @@
58
70
  "mcpServers": {
59
71
  "continuous-improvement": {
60
72
  "command": "node",
61
- "args": ["<install-path>/bin/mcp-server.mjs", "--mode", "expert"]
73
+ "args": [
74
+ "<install-path>/bin/mcp-server.mjs",
75
+ "--mode",
76
+ "expert"
77
+ ]
62
78
  }
63
79
  }
64
80
  }
65
81
  },
66
82
  "hooks": {
67
- "included": ["PreToolUse", "PostToolUse", "SessionStart", "SessionEnd"],
83
+ "included": [
84
+ "PreToolUse",
85
+ "PostToolUse",
86
+ "SessionStart",
87
+ "SessionEnd"
88
+ ],
68
89
  "description": "Full hook suite: observation capture + session-level instinct loading and auto-reflection."
69
90
  }
70
91
  }
@@ -0,0 +1,79 @@
1
+ # Source Skills
2
+
3
+ This directory holds the **source-of-truth** for the companion skills bundled with the `continuous-improvement` plugin.
4
+
5
+ > Edit files **here**. The plugin bundle at `plugins/continuous-improvement/skills/<name>/SKILL.md` is **regenerated** every time you run `npm run build` (see [`bin/generate-plugin-manifests.mjs`](../bin/generate-plugin-manifests.mjs)). Edits made directly inside `plugins/continuous-improvement/skills/` will be overwritten.
6
+
7
+ ## Featured companion — installed by default with the plugin
8
+
9
+ `proceed-with-the-recommendation` is the **recommended pairing** for the 7 Laws. It is the execution arm that turns "do all of it" into a disciplined, verified, one-concern-at-a-time walk through the agent's recommendation list. If you only adopt one companion alongside the core skill, adopt this one.
10
+
11
+ | Skill | What it does | Source |
12
+ |-------|--------------|--------|
13
+ | **`proceed-with-the-recommendation`** ⭐ | Walks any agent's recommendation list top-to-bottom under the 7 Laws — routes each item to the right specialist (`superpowers:*`, `ralph`, `workspace-surface-audit`, `simplify`, `security-review`, `schedule`, `loop`), falls back to inline behavior when a specialist isn't installed, verifies per item, halts on `needs-approval` | @naimkatiman |
14
+
15
+ ## Tier 1 — recommended pairing for **beginner** mode
16
+
17
+ These add concrete enforcement to the 7 Laws. Tier-1 skills are the always-on minimum for any user running `npx continuous-improvement install` (default beginner mode).
18
+
19
+ | Skill | What it does | Pairs with which Law |
20
+ |-------|--------------|----------------------|
21
+ | `para-memory-files` | File-based persistent memory using PARA (Projects/Areas/Resources/Archives) for cross-session context | Law 5 (Reflect), Law 7 (Learn) |
22
+ | `verification-loop` | Six-phase verification (build, types, lint, tests, security, diff) with a structured PASS/FAIL report | Law 4 (Verify Before Reporting) |
23
+ | `gateguard` | PreToolUse fact-forcing gate that blocks Edit/Write/destructive Bash until concrete investigation is presented | Law 1 (Research) |
24
+ | `tdd-workflow` | RED→GREEN→REFACTOR enforcement, 80%+ coverage gate across unit/integration/E2E | Law 3 (One Thing), Law 4 (Verify) |
25
+
26
+ ## Tier 2 — additional skills for **expert** mode
27
+
28
+ Tier-2 skills layer on top of tier-1 for users running `npx continuous-improvement install --mode expert`. They cover autonomous-mode safety, response-depth control, and context-window discipline that matter once an agent runs longer or more aggressively.
29
+
30
+ | Skill | What it does | When it pays off |
31
+ |-------|--------------|------------------|
32
+ | `safety-guard` | Three-mode runtime guard (careful/freeze/guard) that blocks destructive commands and locks edits to a directory | Autonomous loops, prod systems, `--dangerously-skip-permissions` sessions |
33
+ | `token-budget-advisor` | Heuristic input/output token estimator that offers 25%/50%/75%/100% depth choices before answering | Long sessions where response size matters |
34
+ | `strategic-compact` | PreToolUse hook that suggests `/compact` at logical phase boundaries (research→plan, plan→implement, debug→next) instead of arbitrary auto-compaction | Multi-phase tasks that approach context limits |
35
+ | `wild-risa-balance` | Decision-framing lens that pairs WILD (Wild/Imaginative/Limitless/Disruptive) generation with RISA (Realistic/Important/Specific/Agreeable) execution, used to split recommendation lists into bold pilots above a safe baseline | Multi-item recommendation blocks where bold options keep losing to safe ones in a flat list |
36
+
37
+ The `/learn-eval` slash command also ships as part of the expert install: extract a session pattern, run a checklist quality gate, and decide global-vs-project save location before writing any skill file.
38
+
39
+ ## Other always-bundled companion skills
40
+
41
+ These ship in the same plugin bundle regardless of mode and are available the moment you install the `continuous-improvement` plugin from the marketplace.
42
+
43
+ | Skill | What it does | Source |
44
+ |-------|--------------|--------|
45
+ | `ralph` | Autonomous loop that executes a PRD story-by-story with quality checks between iterations | [snarktank/ralph](https://github.com/snarktank/ralph) |
46
+ | `superpowers` | **Law activator.** Routes tasks to the correct Law-aligned specialist (brainstorming → Law 2, writing-plans → Law 2, TDD → Law 3+4, verification-before-completion → Law 4, etc.) so the right discipline fires automatically. Not a peer skill — a dispatcher for the others. | [obra/superpowers](https://github.com/obra/superpowers) |
47
+ | `workspace-surface-audit` | Audits the active repo, MCP servers, plugins, and env, then recommends high-value skills/workflows | continuous-improvement |
48
+
49
+ ## How they get to your machine
50
+
51
+ Two paths, you pick:
52
+
53
+ **Path A — Install the plugin (recommended).** Bundled with the core skill, no per-skill copying. All companions land in one shot:
54
+
55
+ ```bash
56
+ /plugin marketplace add naimkatiman/continuous-improvement
57
+ /plugin install continuous-improvement@continuous-improvement
58
+ ```
59
+
60
+ (The `-dev` suffix is reserved for the in-repo development marketplace at `plugins/continuous-improvement/.claude-plugin/marketplace.json` — only used when iterating on the bundle locally.)
61
+
62
+ **Path B — Drop a single skill in by hand.** Useful if you want only one companion without the rest of the plugin:
63
+
64
+ ```bash
65
+ SKILL=proceed-with-the-recommendation
66
+ mkdir -p ~/.claude/skills/$SKILL
67
+ curl -L https://raw.githubusercontent.com/naimkatiman/continuous-improvement/main/skills/$SKILL.md \
68
+ -o ~/.claude/skills/$SKILL/SKILL.md
69
+ ```
70
+
71
+ Or paste the file's contents directly into your agent's system prompt.
72
+
73
+ ## Pressure-test logs
74
+
75
+ Adversarial pressure-test logs for skills in this directory live under [`docs/testing/`](../docs/testing/). They are not skills — they are baseline guarantees future edits must preserve.
76
+
77
+ ## Relationship to the core skill
78
+
79
+ The core [`SKILL.md`](../SKILL.md) at the repo root defines the **7 Laws of discipline**. The skills in this directory are independent execution tools that build on those laws. They do not depend on `SKILL.md` and `SKILL.md` does not depend on them — but `proceed-with-the-recommendation` was written specifically to operationalize the 7 Laws end-to-end, which is why it's the featured pairing.
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: deploy-receipt
3
+ tier: "1"
4
+ description: Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline at the deploy seam. A merge into a branch that auto-deploys is not "done" until the deploy provider reports the merged commit SHA running and a healthcheck endpoint returns 200. Companion to the vendored `finishing-a-development-branch` skill — does not replace it, runs after it for projects on Railway, Cloudflare Workers, Vercel, Netlify, Fly.io, or any other auto-deploy target.
5
+ origin: https://github.com/naimkatiman/continuous-improvement
6
+ ---
7
+
8
+ # Deploy Receipt — Closing the Merge-to-Production Gap
9
+
10
+ ## Why This Skill Exists
11
+
12
+ Multiple sessions in the operator's recent telemetry ended in a "partially achieved" state with the same shape: PR merged green, branch deleted, agent reports done — and then hours later the operator discovers the deploy provider never picked up the commit, was building from a stale lockfile, or silently rolled back. The merge happened. The deploy did not.
13
+
14
+ `finishing-a-development-branch` (vendored from Obra superpowers in `third-party/superpowers/`) ends at the merge. For repos that do not auto-deploy that is the correct boundary. For repos that DO auto-deploy from `main` (Railway, Cloudflare Workers, Vercel, Netlify, Fly.io, Cloud Run, App Runner, et al.) the merge is only the trigger — the work is not done until the deployed SHA matches the merged HEAD and the application answers a healthcheck.
15
+
16
+ This skill defines the receipt that closes that gap, without modifying the vendored upstream file.
17
+
18
+ ## When to Activate
19
+
20
+ Activate when ALL of the following are true:
21
+
22
+ 1. A merge into the deploy branch (typically `main` or `master`) has just landed
23
+ 2. The repo declares an auto-deploy target — detect via any of:
24
+ - `railway.toml`, `railway.json`, or `RAILWAY_*` env vars in `.env.example`
25
+ - `wrangler.toml` / `wrangler.jsonc` (Cloudflare Workers)
26
+ - `vercel.json` or `.vercel/` directory
27
+ - `netlify.toml`
28
+ - `fly.toml`
29
+ - `app.yaml` (App Engine), `apprunner.yaml` (App Runner)
30
+ - GitHub Actions workflow with `deploy:` job triggered on push to the deploy branch
31
+ 3. `finishing-a-development-branch` has reported "merged" — not "PR opened", not "review pending"
32
+
33
+ Do NOT activate when:
34
+ - Repo is library-only / package-published (npm, PyPI, crates.io) — those have a different verification surface
35
+ - Deploy is manual (operator runs `wrangler deploy` themselves) — the merge is genuinely the boundary
36
+ - Merge target is a non-deploy branch (`develop`, `staging-only`, `experimental`)
37
+
38
+ ## What a Receipt Is
39
+
40
+ A deploy receipt has three components, all required:
41
+
42
+ 1. **SHA match.** The deploy provider's currently-running revision SHA equals the merge commit SHA on the deploy branch. Not "the latest deploy started after the merge" — the SHA itself.
43
+ 2. **Health response.** A documented healthcheck endpoint (project-specific; common shapes: `GET /health`, `GET /api/health`, `GET /version`) returns HTTP 200 within a reasonable timeout (default 5 minutes from merge).
44
+ 3. **Build artifact integrity** (when verifiable). If the deploy emits a build hash, log digest, or version string, it matches what was built on the merge commit. If it does not emit one, this component is recorded as `not verifiable for this provider` — it does not block the receipt, but the gap is logged.
45
+
46
+ A receipt missing any required component is NOT a receipt. The merge is reported as `merged but not deployed — operator action required` per the close-the-loop rule below.
47
+
48
+ ## How to Verify (per provider)
49
+
50
+ The skill is provider-aware but never hardcodes a specific API key or token shape. Three verification routes, in priority order:
51
+
52
+ ### Route A — Provider CLI (preferred when authenticated)
53
+
54
+ The CLI is the highest-fidelity source.
55
+
56
+ | Provider | Command shape | Receipt extraction |
57
+ |---|---|---|
58
+ | Railway | `railway status --json` | `.deployments[0].meta.commitHash` |
59
+ | Cloudflare Workers | `wrangler deployments list --json` | `[0].metadata.deployment_trigger.metadata.commit_hash` |
60
+ | Vercel | `vercel inspect <url> --json` | `.gitSource.sha` |
61
+ | Netlify | `netlify api listSiteDeploys --data='{"site_id":"<id>"}'` | `[0].commit_ref` |
62
+ | Fly.io | `fly releases --json` | `[0].commit_sha` |
63
+
64
+ If the CLI is not installed or not authenticated in this session, fall through to Route B. Do NOT prompt the operator to install the CLI mid-session — that is a drive-by.
65
+
66
+ ### Route B — GitHub Deployments API (works for any provider that posts back)
67
+
68
+ ```
69
+ gh api repos/{owner}/{repo}/deployments --jq '.[0] | {sha, ref, environment}'
70
+ gh api repos/{owner}/{repo}/deployments/{id}/statuses --jq '.[0] | {state, target_url}'
71
+ ```
72
+
73
+ A `state: success` status whose parent deployment's `sha` matches the merge SHA is a valid receipt component (1).
74
+
75
+ ### Route C — Version endpoint curl (works for any HTTP service)
76
+
77
+ The most provider-agnostic. Requires the application to expose a version endpoint that returns its build SHA.
78
+
79
+ ```
80
+ curl -fsS https://<deployed-host>/version
81
+ # Expect a JSON body or plain text containing the merge SHA, e.g. {"commit":"a477ec1"}
82
+ # Or a Git-style SHA prefix that matches `git rev-parse --short HEAD`
83
+ ```
84
+
85
+ If no version endpoint exists in the project, log this as a gap and recommend adding one as a deferred follow-up — do not fabricate a receipt from a 200 on `/` or `/health` alone, because both can succeed against the OLD deploy.
86
+
87
+ ## Output Shape (always emit this verbatim block)
88
+
89
+ After running verification:
90
+
91
+ ```
92
+ ## Deploy Receipt — <project name>
93
+ - Merge SHA: <abbreviated sha>
94
+ - Deployed SHA: <abbreviated sha or "not retrieved (reason)">
95
+ - SHA match: yes | no | not verifiable
96
+ - Health endpoint: <url> → <status code> in <ms>ms
97
+ - Build artifact: <digest if available, else "not emitted by provider">
98
+ - Receipt status: COMPLETE | INCOMPLETE — <reason>
99
+ - Verified via: CLI | GitHub Deployments | version curl | combination
100
+ ```
101
+
102
+ A `COMPLETE` receipt is the only state that lets the merge be reported as `done`. `INCOMPLETE` receipts surface a single named operator-action item (e.g. "Railway last deploy is older than the merge — re-trigger from dashboard or `railway up`").
103
+
104
+ ## On-Incomplete Modes
105
+
106
+ The default behavior on `INCOMPLETE` is **report-only** — the receipt block names the gap, the operator decides recovery. A second mode is available for projects that want the skill to also stage a recovery branch and a failing repro test, without ever executing rollback or merge.
107
+
108
+ ### Mode A — `report-only` (default)
109
+
110
+ The current behavior. Print the receipt block, surface the named operator-action item, hand off. No branch creation, no PR opened. Use this mode when the operator is at the keyboard and will react to the receipt directly. No flag required.
111
+
112
+ ### Mode B — `open-hotfix-pr` (opt-in)
113
+
114
+ Use this mode when the receipt is `INCOMPLETE` AND a documented recovery window has elapsed without the deploy self-correcting (default 10 minutes from merge; tunable per project via `verify-ladder.json` `deploy_receipt_recovery_window_seconds`). The skill then stages a recovery branch *for the operator to review*, but never merges or rolls back on its own.
115
+
116
+ Activate with the explicit invocation:
117
+
118
+ ```
119
+ deploy-receipt --on-incomplete=open-hotfix-pr
120
+ ```
121
+
122
+ When triggered, this mode performs four steps in order, halting on the first failure:
123
+
124
+ 1. **Branch.** `git checkout -b hotfix/<merge-sha-short>-<symptom-slug> origin/<deploy-branch>`. The symptom slug is derived from the named gap on the receipt — `sha-mismatch`, `health-non-200`, `version-endpoint-stale`, or `no-provider-source`. If the slug cannot be derived, halt and revert to report-only.
125
+ 2. **Failing repro test.** Write a single test file at `tests/regressions/deploy-<merge-sha-short>.test.<ext>` that asserts the gap (e.g. `expect(deployedSha).toEqual(mergeSha)` or `expect(healthResponse.status).toBe(200)`). The test MUST currently fail when run against production. The skill writes the assertion against the receipt's recorded values, not against speculation. If the test cannot be made to fail deterministically, halt and revert to report-only.
126
+ 3. **Open PR.** `gh pr create --base <deploy-branch> --head hotfix/... --draft` with body that cites the receipt block verbatim, the merge SHA, the deployed SHA, the named gap, and the documented rollback command for the detected provider (a one-line shell snippet from the table below). Draft state is mandatory — never open as ready-for-review without operator approval.
127
+ 4. **Hand off.** Print a single-line operator-action item naming the new branch, the PR URL, and the documented rollback command. Stop. Do not modify production. Do not merge the PR. Do not run the rollback.
128
+
129
+ ### Documented rollback commands (cited in the PR body, never executed)
130
+
131
+ | Provider | Documented rollback command |
132
+ |---|---|
133
+ | Railway | `railway redeploy --service <service-id> --commit <previous-good-sha>` |
134
+ | Cloudflare Workers | `wrangler rollback --message "deploy-receipt: <merge-sha-short> failed health/SHA gate"` |
135
+ | Vercel | `vercel rollback <previous-good-deployment-url>` |
136
+ | Netlify | `netlify rollback` (interactive — operator picks the prior deploy) |
137
+ | Fly.io | `fly releases rollback <previous-good-version>` |
138
+
139
+ The rollback command is **printed**, not run. The skill's job is to give the operator a complete recovery packet (branch + failing test + cited command) without taking the irreversible step itself.
140
+
141
+ ### When NOT to use Mode B
142
+
143
+ - The deploy is mid-rolling-restart or mid-canary — the receipt is INCOMPLETE because the deploy is still in progress, not because it failed. Wait for the recovery window first.
144
+ - Branch protection on the deploy branch denies hotfix branches by name pattern — the PR will fail to open and the skill should fall back to report-only with a named operator action ("hotfix branch denied by protection — recovery requires direct console access").
145
+ - The previous-good SHA cannot be determined from `git log origin/<deploy-branch>` alone — the rollback command in the PR body would be a guess. Fall back to report-only and name the gap as "previous-good SHA unverifiable — operator must select".
146
+ - The operator has already started a manual recovery (a fresh deploy is running, the dashboard shows a rollback in progress). Detect via Route A or Route B and skip Mode B for this receipt cycle.
147
+
148
+ ## Anti-Patterns
149
+
150
+ - **"Eventually consistent" excuse.** Reporting done with `Deployed SHA: not retrieved` and a comment like "deploy will pick up shortly" is exactly the failure mode this skill prevents. There is no eventually — there is COMPLETE or INCOMPLETE.
151
+ - **Health-only receipts.** A 200 on `/health` against a stale deploy is not a receipt. Without SHA match, the receipt is INCOMPLETE.
152
+ - **Skipping for "small changes."** A docs-only commit still needs a receipt if the deploy branch auto-deploys — small changes have caused stale-build incidents on every provider in the table above.
153
+ - **Recommending the CLI install mid-receipt.** If Route A is unavailable, fall through to B then C. Adding tooling is a separate decision the operator makes outside the receipt loop.
154
+ - **Treating absence of evidence as evidence of success.** If none of the three routes produce a SHA, the receipt is `INCOMPLETE — no provider source available`, not `COMPLETE (assumed)`.
155
+ - **Auto-merging the hotfix PR.** Mode B opens the PR as draft and stops. Auto-merge, `--admin` overrides, and `gh pr merge` calls are refused inside this skill. The hotfix is the operator's decision; the skill stages it but never lands it.
156
+ - **Force-pushing or rewriting the hotfix branch.** Mode B branches off `origin/<deploy-branch>` once and pushes once. If the failing test needs changes, the skill writes a new commit on the branch — never `--force` and never `git rebase --interactive`.
157
+ - **Executing the rollback command.** The rollback command is cited in the PR body for operator review. Mode B never runs `railway redeploy`, `wrangler rollback`, `vercel rollback`, etc. on its own. If the operator wants execution, they run it themselves or they wire a separate runner; that is a different skill.
158
+
159
+ ## Pairs With
160
+
161
+ - `finishing-a-development-branch` (vendored, third-party/superpowers/) — runs first; reports the merge. This skill runs after.
162
+ - `verification-loop` — same Law 4 family; this skill is the deploy-seam specialization
163
+ - `proceed-with-the-recommendation` — routing-table row for "Merge / close branch" should pair `finishing-a-development-branch` with this skill when the project is auto-deploy
164
+ - `safety-guard` — orthogonal; safety-guard prevents destructive ops, this verifies post-deploy state
165
+
166
+ ## Close-the-Loop Rule
167
+
168
+ If the receipt is INCOMPLETE, the merge is NOT reported as a closed item in the Phase 7 summary of `proceed-with-the-recommendation`. It moves to **What is next → Immediate operator action**, with the named action and the exact command or dashboard step. The operator's session record is what determines done — not the agent's optimism.
169
+
170
+ ## Installation
171
+
172
+ ```bash
173
+ mkdir -p ~/.claude/skills/deploy-receipt
174
+ curl -L https://raw.githubusercontent.com/naimkatiman/continuous-improvement/main/skills/deploy-receipt.md \
175
+ -o ~/.claude/skills/deploy-receipt/SKILL.md
176
+ ```
177
+
178
+ Restart the Claude Code session so the registry picks it up.