claude-flow-novice 1.1.9 → 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 (60) 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 +14 -2
  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/slash-commands/mcp-slash-integration.js +146 -0
  59. package/package.json +17 -5
  60. package/src/slash-commands/mcp-slash-integration.js +146 -0
@@ -0,0 +1,223 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Validate All Slash Commands
5
+ *
6
+ * Tests that all slash commands are properly implemented and working
7
+ */
8
+
9
+ import { globalRegistry, executeSlashCommand } from './register-all-commands.js';
10
+
11
+ /**
12
+ * Command Validator
13
+ */
14
+ export class CommandValidator {
15
+ constructor() {
16
+ this.registry = globalRegistry;
17
+ this.results = [];
18
+ }
19
+
20
+ /**
21
+ * Validate all commands
22
+ */
23
+ async validateAll() {
24
+ console.log('šŸ” Validating all slash commands...');
25
+
26
+ const commands = this.registry.listCommands();
27
+
28
+ for (const cmd of commands) {
29
+ await this.validateCommand(cmd.name);
30
+ }
31
+
32
+ this.printResults();
33
+ return this.results;
34
+ }
35
+
36
+ /**
37
+ * Validate individual command
38
+ * @param {string} commandName - Command to validate
39
+ */
40
+ async validateCommand(commandName) {
41
+ const result = {
42
+ command: commandName,
43
+ tests: {
44
+ help: false,
45
+ execute: false,
46
+ errorHandling: false
47
+ },
48
+ errors: []
49
+ };
50
+
51
+ try {
52
+ // Test 1: Help functionality
53
+ const helpResult = this.registry.getHelp(commandName);
54
+ result.tests.help = helpResult.success;
55
+ if (!helpResult.success) {
56
+ result.errors.push(`Help failed: ${helpResult.error}`);
57
+ }
58
+
59
+ // Test 2: Basic execution (should fail gracefully with no args)
60
+ try {
61
+ const execResult = await executeSlashCommand(`/${commandName}`);
62
+ result.tests.execute = true;
63
+ } catch (error) {
64
+ result.tests.execute = false;
65
+ result.errors.push(`Execution failed: ${error.message}`);
66
+ }
67
+
68
+ // Test 3: Error handling (invalid args)
69
+ try {
70
+ const errorResult = await executeSlashCommand(`/${commandName} invalid-arg-test`);
71
+ result.tests.errorHandling = true;
72
+ } catch (error) {
73
+ result.tests.errorHandling = false;
74
+ result.errors.push(`Error handling failed: ${error.message}`);
75
+ }
76
+
77
+ } catch (error) {
78
+ result.errors.push(`Validation failed: ${error.message}`);
79
+ }
80
+
81
+ this.results.push(result);
82
+ }
83
+
84
+ /**
85
+ * Print validation results
86
+ */
87
+ printResults() {
88
+ console.log('\nšŸ“ˆ **VALIDATION RESULTS**\n');
89
+
90
+ let totalTests = 0;
91
+ let passedTests = 0;
92
+
93
+ for (const result of this.results) {
94
+ const tests = Object.values(result.tests);
95
+ const passed = tests.filter(t => t).length;
96
+ const total = tests.length;
97
+
98
+ totalTests += total;
99
+ passedTests += passed;
100
+
101
+ const status = passed === total ? 'āœ…' : 'āš ļø';
102
+ console.log(`${status} /${result.command} - ${passed}/${total} tests passed`);
103
+
104
+ if (result.errors.length > 0) {
105
+ result.errors.forEach(error => {
106
+ console.log(` āŒ ${error}`);
107
+ });
108
+ }
109
+ }
110
+
111
+ console.log(`\nšŸ“‰ **Overall: ${passedTests}/${totalTests} tests passed**`);
112
+
113
+ if (passedTests === totalTests) {
114
+ console.log('āœ… All commands validated successfully!');
115
+ } else {
116
+ console.log('āš ļø Some commands need attention.');
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Test specific command with args
122
+ * @param {string} commandName - Command name
123
+ * @param {string[]} args - Arguments to test
124
+ */
125
+ async testCommand(commandName, args = []) {
126
+ const input = `/${commandName} ${args.join(' ')}`.trim();
127
+
128
+ console.log(`\nšŸ” Testing: ${input}`);
129
+
130
+ try {
131
+ const result = await executeSlashCommand(input);
132
+
133
+ if (result.success) {
134
+ console.log('āœ… Command executed successfully');
135
+ if (result.result && result.result.prompt) {
136
+ console.log('Generated prompt preview:');
137
+ console.log(result.result.prompt.substring(0, 200) + '...');
138
+ }
139
+ } else {
140
+ console.log(`āš ļø Command failed: ${result.error}`);
141
+ }
142
+
143
+ return result;
144
+ } catch (error) {
145
+ console.log(`āŒ Test failed: ${error.message}`);
146
+ return { success: false, error: error.message };
147
+ }
148
+ }
149
+ }
150
+
151
+ /**
152
+ * Run interactive command testing
153
+ */
154
+ export async function interactiveTest() {
155
+ const validator = new CommandValidator();
156
+
157
+ console.log('šŸš€ **INTERACTIVE COMMAND TESTING**\n');
158
+
159
+ // Test each command with example arguments
160
+ const testCases = [
161
+ { command: 'swarm', args: ['init', 'mesh', '8'] },
162
+ { command: 'hooks', args: ['enable'] },
163
+ { command: 'neural', args: ['status'] },
164
+ { command: 'performance', args: ['report'] },
165
+ { command: 'github', args: ['analyze', 'owner/repo'] },
166
+ { command: 'workflow', args: ['create', 'Test Workflow'] },
167
+ { command: 'sparc', args: ['spec', 'Build API'] }
168
+ ];
169
+
170
+ for (const testCase of testCases) {
171
+ await validator.testCommand(testCase.command, testCase.args);
172
+
173
+ // Small delay for readability
174
+ await new Promise(resolve => setTimeout(resolve, 100));
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Quick validation - just check structure
180
+ */
181
+ export function quickValidation() {
182
+ console.log('⚔ **QUICK VALIDATION**\n');
183
+
184
+ const commands = globalRegistry.listCommands();
185
+
186
+ console.log(`āœ… Registry loaded with ${commands.length} commands`);
187
+
188
+ commands.forEach(cmd => {
189
+ console.log(`āœ… /${cmd.name} - ${cmd.description}`);
190
+ if (cmd.aliases.length > 0) {
191
+ console.log(` Aliases: ${cmd.aliases.map(a => `/${a}`).join(', ')}`);
192
+ }
193
+ });
194
+
195
+ console.log('\nāœ… All commands loaded successfully!');
196
+ }
197
+
198
+ // Main execution
199
+ if (import.meta.url === `file://${process.argv[1]}`) {
200
+ const mode = process.argv[2] || 'quick';
201
+
202
+ switch (mode) {
203
+ case 'full':
204
+ const validator = new CommandValidator();
205
+ await validator.validateAll();
206
+ break;
207
+
208
+ case 'interactive':
209
+ await interactiveTest();
210
+ break;
211
+
212
+ case 'quick':
213
+ default:
214
+ quickValidation();
215
+ break;
216
+ }
217
+ }
218
+
219
+ export default {
220
+ CommandValidator,
221
+ interactiveTest,
222
+ quickValidation
223
+ };