supermind-claude 2.1.0 → 4.0.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 (44) hide show
  1. package/.claude-plugin/plugin.json +21 -0
  2. package/README.md +34 -46
  3. package/agents/code-reviewer.md +81 -0
  4. package/cli/commands/doctor.js +415 -79
  5. package/cli/commands/install.js +17 -18
  6. package/cli/commands/skill.js +164 -0
  7. package/cli/commands/uninstall.js +32 -3
  8. package/cli/commands/update.js +27 -5
  9. package/cli/index.js +16 -4
  10. package/cli/lib/agents.js +413 -0
  11. package/cli/lib/executor.js +365 -0
  12. package/cli/lib/hooks.js +8 -1
  13. package/cli/lib/logger.js +1 -1
  14. package/cli/lib/mcp.js +25 -5
  15. package/cli/lib/planning.js +502 -0
  16. package/cli/lib/platform.js +4 -0
  17. package/cli/lib/plugin.js +127 -0
  18. package/cli/lib/settings.js +2 -40
  19. package/cli/lib/skills.js +39 -2
  20. package/cli/lib/templates.js +48 -1
  21. package/cli/lib/vendor-skills.js +594 -0
  22. package/hooks/bash-permissions.js +196 -176
  23. package/hooks/context-monitor.js +79 -0
  24. package/hooks/improvement-logger.js +94 -0
  25. package/hooks/pre-merge-checklist.js +102 -0
  26. package/hooks/session-start.js +109 -5
  27. package/hooks/statusline-command.js +123 -29
  28. package/package.json +4 -2
  29. package/skills/anti-rationalization/SKILL.md +38 -0
  30. package/skills/brainstorming/SKILL.md +165 -0
  31. package/skills/code-review/SKILL.md +144 -0
  32. package/skills/executing-plans/SKILL.md +138 -0
  33. package/skills/finishing-branches/SKILL.md +144 -0
  34. package/skills/project/SKILL.md +533 -0
  35. package/skills/quick/SKILL.md +178 -0
  36. package/skills/supermind/SKILL.md +58 -4
  37. package/skills/supermind-init/SKILL.md +48 -2
  38. package/skills/systematic-debugging/SKILL.md +129 -0
  39. package/skills/tdd/SKILL.md +179 -0
  40. package/skills/using-git-worktrees/SKILL.md +138 -0
  41. package/skills/verification-before-completion/SKILL.md +54 -0
  42. package/skills/writing-plans/SKILL.md +169 -0
  43. package/templates/CLAUDE.md +124 -61
  44. package/cli/lib/plugins.js +0 -23
@@ -8,27 +8,9 @@ const logger = require('./logger');
8
8
  const SUPERMIND_HOOKS = [
9
9
  'bash-permissions.js', 'session-start.js', 'session-end.js',
10
10
  'cost-tracker.js', 'statusline-command.js',
11
+ 'pre-merge-checklist.js', 'improvement-logger.js',
11
12
  ];
12
13
 
