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,435 @@
1
+ export const PACKAGE_NAME = "continuous-improvement";
2
+ export const VERSION = "3.9.0";
3
+ export const PLUGIN_MODES = ["beginner", "expert"];
4
+ const REPOSITORY_URL = "https://github.com/naimkatiman/continuous-improvement";
5
+ const HOMEPAGE_URL = `${REPOSITORY_URL}#readme`;
6
+ const AUTHOR = {
7
+ name: "naimkatiman",
8
+ url: "https://github.com/naimkatiman",
9
+ };
10
+ const KEYWORDS = [
11
+ "claude-code",
12
+ "claude-code-skill",
13
+ "ai-agent",
14
+ "agent-skill",
15
+ "ai-discipline",
16
+ "mulahazah",
17
+ "instinct",
18
+ "hooks",
19
+ "mcp",
20
+ "mcp-server",
21
+ "github-action",
22
+ "transcript-linter",
23
+ ];
24
+ const CLAUDE_PLUGIN_CATEGORY = "productivity";
25
+ const SHARED_PLUGIN_DESCRIPTION = "Stops Claude Code from skipping research, claiming 'done' without verifying, and repeating yesterday's mistakes. The 7 Laws of AI Agent Discipline — 13 enforcement skills, gating hooks, and the Mulahazah auto-leveling instinct engine.";
26
+ // Four vendored upstream companions registered alongside the CI plugin.
27
+ // Each entry points at a pinned-SHA snapshot under third-party/<name>/.
28
+ // See third-party/MANIFEST.md for refresh recipes and per-snapshot
29
+ // OUR_NOTES.md for integration scope and overlap matrices. The unified
30
+ // /superpowers dispatcher (skills/superpowers.md) routes across all four.
31
+ // Product-management coverage is supplied by phuryn/pm-skills as an
32
+ // out-of-band marketplace install — see docs/THIRD_PARTY.md for the
33
+ // `claude plugin marketplace add phuryn/pm-skills` recipe and the eight
34
+ // installable plugins (pm-toolkit, pm-product-strategy, pm-product-discovery,
35
+ // pm-market-research, pm-data-analytics, pm-marketing-growth,
36
+ // pm-go-to-market, pm-execution).
37
+ const THIRD_PARTY_COMPANIONS = [
38
+ {
39
+ name: "superpowers",
40
+ description: "Obra's core skills library: TDD, debugging, brainstorming, writing-plans, executing-plans, dispatching-parallel-agents, using-git-worktrees, finishing-a-development-branch, subagent-driven-development, requesting-code-review, receiving-code-review, systematic-debugging, verification-before-completion, writing-skills, using-superpowers. Vendored snapshot at third-party/superpowers/ pinned to upstream SHA f2cbfbe (v5.1.0). Companion to the /superpowers dispatcher in continuous-improvement plugin.",
41
+ version: "5.1.0",
42
+ source: "./third-party/superpowers",
43
+ author: {
44
+ name: "Jesse Vincent",
45
+ email: "jesse@fsck.com",
46
+ },
47
+ category: "workflow",
48
+ homepage: "https://github.com/obra/superpowers",
49
+ },
50
+ {
51
+ name: "agent-skills",
52
+ description: "Addy Osmani's production-grade engineering skills for AI coding agents — 21 skills covering the full software development lifecycle: spec-driven-development, source-driven-development, context-engineering, idea-refine, incremental-implementation, test-driven-development, 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, using-agent-skills. Vendored snapshot at third-party/addy-agent-skills/ pinned to upstream SHA 742dca5 (v1.0.0).",
53
+ version: "1.0.0",
54
+ source: "./third-party/addy-agent-skills",
55
+ author: {
56
+ name: "Addy Osmani",
57
+ },
58
+ category: "workflow",
59
+ homepage: "https://github.com/addyosmani/agent-skills",
60
+ },
61
+ {
62
+ name: "ruflo-swarm",
63
+ description: "Agent teams, swarm coordination, Monitor streams, and worktree isolation. Wraps 4 swarm_* + 8 agent_* MCP tools (12 total) plus 6 topologies (hierarchical, mesh, hierarchical-mesh, ring, star, adaptive). Slash commands /swarm and /watch. Skills swarm-init and monitor-stream. Cherry-picked from ruvnet/ruflo monorepo (the other 31 plugins are explicitly out of scope). Vendored snapshot at third-party/ruflo-swarm/ pinned to upstream SHA addb5cd (v0.2.0). Activation note: assets reference unpinned npx @claude-flow/cli@latest — supply-chain risk inert until installed.",
64
+ version: "0.2.0",
65
+ source: "./third-party/ruflo-swarm",
66
+ author: {
67
+ name: "ruvnet",
68
+ url: "https://github.com/ruvnet",
69
+ },
70
+ category: "orchestration",
71
+ homepage: "https://github.com/ruvnet/ruflo",
72
+ },
73
+ {
74
+ name: "oh-my-claudecode",
75
+ 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.",
76
+ version: "4.13.6",
77
+ source: "./third-party/oh-my-claudecode",
78
+ author: {
79
+ name: "Yeachan-Heo",
80
+ },
81
+ category: "orchestration",
82
+ homepage: "https://github.com/Yeachan-Heo/oh-my-claudecode",
83
+ },
84
+ ];
85
+ export function isPluginMode(value) {
86
+ return value === "beginner" || value === "expert";
87
+ }
88
+ const BEGINNER_TOOL_ENTRIES = [
89
+ {
90
+ name: "ci_status",
91
+ description: "Show current level, instinct count, and observation count for this project. Good starting point to see what the system has learned.",
92
+ manifestWhat: "See what the system has learned about your project",
93
+ inputSchema: { type: "object", properties: {}, required: [] },
94
+ },
95
+ {
96
+ name: "ci_instincts",
97
+ description: "List all learned instincts for this project with their confidence levels and behaviors.",
98
+ manifestWhat: "List all learned behaviors with confidence levels",
99
+ inputSchema: {
100
+ type: "object",
101
+ properties: {
102
+ min_confidence: {
103
+ type: "number",
104
+ description: "Minimum confidence to show (default: 0)",
105
+ default: 0,
106
+ },
107
+ },
108
+ required: [],
109
+ },
110
+ },
111
+ {
112
+ name: "ci_reflect",
113
+ description: "Generate a structured reflection for the current session. Provide a summary of what you worked on.",
114
+ manifestWhat: "Reflect on what you did this session",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ summary: {
119
+ type: "string",
120
+ description: "Brief summary of what was done this session",
121
+ },
122
+ },
123
+ required: ["summary"],
124
+ },
125
+ },
126
+ ];
127
+ const EXPERT_TOOL_ENTRIES = [
128
+ {
129
+ name: "ci_reinforce",
130
+ description: "Accept or reject an instinct suggestion. Adjusts confidence: +0.15 for accept, -0.1 for reject.",
131
+ manifestWhat: "Accept or reject instinct suggestions to tune confidence",
132
+ inputSchema: {
133
+ type: "object",
134
+ properties: {
135
+ instinct_id: { type: "string", description: "The instinct ID to reinforce" },
136
+ accepted: {
137
+ type: "boolean",
138
+ description: "true = accept (+0.15), false = reject (-0.1)",
139
+ },
140
+ },
141
+ required: ["instinct_id", "accepted"],
142
+ },
143
+ },
144
+ {
145
+ name: "ci_create_instinct",
146
+ description: "Manually create a new instinct with a trigger, body, and starting confidence.",
147
+ manifestWhat: "Manually create instincts with custom triggers and confidence",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ id: { type: "string", description: "Unique instinct ID (kebab-case)" },
152
+ trigger: { type: "string", description: "When this instinct applies" },
153
+ body: { type: "string", description: "The behavior to follow" },
154
+ confidence: {
155
+ type: "number",
156
+ description: "Starting confidence 0.0-0.9 (default: 0.6)",
157
+ default: 0.6,
158
+ },
159
+ domain: {
160
+ type: "string",
161
+ description: "Domain: workflow|tooling|testing|patterns|code-style",
162
+ default: "workflow",
163
+ },
164
+ scope: {
165
+ type: "string",
166
+ description: "Scope: project|global",
167
+ default: "project",
168
+ },
169
+ },
170
+ required: ["id", "trigger", "body"],
171
+ },
172
+ },
173
+ {
174
+ name: "ci_observations",
175
+ description: "View recent tool call observations captured by hooks.",
176
+ manifestWhat: "View raw tool call observations captured by hooks",
177
+ inputSchema: {
178
+ type: "object",
179
+ properties: {
180
+ limit: {
181
+ type: "number",
182
+ description: "Number of recent observations to return (default: 20)",
183
+ default: 20,
184
+ },
185
+ },
186
+ required: [],
187
+ },
188
+ },
189
+ {
190
+ name: "ci_export",
191
+ description: "Export all instincts as a JSON array for sharing or backup.",
192
+ manifestWhat: "Export instincts as JSON for sharing or backup",
193
+ inputSchema: {
194
+ type: "object",
195
+ properties: {
196
+ scope: {
197
+ type: "string",
198
+ description: "Which instincts: project|global|all (default: all)",
199
+ default: "all",
200
+ },
201
+ },
202
+ required: [],
203
+ },
204
+ },
205
+ {
206
+ name: "ci_import",
207
+ description: "Import instincts from a JSON array. Skips duplicates by ID.",
208
+ manifestWhat: "Import instincts from JSON (skip duplicates)",
209
+ inputSchema: {
210
+ type: "object",
211
+ properties: {
212
+ instincts_json: {
213
+ type: "string",
214
+ description: "JSON array of instinct objects to import",
215
+ },
216
+ scope: {
217
+ type: "string",
218
+ description: "Import to: project|global (default: project)",
219
+ default: "project",
220
+ },
221
+ },
222
+ required: ["instincts_json"],
223
+ },
224
+ },
225
+ {
226
+ name: "ci_plan_init",
227
+ description: "Create task_plan.md, findings.md, and progress.md in the project root for persistent file-based planning.",
228
+ manifestWhat: "Create project-root planning files for persistent task memory",
229
+ inputSchema: {
230
+ type: "object",
231
+ properties: {
232
+ goal: { type: "string", description: "Goal for the planning workflow" },
233
+ phases: {
234
+ type: "array",
235
+ description: "Optional ordered phase names. Defaults to Research, Plan, Execute, Verify, Reflect.",
236
+ items: { type: "string" },
237
+ },
238
+ force: {
239
+ type: "boolean",
240
+ description: "Overwrite existing planning files",
241
+ default: false,
242
+ },
243
+ },
244
+ required: ["goal"],
245
+ },
246
+ },
247
+ {
248
+ name: "ci_plan_status",
249
+ description: "Summarize the status of task_plan.md, findings.md, and progress.md in the project root.",
250
+ manifestWhat: "Summarize task_plan.md, findings.md, and progress.md status",
251
+ inputSchema: {
252
+ type: "object",
253
+ properties: {
254
+ include_contents: {
255
+ type: "boolean",
256
+ description: "Include raw file contents in the response",
257
+ default: false,
258
+ },
259
+ },
260
+ required: [],
261
+ },
262
+ },
263
+ {
264
+ name: "ci_dashboard",
265
+ description: "Visual dashboard showing instinct health, observation stats, confidence distribution, and learning progress.",
266
+ manifestWhat: "Visual dashboard showing instinct health, confidence distribution, and learning progress",
267
+ inputSchema: { type: "object", properties: {}, required: [] },
268
+ },
269
+ {
270
+ name: "ci_load_pack",
271
+ description: "Load a starter instinct pack (react, python, go) into the current project.",
272
+ manifestWhat: "Load starter instinct packs (react, python, go) into the current project",
273
+ inputSchema: {
274
+ type: "object",
275
+ properties: {
276
+ pack: { type: "string", description: "Pack name: react, python, or go" },
277
+ },
278
+ required: ["pack"],
279
+ },
280
+ },
281
+ ];
282
+ const MODE_METADATA = {
283
+ beginner: {
284
+ description: "Beginner mode: see what your agent learned, list its instincts, and request a session reflection. Bundles four discipline skills (gateguard, para-memory-files, tdd-workflow, verification-loop) so research, memory, tests, and verification happen by default.",
285
+ hooks: ["PreToolUse", "PostToolUse"],
286
+ hookDescription: "Silently captures every tool call as observations. Lightweight and non-blocking.",
287
+ },
288
+ expert: {
289
+ 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.",
290
+ hooks: ["PreToolUse", "PostToolUse", "SessionStart", "SessionEnd"],
291
+ hookDescription: "Full hook suite: observation capture + session-level instinct loading and auto-reflection.",
292
+ },
293
+ };
294
+ function getToolCatalog(mode) {
295
+ return mode === "expert"
296
+ ? [...BEGINNER_TOOL_ENTRIES, ...EXPERT_TOOL_ENTRIES]
297
+ : [...BEGINNER_TOOL_ENTRIES];
298
+ }
299
+ export function getToolDefinitions(mode) {
300
+ return getToolCatalog(mode).map(({ name, description, inputSchema }) => ({
301
+ name,
302
+ description,
303
+ inputSchema,
304
+ }));
305
+ }
306
+ export function getToolNames(mode) {
307
+ return getToolCatalog(mode).map((tool) => tool.name);
308
+ }
309
+ export function getPluginManifest(mode) {
310
+ const modeMetadata = MODE_METADATA[mode];
311
+ const mcpServerConfig = {
312
+ command: "node",
313
+ args: ["<install-path>/bin/mcp-server.mjs", "--mode", mode],
314
+ };
315
+ return {
316
+ name: PACKAGE_NAME,
317
+ version: VERSION,
318
+ mode,
319
+ description: modeMetadata.description,
320
+ tools: getToolCatalog(mode).map((tool) => ({
321
+ name: tool.name,
322
+ what: tool.manifestWhat,
323
+ })),
324
+ setup: {
325
+ claude_desktop: {
326
+ mcpServers: {
327
+ [PACKAGE_NAME]: mcpServerConfig,
328
+ },
329
+ },
330
+ claude_code: {
331
+ mcpServers: {
332
+ [PACKAGE_NAME]: mcpServerConfig,
333
+ },
334
+ },
335
+ },
336
+ hooks: {
337
+ included: [...modeMetadata.hooks],
338
+ description: modeMetadata.hookDescription,
339
+ },
340
+ };
341
+ }
342
+ export function getClaudePluginManifest() {
343
+ return {
344
+ name: PACKAGE_NAME,
345
+ version: VERSION,
346
+ description: SHARED_PLUGIN_DESCRIPTION,
347
+ author: AUTHOR,
348
+ homepage: HOMEPAGE_URL,
349
+ repository: REPOSITORY_URL,
350
+ license: "MIT",
351
+ keywords: [...KEYWORDS],
352
+ };
353
+ }
354
+ export function getPluginHooksConfig() {
355
+ const gateguardCommand = {
356
+ type: "command",
357
+ command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/gateguard.mjs\"",
358
+ timeout: 5,
359
+ };
360
+ const observeCommand = {
361
+ type: "command",
362
+ command: "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh\"",
363
+ timeout: 5,
364
+ };
365
+ const sessionCommand = {
366
+ type: "command",
367
+ command: "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session.sh\"",
368
+ timeout: 5,
369
+ };
370
+ const threeSectionCloseCommand = {
371
+ type: "command",
372
+ command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/three-section-close.mjs\"",
373
+ timeout: 5,
374
+ };
375
+ return {
376
+ description: "Gateguard fact-forcing PreToolUse, observation, session lifecycle, and 3-section-close discipline hooks for continuous-improvement.",
377
+ hooks: {
378
+ // gateguard runs FIRST so its block decision short-circuits before
379
+ // observe.sh records the tool call. observe.sh stays in PreToolUse for
380
+ // the observation feed; the Claude Code host runs both regardless of
381
+ // gateguard's decision.
382
+ PreToolUse: [{ hooks: [gateguardCommand, observeCommand] }],
383
+ PostToolUse: [{ hooks: [observeCommand] }],
384
+ SessionStart: [{ hooks: [sessionCommand] }],
385
+ SessionEnd: [{ hooks: [sessionCommand] }],
386
+ Stop: [{ hooks: [threeSectionCloseCommand] }],
387
+ },
388
+ };
389
+ }
390
+ export function getClaudePluginMarketplaceManifest() {
391
+ return {
392
+ name: `${PACKAGE_NAME}-dev`,
393
+ description: "Development marketplace for the Continuous Improvement Claude Code plugin.",
394
+ owner: {
395
+ name: AUTHOR.name,
396
+ },
397
+ plugins: [
398
+ {
399
+ name: PACKAGE_NAME,
400
+ description: SHARED_PLUGIN_DESCRIPTION,
401
+ version: VERSION,
402
+ source: "./",
403
+ author: {
404
+ name: AUTHOR.name,
405
+ },
406
+ category: CLAUDE_PLUGIN_CATEGORY,
407
+ homepage: REPOSITORY_URL,
408
+ },
409
+ ],
410
+ };
411
+ }
412
+ export function getClaudeRepoMarketplaceManifest(extraPlugins = []) {
413
+ return {
414
+ name: PACKAGE_NAME,
415
+ description: "Marketplace for the Continuous Improvement Claude Code plugin and four vendored upstream companions (Obra superpowers, addyosmani/agent-skills, ruflo-swarm, oh-my-claudecode). All four companions are pinned-SHA snapshots in third-party/ — see third-party/MANIFEST.md for refresh recipes and per-snapshot OUR_NOTES.md for integration scope. Product-management coverage is provided out-of-band by phuryn/pm-skills via Claude Code's plugin marketplace — see docs/THIRD_PARTY.md.",
416
+ owner: {
417
+ name: AUTHOR.name,
418
+ },
419
+ plugins: [
420
+ {
421
+ name: PACKAGE_NAME,
422
+ description: SHARED_PLUGIN_DESCRIPTION,
423
+ version: VERSION,
424
+ source: `./plugins/${PACKAGE_NAME}`,
425
+ author: {
426
+ name: AUTHOR.name,
427
+ },
428
+ category: CLAUDE_PLUGIN_CATEGORY,
429
+ homepage: REPOSITORY_URL,
430
+ },
431
+ ...THIRD_PARTY_COMPANIONS,
432
+ ...extraPlugins,
433
+ ],
434
+ };
435
+ }
@@ -0,0 +1,43 @@
1
+ // resolve-home-dir.mts — Single source of truth for the telemetry home dir
2
+ // resolution rule shared by hooks/three-section-close.mjs and bin/hook-stats.mjs.
3
+ //
4
+ // Previously this 20-line function lived in three byte-equivalent copies; this
5
+ // module collapses them. Behavior is unchanged.
6
+ import { homedir } from "node:os";
7
+ /**
8
+ * Resolve the home directory used to locate `.claude/hook-telemetry/`.
9
+ *
10
+ * Contract (AND-semantic opt-out):
11
+ * - If BOTH `HOME` and `USERPROFILE` are explicitly set to the empty string
12
+ * (set, not merely undefined), return `""`. This is the operator/test
13
+ * opt-out signal: telemetry is intentionally disabled.
14
+ * - Otherwise return the first truthy value from, in order:
15
+ * `process.env.HOME`, `process.env.USERPROFILE`, `os.homedir()`.
16
+ * - If none yields a truthy path, return `""`.
17
+ *
18
+ * The AND-semantic is deliberate: an OR-semantic would silently disable
19
+ * telemetry whenever a shell happened to clear one variable while the other
20
+ * still pointed at a valid path.
21
+ *
22
+ * Never throws. `os.homedir()` is wrapped in try/catch because it can throw
23
+ * in pathological env conditions.
24
+ */
25
+ export function resolveHomeDir() {
26
+ const home = process.env.HOME;
27
+ const userProfile = process.env.USERPROFILE;
28
+ if (home === "" && userProfile === "")
29
+ return "";
30
+ if (home)
31
+ return home;
32
+ if (userProfile)
33
+ return userProfile;
34
+ try {
35
+ const fromOs = homedir();
36
+ if (fromOs)
37
+ return fromOs;
38
+ }
39
+ catch {
40
+ // os.homedir() can throw in pathological env conditions
41
+ }
42
+ return "";
43
+ }
@@ -0,0 +1,37 @@
1
+ # Bundled Skills (generated)
2
+
3
+ > **Do not edit anything in this directory.** It is regenerated by `npm run build`
4
+ > from the source skill files in the repo root (SKILL.md and skills/*.md).
5
+ > Any local edits here will be lost on the next build.
6
+
7
+ Each skill below declares its own tier via the `tier:` field in its source
8
+ frontmatter. The build groups them into sections; this file is rendered from
9
+ those declarations so the table of contents cannot drift from the actual
10
+ skill set on disk.
11
+
12
+ ## Core skill
13
+ - `continuous-improvement` — Install structured self-improvement loops with instinct-based learning into Claude Code — research, plan, execute, verify, reflect, learn, iterate. On-demand or weekly analysis to save tokens. Supports multi-agent parallel analysis.
14
+
15
+ ## Featured companion
16
+ - `proceed-with-the-recommendation` ⭐ — Orchestrator for all 7 Laws of AI Agent Discipline. Walks an agent-emitted recommendation list top-to-bottom under the 7 Laws — restate, route per item, verify before advancing, reflect at the end, close with the mandatory three-section block. Standalone with inline fallbacks; trigger phrases are matched by the companion hook, not enumerated here.
17
+
18
+ ## Tier 1 — beginner-mode pairing
19
+ - `deploy-receipt` — 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.
20
+ - `gateguard` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Fact-forcing gate that blocks Edit/Write/Bash (including MultiEdit) and demands concrete investigation (importers, data schemas, user instruction) before allowing the action. Measurably improves output quality by +2.25 points vs ungated agents.
21
+ - `para-memory-files` — Enforces Law 5 (Reflect After Every Session) and Law 7 (Learn From Every Session) of the 7 Laws of AI Agent Discipline by giving the agent a durable file-based memory it can read on resume and write at session end. File-based memory system using Tiago Forte's PARA method. Use this skill whenever you need to store, retrieve, update, or organize knowledge across sessions. Covers three memory layers: (1) Knowledge graph in PARA folders with atomic YAML facts, (2) Daily notes as raw timeline, (3) Tacit knowledge about user patterns. Also handles planning files, memory decay, weekly synthesis, and recall via qmd. Trigger on any memory operation: saving facts, writing daily notes, creating entities, running weekly synthesis, recalling past context, or managing plans.
22
+ - `tdd-workflow` — Enforces Law 3 (One Thing at a Time) and Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
23
+ - `verification-loop` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. A comprehensive verification system for agent coding sessions covering build, types, lint, tests, security, and diff with a PASS/FAIL report.
24
+
25
+ ## Tier 2 — expert-mode add-ons
26
+ - `recovery-classification` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. After any failure in the verification ladder or auto-loop, classify the failure class before retrying — provider, tool-schema, deterministic-policy, git, worktree, runtime — so retry-vs-pause-vs-self-heal-vs-stop is an intentional decision, not a generic 'try again'.
27
+ - `safety-guard` — Enforces Law 3 (One Thing at a Time) of the 7 Laws of AI Agent Discipline by scoping edits to a directory and blocking destructive shell commands. Use this skill to prevent destructive operations when working on production systems or running agents autonomously.
28
+ - `state-reconciliation` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Pre-dispatch invariant: reconcile DB-vs-disk-vs-memory state before any unit runs, so a stale flag, missing artifact, or out-of-sync row never re-dispatches a unit that already completed or never started.
29
+ - `strategic-compact` — Enforces Law 5 (Reflect After Every Session) of the 7 Laws of AI Agent Discipline at phase boundaries. Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
30
+ - `token-budget-advisor` — Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline by making token-budget tradeoffs explicit before the response is composed. Offers the user an informed choice about how much response depth to consume before answering. Use this skill when the user explicitly wants to control response length, depth, or token budget. TRIGGER when: "token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed answer", "exhaustive answer", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", or clear variants where the user is explicitly asking to control answer size or depth. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it), the request is clearly a one-word answer, or "token" refers to auth/session/payment tokens rather than response size.
31
+ - `wild-risa-balance` — Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Decision-framing lens that pairs WILD generation with RISA execution when emitting recommendation lists. Not a runtime hook.
32
+ - `worktree-safety` — 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.
33
+
34
+ ## Always-bundled companions
35
+ - `ralph` — Enforces Law 6 (Iterate Means One Thing) of the 7 Laws of AI Agent Discipline at PRD scale. Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete. Converts PRDs to executable JSON, implements stories iteratively with quality checks, and tracks progress.
36
+ - `superpowers` — Law activator for the 7 Laws of AI Agent Discipline. Unified four-source dispatcher — routes tasks to the correct Law-aligned specialist across the CI plugin (tdd-workflow, verification-loop, gateguard, ralph, deploy-receipt) and four registered upstream companions (Obra superpowers, addy agent-skills, ruflo-swarm, oh-my-claudecode) so the right discipline fires automatically instead of the agent skipping a step. Product-management coverage comes from phuryn/pm-skills via an out-of-band marketplace install (see docs/THIRD_PARTY.md). Not a peer skill — a dispatcher for the others.
37
+ - `workspace-surface-audit` — 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.