claude-flow-novice 1.1.8 → 1.1.9

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 (30) hide show
  1. package/dist/mcp/mcp-server-novice.js +10 -2
  2. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +271 -0
  3. package/dist/src/slash-commands/README.md +157 -0
  4. package/dist/src/slash-commands/claude-md.js +237 -0
  5. package/dist/src/slash-commands/claude-soul.js +562 -0
  6. package/dist/src/slash-commands/cli-integration.js +216 -0
  7. package/dist/src/slash-commands/github.js +638 -0
  8. package/dist/src/slash-commands/hooks.js +648 -0
  9. package/dist/src/slash-commands/index.js +115 -0
  10. package/dist/src/slash-commands/neural.js +572 -0
  11. package/dist/src/slash-commands/performance.js +582 -0
  12. package/dist/src/slash-commands/register-all-commands.js +314 -0
  13. package/dist/src/slash-commands/register-claude-md.js +82 -0
  14. package/dist/src/slash-commands/register-claude-soul.js +80 -0
  15. package/dist/src/slash-commands/sparc.js +110 -0
  16. package/dist/src/slash-commands/swarm.js +423 -0
  17. package/dist/src/slash-commands/validate-commands.js +223 -0
  18. package/dist/src/slash-commands/workflow.js +606 -0
  19. package/package.json +8 -7
  20. package/src/slash-commands/cli-integration.js +216 -0
  21. package/src/slash-commands/github.js +638 -0
  22. package/src/slash-commands/hooks.js +648 -0
  23. package/src/slash-commands/index.js +115 -0
  24. package/src/slash-commands/neural.js +572 -0
  25. package/src/slash-commands/performance.js +582 -0
  26. package/src/slash-commands/register-all-commands.js +314 -0
  27. package/src/slash-commands/sparc.js +110 -0
  28. package/src/slash-commands/swarm.js +423 -0
  29. package/src/slash-commands/validate-commands.js +223 -0
  30. package/src/slash-commands/workflow.js +606 -0
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Slash Commands Index
5
+ *
6
+ * Exports all slash commands and utilities
7
+ */
8
+
9
+ // Base command class
10
+ export { SlashCommand } from '../core/slash-command.js';
11
+
12
+ // Individual command classes
13
+ export { SparcCommand } from './sparc.js';
14
+ export { SwarmCommand } from './swarm.js';
15
+ export { HooksCommand } from './hooks.js';
16
+ export { NeuralCommand } from './neural.js';
17
+ export { PerformanceCommand } from './performance.js';
18
+ export { GitHubCommand } from './github.js';
19
+ export { WorkflowCommand } from './workflow.js';
20
+ export { ClaudeMdSlashCommand } from './claude-md.js';
21
+
22
+ // Command executors
23
+ export { executeClaudeSoulCommand } from './claude-soul.js';
24
+ export { executeClaudeMdCommand } from './claude-md.js';
25
+
26
+ // Registry and utilities
27
+ export {
28
+ SlashCommandRegistry,
29
+ globalRegistry,
30
+ executeSlashCommand,
31
+ getAllCommands,
32
+ getCommandHelp,
33
+ registerCommand
34
+ } from './register-all-commands.js';
35
+
36
+ // Registration functions
37
+ export { registerClaudeSoulCommand } from './register-claude-soul.js';
38
+ export { default as registerClaudeMd } from './register-claude-md.js';
39
+
40
+ /**
41
+ * Quick access to commonly used commands
42
+ */
43
+ export const Commands = {
44
+ SPARC: 'sparc',
45
+ SWARM: 'swarm',
46
+ HOOKS: 'hooks',
47
+ NEURAL: 'neural',
48
+ PERFORMANCE: 'performance',
49
+ GITHUB: 'github',
50
+ WORKFLOW: 'workflow',
51
+ CLAUDE_MD: 'claude-md',
52
+ CLAUDE_SOUL: 'claude-soul'
53
+ };
54
+
55
+ /**
56
+ * Command aliases for quick access
57
+ */
58
+ export const Aliases = {
59
+ s: 'swarm',
60
+ h: 'hooks',
61
+ n: 'neural',
62
+ p: 'performance',
63
+ perf: 'performance',
64
+ gh: 'github',
65
+ git: 'github',
66
+ w: 'workflow',
67
+ wf: 'workflow'
68
+ };
69
+
70
+ /**
71
+ * Initialize all slash commands
72
+ * @returns {SlashCommandRegistry} - Initialized registry
73
+ */
74
+ export function initializeSlashCommands() {
75
+ console.log('🚀 Initializing Claude-Flow slash commands...');
76
+
77
+ // Registry is automatically initialized when imported
78
+ const commandCount = globalRegistry.listCommands().length;
79
+
80
+ console.log(`✅ Initialized ${commandCount} slash commands`);
81
+ console.log('Available commands:', Object.values(Commands).join(', '));
82
+
83
+ return globalRegistry;
84
+ }
85
+
86
+ /**
87
+ * Get quick help text
88
+ */
89
+ export function getQuickHelp() {
90
+ return `
91
+ 🚀 **CLAUDE-FLOW SLASH COMMANDS**
92
+
93
+ **Essential Commands:**
94
+ - \`/swarm init mesh 8\` - Initialize agent swarm
95
+ - \`/hooks enable\` - Enable automation hooks
96
+ - \`/sparc spec "task"\` - Run SPARC methodology
97
+ - \`/neural train coordination\` - Train neural patterns
98
+ - \`/performance report\` - Generate performance report
99
+ - \`/github analyze repo\` - Analyze GitHub repository
100
+ - \`/workflow create "name"\` - Create automated workflow
101
+
102
+ **For full help:** Use \`/help\` or see individual command documentation
103
+ `;
104
+ }
105
+
106
+ export default {
107
+ Commands,
108
+ Aliases,
109
+ globalRegistry,
110
+ executeSlashCommand,
111
+ getAllCommands,
112
+ getCommandHelp,
113
+ initializeSlashCommands,
114
+ getQuickHelp
115
+ };
@@ -0,0 +1,572 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Neural Networks Slash Command
5
+ * Usage: /neural <action> [options]
6
+ */
7
+
8
+ import { SlashCommand } from '../core/slash-command.js';
9
+
10
+ export class NeuralCommand extends SlashCommand {
11
+ constructor() {
12
+ super('neural', 'Manage neural networks and AI training for agent coordination');
13
+ }
14
+
15
+ getUsage() {
16
+ return '/neural <action> [options]';
17
+ }
18
+
19
+ getExamples() {
20
+ return [
21
+ '/neural status - Check neural network status',
22
+ '/neural train coordination 50 - Train coordination patterns for 50 epochs',
23
+ '/neural patterns analyze - Analyze cognitive patterns',
24
+ '/neural predict "task completion" - Make AI predictions',
25
+ '/neural compress model-123 0.5 - Compress neural model by 50%',
26
+ '/neural ensemble create - Create model ensemble',
27
+ '/neural explain prediction-456 - Get AI explainability'
28
+ ];
29
+ }
30
+
31
+ async execute(args, context) {
32
+ const [action, ...params] = args;
33
+
34
+ if (!action) {
35
+ return this.formatResponse({
36
+ success: false,
37
+ error: 'Action required',
38
+ usage: this.getUsage(),
39
+ availableActions: [
40
+ 'status', 'train', 'patterns', 'predict', 'compress',
41
+ 'ensemble', 'explain', 'transfer', 'load', 'save'
42
+ ]
43
+ });
44
+ }
45
+
46
+ try {
47
+ let result;
48
+
49
+ switch (action.toLowerCase()) {
50
+ case 'status':
51
+ result = await this.getStatus(params);
52
+ break;
53
+
54
+ case 'train':
55
+ result = await this.trainModel(params);
56
+ break;
57
+
58
+ case 'patterns':
59
+ result = await this.analyzePatterns(params);
60
+ break;
61
+
62
+ case 'predict':
63
+ result = await this.makePrediction(params);
64
+ break;
65
+
66
+ case 'compress':
67
+ result = await this.compressModel(params);
68
+ break;
69
+
70
+ case 'ensemble':
71
+ result = await this.manageEnsemble(params);
72
+ break;
73
+
74
+ case 'explain':
75
+ result = await this.explainPrediction(params);
76
+ break;
77
+
78
+ case 'transfer':
79
+ result = await this.transferLearning(params);
80
+ break;
81
+
82
+ case 'load':
83
+ result = await this.loadModel(params);
84
+ break;
85
+
86
+ case 'save':
87
+ result = await this.saveModel(params);
88
+ break;
89
+
90
+ default:
91
+ result = {
92
+ success: false,
93
+ error: `Unknown action: ${action}`,
94
+ availableActions: [
95
+ 'status', 'train', 'patterns', 'predict', 'compress',
96
+ 'ensemble', 'explain', 'transfer', 'load', 'save'
97
+ ]
98
+ };
99
+ }
100
+
101
+ return this.formatResponse(result);
102
+ } catch (error) {
103
+ return this.formatResponse({
104
+ success: false,
105
+ error: error.message,
106
+ action: action
107
+ });
108
+ }
109
+ }
110
+
111
+ async getStatus(params) {
112
+ const [modelId] = params;
113
+
114
+ console.log(`🧠 Checking neural network status${modelId ? ` for model: ${modelId}` : ''}...`);
115
+
116
+ const prompt = `
117
+ 🧠 **NEURAL NETWORK STATUS**
118
+
119
+ **Check neural network status and performance:**
120
+
121
+ \`\`\`javascript
122
+ // Get neural status with MCP tools
123
+ mcp__claude-flow__neural_status(${modelId ? `{ modelId: "${modelId}" }` : '{}'});
124
+
125
+ // Check cognitive patterns
126
+ mcp__claude-flow__neural_patterns({ action: "analyze" });
127
+
128
+ // Get performance metrics
129
+ mcp__claude-flow__performance_report({ format: "neural" });
130
+ \`\`\`
131
+
132
+ **Status Information:**
133
+ - Neural model health and performance
134
+ - Training progress and accuracy
135
+ - Resource utilization
136
+ - Pattern recognition capabilities
137
+ - WASM SIMD optimization status
138
+
139
+ **Execute neural status check now**:
140
+ `;
141
+
142
+ return {
143
+ success: true,
144
+ prompt: prompt,
145
+ modelId: modelId
146
+ };
147
+ }
148
+
149
+ async trainModel(params) {
150
+ const [patternType, epochs = '50', trainingData] = params;
151
+
152
+ if (!patternType) {
153
+ return {
154
+ success: false,
155
+ error: 'Pattern type required',
156
+ availableTypes: ['coordination', 'optimization', 'prediction']
157
+ };
158
+ }
159
+
160
+ const epochCount = parseInt(epochs);
161
+ if (isNaN(epochCount) || epochCount < 1 || epochCount > 1000) {
162
+ return {
163
+ success: false,
164
+ error: 'Epochs must be between 1 and 1000'
165
+ };
166
+ }
167
+
168
+ console.log(`🎯 Training ${patternType} patterns for ${epochCount} epochs...`);
169
+
170
+ const prompt = `
171
+ 🎯 **NEURAL NETWORK TRAINING**
172
+
173
+ **Configuration:**
174
+ - Pattern Type: ${patternType}
175
+ - Epochs: ${epochCount}
176
+ - Training Data: ${trainingData || 'auto-generated'}
177
+
178
+ **Start neural training:**
179
+
180
+ \`\`\`javascript
181
+ // Train neural patterns with WASM SIMD acceleration
182
+ mcp__claude-flow__neural_train({
183
+ pattern_type: "${patternType}",
184
+ epochs: ${epochCount},
185
+ training_data: "${trainingData || 'agent-coordination-data'}"
186
+ });
187
+
188
+ // Enable WASM optimization
189
+ mcp__claude-flow__wasm_optimize({ operation: "neural-training" });
190
+
191
+ // Monitor training progress
192
+ mcp__claude-flow__neural_status({ modelId: "training-${Date.now()}" });
193
+ \`\`\`
194
+
195
+ **Training Features:**
196
+ - ✅ WASM SIMD acceleration for 2.8-4.4x speed
197
+ - ✅ Adaptive learning algorithms
198
+ - ✅ Pattern recognition optimization
199
+ - ✅ Real-time performance monitoring
200
+ - ✅ Automatic checkpoint saving
201
+
202
+ **Execute neural training now**:
203
+ `;
204
+
205
+ return {
206
+ success: true,
207
+ prompt: prompt,
208
+ patternType: patternType,
209
+ epochs: epochCount,
210
+ trainingData: trainingData
211
+ };
212
+ }
213
+
214
+ async analyzePatterns(params) {
215
+ const [action = 'analyze', operation, outcome] = params;
216
+
217
+ console.log(`🔍 Analyzing cognitive patterns with action: ${action}`);
218
+
219
+ const prompt = `
220
+ 🔍 **COGNITIVE PATTERN ANALYSIS**
221
+
222
+ **Action:** ${action}
223
+
224
+ **Analyze cognitive and coordination patterns:**
225
+
226
+ \`\`\`javascript
227
+ // Analyze cognitive patterns
228
+ mcp__claude-flow__neural_patterns({
229
+ action: "${action}",
230
+ ${operation ? `operation: "${operation}",` : ''}
231
+ ${outcome ? `outcome: "${outcome}"` : ''}
232
+ });
233
+
234
+ // Pattern recognition
235
+ mcp__claude-flow__pattern_recognize({
236
+ data: ["current-agent-behaviors"],
237
+ patterns: ["convergent", "divergent", "lateral", "systems"]
238
+ });
239
+
240
+ // Cognitive behavior analysis
241
+ mcp__claude-flow__cognitive_analyze({
242
+ behavior: "${action}-pattern"
243
+ });
244
+ \`\`\`
245
+
246
+ **Pattern Types:**
247
+ - 🎯 Convergent thinking patterns
248
+ - 🎆 Divergent creativity patterns
249
+ - 🔄 Lateral problem-solving
250
+ - 🌐 Systems thinking
251
+ - ⚙️ Critical analysis patterns
252
+ - 🎨 Abstract reasoning
253
+
254
+ **Execute pattern analysis now**:
255
+ `;
256
+
257
+ return {
258
+ success: true,
259
+ prompt: prompt,
260
+ action: action,
261
+ operation: operation,
262
+ outcome: outcome
263
+ };
264
+ }
265
+
266
+ async makePrediction(params) {
267
+ const input = params.join(' ');
268
+
269
+ if (!input) {
270
+ return {
271
+ success: false,
272
+ error: 'Input required for prediction'
273
+ };
274
+ }
275
+
276
+ console.log(`🔮 Making AI prediction for: ${input}`);
277
+
278
+ const prompt = `
279
+ 🔮 **AI PREDICTION**
280
+
281
+ **Input:** ${input}
282
+
283
+ **Generate AI predictions:**
284
+
285
+ \`\`\`javascript
286
+ // Make neural predictions
287
+ mcp__claude-flow__neural_predict({
288
+ modelId: "coordination-model",
289
+ input: "${input}"
290
+ });
291
+
292
+ // Run inference
293
+ mcp__claude-flow__inference_run({
294
+ modelId: "coordination-model",
295
+ data: ["${input}"]
296
+ });
297
+ \`\`\`
298
+
299
+ **Prediction Capabilities:**
300
+ - Task completion probability
301
+ - Resource requirements estimation
302
+ - Performance optimization suggestions
303
+ - Coordination efficiency predictions
304
+ - Risk assessment and mitigation
305
+
306
+ **Execute AI prediction now**:
307
+ `;
308
+
309
+ return {
310
+ success: true,
311
+ prompt: prompt,
312
+ input: input
313
+ };
314
+ }
315
+
316
+ async compressModel(params) {
317
+ const [modelId, ratio = '0.5'] = params;
318
+
319
+ if (!modelId) {
320
+ return {
321
+ success: false,
322
+ error: 'Model ID required for compression'
323
+ };
324
+ }
325
+
326
+ const compressionRatio = parseFloat(ratio);
327
+ if (isNaN(compressionRatio) || compressionRatio <= 0 || compressionRatio >= 1) {
328
+ return {
329
+ success: false,
330
+ error: 'Compression ratio must be between 0 and 1'
331
+ };
332
+ }
333
+
334
+ console.log(`🗃️ Compressing model ${modelId} by ${(compressionRatio * 100).toFixed(1)}%...`);
335
+
336
+ const prompt = `
337
+ 🗃️ **NEURAL MODEL COMPRESSION**
338
+
339
+ **Model ID:** ${modelId}
340
+ **Compression Ratio:** ${(compressionRatio * 100).toFixed(1)}%
341
+
342
+ **Compress neural model:**
343
+
344
+ \`\`\`javascript
345
+ // Compress neural model
346
+ mcp__claude-flow__neural_compress({
347
+ modelId: "${modelId}",
348
+ ratio: ${compressionRatio}
349
+ });
350
+ \`\`\`
351
+
352
+ **Compression Benefits:**
353
+ - ⚙️ Reduced memory usage
354
+ - ⚡ Faster inference speed
355
+ - 💾 Smaller storage footprint
356
+ - 🚀 Improved deployment efficiency
357
+
358
+ **Execute model compression now**:
359
+ `;
360
+
361
+ return {
362
+ success: true,
363
+ prompt: prompt,
364
+ modelId: modelId,
365
+ compressionRatio: compressionRatio
366
+ };
367
+ }
368
+
369
+ async manageEnsemble(params) {
370
+ const [action = 'create', ...models] = params;
371
+
372
+ console.log(`🎵 Managing model ensemble: ${action}`);
373
+
374
+ const prompt = `
375
+ 🎵 **MODEL ENSEMBLE MANAGEMENT**
376
+
377
+ **Action:** ${action}
378
+ **Models:** ${models.length > 0 ? models.join(', ') : 'auto-select'}
379
+
380
+ **Manage model ensemble:**
381
+
382
+ \`\`\`javascript
383
+ // Create model ensemble
384
+ mcp__claude-flow__ensemble_create({
385
+ models: [${models.length > 0 ? models.map(m => `"${m}"`).join(', ') : '"coordination-model", "optimization-model", "prediction-model"'}],
386
+ strategy: "voting"
387
+ });
388
+ \`\`\`
389
+
390
+ **Ensemble Benefits:**
391
+ - 🎯 Improved accuracy through model combination
392
+ - 🔄 Robust predictions with multiple perspectives
393
+ - ⚙️ Reduced overfitting risk
394
+ - 📈 Enhanced performance metrics
395
+
396
+ **Execute ensemble management now**:
397
+ `;
398
+
399
+ return {
400
+ success: true,
401
+ prompt: prompt,
402
+ action: action,
403
+ models: models
404
+ };
405
+ }
406
+
407
+ async explainPrediction(params) {
408
+ const [predictionId] = params;
409
+
410
+ if (!predictionId) {
411
+ return {
412
+ success: false,
413
+ error: 'Prediction ID required for explainability'
414
+ };
415
+ }
416
+
417
+ console.log(`🔎 Explaining prediction: ${predictionId}`);
418
+
419
+ const prompt = `
420
+ 🔎 **AI EXPLAINABILITY**
421
+
422
+ **Prediction ID:** ${predictionId}
423
+
424
+ **Generate AI explanation:**
425
+
426
+ \`\`\`javascript
427
+ // Get AI explainability
428
+ mcp__claude-flow__neural_explain({
429
+ modelId: "coordination-model",
430
+ prediction: { id: "${predictionId}" }
431
+ });
432
+ \`\`\`
433
+
434
+ **Explainability Features:**
435
+ - 📊 Feature importance analysis
436
+ - 🔄 Decision path visualization
437
+ - ⚙️ Model behavior interpretation
438
+ - 🎯 Confidence score breakdown
439
+ - 📝 Human-readable explanations
440
+
441
+ **Execute AI explanation now**:
442
+ `;
443
+
444
+ return {
445
+ success: true,
446
+ prompt: prompt,
447
+ predictionId: predictionId
448
+ };
449
+ }
450
+
451
+ async transferLearning(params) {
452
+ const [sourceModel, targetDomain] = params;
453
+
454
+ if (!sourceModel || !targetDomain) {
455
+ return {
456
+ success: false,
457
+ error: 'Source model and target domain required for transfer learning'
458
+ };
459
+ }
460
+
461
+ console.log(`🔄 Transfer learning from ${sourceModel} to ${targetDomain}...`);
462
+
463
+ const prompt = `
464
+ 🔄 **TRANSFER LEARNING**
465
+
466
+ **Source Model:** ${sourceModel}
467
+ **Target Domain:** ${targetDomain}
468
+
469
+ **Execute transfer learning:**
470
+
471
+ \`\`\`javascript
472
+ // Transfer learning
473
+ mcp__claude-flow__transfer_learn({
474
+ sourceModel: "${sourceModel}",
475
+ targetDomain: "${targetDomain}"
476
+ });
477
+ \`\`\`
478
+
479
+ **Transfer Learning Benefits:**
480
+ - ⚡ Faster training on new domains
481
+ - 🎯 Leverages existing knowledge
482
+ - 📉 Reduced data requirements
483
+ - ⚙️ Improved generalization
484
+
485
+ **Execute transfer learning now**:
486
+ `;
487
+
488
+ return {
489
+ success: true,
490
+ prompt: prompt,
491
+ sourceModel: sourceModel,
492
+ targetDomain: targetDomain
493
+ };
494
+ }
495
+
496
+ async loadModel(params) {
497
+ const [modelPath] = params;
498
+
499
+ if (!modelPath) {
500
+ return {
501
+ success: false,
502
+ error: 'Model path required for loading'
503
+ };
504
+ }
505
+
506
+ console.log(`📥 Loading model from: ${modelPath}`);
507
+
508
+ const prompt = `
509
+ 📥 **LOAD NEURAL MODEL**
510
+
511
+ **Model Path:** ${modelPath}
512
+
513
+ **Load pre-trained model:**
514
+
515
+ \`\`\`javascript
516
+ // Load pre-trained model
517
+ mcp__claude-flow__model_load({
518
+ modelPath: "${modelPath}"
519
+ });
520
+ \`\`\`
521
+
522
+ **Execute model loading now**:
523
+ `;
524
+
525
+ return {
526
+ success: true,
527
+ prompt: prompt,
528
+ modelPath: modelPath
529
+ };
530
+ }
531
+
532
+ async saveModel(params) {
533
+ const [modelId, path] = params;
534
+
535
+ if (!modelId || !path) {
536
+ return {
537
+ success: false,
538
+ error: 'Model ID and path required for saving'
539
+ };
540
+ }
541
+
542
+ console.log(`💾 Saving model ${modelId} to: ${path}`);
543
+
544
+ const prompt = `
545
+ 💾 **SAVE NEURAL MODEL**
546
+
547
+ **Model ID:** ${modelId}
548
+ **Save Path:** ${path}
549
+
550
+ **Save trained model:**
551
+
552
+ \`\`\`javascript
553
+ // Save trained model
554
+ mcp__claude-flow__model_save({
555
+ modelId: "${modelId}",
556
+ path: "${path}"
557
+ });
558
+ \`\`\`
559
+
560
+ **Execute model saving now**:
561
+ `;
562
+
563
+ return {
564
+ success: true,
565
+ prompt: prompt,
566
+ modelId: modelId,
567
+ path: path
568
+ };
569
+ }
570
+ }
571
+
572
+ export default NeuralCommand;