13
- // Derived from plugins.js — single source of truth for plugin and marketplace IDs.
14
- // Wrapped in try-catch so a plugins.js error doesn't crash doctor/uninstall.
15
- function loadPluginIds() {
16
- try {
17
- const { getPluginDefaults } = require('./plugins');
18
- const defaults = getPluginDefaults();
19
- return {
20
- plugins: Object.keys(defaults.enabledPlugins),
21
- marketplaces: Object.keys(defaults.extraKnownMarketplaces),
22
- };
23
- } catch (err) {
24
- logger.warn(`Could not load plugins.js — plugin checks/cleanup will be skipped (${err.message})`);
25
- return { plugins: [], marketplaces: [] };
26
- }
27
- }
28
-
29
- const { plugins: SUPERMIND_PLUGINS, marketplaces: SUPERMIND_MARKETPLACES } = loadPluginIds();
30
- // SUPERMIND_MARKETPLACES is used only within this module (for uninstall cleanup) — intentionally not exported
31
-
32
14
  function readSettings() {
33
15
  try {
34
16
  return JSON.parse(fs.readFileSync(PATHS.settings, 'utf-8'));
@@ -120,9 +102,6 @@ function mergeSettings(existing, defaults) {
120
102
 
121
103
  // Objects: recursive merge
122
104
  if (defaults.permissions) result.permissions = mergeObjects(result.permissions || {}, defaults.permissions);
123
- if (defaults.enabledPlugins) result.enabledPlugins = mergeObjects(result.enabledPlugins || {}, defaults.enabledPlugins);
124
- if (defaults.extraKnownMarketplaces) result.extraKnownMarketplaces = mergeObjects(result.extraKnownMarketplaces || {}, defaults.extraKnownMarketplaces);
125
-
126
105
  // Hooks: special merge
127
106
  if (defaults.hooks) result.hooks = mergeHookEvents(result.hooks || {}, defaults.hooks);
128
107
 
@@ -136,23 +115,6 @@ function removeSupermindEntries(settings) {
136
115
  // Remove statusLine
137
116
  delete result.statusLine;
138
117
 
139
- // Remove Supermind plugins and marketplace entries
140
- if (SUPERMIND_PLUGINS.length === 0) {
141
- logger.warn('Plugin/marketplace list unavailable — these entries were NOT removed from settings. ' +
142
- 'You may need to manually edit ~/.claude/settings.json');
143
- } else {
144
- if (result.enabledPlugins) {
145
- for (const id of SUPERMIND_PLUGINS) {
146
- delete result.enabledPlugins[id];
147
- }
148
- }
149
- if (result.extraKnownMarketplaces) {
150
- for (const id of SUPERMIND_MARKETPLACES) {
151
- delete result.extraKnownMarketplaces[id];
152
- }
153
- }
154
- }
155
-
156
118
  // Remove Supermind hooks from each event
157
119
  if (result.hooks) {
158
120
  for (const [event, configs] of Object.entries(result.hooks)) {
@@ -178,5 +140,5 @@ function removeSupermindEntries(settings) {
178
140
  module.exports = {
179
141
  readSettings, writeSettings, backupSettings,
180
142
  mergeSettings, removeSupermindEntries,
181
- SUPERMIND_HOOKS, SUPERMIND_PLUGINS,
143
+ SUPERMIND_HOOKS,
182
144
  };
package/cli/lib/skills.js CHANGED
@@ -38,7 +38,7 @@ function installSkills() {
38
38
  }
39
39
 
40
40
  // Fallback list if package source is unavailable
41
- const KNOWN_SKILLS = ['supermind', 'supermind-init', 'supermind-living-docs'];
41
+ const KNOWN_SKILLS = ['supermind', 'supermind-init', 'supermind-living-docs', 'anti-rationalization', 'verification-before-completion', 'tdd', 'systematic-debugging', 'brainstorming', 'code-review', 'using-git-worktrees', 'writing-plans', 'executing-plans', 'finishing-branches', 'quick', 'project'];
42
42
 
43
43
  function removeSkills() {
44
44
  let dirs;
@@ -67,4 +67,41 @@ function removeLegacySkills() {
67
67
  }
68
68
  }
69
69
 
70
- module.exports = { installSkills, removeSkills, removeLegacySkills, getSkillDirs };
70
+ // ---------------------------------------------------------------------------
71
+ // Agent definitions — copied to ~/.claude/agents/ on install
72
+ // ---------------------------------------------------------------------------
73
+
74
+ const KNOWN_AGENTS = ['code-reviewer'];
75
+
76
+ function getAgentFiles() {
77
+ const agentsSource = path.join(getPackageRoot(), 'agents');
78
+ return fs.readdirSync(agentsSource).filter(f =>
79
+ f.endsWith('.md') && fs.statSync(path.join(agentsSource, f)).isFile()
80
+ );
81
+ }
82
+
83
+ function installAgents() {
84
+ ensureDir(PATHS.agentsDir);
85
+ const agentsSource = path.join(getPackageRoot(), 'agents');
86
+ const files = getAgentFiles();
87
+
88
+ for (const file of files) {
89
+ fs.copyFileSync(path.join(agentsSource, file), path.join(PATHS.agentsDir, file));
90
+ logger.success(file);
91
+ }
92
+ return files;
93
+ }
94
+
95
+ function removeAgents() {
96
+ let files;
97
+ try { files = getAgentFiles(); } catch { files = KNOWN_AGENTS.map(n => `${n}.md`); }
98
+ for (const file of files) {
99
+ const target = path.join(PATHS.agentsDir, file);
100
+ if (fs.existsSync(target)) {
101
+ fs.unlinkSync(target);
102
+ logger.success(`Removed ${file}`);
103
+ }
104
+ }
105
+ }
106
+
107
+ module.exports = { installSkills, removeSkills, removeLegacySkills, getSkillDirs, installAgents, removeAgents, getAgentFiles };
@@ -5,11 +5,58 @@ const path = require('path');
5
5
  const { PATHS, ensureDir, getPackageRoot } = require('./platform');
6
6
  const logger = require('./logger');
7
7
 
8
- function installTemplates() {
8
+ const MCP_SECTIONS = {
9
+ docker: `## MCP Servers
10
+ Use these naturally when relevant — don't wait to be asked.
11
+
12
+ - **Magic MCP** — \`component_builder\`, \`component_inspiration\`, \`component_refiner\`, \`logo_search\` — use when building/refining UI components
13
+ - **Airis Gateway** (Docker, localhost:9400) — cold-start sub-servers:
14
+ - **context7** — Library docs lookup
15
+ - **playwright** — Browser automation/testing
16
+ - **serena** — Symbolic code navigation (run \`activate_project\` on first use)
17
+ - **tavily** — Web search/research
18
+ - **chrome-devtools** — Chrome debugging
19
+ - **shadcn** — shadcn/ui component search
20
+ `,
21
+
22
+ direct: `## MCP Servers
23
+ Use these naturally when relevant — don't wait to be asked.
24
+
25
+ - **Magic MCP** — \`component_builder\`, \`component_inspiration\`, \`component_refiner\`, \`logo_search\` — use when building/refining UI components
26
+ - **context7** — Library docs lookup (npx)
27
+ - **playwright** — Browser automation/testing (npx)
28
+ - **serena** — Symbolic code navigation; run \`activate_project\` on first use (uvx)
29
+ - **tavily** — Web search/research (npx, requires TAVILY_API_KEY)
30
+ - **chrome-devtools** — Chrome debugging (npx)
31
+ - **shadcn** — shadcn/ui component search (npx)
32
+ `,
33
+
34
+ skip: `## MCP Servers
35
+ Use these naturally when relevant — don't wait to be asked.
36
+
37
+ - **Magic MCP** — \`component_builder\`, \`component_inspiration\`, \`component_refiner\`, \`logo_search\` — use when building/refining UI components
38
+ <!-- Add your MCP servers here. Run \`npx supermind-claude\` to set up context7, playwright, serena, tavily, and more. -->
39
+ `,
40
+ };
41
+
42
+ // Matches MCP section up to next heading or end of file (with or without trailing newline)
43
+ const MCP_SECTION_PATTERN = /## MCP Servers\nUse these naturally when relevant.*?(?=\n## |\n?$)/s;
44
+
45
+ function installTemplates(mcpMode) {
9
46
  ensureDir(PATHS.templatesDir);
10
47
  const src = path.join(getPackageRoot(), 'templates', 'CLAUDE.md');
11
48
  const dest = path.join(PATHS.templatesDir, 'CLAUDE.md');
12
49
  fs.copyFileSync(src, dest);
50
+
51
+ if (mcpMode && MCP_SECTIONS[mcpMode]) {
52
+ const content = fs.readFileSync(dest, 'utf-8');
53
+ const updated = content.replace(MCP_SECTION_PATTERN, MCP_SECTIONS[mcpMode]);
54
+ if (updated === content && mcpMode !== 'docker') { // docker is the template default, so no-op is expected
55
+ logger.warn('MCP section pattern did not match template — using default MCP content');
56
+ }
57
+ fs.writeFileSync(dest, updated);
58
+ }
59
+
13
60
  logger.success('CLAUDE.md template');
14
61
  }
15
62