continuous-improvement 3.0.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +78 -0
- package/CHANGELOG.md +210 -0
- package/LICENSE +21 -21
- package/QUICKSTART.md +101 -81
- package/README.md +224 -198
- package/SKILL.md +87 -9
- package/action.yml +33 -0
- package/bin/analyze.sh +161 -153
- package/bin/backfill.mjs +172 -0
- package/bin/check-docs-substrings.mjs +333 -0
- package/bin/check-everything-mirror.mjs +145 -0
- package/bin/check-routing-targets.mjs +151 -0
- package/bin/check-skill-law-tag.mjs +128 -0
- package/bin/check-skill-mirror.mjs +119 -0
- package/bin/check-skill-tiers.mjs +116 -0
- package/bin/check-third-party-shape.mjs +202 -0
- package/bin/generate-plugin-manifests.mjs +169 -0
- package/bin/harvest-friction.mjs +279 -0
- package/bin/hook-stats.mjs +258 -0
- package/bin/install.mjs +418 -456
- package/bin/lint-transcript.mjs +239 -0
- package/bin/mcp-server.mjs +842 -499
- package/bin/observe.mjs +148 -0
- package/bin/pre-commit-block-strays.sh +49 -0
- package/bin/refresh-third-party.mjs +416 -0
- package/bin/unified-cli.mjs +533 -0
- package/commands/continuous-improvement.md +115 -74
- package/commands/dashboard.md +56 -0
- package/commands/discipline.md +51 -0
- package/commands/harvest.md +76 -0
- package/commands/learn-eval.md +117 -0
- package/commands/planning-with-files.md +66 -0
- package/commands/proceed-with-the-recommendation.md +62 -0
- package/commands/ralph.md +103 -0
- package/commands/release-train.md +81 -0
- package/commands/seven-laws.md +16 -0
- package/commands/superpowers.md +153 -0
- package/commands/swarm.md +101 -0
- package/commands/workspace-surface-audit.md +77 -0
- package/hooks/observe.sh +172 -134
- package/hooks/session.sh +106 -106
- package/hooks/three-section-close.mjs +181 -0
- package/instinct-packs/go.json +58 -0
- package/instinct-packs/meta.json +16 -0
- package/instinct-packs/python.json +58 -0
- package/instinct-packs/react.json +58 -0
- package/lib/cli-anything.mjs +401 -0
- package/lib/compound-engineering.mjs +831 -0
- package/lib/observe-event.mjs +128 -0
- package/lib/plugin-metadata.mjs +432 -0
- package/lib/pm-marketplace.mjs +61 -0
- package/lib/pm-skills.mjs +1274 -0
- package/lib/resolve-home-dir.mjs +43 -0
- package/lib/skill-tiers.mjs +137 -0
- package/lib/unified-plugin.mjs +924 -0
- package/llms.txt +68 -0
- package/package.json +38 -15
- package/plugins/beginner.json +17 -6
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
- package/plugins/continuous-improvement/LICENSE +21 -0
- package/plugins/continuous-improvement/README.md +56 -0
- package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
- package/plugins/continuous-improvement/bin/mcp-server.mjs +886 -0
- package/plugins/continuous-improvement/bin/observe.mjs +148 -0
- package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
- package/plugins/continuous-improvement/commands/dashboard.md +56 -0
- package/plugins/continuous-improvement/commands/discipline.md +51 -0
- package/plugins/continuous-improvement/commands/harvest.md +76 -0
- package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
- package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
- package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
- package/plugins/continuous-improvement/commands/ralph.md +103 -0
- package/plugins/continuous-improvement/commands/release-train.md +81 -0
- package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
- package/plugins/continuous-improvement/commands/superpowers.md +153 -0
- package/plugins/continuous-improvement/commands/swarm.md +101 -0
- package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
- package/plugins/continuous-improvement/hooks/hooks.json +60 -0
- package/plugins/continuous-improvement/hooks/observe.sh +172 -0
- package/plugins/continuous-improvement/hooks/session.sh +106 -0
- package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
- package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
- package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
- package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +432 -0
- package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
- package/plugins/continuous-improvement/skills/README.md +34 -0
- package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
- package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +131 -0
- package/plugins/continuous-improvement/skills/gateguard/SKILL.md +155 -0
- package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +454 -0
- package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
- package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
- package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
- package/plugins/continuous-improvement/skills/superpowers/SKILL.md +212 -0
- package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
- package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
- package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +192 -0
- package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
- package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
- package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
- package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
- package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
- package/plugins/expert.json +34 -5
- package/skills/README.md +79 -0
- package/skills/deploy-receipt.md +131 -0
- package/skills/gateguard.md +155 -0
- package/skills/para-memory-files.md +108 -0
- package/skills/proceed-with-the-recommendation.md +454 -0
- package/skills/ralph.md +221 -0
- package/skills/safety-guard.md +76 -0
- package/skills/strategic-compact.md +104 -0
- package/skills/superpowers.md +212 -0
- package/skills/tdd-workflow.md +411 -0
- package/skills/token-budget-advisor.md +136 -0
- package/skills/verification-loop.md +192 -0
- package/skills/wild-risa-balance.md +191 -0
- package/skills/workspace-surface-audit.md +147 -0
- package/templates/planning-with-files/findings.md +8 -0
- package/templates/planning-with-files/progress.md +7 -0
- package/templates/planning-with-files/task_plan.md +23 -0
- package/templates/verify-ladder.example.json +47 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// observe-event.mts — Pure parsers for the Mulahazah observation hook.
|
|
2
|
+
//
|
|
3
|
+
// These functions have NO I/O. They turn raw stdin text and tool input/output
|
|
4
|
+
// payloads into shaped data the entrypoint (src/bin/observe.mts) writes to
|
|
5
|
+
// observations.jsonl. Pure separation lets the unit tests cover schema edge
|
|
6
|
+
// cases (malformed JSON, missing fields, oversized payloads) without ever
|
|
7
|
+
// touching the filesystem or computing project hashes.
|
|
8
|
+
//
|
|
9
|
+
// Truncation budgets match the prior bash/jq behavior to preserve the existing
|
|
10
|
+
// privacy contract: input head ≤500 chars, output head ≤200 chars.
|
|
11
|
+
const INPUT_TRUNCATE = 500;
|
|
12
|
+
const OUTPUT_TRUNCATE = 200;
|
|
13
|
+
/**
|
|
14
|
+
* Parse the raw JSON stdin payload from a Claude Code PreToolUse/PostToolUse
|
|
15
|
+
* hook event. Returns null for any unparseable or schema-invalid input —
|
|
16
|
+
* never throws. Empty/null/array payloads are rejected (the harness only
|
|
17
|
+
* sends objects).
|
|
18
|
+
*
|
|
19
|
+
* Field-name normalisation: Claude Code's PostToolUse payload uses
|
|
20
|
+
* `tool_response`. Older mocks and some third-party harnesses emit
|
|
21
|
+
* `tool_output` or `toolOutput`. We accept all three at the boundary and
|
|
22
|
+
* expose a single `tool_response` field downstream so the discriminator and
|
|
23
|
+
* `summariseOutput` only have to know one name.
|
|
24
|
+
*/
|
|
25
|
+
export function parseHookPayload(raw) {
|
|
26
|
+
if (!raw)
|
|
27
|
+
return null;
|
|
28
|
+
let parsed;
|
|
29
|
+
try {
|
|
30
|
+
parsed = JSON.parse(raw);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const obj = parsed;
|
|
39
|
+
if (typeof obj.tool_name !== "string" || obj.tool_name.length === 0) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const toolResponse = obj.tool_response !== undefined
|
|
43
|
+
? obj.tool_response
|
|
44
|
+
: obj.tool_output !== undefined
|
|
45
|
+
? obj.tool_output
|
|
46
|
+
: obj.toolOutput;
|
|
47
|
+
return {
|
|
48
|
+
tool_name: obj.tool_name,
|
|
49
|
+
session_id: typeof obj.session_id === "string" ? obj.session_id : "",
|
|
50
|
+
tool_input: obj.tool_input,
|
|
51
|
+
tool_response: toolResponse,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Extract a tool-aware short summary from `tool_input`. Tool-specific cases
|
|
56
|
+
* cover the high-frequency surfaces the linter/analyser reads (Bash command
|
|
57
|
+
* head, Edit/Write/Read file_path, Grep/Glob pattern). Unknown tools fall
|
|
58
|
+
* back to JSON.stringify(input) capped at INPUT_TRUNCATE.
|
|
59
|
+
*
|
|
60
|
+
* Returns an empty string when the expected field is missing on a known tool
|
|
61
|
+
* or when input is null/undefined — never returns "undefined" or "null"
|
|
62
|
+
* literals to the caller.
|
|
63
|
+
*/
|
|
64
|
+
export function summariseInput(toolName, input) {
|
|
65
|
+
if (input === null || input === undefined)
|
|
66
|
+
return "";
|
|
67
|
+
switch (toolName) {
|
|
68
|
+
case "Bash": {
|
|
69
|
+
const cmd = readStringField(input, "command");
|
|
70
|
+
return cmd === null ? "" : truncate(cmd, INPUT_TRUNCATE);
|
|
71
|
+
}
|
|
72
|
+
case "Edit":
|
|
73
|
+
case "Write":
|
|
74
|
+
case "Read":
|
|
75
|
+
case "NotebookEdit": {
|
|
76
|
+
const path = readStringField(input, "file_path");
|
|
77
|
+
return path === null ? "" : truncate(path, INPUT_TRUNCATE);
|
|
78
|
+
}
|
|
79
|
+
case "Grep":
|
|
80
|
+
case "Glob": {
|
|
81
|
+
const pattern = readStringField(input, "pattern");
|
|
82
|
+
return pattern === null ? "" : truncate(pattern, INPUT_TRUNCATE);
|
|
83
|
+
}
|
|
84
|
+
default: {
|
|
85
|
+
// Unknown tool: stringify input so we record *something* useful for
|
|
86
|
+
// future analysis. Truncate to keep observations.jsonl row size bounded.
|
|
87
|
+
let serialised;
|
|
88
|
+
try {
|
|
89
|
+
serialised = JSON.stringify(input);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
serialised = "";
|
|
93
|
+
}
|
|
94
|
+
return truncate(serialised ?? "", INPUT_TRUNCATE);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Extract a short summary from `tool_response`. Strings pass through (capped
|
|
100
|
+
* at OUTPUT_TRUNCATE); numbers/booleans coerce to string; objects
|
|
101
|
+
* JSON-stringify. Null/undefined collapse to "".
|
|
102
|
+
*/
|
|
103
|
+
export function summariseOutput(output) {
|
|
104
|
+
if (output === null || output === undefined)
|
|
105
|
+
return "";
|
|
106
|
+
if (typeof output === "string")
|
|
107
|
+
return truncate(output, OUTPUT_TRUNCATE);
|
|
108
|
+
if (typeof output === "number" || typeof output === "boolean") {
|
|
109
|
+
return String(output);
|
|
110
|
+
}
|
|
111
|
+
let serialised;
|
|
112
|
+
try {
|
|
113
|
+
serialised = JSON.stringify(output);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
serialised = "";
|
|
117
|
+
}
|
|
118
|
+
return truncate(serialised ?? "", OUTPUT_TRUNCATE);
|
|
119
|
+
}
|
|
120
|
+
function readStringField(input, field) {
|
|
121
|
+
if (input === null || typeof input !== "object")
|
|
122
|
+
return null;
|
|
123
|
+
const value = input[field];
|
|
124
|
+
return typeof value === "string" ? value : null;
|
|
125
|
+
}
|
|
126
|
+
function truncate(value, max) {
|
|
127
|
+
return value.length > max ? value.slice(0, max) : value;
|
|
128
|
+
}
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
export const PACKAGE_NAME = "continuous-improvement";
|
|
2
|
+
export const VERSION = "3.8.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
|
+
// Five 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 five.
|
|
31
|
+
const THIRD_PARTY_COMPANIONS = [
|
|
32
|
+
{
|
|
33
|
+
name: "superpowers",
|
|
34
|
+
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.",
|
|
35
|
+
version: "5.1.0",
|
|
36
|
+
source: "./third-party/superpowers",
|
|
37
|
+
author: {
|
|
38
|
+
name: "Jesse Vincent",
|
|
39
|
+
email: "jesse@fsck.com",
|
|
40
|
+
},
|
|
41
|
+
category: "workflow",
|
|
42
|
+
homepage: "https://github.com/obra/superpowers",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "agent-skills",
|
|
46
|
+
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).",
|
|
47
|
+
version: "1.0.0",
|
|
48
|
+
source: "./third-party/addy-agent-skills",
|
|
49
|
+
author: {
|
|
50
|
+
name: "Addy Osmani",
|
|
51
|
+
},
|
|
52
|
+
category: "workflow",
|
|
53
|
+
homepage: "https://github.com/addyosmani/agent-skills",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ruflo-swarm",
|
|
57
|
+
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.",
|
|
58
|
+
version: "0.2.0",
|
|
59
|
+
source: "./third-party/ruflo-swarm",
|
|
60
|
+
author: {
|
|
61
|
+
name: "ruvnet",
|
|
62
|
+
url: "https://github.com/ruvnet",
|
|
63
|
+
},
|
|
64
|
+
category: "orchestration",
|
|
65
|
+
homepage: "https://github.com/ruvnet/ruflo",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "oh-my-claudecode",
|
|
69
|
+
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.",
|
|
70
|
+
version: "4.13.6",
|
|
71
|
+
source: "./third-party/oh-my-claudecode",
|
|
72
|
+
author: {
|
|
73
|
+
name: "Yeachan-Heo",
|
|
74
|
+
},
|
|
75
|
+
category: "orchestration",
|
|
76
|
+
homepage: "https://github.com/Yeachan-Heo/oh-my-claudecode",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "pm-skills",
|
|
80
|
+
description: "Product management skills for AI agents — 41 skills + 47 commands across the full product lifecycle (discover, define, develop, deliver, measure, iterate). Includes Meeting Skills Family v2.11.0 (5 cross-cutting skills under a shared contract with enforcing CI), OKR Skills v2.12.0 (foundation-okr-writer + measure-okr-grader for the quarterly OKR write-and-score cycle), lean canvas, persona, JTBD, PRD, user stories, acceptance criteria, hypothesis, experiment design, retrospective, launch checklist, release notes, and pm-skill-builder for authoring new skills. Follows the agentskills.io specification. Vendored snapshot at third-party/pm-skills/ pinned to upstream SHA 8d23508 (v2.13.1).",
|
|
81
|
+
version: "2.13.1",
|
|
82
|
+
source: "./third-party/pm-skills",
|
|
83
|
+
author: {
|
|
84
|
+
name: "product-on-purpose",
|
|
85
|
+
url: "https://github.com/product-on-purpose",
|
|
86
|
+
},
|
|
87
|
+
category: "product",
|
|
88
|
+
homepage: "https://github.com/product-on-purpose/pm-skills",
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
export function isPluginMode(value) {
|
|
92
|
+
return value === "beginner" || value === "expert";
|
|
93
|
+
}
|
|
94
|
+
const BEGINNER_TOOL_ENTRIES = [
|
|
95
|
+
{
|
|
96
|
+
name: "ci_status",
|
|
97
|
+
description: "Show current level, instinct count, and observation count for this project. Good starting point to see what the system has learned.",
|
|
98
|
+
manifestWhat: "See what the system has learned about your project",
|
|
99
|
+
inputSchema: { type: "object", properties: {}, required: [] },
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "ci_instincts",
|
|
103
|
+
description: "List all learned instincts for this project with their confidence levels and behaviors.",
|
|
104
|
+
manifestWhat: "List all learned behaviors with confidence levels",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
min_confidence: {
|
|
109
|
+
type: "number",
|
|
110
|
+
description: "Minimum confidence to show (default: 0)",
|
|
111
|
+
default: 0,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
required: [],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "ci_reflect",
|
|
119
|
+
description: "Generate a structured reflection for the current session. Provide a summary of what you worked on.",
|
|
120
|
+
manifestWhat: "Reflect on what you did this session",
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
summary: {
|
|
125
|
+
type: "string",
|
|
126
|
+
description: "Brief summary of what was done this session",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
required: ["summary"],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
const EXPERT_TOOL_ENTRIES = [
|
|
134
|
+
{
|
|
135
|
+
name: "ci_reinforce",
|
|
136
|
+
description: "Accept or reject an instinct suggestion. Adjusts confidence: +0.15 for accept, -0.1 for reject.",
|
|
137
|
+
manifestWhat: "Accept or reject instinct suggestions to tune confidence",
|
|
138
|
+
inputSchema: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
instinct_id: { type: "string", description: "The instinct ID to reinforce" },
|
|
142
|
+
accepted: {
|
|
143
|
+
type: "boolean",
|
|
144
|
+
description: "true = accept (+0.15), false = reject (-0.1)",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
required: ["instinct_id", "accepted"],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "ci_create_instinct",
|
|
152
|
+
description: "Manually create a new instinct with a trigger, body, and starting confidence.",
|
|
153
|
+
manifestWhat: "Manually create instincts with custom triggers and confidence",
|
|
154
|
+
inputSchema: {
|
|
155
|
+
type: "object",
|
|
156
|
+
properties: {
|
|
157
|
+
id: { type: "string", description: "Unique instinct ID (kebab-case)" },
|
|
158
|
+
trigger: { type: "string", description: "When this instinct applies" },
|
|
159
|
+
body: { type: "string", description: "The behavior to follow" },
|
|
160
|
+
confidence: {
|
|
161
|
+
type: "number",
|
|
162
|
+
description: "Starting confidence 0.0-0.9 (default: 0.6)",
|
|
163
|
+
default: 0.6,
|
|
164
|
+
},
|
|
165
|
+
domain: {
|
|
166
|
+
type: "string",
|
|
167
|
+
description: "Domain: workflow|tooling|testing|patterns|code-style",
|
|
168
|
+
default: "workflow",
|
|
169
|
+
},
|
|
170
|
+
scope: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Scope: project|global",
|
|
173
|
+
default: "project",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
required: ["id", "trigger", "body"],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "ci_observations",
|
|
181
|
+
description: "View recent tool call observations captured by hooks.",
|
|
182
|
+
manifestWhat: "View raw tool call observations captured by hooks",
|
|
183
|
+
inputSchema: {
|
|
184
|
+
type: "object",
|
|
185
|
+
properties: {
|
|
186
|
+
limit: {
|
|
187
|
+
type: "number",
|
|
188
|
+
description: "Number of recent observations to return (default: 20)",
|
|
189
|
+
default: 20,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
required: [],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "ci_export",
|
|
197
|
+
description: "Export all instincts as a JSON array for sharing or backup.",
|
|
198
|
+
manifestWhat: "Export instincts as JSON for sharing or backup",
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: "object",
|
|
201
|
+
properties: {
|
|
202
|
+
scope: {
|
|
203
|
+
type: "string",
|
|
204
|
+
description: "Which instincts: project|global|all (default: all)",
|
|
205
|
+
default: "all",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
required: [],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "ci_import",
|
|
213
|
+
description: "Import instincts from a JSON array. Skips duplicates by ID.",
|
|
214
|
+
manifestWhat: "Import instincts from JSON (skip duplicates)",
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
instincts_json: {
|
|
219
|
+
type: "string",
|
|
220
|
+
description: "JSON array of instinct objects to import",
|
|
221
|
+
},
|
|
222
|
+
scope: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "Import to: project|global (default: project)",
|
|
225
|
+
default: "project",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
required: ["instincts_json"],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "ci_plan_init",
|
|
233
|
+
description: "Create task_plan.md, findings.md, and progress.md in the project root for persistent file-based planning.",
|
|
234
|
+
manifestWhat: "Create project-root planning files for persistent task memory",
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: "object",
|
|
237
|
+
properties: {
|
|
238
|
+
goal: { type: "string", description: "Goal for the planning workflow" },
|
|
239
|
+
phases: {
|
|
240
|
+
type: "array",
|
|
241
|
+
description: "Optional ordered phase names. Defaults to Research, Plan, Execute, Verify, Reflect.",
|
|
242
|
+
items: { type: "string" },
|
|
243
|
+
},
|
|
244
|
+
force: {
|
|
245
|
+
type: "boolean",
|
|
246
|
+
description: "Overwrite existing planning files",
|
|
247
|
+
default: false,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
required: ["goal"],
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "ci_plan_status",
|
|
255
|
+
description: "Summarize the status of task_plan.md, findings.md, and progress.md in the project root.",
|
|
256
|
+
manifestWhat: "Summarize task_plan.md, findings.md, and progress.md status",
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: "object",
|
|
259
|
+
properties: {
|
|
260
|
+
include_contents: {
|
|
261
|
+
type: "boolean",
|
|
262
|
+
description: "Include raw file contents in the response",
|
|
263
|
+
default: false,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
required: [],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "ci_dashboard",
|
|
271
|
+
description: "Visual dashboard showing instinct health, observation stats, confidence distribution, and learning progress.",
|
|
272
|
+
manifestWhat: "Visual dashboard showing instinct health, confidence distribution, and learning progress",
|
|
273
|
+
inputSchema: { type: "object", properties: {}, required: [] },
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: "ci_load_pack",
|
|
277
|
+
description: "Load a starter instinct pack (react, python, go) into the current project.",
|
|
278
|
+
manifestWhat: "Load starter instinct packs (react, python, go) into the current project",
|
|
279
|
+
inputSchema: {
|
|
280
|
+
type: "object",
|
|
281
|
+
properties: {
|
|
282
|
+
pack: { type: "string", description: "Pack name: react, python, or go" },
|
|
283
|
+
},
|
|
284
|
+
required: ["pack"],
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
];
|
|
288
|
+
const MODE_METADATA = {
|
|
289
|
+
beginner: {
|
|
290
|
+
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.",
|
|
291
|
+
hooks: ["PreToolUse", "PostToolUse"],
|
|
292
|
+
hookDescription: "Silently captures every tool call as observations. Lightweight and non-blocking.",
|
|
293
|
+
},
|
|
294
|
+
expert: {
|
|
295
|
+
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.",
|
|
296
|
+
hooks: ["PreToolUse", "PostToolUse", "SessionStart", "SessionEnd"],
|
|
297
|
+
hookDescription: "Full hook suite: observation capture + session-level instinct loading and auto-reflection.",
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
function getToolCatalog(mode) {
|
|
301
|
+
return mode === "expert"
|
|
302
|
+
? [...BEGINNER_TOOL_ENTRIES, ...EXPERT_TOOL_ENTRIES]
|
|
303
|
+
: [...BEGINNER_TOOL_ENTRIES];
|
|
304
|
+
}
|
|
305
|
+
export function getToolDefinitions(mode) {
|
|
306
|
+
return getToolCatalog(mode).map(({ name, description, inputSchema }) => ({
|
|
307
|
+
name,
|
|
308
|
+
description,
|
|
309
|
+
inputSchema,
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
export function getToolNames(mode) {
|
|
313
|
+
return getToolCatalog(mode).map((tool) => tool.name);
|
|
314
|
+
}
|
|
315
|
+
export function getPluginManifest(mode) {
|
|
316
|
+
const modeMetadata = MODE_METADATA[mode];
|
|
317
|
+
const mcpServerConfig = {
|
|
318
|
+
command: "node",
|
|
319
|
+
args: ["<install-path>/bin/mcp-server.mjs", "--mode", mode],
|
|
320
|
+
};
|
|
321
|
+
return {
|
|
322
|
+
name: PACKAGE_NAME,
|
|
323
|
+
version: VERSION,
|
|
324
|
+
mode,
|
|
325
|
+
description: modeMetadata.description,
|
|
326
|
+
tools: getToolCatalog(mode).map((tool) => ({
|
|
327
|
+
name: tool.name,
|
|
328
|
+
what: tool.manifestWhat,
|
|
329
|
+
})),
|
|
330
|
+
setup: {
|
|
331
|
+
claude_desktop: {
|
|
332
|
+
mcpServers: {
|
|
333
|
+
[PACKAGE_NAME]: mcpServerConfig,
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
claude_code: {
|
|
337
|
+
mcpServers: {
|
|
338
|
+
[PACKAGE_NAME]: mcpServerConfig,
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
hooks: {
|
|
343
|
+
included: [...modeMetadata.hooks],
|
|
344
|
+
description: modeMetadata.hookDescription,
|
|
345
|
+
},
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
export function getClaudePluginManifest() {
|
|
349
|
+
return {
|
|
350
|
+
name: PACKAGE_NAME,
|
|
351
|
+
version: VERSION,
|
|
352
|
+
description: SHARED_PLUGIN_DESCRIPTION,
|
|
353
|
+
author: AUTHOR,
|
|
354
|
+
homepage: HOMEPAGE_URL,
|
|
355
|
+
repository: REPOSITORY_URL,
|
|
356
|
+
license: "MIT",
|
|
357
|
+
keywords: [...KEYWORDS],
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
export function getPluginHooksConfig() {
|
|
361
|
+
const observeCommand = {
|
|
362
|
+
type: "command",
|
|
363
|
+
command: "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh\"",
|
|
364
|
+
timeout: 5,
|
|
365
|
+
};
|
|
366
|
+
const sessionCommand = {
|
|
367
|
+
type: "command",
|
|
368
|
+
command: "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session.sh\"",
|
|
369
|
+
timeout: 5,
|
|
370
|
+
};
|
|
371
|
+
const threeSectionCloseCommand = {
|
|
372
|
+
type: "command",
|
|
373
|
+
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/three-section-close.mjs\"",
|
|
374
|
+
timeout: 5,
|
|
375
|
+
};
|
|
376
|
+
return {
|
|
377
|
+
description: "Observation, session lifecycle, and 3-section-close discipline hooks for continuous-improvement.",
|
|
378
|
+
hooks: {
|
|
379
|
+
PreToolUse: [{ hooks: [observeCommand] }],
|
|
380
|
+
PostToolUse: [{ hooks: [observeCommand] }],
|
|
381
|
+
SessionStart: [{ hooks: [sessionCommand] }],
|
|
382
|
+
SessionEnd: [{ hooks: [sessionCommand] }],
|
|
383
|
+
Stop: [{ hooks: [threeSectionCloseCommand] }],
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
export function getClaudePluginMarketplaceManifest() {
|
|
388
|
+
return {
|
|
389
|
+
name: `${PACKAGE_NAME}-dev`,
|
|
390
|
+
description: "Development marketplace for the Continuous Improvement Claude Code plugin.",
|
|
391
|
+
owner: {
|
|
392
|
+
name: AUTHOR.name,
|
|
393
|
+
},
|
|
394
|
+
plugins: [
|
|
395
|
+
{
|
|
396
|
+
name: PACKAGE_NAME,
|
|
397
|
+
description: SHARED_PLUGIN_DESCRIPTION,
|
|
398
|
+
version: VERSION,
|
|
399
|
+
source: "./",
|
|
400
|
+
author: {
|
|
401
|
+
name: AUTHOR.name,
|
|
402
|
+
},
|
|
403
|
+
category: CLAUDE_PLUGIN_CATEGORY,
|
|
404
|
+
homepage: REPOSITORY_URL,
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
export function getClaudeRepoMarketplaceManifest(extraPlugins = []) {
|
|
410
|
+
return {
|
|
411
|
+
name: PACKAGE_NAME,
|
|
412
|
+
description: "Marketplace for the Continuous Improvement Claude Code plugin and five vendored upstream companions (Obra superpowers, addyosmani/agent-skills, ruflo-swarm, oh-my-claudecode, product-on-purpose/pm-skills). All five 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.",
|
|
413
|
+
owner: {
|
|
414
|
+
name: AUTHOR.name,
|
|
415
|
+
},
|
|
416
|
+
plugins: [
|
|
417
|
+
{
|
|
418
|
+
name: PACKAGE_NAME,
|
|
419
|
+
description: SHARED_PLUGIN_DESCRIPTION,
|
|
420
|
+
version: VERSION,
|
|
421
|
+
source: `./plugins/${PACKAGE_NAME}`,
|
|
422
|
+
author: {
|
|
423
|
+
name: AUTHOR.name,
|
|
424
|
+
},
|
|
425
|
+
category: CLAUDE_PLUGIN_CATEGORY,
|
|
426
|
+
homepage: REPOSITORY_URL,
|
|
427
|
+
},
|
|
428
|
+
...THIRD_PARTY_COMPANIONS,
|
|
429
|
+
...extraPlugins,
|
|
430
|
+
],
|
|
431
|
+
};
|
|
432
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Discovery + curated ordering for the PM plugin marketplace entries.
|
|
2
|
+
// Used by both the generator (build time) and the marketplace-manifest test.
|
|
3
|
+
// Single source of truth so the test can never drift from the generator.
|
|
4
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
const PM_PLUGIN_CATEGORY = "product-management";
|
|
7
|
+
// Curated display order (product-journey flow).
|
|
8
|
+
// Plugins on disk that aren't in this list are appended alphabetically.
|
|
9
|
+
export const PM_PLUGIN_ORDER = [
|
|
10
|
+
"pm-product-discovery",
|
|
11
|
+
"pm-product-strategy",
|
|
12
|
+
"pm-execution",
|
|
13
|
+
"pm-market-research",
|
|
14
|
+
"pm-data-analytics",
|
|
15
|
+
"pm-go-to-market",
|
|
16
|
+
"pm-marketing-growth",
|
|
17
|
+
"pm-toolkit",
|
|
18
|
+
];
|
|
19
|
+
export function discoverPmMarketplaceEntries(pluginsDir) {
|
|
20
|
+
const entries = readdirSync(pluginsDir, { withFileTypes: true });
|
|
21
|
+
const pmDirs = entries
|
|
22
|
+
.filter((e) => e.isDirectory() && e.name.startsWith("pm-"))
|
|
23
|
+
.map((e) => e.name);
|
|
24
|
+
const orderIndex = new Map(PM_PLUGIN_ORDER.map((name, i) => [name, i]));
|
|
25
|
+
pmDirs.sort((a, b) => {
|
|
26
|
+
const ia = orderIndex.get(a) ?? Number.MAX_SAFE_INTEGER;
|
|
27
|
+
const ib = orderIndex.get(b) ?? Number.MAX_SAFE_INTEGER;
|
|
28
|
+
if (ia !== ib)
|
|
29
|
+
return ia - ib;
|
|
30
|
+
return a.localeCompare(b);
|
|
31
|
+
});
|
|
32
|
+
const result = [];
|
|
33
|
+
for (const dir of pmDirs) {
|
|
34
|
+
const manifestPath = join(pluginsDir, dir, ".claude-plugin", "plugin.json");
|
|
35
|
+
let raw;
|
|
36
|
+
try {
|
|
37
|
+
raw = readFileSync(manifestPath, "utf8");
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const parsed = JSON.parse(raw);
|
|
43
|
+
if (!parsed.author?.name) {
|
|
44
|
+
throw new Error(`plugins/${dir}/.claude-plugin/plugin.json is missing author.name`);
|
|
45
|
+
}
|
|
46
|
+
result.push({
|
|
47
|
+
name: parsed.name,
|
|
48
|
+
description: parsed.description,
|
|
49
|
+
version: parsed.version,
|
|
50
|
+
source: `./plugins/${dir}`,
|
|
51
|
+
author: {
|
|
52
|
+
name: parsed.author.name,
|
|
53
|
+
...(parsed.author.email ? { email: parsed.author.email } : {}),
|
|
54
|
+
...(parsed.author.url ? { url: parsed.author.url } : {}),
|
|
55
|
+
},
|
|
56
|
+
category: PM_PLUGIN_CATEGORY,
|
|
57
|
+
homepage: parsed.homepage ?? "",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|