continuous-improvement 3.12.3 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +45 -1
  3. package/LICENSE +21 -21
  4. package/QUICKSTART.md +1 -1
  5. package/README.md +29 -8
  6. package/bin/analyze.sh +161 -161
  7. package/bin/backfill.mjs +19 -19
  8. package/bin/check-doc-runtime-claims.mjs +0 -0
  9. package/bin/check-docs-substrings.mjs +0 -0
  10. package/bin/check-everything-mirror.mjs +0 -0
  11. package/bin/check-routing-targets.mjs +0 -0
  12. package/bin/check-scripts-citation-drift.mjs +0 -0
  13. package/bin/check-skill-count-prose.mjs +168 -0
  14. package/bin/check-skill-count.mjs +32 -1
  15. package/bin/check-skill-law-tag.mjs +0 -0
  16. package/bin/check-skill-mirror.mjs +0 -0
  17. package/bin/check-skill-tiers.mjs +0 -0
  18. package/bin/check-test-imports-only.mjs +1 -1
  19. package/bin/check-third-party-shape.mjs +0 -0
  20. package/bin/check-tool-count.mjs +0 -0
  21. package/bin/companion-preference-status.mjs +0 -0
  22. package/bin/gateguard-clear.mjs +0 -0
  23. package/bin/generate-plugin-manifests.mjs +2 -1
  24. package/bin/harvest-friction.mjs +0 -0
  25. package/bin/hook-stats.mjs +21 -21
  26. package/bin/install.mjs +120 -2
  27. package/bin/lint-transcript.mjs +15 -3
  28. package/bin/mcp-server.mjs +66 -8
  29. package/bin/observe.mjs +0 -0
  30. package/bin/plan-pack.mjs +77 -0
  31. package/bin/pre-commit-block-strays.sh +0 -0
  32. package/bin/refresh-third-party.mjs +0 -0
  33. package/bin/unified-cli.mjs +55 -410
  34. package/commands/continuous-improvement.md +115 -115
  35. package/commands/dashboard.md +56 -56
  36. package/commands/model-forward.md +13 -0
  37. package/commands/production-readiness-review.md +53 -0
  38. package/commands/roast.md +34 -0
  39. package/commands/seven-laws.md +16 -16
  40. package/commands/ship.md +57 -0
  41. package/commands/workspace-surface-audit.md +77 -77
  42. package/hooks/companion-preference.mjs +31 -19
  43. package/hooks/gateguard.mjs +38 -16
  44. package/hooks/goal-drift-stop.mjs +0 -0
  45. package/hooks/hook-pack.mjs +110 -0
  46. package/hooks/observe.sh +0 -0
  47. package/hooks/recall-briefing.mjs +0 -0
  48. package/hooks/route-prompt.mjs +0 -0
  49. package/hooks/session.sh +106 -106
  50. package/hooks/three-section-close.mjs +0 -0
  51. package/hooks/workflow-distill.mjs +145 -0
  52. package/instinct-packs/go.json +58 -58
  53. package/instinct-packs/meta.json +16 -16
  54. package/instinct-packs/python.json +58 -58
  55. package/instinct-packs/react.json +58 -58
  56. package/lib/cli-anything.mjs +0 -0
  57. package/lib/gateguard-state.mjs +62 -13
  58. package/lib/goal-drift-gate.mjs +0 -0
  59. package/lib/goal-state.mjs +8 -4
  60. package/lib/hook-pack-gate.mjs +65 -0
  61. package/lib/install-targets.mjs +121 -0
  62. package/lib/observe-event.mjs +0 -0
  63. package/lib/plan-review-packet.mjs +96 -0
  64. package/lib/plugin-metadata.mjs +30 -4
  65. package/lib/pm-marketplace.mjs +0 -0
  66. package/lib/recall-briefing.mjs +0 -0
  67. package/lib/recall-index.mjs +0 -0
  68. package/lib/resolve-home-dir.mjs +0 -0
  69. package/lib/skill-distill.mjs +141 -0
  70. package/lib/skill-tiers.mjs +0 -0
  71. package/lib/version-check.mjs +115 -0
  72. package/llms.txt +2 -2
  73. package/package.json +6 -4
  74. package/plugins/beginner.json +2 -2
  75. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
  76. package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
  77. package/plugins/continuous-improvement/LICENSE +21 -21
  78. package/plugins/continuous-improvement/README.md +1 -1
  79. package/plugins/continuous-improvement/bin/backfill.mjs +19 -19
  80. package/plugins/continuous-improvement/bin/gateguard-clear.mjs +0 -0
  81. package/plugins/continuous-improvement/bin/mcp-server.mjs +66 -8
  82. package/plugins/continuous-improvement/bin/observe.mjs +0 -0
  83. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -115
  84. package/plugins/continuous-improvement/commands/dashboard.md +56 -56
  85. package/plugins/continuous-improvement/commands/model-forward.md +13 -0
  86. package/plugins/continuous-improvement/commands/production-readiness-review.md +53 -0
  87. package/plugins/continuous-improvement/commands/roast.md +34 -0
  88. package/plugins/continuous-improvement/commands/seven-laws.md +16 -16
  89. package/plugins/continuous-improvement/commands/ship.md +57 -0
  90. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -77
  91. package/plugins/continuous-improvement/hooks/companion-preference.mjs +31 -19
  92. package/plugins/continuous-improvement/hooks/gateguard.mjs +38 -16
  93. package/plugins/continuous-improvement/hooks/goal-drift-stop.mjs +0 -0
  94. package/plugins/continuous-improvement/hooks/hook-pack.mjs +110 -0
  95. package/plugins/continuous-improvement/hooks/hooks.json +16 -1
  96. package/plugins/continuous-improvement/hooks/observe.sh +0 -0
  97. package/plugins/continuous-improvement/hooks/recall-briefing.mjs +0 -0
  98. package/plugins/continuous-improvement/hooks/route-prompt.mjs +0 -0
  99. package/plugins/continuous-improvement/hooks/session.sh +106 -106
  100. package/plugins/continuous-improvement/hooks/three-section-close.mjs +0 -0
  101. package/plugins/continuous-improvement/hooks/workflow-distill.mjs +145 -0
  102. package/plugins/continuous-improvement/instinct-packs/go.json +58 -58
  103. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -16
  104. package/plugins/continuous-improvement/instinct-packs/python.json +58 -58
  105. package/plugins/continuous-improvement/instinct-packs/react.json +58 -58
  106. package/plugins/continuous-improvement/lib/gateguard-state.mjs +62 -13
  107. package/plugins/continuous-improvement/lib/goal-drift-gate.mjs +0 -0
  108. package/plugins/continuous-improvement/lib/goal-state.mjs +8 -4
  109. package/plugins/continuous-improvement/lib/hook-pack-gate.mjs +65 -0
  110. package/plugins/continuous-improvement/lib/observe-event.mjs +0 -0
  111. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +30 -4
  112. package/plugins/continuous-improvement/lib/recall-briefing.mjs +0 -0
  113. package/plugins/continuous-improvement/lib/recall-index.mjs +0 -0
  114. package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +0 -0
  115. package/plugins/continuous-improvement/lib/skill-distill.mjs +141 -0
  116. package/plugins/continuous-improvement/skills/README.md +2 -1
  117. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +4 -4
  118. package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +1 -1
  119. package/plugins/continuous-improvement/skills/handoff/SKILL.md +0 -1
  120. package/plugins/continuous-improvement/skills/model-forward/SKILL.md +44 -0
  121. package/plugins/continuous-improvement/skills/roast/SKILL.md +108 -0
  122. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +12 -32
  123. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -411
  124. package/plugins/expert.json +5 -1
  125. package/skills/README.md +5 -3
  126. package/skills/gateguard.md +4 -4
  127. package/skills/goal-monitor.md +1 -1
  128. package/skills/handoff.md +0 -1
  129. package/skills/model-forward.md +44 -0
  130. package/skills/roast.md +108 -0
  131. package/skills/strategic-compact.md +12 -32
  132. package/skills/tdd-workflow.md +411 -411
  133. package/lib/compound-engineering.mjs +0 -831
  134. package/lib/pm-skills.mjs +0 -1274
  135. package/lib/unified-plugin.mjs +0 -924
  136. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +0 -108
  137. package/skills/para-memory-files.md +0 -108
