claude-flow-novice 1.1.8 → 1.2.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 (88) hide show
  1. package/.claude/SLASH-COMMANDS-READY.md +53 -0
  2. package/.claude/WORKING-SETUP.md +67 -0
  3. package/.claude/commands/README.md +157 -0
  4. package/.claude/commands/claude-md.js +237 -0
  5. package/.claude/commands/claude-md.md +64 -0
  6. package/.claude/commands/claude-soul.js +562 -0
  7. package/.claude/commands/claude-soul.md +22 -0
  8. package/.claude/commands/cli-integration.js +216 -0
  9. package/.claude/commands/dependency-recommendations.md +171 -0
  10. package/.claude/commands/github.js +638 -0
  11. package/.claude/commands/github.md +221 -0
  12. package/.claude/commands/hooks.js +648 -0
  13. package/.claude/commands/hooks.md +38 -0
  14. package/.claude/commands/index.js +115 -0
  15. package/.claude/commands/neural.js +572 -0
  16. package/.claude/commands/neural.md +39 -0
  17. package/.claude/commands/performance.js +582 -0
  18. package/.claude/commands/performance.md +41 -0
  19. package/.claude/commands/register-all-commands.js +314 -0
  20. package/.claude/commands/register-claude-md.js +82 -0
  21. package/.claude/commands/register-claude-soul.js +80 -0
  22. package/.claude/commands/sparc.js +110 -0
  23. package/.claude/commands/sparc.md +46 -0
  24. package/.claude/commands/suggest-improvements.md +95 -0
  25. package/.claude/commands/suggest-templates.md +147 -0
  26. package/.claude/commands/swarm.js +423 -0
  27. package/.claude/commands/swarm.md +24 -0
  28. package/.claude/commands/validate-commands.js +223 -0
  29. package/.claude/commands/workflow.js +606 -0
  30. package/.claude/commands/workflow.md +295 -0
  31. package/.claude/core/agent-manager.js +80 -0
  32. package/.claude/core/agent-manager.js.map +1 -0
  33. package/.claude/core/config.js +1221 -0
  34. package/.claude/core/config.js.map +1 -0
  35. package/.claude/core/event-bus.js +136 -0
  36. package/.claude/core/event-bus.js.map +1 -0
  37. package/.claude/core/index.js +6 -0
  38. package/.claude/core/index.js.map +1 -0
  39. package/.claude/core/json-persistence.js +112 -0
  40. package/.claude/core/json-persistence.js.map +1 -0
  41. package/.claude/core/logger.js +245 -0
  42. package/.claude/core/logger.js.map +1 -0
  43. package/.claude/core/orchestrator-fixed.js +236 -0
  44. package/.claude/core/orchestrator-fixed.js.map +1 -0
  45. package/.claude/core/orchestrator.js +1136 -0
  46. package/.claude/core/orchestrator.js.map +1 -0
  47. package/.claude/core/persistence.js +185 -0
  48. package/.claude/core/persistence.js.map +1 -0
  49. package/.claude/core/project-manager.js +80 -0
  50. package/.claude/core/project-manager.js.map +1 -0
  51. package/.claude/core/slash-command.js +24 -0
  52. package/.claude/core/version.js +35 -0
  53. package/.claude/core/version.js.map +1 -0
  54. package/.claude/slash-commands.json +92 -0
  55. package/dist/mcp/mcp-server-novice.js +24 -4
  56. package/dist/mcp/mcp-server-sdk.js +649 -0
  57. package/dist/mcp/mcp-server-with-slash-commands.js +776 -0
  58. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +271 -0
  59. package/dist/src/slash-commands/README.md +157 -0
  60. package/dist/src/slash-commands/claude-md.js +237 -0
  61. package/dist/src/slash-commands/claude-soul.js +562 -0
  62. package/dist/src/slash-commands/cli-integration.js +216 -0
  63. package/dist/src/slash-commands/github.js +638 -0
  64. package/dist/src/slash-commands/hooks.js +648 -0
  65. package/dist/src/slash-commands/index.js +115 -0
  66. package/dist/src/slash-commands/mcp-slash-integration.js +146 -0
  67. package/dist/src/slash-commands/neural.js +572 -0
  68. package/dist/src/slash-commands/performance.js +582 -0
  69. package/dist/src/slash-commands/register-all-commands.js +314 -0
  70. package/dist/src/slash-commands/register-claude-md.js +82 -0
  71. package/dist/src/slash-commands/register-claude-soul.js +80 -0
  72. package/dist/src/slash-commands/sparc.js +110 -0
  73. package/dist/src/slash-commands/swarm.js +423 -0
  74. package/dist/src/slash-commands/validate-commands.js +223 -0
  75. package/dist/src/slash-commands/workflow.js +606 -0
  76. package/package.json +23 -10
  77. package/src/slash-commands/cli-integration.js +216 -0
  78. package/src/slash-commands/github.js +638 -0
  79. package/src/slash-commands/hooks.js +648 -0
  80. package/src/slash-commands/index.js +115 -0
  81. package/src/slash-commands/mcp-slash-integration.js +146 -0
  82. package/src/slash-commands/neural.js +572 -0
  83. package/src/slash-commands/performance.js +582 -0
  84. package/src/slash-commands/register-all-commands.js +314 -0
  85. package/src/slash-commands/sparc.js +110 -0
  86. package/src/slash-commands/swarm.js +423 -0
  87. package/src/slash-commands/validate-commands.js +223 -0
  88. package/src/slash-commands/workflow.js +606 -0
