claude-flow-novice 1.1.9 ā 1.2.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.
- package/.claude/SLASH-COMMANDS-READY.md +53 -0
- package/.claude/WORKING-SETUP.md +67 -0
- package/.claude/commands/README.md +157 -0
- package/.claude/commands/claude-md.js +237 -0
- package/.claude/commands/claude-md.md +64 -0
- package/.claude/commands/claude-soul.js +562 -0
- package/.claude/commands/claude-soul.md +22 -0
- package/.claude/commands/cli-integration.js +216 -0
- package/.claude/commands/dependency-recommendations.md +171 -0
- package/.claude/commands/github.js +638 -0
- package/.claude/commands/github.md +221 -0
- package/.claude/commands/hooks.js +648 -0
- package/.claude/commands/hooks.md +38 -0
- package/.claude/commands/index.js +115 -0
- package/.claude/commands/neural.js +572 -0
- package/.claude/commands/neural.md +39 -0
- package/.claude/commands/performance.js +582 -0
- package/.claude/commands/performance.md +41 -0
- package/.claude/commands/register-all-commands.js +314 -0
- package/.claude/commands/register-claude-md.js +82 -0
- package/.claude/commands/register-claude-soul.js +80 -0
- package/.claude/commands/sparc.js +110 -0
- package/.claude/commands/sparc.md +46 -0
- package/.claude/commands/suggest-improvements.md +95 -0
- package/.claude/commands/suggest-templates.md +147 -0
- package/.claude/commands/swarm.js +423 -0
- package/.claude/commands/swarm.md +24 -0
- package/.claude/commands/validate-commands.js +223 -0
- package/.claude/commands/workflow.js +606 -0
- package/.claude/commands/workflow.md +295 -0
- package/.claude/core/agent-manager.js +80 -0
- package/.claude/core/agent-manager.js.map +1 -0
- package/.claude/core/config.js +1221 -0
- package/.claude/core/config.js.map +1 -0
- package/.claude/core/event-bus.js +136 -0
- package/.claude/core/event-bus.js.map +1 -0
- package/.claude/core/index.js +6 -0
- package/.claude/core/index.js.map +1 -0
- package/.claude/core/json-persistence.js +112 -0
- package/.claude/core/json-persistence.js.map +1 -0
- package/.claude/core/logger.js +245 -0
- package/.claude/core/logger.js.map +1 -0
- package/.claude/core/orchestrator-fixed.js +236 -0
- package/.claude/core/orchestrator-fixed.js.map +1 -0
- package/.claude/core/orchestrator.js +1136 -0
- package/.claude/core/orchestrator.js.map +1 -0
- package/.claude/core/persistence.js +185 -0
- package/.claude/core/persistence.js.map +1 -0
- package/.claude/core/project-manager.js +80 -0
- package/.claude/core/project-manager.js.map +1 -0
- package/.claude/core/slash-command.js +24 -0
- package/.claude/core/version.js +35 -0
- package/.claude/core/version.js.map +1 -0
- package/.claude/slash-commands.json +92 -0
- package/dist/mcp/mcp-server-novice.js +14 -2
- package/dist/mcp/mcp-server-sdk.js +649 -0
- package/dist/mcp/mcp-server-with-slash-commands.js +776 -0
- package/dist/src/slash-commands/mcp-slash-integration.js +146 -0
- package/package.json +18 -6
- 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
|
+
};
|