package/bin/observe.mjs CHANGED
File without changes
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * plan-pack (`ci-plan-pack`).
4
+ *
5
+ * Turn a plan doc into a commentable review packet a colleague can mark up.
6
+ *
7
+ * node bin/plan-pack.mjs <plan.md> write <plan>.review.md
8
+ * node bin/plan-pack.mjs <plan.md> --stdout print the packet to stdout
9
+ * node bin/plan-pack.mjs <plan.md> --gh-issue write the packet, then print a
10
+ * ready-to-run `gh issue create`
11
+ * command (does NOT auto-post)
12
+ */
13
+ import { readFileSync, writeFileSync } from "node:fs";
14
+ import { extname } from "node:path";
15
+ import { pathToFileURL } from "node:url";
16
+ import { buildReviewPacket } from "../lib/plan-review-packet.mjs";
17
+ function getErrorMessage(error) {
18
+ return error instanceof Error ? error.message : String(error);
19
+ }
20
+ function reviewPathFor(source) {
21
+ const ext = extname(source);
22
+ return ext ? `${source.slice(0, -ext.length)}.review${ext}` : `${source}.review.md`;
23
+ }
24
+ function packetTitle(packet) {
25
+ const match = /^# Review packet: (.*)$/m.exec(packet);
26
+ return match ? match[1].trim() : "Plan review";
27
+ }
28
+ const HELP = `
29
+ plan-pack (ci-plan-pack) - turn a plan doc into a commentable review packet
30
+
31
+ Usage: ci-plan-pack <plan.md> [--stdout] [--gh-issue]
32
+
33
+ Options:
34
+ --stdout Print the packet to stdout instead of writing a file
35
+ --gh-issue Write the packet, then print a 'gh issue create' command
36
+ (does not post anything - you run it)
37
+
38
+ Examples:
39
+ ci-plan-pack docs/plans/2026-06-15-plan-pack.md
40
+ ci-plan-pack docs/plans/2026-06-15-plan-pack.md --stdout
41
+ `;
42
+ function main() {
43
+ const args = process.argv.slice(2);
44
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
45
+ console.log(HELP);
46
+ process.exit(args.length === 0 ? 1 : 0);
47
+ }
48
+ const toStdout = args.includes("--stdout");
49
+ const ghIssue = args.includes("--gh-issue");
50
+ const source = args.find((a) => !a.startsWith("-"));
51
+ if (!source) {
52
+ throw new Error("Usage: ci-plan-pack <plan.md> [--stdout] [--gh-issue]");
53
+ }
54
+ const markdown = readFileSync(source, "utf8");
55
+ const packet = buildReviewPacket(markdown, { source });
56
+ if (toStdout) {
57
+ process.stdout.write(packet.endsWith("\n") ? packet : `${packet}\n`);
58
+ return;
59
+ }
60
+ const outPath = reviewPathFor(source);
61
+ writeFileSync(outPath, packet.endsWith("\n") ? packet : `${packet}\n`);
62
+ console.log(`Wrote review packet: ${outPath}`);
63
+ if (ghIssue) {
64
+ const title = packetTitle(packet);
65
+ console.log("\nTo open it for comments on GitHub, run:");
66
+ console.log(` gh issue create --title "${title}" --body-file "${outPath}"`);
67
+ }
68
+ }
69
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
70
+ try {
71
+ main();
72
+ }
73
+ catch (error) {
74
+ console.error(`Error: ${getErrorMessage(error)}`);
75
+ process.exit(1);
76
+ }
77
+ }
File without changes
File without changes
@@ -1,33 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Unified Continuous Improvement CLI.
3
+ * CLI-Anything command (`ci`).
4
4
  *