@@ -0,0 +1,314 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Register All Slash Commands
5
+ *
6
+ * Central registry for all claude-flow slash commands
7
+ */
8
+
9
+ import { ClaudeMdSlashCommand } from './claude-md.js';
10
+ import { SparcCommand } from './sparc.js';
11
+ import { SwarmCommand } from './swarm.js';
12
+ import { HooksCommand } from './hooks.js';
13
+ import { NeuralCommand } from './neural.js';
14
+ import { PerformanceCommand } from './performance.js';
15
+ import { GitHubCommand } from './github.js';
16
+ import { WorkflowCommand } from './workflow.js';
17
+ import { executeClaudeSoulCommand } from './claude-soul.js';
18
+
19
+ /**
20
+ * Command Registry Class
21
+ */
22
+ export class SlashCommandRegistry {
23
+ constructor() {
24
+ this.commands = new Map();
25
+ this.aliases = new Map();
26
+ this.initializeCommands();
27
+ }
28
+
29
+ /**
30
+ * Initialize all available commands
31
+ */
32
+ initializeCommands() {
33
+ // Core SPARC methodology command
34
+ this.register(new SparcCommand());
35
+
36
+ // Swarm management commands
37
+ this.register(new SwarmCommand());
38
+ this.addAlias('swarm', 's');
39
+
40
+ // Hooks automation commands
41
+ this.register(new HooksCommand());
42
+ this.addAlias('hooks', 'h');
43
+
44
+ // Neural network commands
45
+ this.register(new NeuralCommand());
46
+ this.addAlias('neural', 'n');
47
+
48
+ // Performance monitoring commands
49
+ this.register(new PerformanceCommand());
50
+ this.addAlias('performance', 'perf');
51
+ this.addAlias('performance', 'p');
52
+
53
+ // GitHub integration commands
54
+ this.register(new GitHubCommand());
55
+ this.addAlias('github', 'gh');
56
+ this.addAlias('github', 'git');
57
+
58
+ // Workflow automation commands
59
+ this.register(new WorkflowCommand());
60
+ this.addAlias('workflow', 'wf');
61
+ this.addAlias('workflow', 'w');
62
+
63
+ // Legacy function-based commands
64
+ this.registerLegacyCommand('claude-md', {
65
+ description: 'Generate CLAUDE.md configuration file',
66
+ usage: '/claude-md [--preview] [--force] [--no-backup]',
67
+ execute: async (args, context) => {
68
+ const command = new ClaudeMdSlashCommand();
69
+ const options = {
70
+ preview: args.includes('--preview'),
71
+ force: args.includes('--force'),
72
+ backup: !args.includes('--no-backup')
73
+ };
74
+ return await command.execute(options);
75
+ }
76
+ });
77
+
78
+ this.registerLegacyCommand('claude-soul', {
79
+ description: 'Generate claude-soul.md project essence document',
80
+ usage: '/claude-soul [--preview] [--force] [--no-backup]',
81
+ execute: async (args, context) => {
82
+ const options = {
83
+ preview: args.includes('--preview'),
84
+ force: args.includes('--force'),
85
+ backup: !args.includes('--no-backup')
86
+ };
87
+ return await executeClaudeSoulCommand(options);
88
+ }
89
+ });
90
+ }
91
+
92
+ /**
93
+ * Register a command
94
+ * @param {SlashCommand} command - Command instance
95
+ */
96
+ register(command) {
97
+ this.commands.set(command.name, command);
98
+ console.log(`✅ Registered /${command.name} command`);
99
+ }
100
+
101
+ /**
102
+ * Register legacy function-based command
103
+ * @param {string} name - Command name
104
+ * @param {Object} config - Command configuration
105
+ */
106
+ registerLegacyCommand(name, config) {
107
+ this.commands.set(name, {
108
+ name: name,
109
+ description: config.description,
110
+ usage: config.usage,
111
+ execute: config.execute,
112
+ getHelp: () => ({
113
+ name: name,
114
+ description: config.description,
115
+ usage: config.usage,
116
+ examples: config.examples || []
117
+ })
118
+ });
119
+ console.log(`✅ Registered /${name} legacy command`);
120
+ }
121
+
122
+ /**
123
+ * Add alias for a command
124
+ * @param {string} commandName - Original command name
125
+ * @param {string} alias - Alias name
126
+ */
127
+ addAlias(commandName, alias) {
128
+ this.aliases.set(alias, commandName);
129
+ }
130
+
131
+ /**
132
+ * Execute a slash command
133
+ * @param {string} input - Full command input (e.g., "/swarm init mesh")
134
+ * @param {Object} context - Execution context
135
+ */
136
+ async execute(input, context = {}) {
137
+ if (!input.startsWith('/')) {
138
+ return {
139
+ success: false,
140
+ error: 'Commands must start with /'
141
+ };
142
+ }
143
+
144
+ const parts = input.slice(1).split(' ');
145
+ const commandName = parts[0];
146
+ const args = parts.slice(1);
147
+
148
+ // Resolve aliases
149
+ const resolvedName = this.aliases.get(commandName) || commandName;
150
+ const command = this.commands.get(resolvedName);
151
+
152
+ if (!command) {
153
+ return {
154
+ success: false,
155
+ error: `Unknown command: ${commandName}`,
156
+ suggestions: this.getSuggestions(commandName)
157
+ };
158
+ }
159
+
160
+ try {
161
+ const result = await command.execute(args, context);
162
+ return {
163
+ success: true,
164
+ command: resolvedName,
165
+ result: result
166
+ };
167
+ } catch (error) {
168
+ return {
169
+ success: false,
170
+ error: `Command execution failed: ${error.message}`,
171
+ command: resolvedName
172
+ };
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Get command suggestions for unknown commands
178
+ * @param {string} input - Input command
179
+ */
180
+ getSuggestions(input) {
181
+ const commands = Array.from(this.commands.keys());
182
+ const aliases = Array.from(this.aliases.keys());
183
+ const allCommands = [...commands, ...aliases];
184
+
185
+ return allCommands
186
+ .filter(cmd => cmd.includes(input) || input.includes(cmd))
187
+ .slice(0, 5);
188
+ }
189
+
190
+ /**
191
+ * List all available commands
192
+ */
193
+ listCommands() {
194
+ const commands = [];
195
+
196
+ for (const [name, command] of this.commands) {
197
+ commands.push({
198
+ name: name,
199
+ description: command.description,
200
+ usage: command.usage || command.getUsage?.() || `/${name} [options]`,
201
+ aliases: Array.from(this.aliases.entries())
202
+ .filter(([alias, target]) => target === name)
203
+ .map(([alias]) => alias)
204
+ });
205
+ }
206
+
207
+ return commands.sort((a, b) => a.name.localeCompare(b.name));
208
+ }
209
+
210
+ /**
211
+ * Get help for a specific command
212
+ * @param {string} commandName - Command name
213
+ */
214
+ getHelp(commandName) {
215
+ const resolvedName = this.aliases.get(commandName) || commandName;
216
+ const command = this.commands.get(resolvedName);
217
+
218
+ if (!command) {
219
+ return {
220
+ success: false,
221
+ error: `Unknown command: ${commandName}`
222
+ };
223
+ }
224
+
225
+ return {
226
+ success: true,
227
+ help: command.getHelp ? command.getHelp() : {
228
+ name: command.name,
229
+ description: command.description,
230
+ usage: command.usage
231
+ }
232
+ };
233
+ }
234
+
235
+ /**
236
+ * Generate help text for all commands
237
+ */
238
+ generateHelpText() {
239
+ const commands = this.listCommands();
240
+
241
+ let helpText = `
242
+ 🚀 **CLAUDE-FLOW SLASH COMMANDS**
243
+
244
+ `;
245
+
246
+ helpText += `**Available Commands:**
247
+
248
+ `;
249
+
250
+ for (const cmd of commands) {
251
+ helpText += `**/${cmd.name}** - ${cmd.description}\n`;
252
+ helpText += ` Usage: ${cmd.usage}\n`;
253
+ if (cmd.aliases.length > 0) {
254
+ helpText += ` Aliases: ${cmd.aliases.map(a => `/${a}`).join(', ')}\n`;
255
+ }
256
+ helpText += `\n`;
257
+ }
258
+
259
+ helpText += `
260
+ **Examples:**
261
+ `;
262
+ helpText += `- \`/swarm init mesh 8\` - Initialize mesh swarm with 8 agents\n`;
263
+ helpText += `- \`/hooks enable\` - Enable automation hooks\n`;
264
+ helpText += `- \`/neural train coordination 50\` - Train neural coordination patterns\n`;
265
+ helpText += `- \`/performance report\` - Generate performance report\n`;
266
+ helpText += `- \`/github analyze owner/repo\` - Analyze GitHub repository\n`;
267
+ helpText += `- \`/workflow create "Build Pipeline"\` - Create automated workflow\n`;
268
+ helpText += `- \`/sparc spec "Build API"\` - Run SPARC specification phase\n`;
269
+
270
+ helpText += `
271
+ **For detailed help on any command:** \`/help <command>\`\n`;
272
+
273
+ return helpText;
274
+ }
275
+ }
276
+
277
+ /**
278
+ * Global registry instance
279
+ */
280
+ export const globalRegistry = new SlashCommandRegistry();
281
+
282
+ /**
283
+ * Execute slash command with global registry
284
+ * @param {string} input - Command input
285
+ * @param {Object} context - Execution context
286
+ */
287
+ export async function executeSlashCommand(input, context = {}) {
288
+ return await globalRegistry.execute(input, context);
289
+ }
290
+
291
+ /**
292
+ * Get all available commands
293
+ */
294
+ export function getAllCommands() {
295
+ return globalRegistry.listCommands();
296
+ }
297
+
298
+ /**
299
+ * Get help for specific command
300
+ * @param {string} commandName - Command name
301
+ */
302
+ export function getCommandHelp(commandName) {
303
+ return globalRegistry.getHelp(commandName);
304
+ }
305
+
306
+ /**
307
+ * Register additional command
308
+ * @param {SlashCommand} command - Command to register
309
+ */
310
+ export function registerCommand(command) {
311
+ return globalRegistry.register(command);
312
+ }
313
+
314
+ export default SlashCommandRegistry;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Slash Command Registration for /claude-md
3
+ *
4
+ * Simple registration that integrates with existing slash command system
5
+ */
6
+
7
+ import { executeClaudeMdCommand } from './claude-md.js';
8
+
9
+ /**
10
+ * Register the /claude-md slash command
11
+ */
12
+ export function registerClaudeMdCommand(slashCommandRegistry) {
13
+ slashCommandRegistry.register('claude-md', {
14
+ description: 'Generate or update CLAUDE.md file for current project',
15
+ usage: '/claude-md [--preview] [--force] [--no-backup] [--detect]',
16
+ options: [
17
+ { name: '--preview', description: 'Show what would be generated without writing file' },
18
+ { name: '--force', description: 'Overwrite existing CLAUDE.md without confirmation' },
19
+ { name: '--no-backup', description: 'Skip creating backup of existing file' },
20
+ { name: '--detect', description: 'Auto-detect project type and show recommendations' }
21
+ ],
22
+ examples: [
23
+ '/claude-md',
24
+ '/claude-md --preview',
25
+ '/claude-md --force',
26
+ '/claude-md --detect'
27
+ ],
28
+ async execute(args, context) {
29
+ try {
30
+ // Parse slash command arguments
31
+ const options = {
32
+ preview: args.includes('--preview'),
33
+ force: args.includes('--force'),
34
+ backup: !args.includes('--no-backup'),
35
+ detect: args.includes('--detect'),
36
+ isNpxInstall: false // Slash commands are manual, not NPX
37
+ };
38
+
39
+ console.log('🎯 Executing /claude-md slash command...');
40
+
41
+ const result = await executeClaudeMdCommand(options);
42
+
43
+ // Format response for slash command system
44
+ if (result.success) {
45
+ return {
46
+ success: true,
47
+ message: result.message || 'CLAUDE.md operation completed successfully',
48
+ data: {
49
+ action: result.action,
50
+ file: result.file,
51
+ length: result.length
52
+ }
53
+ };
54
+ } else {
55
+ return {
56
+ success: false,
57
+ error: result.error || 'CLAUDE.md operation failed',
58
+ action: result.action
59
+ };
60
+ }
61
+
62
+ } catch (error) {
63
+ console.error('❌ Slash command execution failed:', error.message);
64
+ return {
65
+ success: false,
66
+ error: `Slash command failed: ${error.message}`
67
+ };
68
+ }
69
+ }
70
+ });
71
+
72
+ console.log('✅ /claude-md slash command registered');
73
+ }
74
+
75
+ /**
76
+ * Auto-registration if this module is imported
77
+ */
78
+ export default function autoRegister(registry) {
79
+ if (registry) {
80
+ registerClaudeMdCommand(registry);
81
+ }
82
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Slash Command Registration for /claude-soul
3
+ *
4
+ * Register the claude-soul.md generation command
5
+ */
6
+
7
+ import { executeClaudeSoulCommand } from './claude-soul.js';
8
+
9
+ /**
10
+ * Register the /claude-soul slash command
11
+ */
12
+ export function registerClaudeSoulCommand(slashCommandRegistry) {
13
+ slashCommandRegistry.register('claude-soul', {
14
+ description: 'Generate claude-soul.md - project essence and philosophy document',
15
+ usage: '/claude-soul [--preview] [--force] [--no-backup]',
16
+ options: [
17
+ { name: '--preview', description: 'Show what would be generated without writing file' },
18
+ { name: '--force', description: 'Overwrite existing claude-soul.md without confirmation' },
19
+ { name: '--no-backup', description: 'Skip creating backup of existing file' }
20
+ ],
21
+ examples: [
22
+ '/claude-soul',
23
+ '/claude-soul --preview',
24
+ '/claude-soul --force',
25
+ '/claude-soul --no-backup'
26
+ ],
27
+ async execute(args, context) {
28
+ try {
29
+ // Parse slash command arguments
30
+ const options = {
31
+ preview: args.includes('--preview'),
32
+ force: args.includes('--force'),
33
+ backup: !args.includes('--no-backup')
34
+ };
35
+
36
+ console.log('🎯 Executing /claude-soul slash command...');
37
+
38
+ const result = await executeClaudeSoulCommand(options);
39
+
40
+ // Format response for slash command system
41
+ if (result.success) {
42
+ return {
43
+ success: true,
44
+ message: result.message || 'claude-soul.md operation completed successfully',
45
+ data: {
46
+ action: result.action,
47
+ file: result.file,
48
+ length: result.length,
49
+ lineCount: result.lineCount
50
+ }
51
+ };
52
+ } else {
53
+ return {
54
+ success: false,
55
+ error: result.error || 'claude-soul.md operation failed',
56
+ action: result.action
57
+ };
58
+ }
59
+
60
+ } catch (error) {
61
+ console.error('❌ Slash command execution failed:', error.message);
62
+ return {
63
+ success: false,
64
+ error: `Slash command failed: ${error.message}`
65
+ };
66
+ }
67
+ }
68
+ });
69
+
70
+ console.log('✅ /claude-soul slash command registered');
71
+ }
72
+
73
+ /**
74
+ * Auto-registration if this module is imported
75
+ */
76
+ export default function autoRegister(registry) {
77
+ if (registry) {
78
+ registerClaudeSoulCommand(registry);
79
+ }
80
+ }
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SPARC Methodology Slash Command
5
+ * Usage: /sparc <mode> <task>
6
+ */
7
+
8
+ import { SlashCommand } from '../core/slash-command.js';
9
+
10
+ export class SparcCommand extends SlashCommand {
11
+ constructor() {
12
+ super('sparc', 'Execute SPARC methodology phases');
13
+ }
14
+
15
+ async execute(args, context) {
16
+ const [mode, ...taskArgs] = args;
17
+ const task = taskArgs.join(' ');
18
+
19
+ const modes = {
20
+ 'spec': 'Specification - Requirements analysis and user story definition',
21
+ 'pseudo': 'Pseudocode - Algorithm design and logic flow',
22
+ 'arch': 'Architecture - System design and component structure',
23
+ 'refine': 'Refinement - Iterative improvement and optimization',
24
+ 'complete': 'Completion - Final implementation and testing'
25
+ };
26
+
27
+ if (!mode || !modes[mode]) {
28
+ return {
29
+ success: false,
30
+ error: `Invalid mode. Available modes: ${Object.keys(modes).join(', ')}`,
31
+ usage: '/sparc <mode> <task_description>'
32
+ };
33
+ }
34
+
35
+ if (!task) {
36
+ return {
37
+ success: false,
38
+ error: 'Task description required',
39
+ usage: `/sparc ${mode} <task_description>`
40
+ };
41
+ }
42
+
43
+ console.log(`🎯 SPARC ${mode.toUpperCase()}: ${task}`);
44
+
45
+ const sparcPrompt = `
46
+ 🎯 **SPARC Methodology - ${modes[mode]}**
47
+
48
+ **Task**: ${task}
49
+
50
+ **Phase**: ${mode.toUpperCase()}
51
+ **Description**: ${modes[mode]}
52
+
53
+ **Instructions for ${mode.toUpperCase()} phase**:
54
+ ${this.getPhaseInstructions(mode)}
55
+
56
+ **Execute this SPARC phase now**:
57
+ `;
58
+
59
+ return {
60
+ success: true,
61
+ prompt: sparcPrompt,
62
+ mode: `sparc-${mode}`,
63
+ task: task,
64
+ timestamp: new Date().toISOString()
65
+ };
66
+ }
67
+
68
+ getPhaseInstructions(mode) {
69
+ const instructions = {
70
+ 'spec': `
71
+ - Define clear requirements and acceptance criteria
72
+ - Create user stories and use cases
73
+ - Identify constraints and assumptions
74
+ - Specify input/output requirements
75
+ - Document functional and non-functional requirements`,
76
+
77
+ 'pseudo': `
78
+ - Break down the problem into logical steps
79
+ - Write high-level algorithm pseudocode
80
+ - Define data structures and flow
81
+ - Identify key functions and modules
82
+ - Plan error handling and edge cases`,
83
+
84
+ 'arch': `
85
+ - Design system architecture and components
86
+ - Define interfaces and APIs
87
+ - Choose appropriate patterns and technologies
88
+ - Plan data flow and storage
89
+ - Consider scalability and maintainability`,
90
+
91
+ 'refine': `
92
+ - Review and improve the design
93
+ - Optimize algorithms and data structures
94
+ - Refactor for clarity and efficiency
95
+ - Add comprehensive error handling
96
+ - Enhance documentation and comments`,
97
+
98
+ 'complete': `
99
+ - Implement the final solution
100
+ - Write comprehensive tests
101
+ - Perform integration testing
102
+ - Document usage and deployment
103
+ - Prepare for production deployment`
104
+ };
105
+
106
+ return instructions[mode] || 'Execute the specified SPARC phase';
107
+ }
108
+ }
109
+
110
+ export default SparcCommand;