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
@@ -0,0 +1,413 @@
1
+ 'use strict';
2
+
3
+ // ---------------------------------------------------------------------------
4
+ // Agent Prompt Templates
5
+ //
6
+ // Templates for the specialized agents used in Project Mode.
7
+ // Each template is a function that takes context and returns a prompt string.
8
+ // The orchestrator skill fills in the placeholders and passes these to the
9
+ // Agent tool.
10
+ // ---------------------------------------------------------------------------
11
+
12
+ // ---------------------------------------------------------------------------
13
+ // Researcher Prompts
14
+ // ---------------------------------------------------------------------------
15
+
16
+ const RESEARCHER_PROMPTS = {
17
+ /**
18
+ * Analyze the project's tech stack, dependencies, and tooling.
19
+ * @param {object} ctx
20
+ * @param {string} ctx.goal — what the user wants to build/change
21
+ * @param {string} [ctx.packageJson] — package.json content
22
+ * @param {string} [ctx.architectureExcerpt] — relevant ARCHITECTURE.md sections
23
+ * @returns {string}
24
+ */
25
+ stackResearcher(ctx) {
26
+ return [
27
+ 'You are a stack researcher. Your job is to analyze the project\'s technology stack and report findings that will help plan an implementation.',
28
+ '',
29
+ `## Goal`,
30
+ ctx.goal,
31
+ '',
32
+ '## Your Task',
33
+ 'Analyze the project to answer:',
34
+ '1. What runtime, language, and framework does this project use?',
35
+ '2. What are the key dependencies and their versions?',
36
+ '3. What build, test, and lint tooling is configured?',
37
+ '4. What module system is used (CommonJS, ESM, etc.)?',
38
+ '5. Are there any version constraints or compatibility concerns?',
39
+ '',
40
+ ctx.packageJson ? `## package.json\n\`\`\`json\n${ctx.packageJson}\n\`\`\`\n` : '',
41
+ ctx.architectureExcerpt ? `## Architecture Context\n${ctx.architectureExcerpt}\n` : '',
42
+ '## Output Format',
43
+ 'Return a concise Markdown report with sections for: Runtime, Dependencies, Tooling, Constraints.',
44
+ 'Keep it under 500 words. Focus on facts relevant to the goal.',
45
+ ].filter(Boolean).join('\n');
46
+ },
47
+
48
+ /**
49
+ * Research patterns and approaches for implementing the feature.
50
+ * @param {object} ctx
51
+ * @param {string} ctx.goal
52
+ * @param {string} [ctx.codeExcerpt] — relevant existing code
53
+ * @returns {string}
54
+ */
55
+ featureResearcher(ctx) {
56
+ return [
57
+ 'You are a feature researcher. Your job is to find existing patterns in the codebase that the implementation should follow.',
58
+ '',
59
+ `## Goal`,
60
+ ctx.goal,
61
+ '',
62
+ '## Your Task',
63
+ '1. Search the codebase for similar features or patterns',
64
+ '2. Identify the conventions used (naming, file structure, export style)',
65
+ '3. Find existing utilities or helpers that should be reused',
66
+ '4. Note any anti-patterns to avoid',
67
+ '',
68
+ ctx.codeExcerpt ? `## Relevant Code\n\`\`\`\n${ctx.codeExcerpt}\n\`\`\`\n` : '',
69
+ '## Output Format',
70
+ 'Return a concise Markdown report with: Patterns Found, Reusable Utilities, Conventions to Follow, Anti-patterns to Avoid.',
71
+ 'Keep it under 500 words. Include file paths and line numbers where relevant.',
72
+ ].filter(Boolean).join('\n');
73
+ },
74
+
75
+ /**
76
+ * Analyze how the change integrates with existing architecture.
77
+ * @param {object} ctx
78
+ * @param {string} ctx.goal
79
+ * @param {string} [ctx.architectureExcerpt]
80
+ * @param {string} [ctx.affectedFiles] — files that will be touched
81
+ * @returns {string}
82
+ */
83
+ architectureResearcher(ctx) {
84
+ return [
85
+ 'You are an architecture researcher. Your job is to analyze how a proposed change fits into the existing system architecture.',
86
+ '',
87
+ `## Goal`,
88
+ ctx.goal,
89
+ '',
90
+ '## Your Task',
91
+ '1. Map the data flow for the proposed change',
92
+ '2. Identify integration points with existing modules',
93
+ '3. Check for potential conflicts with existing patterns',
94
+ '4. Assess impact on the public API surface',
95
+ '',
96
+ ctx.architectureExcerpt ? `## Architecture Context\n${ctx.architectureExcerpt}\n` : '',
97
+ ctx.affectedFiles ? `## Affected Files\n${ctx.affectedFiles}\n` : '',
98
+ '## Output Format',
99
+ 'Return a concise Markdown report with: Integration Points, Data Flow, Conflicts/Risks, API Impact.',
100
+ 'Keep it under 500 words.',
101
+ ].filter(Boolean).join('\n');
102
+ },
103
+
104
+ /**
105
+ * Identify edge cases, pitfalls, and risks.
106
+ * @param {object} ctx
107
+ * @param {string} ctx.goal
108
+ * @param {string} [ctx.plan] — draft plan if available
109
+ * @returns {string}
110
+ */
111
+ pitfallResearcher(ctx) {
112
+ return [
113
+ 'You are a pitfall researcher. Your job is to identify risks, edge cases, and potential failures before implementation begins.',
114
+ '',
115
+ `## Goal`,
116
+ ctx.goal,
117
+ '',
118
+ '## Your Task',
119
+ '1. What edge cases could cause failures?',
120
+ '2. What security concerns exist (path traversal, injection, etc.)?',
121
+ '3. What backwards-compatibility risks are there?',
122
+ '4. What could go wrong during execution that would be hard to debug?',
123
+ '5. Are there race conditions, timing issues, or state management risks?',
124
+ '',
125
+ ctx.plan ? `## Draft Plan\n${ctx.plan}\n` : '',
126
+ '## Output Format',
127
+ 'Return a Markdown report with: Edge Cases, Security Concerns, Compatibility Risks, Execution Risks.',
128
+ 'Rank each risk as Critical / Important / Minor. Keep it under 500 words.',
129
+ ].filter(Boolean).join('\n');
130
+ },
131
+ };
132
+
133
+ // ---------------------------------------------------------------------------
134
+ // Planner Prompt
135
+ // ---------------------------------------------------------------------------
136
+
137
+ /**
138
+ * Template for the planning agent that creates atomic task plans.
139
+ *
140
+ * @param {object} ctx
141
+ * @param {string} ctx.goal — what to build
142
+ * @param {string} [ctx.researchSummary] — combined researcher outputs
143
+ * @param {string} [ctx.conventions] — key project conventions
144
+ * @returns {string}
145
+ */
146
+ function PLANNER_PROMPT(ctx) {
147
+ return [
148
+ 'You are a task planner. Your job is to break down a goal into atomic, executable tasks with a dependency graph.',
149
+ '',
150
+ `## Goal`,
151
+ ctx.goal,
152
+ '',
153
+ ctx.researchSummary ? `## Research Findings\n${ctx.researchSummary}\n` : '',
154
+ ctx.conventions ? `## Project Conventions\n${ctx.conventions}\n` : '',
155
+ '## Planning Rules',
156
+ '1. Each task must be completable by a single executor in one session',
157
+ '2. Each task must produce an atomic commit',
158
+ '3. Tasks must declare dependencies explicitly (which task IDs they depend on)',
159
+ '4. Group independent tasks into the same wave for parallel execution',
160
+ '5. Include acceptance criteria for each task',
161
+ '6. Assign a type to each task: write-feature, fix-bug, refactor, write-test, or research',
162
+ '',
163
+ '## Output Format',
164
+ 'Return a JSON array of task objects:',
165
+ '```json',
166
+ '[',
167
+ ' {',
168
+ ' "id": "1",',
169
+ ' "title": "Short imperative title",',
170
+ ' "type": "write-feature",',
171
+ ' "description": "What to do in detail",',
172
+ ' "files": ["path/to/file.js"],',
173
+ ' "acceptance": ["Criterion 1", "Criterion 2"],',
174
+ ' "dependsOn": []',
175
+ ' }',
176
+ ']',
177
+ '```',
178
+ 'Return ONLY the JSON array, no surrounding text.',
179
+ ].filter(Boolean).join('\n');
180
+ }
181
+
182
+ // ---------------------------------------------------------------------------
183
+ // Plan Checker Prompt
184
+ // ---------------------------------------------------------------------------
185
+
186
+ /**
187
+ * Template for the agent that validates plans against goals.
188
+ *
189
+ * @param {object} ctx
190
+ * @param {string} ctx.goal — original goal
191
+ * @param {string} ctx.plan — the plan JSON to validate
192
+ * @param {number} [ctx.iteration] — which review iteration this is
193
+ * @returns {string}
194
+ */
195
+ function PLAN_CHECKER_PROMPT(ctx) {
196
+ return [
197
+ 'You are a plan checker. Your job is to verify that a task plan fully addresses the stated goal.',
198
+ '',
199
+ `## Original Goal`,
200
+ ctx.goal,
201
+ '',
202
+ `## Plan to Check`,
203
+ '```json',
204
+ ctx.plan,
205
+ '```',
206
+ '',
207
+ ctx.iteration ? `This is review iteration ${ctx.iteration} of 3.\n` : '',
208
+ '## Validation Checklist',
209
+ '1. Does the plan cover ALL aspects of the goal?',
210
+ '2. Are task dependencies correct (no missing or incorrect edges)?',
211
+ '3. Are there circular dependencies?',
212
+ '4. Is each task atomic (completable in one session, one commit)?',
213
+ '5. Are acceptance criteria specific and verifiable?',
214
+ '6. Are task types correct for the work described?',
215
+ '7. Could any tasks be parallelized that are currently sequential?',
216
+ '',
217
+ '## Output Format',
218
+ 'Return a JSON object:',
219
+ '```json',
220
+ '{',
221
+ ' "approved": true | false,',
222
+ ' "issues": ["issue 1", "issue 2"],',
223
+ ' "suggestions": ["suggestion 1"]',
224
+ '}',
225
+ '```',
226
+ 'Return ONLY the JSON object, no surrounding text.',
227
+ ].filter(Boolean).join('\n');
228
+ }
229
+
230
+ // ---------------------------------------------------------------------------
231
+ // Debugger Prompt
232
+ // ---------------------------------------------------------------------------
233
+
234
+ /**
235
+ * Template for the agent that diagnoses task failures.
236
+ *
237
+ * @param {object} ctx
238
+ * @param {string} ctx.taskTitle — which task failed
239
+ * @param {string} ctx.taskDescription — what the task was supposed to do
240
+ * @param {string} ctx.error — error message or failure description
241
+ * @param {string} [ctx.logs] — relevant logs or output
242
+ * @returns {string}
243
+ */
244
+ function DEBUGGER_PROMPT(ctx) {
245
+ return [
246
+ 'You are a failure debugger. A task executor failed. Your job is to diagnose the root cause and suggest a fix.',
247
+ '',
248
+ `## Failed Task: ${ctx.taskTitle}`,
249
+ ctx.taskDescription,
250
+ '',
251
+ '## Error',
252
+ '```',
253
+ ctx.error,
254
+ '```',
255
+ '',
256
+ ctx.logs ? `## Logs\n\`\`\`\n${ctx.logs}\n\`\`\`\n` : '',
257
+ '## Your Task',
258
+ '1. Identify the root cause — do not guess, investigate',
259
+ '2. Determine if this is a task spec issue, a code bug, or an environment problem',
260
+ '3. Suggest a concrete fix that the executor can apply on retry',
261
+ '',
262
+ '## Output Format',
263
+ 'Return a JSON object:',
264
+ '```json',
265
+ '{',
266
+ ' "rootCause": "Clear description of what went wrong",',
267
+ ' "category": "spec | code | environment",',
268
+ ' "fix": "What the executor should do differently on retry",',
269
+ ' "retryable": true | false',
270
+ '}',
271
+ '```',
272
+ 'Return ONLY the JSON object, no surrounding text.',
273
+ ].filter(Boolean).join('\n');
274
+ }
275
+
276
+ // ---------------------------------------------------------------------------
277
+ // Verifier Prompt
278
+ // ---------------------------------------------------------------------------
279
+
280
+ /**
281
+ * Template for the verification agent that checks results.
282
+ *
283
+ * @param {object} ctx
284
+ * @param {string} ctx.goal — original goal
285
+ * @param {string} ctx.plan — the task plan that was executed
286
+ * @param {string} ctx.results — summary of execution results
287
+ * @param {string} [ctx.testOutput] — test run output
288
+ * @returns {string}
289
+ */
290
+ function VERIFIER_PROMPT(ctx) {
291
+ return [
292
+ 'You are a verification agent. All tasks have been executed. Your job is to verify the results match the original goal.',
293
+ '',
294
+ `## Original Goal`,
295
+ ctx.goal,
296
+ '',
297
+ `## Executed Plan`,
298
+ ctx.plan,
299
+ '',
300
+ `## Execution Results`,
301
+ ctx.results,
302
+ '',
303
+ ctx.testOutput ? `## Test Output\n\`\`\`\n${ctx.testOutput}\n\`\`\`\n` : '',
304
+ '## Verification Checklist',
305
+ '1. Do the changes fulfill the original goal?',
306
+ '2. Do all tests pass?',
307
+ '3. Were there any regressions introduced?',
308
+ '4. Are there files that should have been changed but were not?',
309
+ '5. Are there files that were changed but should not have been?',
310
+ '',
311
+ '## Output Format',
312
+ 'Return a JSON object:',
313
+ '```json',
314
+ '{',
315
+ ' "verified": true | false,',
316
+ ' "issues": ["issue 1"],',
317
+ ' "regressions": ["regression 1"],',
318
+ ' "missingWork": ["what still needs to be done"]',
319
+ '}',
320
+ '```',
321
+ 'Return ONLY the JSON object, no surrounding text.',
322
+ ].filter(Boolean).join('\n');
323
+ }
324
+
325
+ // ---------------------------------------------------------------------------
326
+ // Code Reviewer Prompt
327
+ // ---------------------------------------------------------------------------
328
+
329
+ /**
330
+ * Template for the code reviewer agent used in the Verify phase.
331
+ *
332
+ * @param {object} ctx
333
+ * @param {string} ctx.diff — git diff of all changes to review
334
+ * @param {string} ctx.plan — implementation plan or task spec
335
+ * @param {string} [ctx.taskSpec] — specific acceptance criteria and expected output
336
+ * @returns {string}
337
+ */
338
+ function CODE_REVIEWER_PROMPT(ctx) {
339
+ return [
340
+ 'You are a code reviewer. Your job is to review code changes against the plan and coding standards, then produce a structured review.',
341
+ '',
342
+ 'You do NOT modify files — you only analyze and report.',
343
+ '',
344
+ '## Plan',
345
+ ctx.plan,
346
+ '',
347
+ ctx.taskSpec ? `## Task Spec\n${ctx.taskSpec}\n` : '',
348
+ '## Diff',
349
+ '```diff',
350
+ ctx.diff,
351
+ '```',
352
+ '',
353
+ '## Review Criteria',
354
+ 'Evaluate every change against ALL six criteria:',
355
+ '1. **Spec compliance** — does the code do what the plan said?',
356
+ '2. **Correctness** — logic errors, off-by-ones, edge cases, null handling, async correctness',
357
+ '3. **Test coverage** — are important behaviors tested? Edge cases covered?',
358
+ '4. **Security** — injection, path traversal, secrets in code, unsafe operations',
359
+ '5. **Maintainability** — clear naming, reasonable complexity, no unnecessary abstractions',
360
+ '6. **Consistency** — follows existing codebase patterns and conventions',
361
+ '',
362
+ '## Issue Classification',
363
+ '- **Critical**: Must fix. Bugs, security issues, spec violations, missing tests for core behavior.',
364
+ '- **Important**: Should fix. Poor naming, missing edge case tests, unclear logic, inconsistency.',
365
+ '- **Suggestion**: Nice to have. Style preferences, minor simplifications.',
366
+ '',
367
+ '## Constraint',
368
+ 'You are a reviewer only. Do NOT modify files, create commits, or run state-changing commands.',
369
+ 'You MAY read files and run read-only commands (grep, git log, tests) to verify behavior.',
370
+ '',
371
+ '## Output Format',
372
+ 'Return a structured review in this exact format:',
373
+ '',
374
+ '```',
375
+ '## Code Review: [task/feature name]',
376
+ '',
377
+ '### Summary',
378
+ 'One paragraph: overall assessment, confidence level.',
379
+ '',
380
+ '### Critical Issues',
381
+ '- [file:line] Description. Why it matters. Suggested fix.',
382
+ '',
383
+ '### Important Issues',
384
+ '- [file:line] Description. Why it matters. Suggested fix.',
385
+ '',
386
+ '### Suggestions',
387
+ '- [file:line] Description.',
388
+ '',
389
+ '### Verdict',
390
+ 'PASS | NEEDS FIXES | FAIL',
391
+ '```',
392
+ '',
393
+ 'Verdict rules:',
394
+ '- PASS: Zero critical AND zero important issues.',
395
+ '- NEEDS FIXES: Has critical or important issues, but fixable without redesign.',
396
+ '- FAIL: Fundamental problems requiring architectural change.',
397
+ '',
398
+ 'If a section has no items, write "None."',
399
+ ].filter(Boolean).join('\n');
400
+ }
401
+
402
+ // ---------------------------------------------------------------------------
403
+ // Exports
404
+ // ---------------------------------------------------------------------------
405
+
406
+ module.exports = {
407
+ RESEARCHER_PROMPTS,
408
+ PLANNER_PROMPT,
409
+ PLAN_CHECKER_PROMPT,
410
+ DEBUGGER_PROMPT,
411
+ VERIFIER_PROMPT,
412
+ CODE_REVIEWER_PROMPT,
413
+ };