5
- * Comprehensive command-line interface for the unified plugin that combines
6
- * CLI-Anything, Compound Engineering, and PM-Skills.
5
+ * Thin front-end over the CLIAnything library: turns a repository into an
6
+ * agent-native CLI wrapper that a language model can drive.
7
+ *
8
+ * The former Compound Engineering and PM-Skills tools (and the unified-plugin
9
+ * orchestrator that combined all three) were removed in 3.13.0 - Compound
10
+ * Engineering overlapped the Mulahazah instinct engine and PM-Skills overlapped
11
+ * the out-of-band phuryn/pm-skills marketplace install. See CHANGELOG [3.13.0].
7
12
  */
8
13
  import { existsSync, readFileSync } from "node:fs";
9
14
  import { join } from "node:path";
10
- import UnifiedContinuousImprovement from "../lib/unified-plugin.mjs";
15
+ import CLIAnything from "../lib/cli-anything.mjs";
11
16
  const DEFAULT_CONFIG = {
12
17
  workspace: "./ci-workspace",
13
18
  verbose: false,
14
- defaultMode: "expert",
15
19
  };
16
20
  function getErrorMessage(error) {
17
21
  return error instanceof Error ? error.message : String(error);
18
22
  }
19
- function parseJsonOption(raw) {
20
- if (!raw)
21
- return undefined;
22
- try {
23
- return JSON.parse(raw);
24
- }
25
- catch (error) {
26
- throw new Error(`Invalid JSON option: ${getErrorMessage(error)}`);
27
- }
28
- }
29
23
  class UnifiedCLI {
30
- plugin = null;
31
24
  config;
32
25
  constructor() {
33
26
  this.config = this.loadConfig();
@@ -40,350 +33,48 @@ class UnifiedCLI {
40
33
  return { ...DEFAULT_CONFIG, ...parsed };
41
34
  }
42
35
  catch {
43
- console.warn("Warning: Invalid config file, using defaults");
36
+ console.warn("Warning: invalid config file, using defaults");
44
37
  }
45
38
  }
46
39
  return { ...DEFAULT_CONFIG };
47
40
  }
48
- initializePlugin(options) {
49
- this.plugin = new UnifiedContinuousImprovement({
50
- workspace: options.workspace ?? this.config.workspace,
51
- verbose: options.verbose ?? this.config.verbose,
52
- });
53
- return this.plugin;
54
- }
55
- requirePlugin() {
56
- if (!this.plugin) {
57
- throw new Error("CLI plugin not initialized");
58
- }
59
- return this.plugin;
60
- }
61
41
  async runCommand(command, args, options = {}) {
62
- this.initializePlugin(options);
63
42
  switch (command) {
64
- case "init":
65
- return this.handleInit(args, options);
66
- case "workflow":
67
- return this.handleWorkflow(args, options);
68
- case "research":
69
- return this.handleResearch(options);
70
- case "planning":
71
- return this.handlePlanning(options);
72
- case "execution":
73
- return this.handleExecution();
74
- case "review":
75
- return this.handleReview(options);
76
- case "status":
77
- return this.handleStatus();
78
- case "cli":
79
- return this.handleCLI(args);
80
- case "pm":
81
- return this.handlePM(args, options);
82
- case "compound":
83
- return this.handleCompound(args);
84
- case "learnings":
85
- return this.handleLearnings(args);
43
+ case "generate":
44
+ return this.handleGenerate(args, options);
45
+ case "list":
46
+ return this.handleList();
86
47
  case "config":
87
48
  return this.handleConfig(args);
88
49
  default:
89
50
  throw new Error(`Unknown command: ${command}`);
90
51
  }
91
52
  }
92
- async handleInit(args, options) {
93
- if (args.length < 2) {
94
- throw new Error("Usage: ci init <project-name> <objective> [options]");
95
- }
96
- const [name, ...objectiveParts] = args;
97
- const objective = objectiveParts.join(" ");
98
- console.log(`šŸš€ Initializing project: ${name}`);
99
- console.log(`šŸ“‹ Objective: ${objective}`);
100
- const plugin = this.requirePlugin();
101
- const result = await plugin.initializeProject({
102
- name: name,
103
- objective,
104
- product: parseJsonOption(options.product) ?? {},
105
- industry: options.industry ?? "",
106
- targetMarket: parseJsonOption(options.targetMarket) ?? {},
107
- });
108
- console.log(`āœ… Project initialized successfully!`);
109
- console.log(`šŸ†” Project ID: ${result.projectId}`);
110
- console.log(`šŸ”— Session ID: ${result.sessionId}`);
111
- console.log(`šŸ“Š PM Analysis: ${result.pmAnalysis.totalSkills} skills completed`);
112
- console.log(`\nšŸŽÆ Next steps:`);
113
- result.nextSteps.forEach((step, i) => {
114
- console.log(` ${i + 1}. ${step}`);
115
- });
116
- return result;
117
- }
118
- async handleWorkflow(args, options) {
119
- if (args.length < 2) {
120
- throw new Error("Usage: ci workflow <project-name> <objective> [options]");
53
+ async handleGenerate(args, options) {
54
+ const repoPath = args[0];
55
+ if (!repoPath) {
56
+ throw new Error("Usage: ci generate <repository-path>");
121
57
  }
122
- const [name, ...objectiveParts] = args;
123
- const objective = objectiveParts.join(" ");
124
- console.log(`šŸš€ Starting complete workflow for: ${name}`);
125
- console.log(`šŸ“‹ Objective: ${objective}`);
126
- const progressCallback = (message) => {
127
- console.log(` ā³ ${message}`);
128
- };
129
- const plugin = this.requirePlugin();
130
- const result = await plugin.executeCompleteWorkflow({
131
- name: name,
132
- objective,
133
- product: parseJsonOption(options.product) ?? {},
134
- industry: options.industry ?? "",
135
- targetMarket: parseJsonOption(options.targetMarket) ?? {},
136
- }, {
137
- researchContext: options.repo ? { repositoryPath: options.repo } : {},
138
- progressCallback,
58
+ const cliAnything = new CLIAnything({
59
+ outputDir: options.workspace ?? this.config.workspace,
60
+ verbose: options.verbose ?? this.config.verbose,
139
61
  });
140
- console.log(`šŸŽ‰ Complete workflow finished!`);
141
- console.log(`šŸ†” Project: ${result.project}`);
142
- console.log(`šŸ”— Session: ${result.sessionId}`);
143
- for (const [phase] of Object.entries(result.phases)) {
144
- console.log(`\nšŸ“Š ${phase.charAt(0).toUpperCase() + phase.slice(1)} Phase:`);
145
- }
146
- return result;
147
- }
148
- async handleResearch(options) {
149
- console.log(`šŸ” Starting research phase...`);
150
- const context = {};
151
- if (options.repo)
152
- context.repositoryPath = options.repo;
153
- if (options.context)
154
- context.additionalContext = parseJsonOption(options.context);
155
- const plugin = this.requirePlugin();
156
- const result = await plugin.executeResearchPhase(context);
157
- console.log(`āœ… Research phase completed!`);
158
- console.log(`šŸ’” Generated ${result.brainstorm.ideas.length} ideas`);
159
- console.log(`šŸ” Identified ${result.brainstorm.risks.length} risks`);
160
- if (result.cliTools) {
161
- console.log(`šŸ› ļø Generated CLI with ${result.cliTools.commands.length} commands`);
162
- }
163
- return result;
164
- }
165
- async handlePlanning(options) {
166
- console.log(`šŸ“‹ Starting planning phase...`);
167
- const preferences = parseJsonOption(options.preferences) ?? {};
168
- const plugin = this.requirePlugin();
169
- const result = await plugin.executePlanningPhase(preferences);
170
- console.log(`āœ… Planning phase completed!`);
171
- console.log(`šŸ“ˆ Created plan with ${result.corePlan.steps.length} steps`);
172
- const estimated = result.corePlan.timeline?.estimated;
173
- if (estimated)
174
- console.log(`ā±ļø Timeline: ${estimated}`);
175
- console.log(`āš ļø Identified ${result.risks.length} risks`);
176
- return result;
177
- }
178
- async handleExecution() {
179
- console.log(`šŸ”§ Starting execution phase...`);
180
- const progressCallback = (message) => {
181
- console.log(` ⚔ ${message}`);
182
- };
183
- const plugin = this.requirePlugin();
184
- const result = await plugin.executeWorkingPhase(progressCallback);
185
- console.log(`āœ… Execution phase completed!`);
186
- console.log(`šŸ“‹ Completed ${result.coreWork.steps.length} steps`);
187
- console.log(`šŸ”§ Resolved ${result.issues.length} issues`);
188
- console.log(`šŸ’” Applied ${result.solutions.length} solutions`);
189
- return result;
190
- }
191
- async handleReview(options) {
192
- console.log(`šŸ” Starting review phase...`);
193
- const criteria = parseJsonOption(options.criteria);
194
- const plugin = this.requirePlugin();
195
- const result = await plugin.executeReviewPhase(criteria);
196
- console.log(`āœ… Review phase completed!`);
197
- console.log(`šŸ“Š Overall score: ${result.coreReview.review.overallScore}/100`);
198
- console.log(`šŸ’” Generated ${result.learnings.length} learnings`);
199
- console.log(`šŸ“‹ Created ${result.recommendations.length} recommendations`);
200
- return result;
201
- }
202
- async handleStatus() {
203
- const plugin = this.requirePlugin();
204
- const status = await plugin.getProjectStatus();
205
- console.log(`šŸ“Š Project Status:`);
206
- console.log(` Project: ${status.project ?? "No active project"}`);
207
- console.log(` Session: ${status.sessionId ?? "N/A"}`);
208
- console.log(` Current Phase: ${status.currentPhase ?? "N/A"}`);
209
- if (status.progress) {
210
- console.log(` Progress: ${status.progress.completed}/${status.progress.total} (${status.progress.percentage}%)`);
211
- }
212
- if (status.nextSteps && status.nextSteps.length > 0) {
213
- console.log(`\nšŸŽÆ Next Steps:`);
214
- status.nextSteps.forEach((step, i) => {
215
- console.log(` ${i + 1}. ${step}`);
216
- });
217
- }
218
- return status;
219
- }
220
- async handleCLI(args) {
221
- const [subcommand, ...subArgs] = args;
222
- switch (subcommand) {
223
- case "generate":
224
- if (subArgs.length === 0) {
225
- throw new Error("Usage: ci cli generate <repository-path>");
226
- }
227
- return this.handleCLIGenerate(subArgs[0]);
228
- case "list":
229
- return this.handleCLIList();
230
- default:
231
- throw new Error("Usage: ci cli <generate|list> [args]");
232
- }
233
- }
234
- async handleCLIGenerate(repoPath) {
235
- console.log(`šŸ› ļø Generating CLI for: ${repoPath}`);
236
- const plugin = this.requirePlugin();
237
- const result = await plugin.cliAnything.generateCLI(repoPath);
238
- console.log(`āœ… CLI generated successfully!`);
239
- console.log(`šŸ“ Output: ${result.outputPath}`);
240
- console.log(`šŸ”§ Commands: ${result.commands.length}`);
241
- console.log(`\nšŸ“‹ Available Commands:`);
62
+ const result = await cliAnything.generateCLI(repoPath);
63
+ console.log(`Generated CLI for: ${repoPath}`);
64
+ console.log(` Output: ${result.outputPath}`);
65
+ console.log(` Commands: ${result.commands.length}`);
242
66
  for (const cmd of result.commands) {
243
- console.log(` ${cmd.name.padEnd(15)} - ${cmd.description}`);
67
+ console.log(` ${cmd.name.padEnd(15)} ${cmd.description}`);
244
68
  }
245
69
  return result;
246
70
  }
247
- handleCLIList() {
248
- console.log(`šŸ› ļø CLI Generation Tool Status: Ready`);
249
- console.log(` Repository Analysis: Supported`);
250
- console.log(` Project Types: Node.js, React, Python, Docker, and more`);
251
- console.log(` Output Format: Executable JavaScript`);
71
+ handleList() {
72
+ console.log("CLI-Anything status: ready");
73
+ console.log(" Repository analysis: supported");
74
+ console.log(" Project types: Node.js, React, Python, Docker, and more");
75
+ console.log(" Output format: executable JavaScript");
252
76
  }
253
- async handlePM(args, options) {
254
- const [subcommand, ...subArgs] = args;
255
- switch (subcommand) {
256
- case "analyze":
257
- return this.handlePMAnalyze(options);
258
- case "skill":
259
- return this.handlePMSkill(subArgs);
260
- case "list":
261
- return this.handlePMList();
262
- default:
263
- throw new Error("Usage: ci pm <analyze|skill|list> [args]");
264
- }
265
- }
266
- async handlePMAnalyze(options) {
267
- console.log(`šŸ“Š Running comprehensive PM analysis...`);
268
- const productInfo = {
269
- product: parseJsonOption(options.product) ?? {},
270
- industry: options.industry ?? "Technology",
271
- targetMarket: parseJsonOption(options.targetMarket) ?? {},
272
- };
273
- const plugin = this.requirePlugin();
274
- const result = await plugin.pmSkills.runProductAnalysis(productInfo);
275
- console.log(`āœ… PM analysis completed!`);
276
- console.log(`šŸ“Š Summary: ${result.summary.completedSkills}/${result.summary.totalSkills} skills completed`);
277
- console.log(`šŸ’” Key insights: ${result.summary.keyInsights.length}`);
278
- console.log(`šŸ“‹ Recommendations: ${result.summary.recommendations.length}`);
279
- console.log(`šŸ“ Results saved to: ${result.savedTo}`);
280
- return result;
281
- }
282
- async handlePMSkill(args) {
283
- if (args.length === 0) {
284
- throw new Error("Usage: ci pm skill <skill-name>");
285
- }
286
- const [skillName] = args;
287
- console.log(`šŸ“Š Executing PM skill: ${skillName}`);
288
- const input = {
289
- product: { name: "Sample Product" },
290
- market: { size: "Medium" },
291
- };
292
- const plugin = this.requirePlugin();
293
- const result = await plugin.pmSkills.executeSkill(skillName, input);
294
- console.log(`āœ… PM skill ${skillName} completed!`);
295
- console.log(`šŸ“ Results saved to: ${result.savedTo}`);
296
- return result;
297
- }
298
- handlePMList() {
299
- const plugin = this.requirePlugin();
300
- const skills = plugin.pmSkills.getAvailableSkills();
301
- console.log(`šŸ“Š Available PM Skills:`);
302
- for (const skill of skills) {
303
- console.log(` ${skill.name.padEnd(20)} - ${skill.description} [${skill.category}]`);
304
- }
305
- }
306
- async handleCompound(args) {
307
- const [subcommand, ...subArgs] = args;
308
- switch (subcommand) {
309
- case "session":
310
- return this.handleCompoundSession(subArgs);
311
- case "learnings":
312
- return this.handleCompoundLearnings();
313
- default:
314
- throw new Error("Usage: ci compound <session|learnings> [args]");
315
- }
316
- }
317
- async handleCompoundSession(args) {
318
- if (args.length < 2) {
319
- throw new Error("Usage: ci compound session <project-name> <objective>");
320
- }
321
- const [name, ...objectiveParts] = args;
322
- const objective = objectiveParts.join(" ");
323
- console.log(`šŸ”§ Starting compound engineering session...`);
324
- const plugin = this.requirePlugin();
325
- const session = await plugin.compoundEngineering.startSession(name, objective);
326
- console.log(`āœ… Session started!`);
327
- console.log(`šŸ†” Session ID: ${session.id}`);
328
- console.log(`šŸ“‹ Objective: ${session.objective}`);
329
- console.log(`šŸ”„ Current Phase: ${session.phase}`);
330
- return session;
331
- }
332
- async handleCompoundLearnings() {
333
- console.log(`šŸ“š Loading compound engineering learnings...`);
334
- const plugin = this.requirePlugin();
335
- await plugin.compoundEngineering.loadLearnings();
336
- const learnings = plugin.compoundEngineering.getAllLearnings();
337
- console.log(`šŸ“š Found ${learnings.length} learnings:`);
338
- for (const learning of learnings) {
339
- console.log(` [${learning.confidence.toFixed(2)}] ${learning.summary}`);
340
- }
341
- return learnings;
342
- }
343
- async handleLearnings(args) {
344
- const [subcommand, ...subArgs] = args;
345
- switch (subcommand) {
346
- case "search":
347
- return this.handleLearningsSearch(subArgs.join(" "));
348
- case "all":
349
- return this.handleLearningsAll();
350
- default:
351
- throw new Error("Usage: ci learnings <search|all> [query]");
352
- }
353
- }
354
- async handleLearningsSearch(query) {
355
- console.log(`šŸ” Searching learnings for: "${query}"`);
356
- const plugin = this.requirePlugin();
357
- await plugin.compoundEngineering.loadLearnings();
358
- const results = plugin.compoundEngineering.searchLearnings(query);
359
- console.log(`šŸ” Found ${results.length} matching learnings:`);
360
- for (const learning of results) {
361
- console.log(` [${learning.confidence.toFixed(2)}] ${learning.summary}`);
362
- }
363
- return results;
364
- }
365
- async handleLearningsAll() {
366
- console.log(`šŸ“š Loading all learnings...`);
367
- const plugin = this.requirePlugin();
368
- await plugin.compoundEngineering.loadLearnings();
369
- const learnings = plugin.compoundEngineering.getAllLearnings();
370
- console.log(`šŸ“š Total learnings: ${learnings.length}`);
371
- const grouped = learnings.reduce((groups, learning) => {
372
- const type = learning.type || "general";
373
- if (!groups[type])
374
- groups[type] = [];
375
- groups[type].push(learning);
376
- return groups;
377
- }, {});
378
- for (const [type, items] of Object.entries(grouped)) {
379
- console.log(`\n ${type.charAt(0).toUpperCase() + type.slice(1)} (${items.length}):`);
380
- for (const learning of items) {
381
- console.log(` [${learning.confidence.toFixed(2)}] ${learning.summary}`);
382
- }
383
- }
384
- return learnings;
385
- }
386
- async handleConfig(args) {
77
+ handleConfig(args) {
387
78
  const [subcommand, ...subArgs] = args;
388
79
  switch (subcommand) {
389
80
  case "show":
@@ -395,15 +86,11 @@ class UnifiedCLI {
395
86
  }
396
87
  }
397
88
  handleConfigShow() {
398
- console.log(`āš™ļø Current Configuration:`);
399
- console.log(` Workspace: ${this.config.workspace}`);
400
- console.log(` Verbose: ${this.config.verbose}`);
401
- console.log(` Default Mode: ${this.config.defaultMode}`);
89
+ console.log("Current configuration:");
90
+ console.log(` Workspace: ${this.config.workspace}`);
91
+ console.log(` Verbose: ${this.config.verbose}`);
402
92
  }
403
93
  handleConfigSet(args) {
404
- if (args.length < 2) {
405
- throw new Error("Usage: ci config set <key> <value>");
406
- }
407
94
  const [key, value] = args;
408
95
  if (!key || value === undefined) {
409
96
  throw new Error("Usage: ci config set <key> <value>");
@@ -414,13 +101,10 @@ class UnifiedCLI {
414
101
  else if (key === "verbose") {
415
102
  this.config.verbose = value === "true";
416
103
  }
417
- else if (key === "defaultMode") {
418
- this.config.defaultMode = value;
419
- }
420
104
  else {
421
105
  throw new Error(`Unknown config key: ${key}`);
422
106
  }
423
- console.log(`āœ… Configuration updated: ${key} = ${value}`);
107
+ console.log(`Configuration updated: ${key} = ${value}`);
424
108
  }
425
109
  }
426
110
  function parseGlobalOptions(args) {
@@ -428,34 +112,19 @@ function parseGlobalOptions(args) {
428
112
  for (let i = 0; i < args.length; i++) {
429
113
  const flag = args[i];
430
114
  const next = args[i + 1];
431
- const consumeValue = (key) => {
432
- if (next === undefined)
433
- return;
434
- options[key] = next;
435
- args.splice(i, 2);
436
- i--;
437
- };
438
115
  switch (flag) {
439
116
  case "--workspace":
440
- consumeValue("workspace");
117
+ if (next !== undefined) {
118
+ options.workspace = next;
119
+ args.splice(i, 2);
120
+ i--;
121
+ }
441
122
  break;
442
123
  case "--verbose":
443
124
  options.verbose = true;
444
125
  args.splice(i, 1);
445
126
  i--;
446
127
  break;
447
- case "--repo":
448
- consumeValue("repo");
449
- break;
450
- case "--product":
451
- consumeValue("product");
452
- break;
453
- case "--industry":
454
- consumeValue("industry");
455
- break;
456
- case "--target-market":
457
- consumeValue("targetMarket");
458
- break;
459
128
  default:
460
129
  break;
461
130
  }
@@ -464,49 +133,25 @@ function parseGlobalOptions(args) {
464
133
  }
465
134
  async function main() {
466
135
  const [, , command, ...args] = process.argv;
467
- if (!command || command === "--help" || command === "-h") {
136
+ if (!command || command === "--help" || command === "-h" || command === "help") {
468
137
  console.log(`
469
- Unified Continuous Improvement CLI
138
+ CLI-Anything (ci) - turn a repository into an agent-native CLI
470
139
 
471
140
  Usage: ci <command> [args] [options]
472
141
 
473
- Main Commands:
474
- init <name> <objective> Initialize new project with comprehensive analysis
475
- workflow <name> <objective> Run complete end-to-end workflow
476
- research Execute research phase
477
- planning Execute planning phase
478
- execution Execute execution phase
479
- review Execute review phase
480
- status Show project status
481
-
482
- Tool Commands:
483
- cli generate <repo-path> Generate CLI for repository
484
- pm analyze Run comprehensive PM analysis
485
- pm skill <name> Execute specific PM skill
486
- pm list List available PM skills
487
- compound session <name> <obj> Start compound engineering session
488
- compound learnings Show compound engineering learnings
489
- learnings search <query> Search through all learnings
490
- learnings all Show all learnings
491
-
492
- Configuration:
493
- config show Show current configuration
494
- config set <key> <value> Set configuration value
142
+ Commands:
143
+ generate <repo-path> Analyze a repository and generate an agent-native CLI wrapper
144
+ list Show CLI-Anything capabilities
145
+ config show Show current configuration
146
+ config set <key> <value> Set a configuration value (workspace | verbose)
495
147
 
496
148
  Global Options:
497
- --workspace <dir> Workspace directory
498
- --verbose Enable verbose logging
499
- --repo <path> Repository path for CLI generation
500
- --product <json> Product information as JSON
501
- --industry <name> Industry name
502
- --target-market <json> Target market as JSON
149
+ --workspace <dir> Workspace directory (default: ./ci-workspace)
150
+ --verbose Enable verbose logging
503
151
 
504
152
  Examples:
505
- ci init "MyApp" "Build a task management app"
506
- ci workflow "MyApp" "Build task management" --repo ./my-app
507
- ci cli generate ./my-repo
508
- ci pm analyze --industry "SaaS" --target-market '{"segment":"SMB"}'
509
- ci learnings search "performance"
153
+ ci generate ./my-repo
154
+ ci config set workspace ./out
510
155
  `);
511
156
  process.exit(0);
512
157
  }
@@ -515,18 +160,18 @@ Examples:
515
160
  try {
516
161
  const result = await cli.runCommand(command, args, options);
517
162
  if (options.verbose && result) {
518
- console.log(`\nšŸ” Detailed result:`);
163
+ console.log("\nDetailed result:");
519
164
  console.log(JSON.stringify(result, null, 2));
520
165
  }
521
166
  }
522
167
  catch (error) {
523
- console.error(`āŒ Error: ${getErrorMessage(error)}`);
168
+ console.error(`Error: ${getErrorMessage(error)}`);
524
169
  process.exit(1);
525
170
  }
526
171
  }
527
172
  if (import.meta.url === `file://${process.argv[1]}`) {
528
173
  main().catch((error) => {
529
- console.error(`āŒ Fatal error: ${getErrorMessage(error)}`);
174
+ console.error(`Fatal error: ${getErrorMessage(error)}`);
530
175
  process.exit(1);
531
176
  });
532
177
  }