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.
- package/dist/mcp/mcp-server-novice.js +10 -2
- package/dist/src/cli/simple-commands/hooks/session-start-soul.js +271 -0
- package/dist/src/slash-commands/README.md +157 -0
- package/dist/src/slash-commands/claude-md.js +237 -0
- package/dist/src/slash-commands/claude-soul.js +562 -0
- package/dist/src/slash-commands/cli-integration.js +216 -0
- package/dist/src/slash-commands/github.js +638 -0
- package/dist/src/slash-commands/hooks.js +648 -0
- package/dist/src/slash-commands/index.js +115 -0
- package/dist/src/slash-commands/neural.js +572 -0
- package/dist/src/slash-commands/performance.js +582 -0
- package/dist/src/slash-commands/register-all-commands.js +314 -0
- package/dist/src/slash-commands/register-claude-md.js +82 -0
- package/dist/src/slash-commands/register-claude-soul.js +80 -0
- package/dist/src/slash-commands/sparc.js +110 -0
- package/dist/src/slash-commands/swarm.js +423 -0
- package/dist/src/slash-commands/validate-commands.js +223 -0
- package/dist/src/slash-commands/workflow.js +606 -0
- package/package.json +8 -7
- package/src/slash-commands/cli-integration.js +216 -0
- package/src/slash-commands/github.js +638 -0
- package/src/slash-commands/hooks.js +648 -0
- package/src/slash-commands/index.js +115 -0
- package/src/slash-commands/neural.js +572 -0
- package/src/slash-commands/performance.js +582 -0
- package/src/slash-commands/register-all-commands.js +314 -0
- package/src/slash-commands/sparc.js +110 -0
- package/src/slash-commands/swarm.js +423 -0
- package/src/slash-commands/validate-commands.js +223 -0
- package/src/slash-commands/workflow.js +606 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Workflow Automation Slash Command
|
|
5
|
+
* Usage: /workflow <action> [options]
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { SlashCommand } from '../core/slash-command.js';
|
|
9
|
+
|
|
10
|
+
export class WorkflowCommand extends SlashCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
super('workflow', 'Create and manage automated workflows and CI/CD pipelines');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getUsage() {
|
|
16
|
+
return '/workflow <action> [options]';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getExamples() {
|
|
20
|
+
return [
|
|
21
|
+
'/workflow create "Build and Test" - Create new workflow',
|
|
22
|
+
'/workflow execute build-workflow - Execute existing workflow',
|
|
23
|
+
'/workflow pipeline nodejs - Create CI/CD pipeline',
|
|
24
|
+
'/workflow automate tests - Setup test automation',
|
|
25
|
+
'/workflow schedule daily - Setup scheduled workflows',
|
|
26
|
+
'/workflow template list - List available templates',
|
|
27
|
+
'/workflow trigger push - Setup event triggers'
|
|
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
|
+
'create', 'execute', 'pipeline', 'automate', 'schedule',
|
|
41
|
+
'template', 'trigger', 'export', 'batch', 'parallel'
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
let result;
|
|
48
|
+
|
|
49
|
+
switch (action.toLowerCase()) {
|
|
50
|
+
case 'create':
|
|
51
|
+
result = await this.createWorkflow(params);
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'execute':
|
|
55
|
+
result = await this.executeWorkflow(params);
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 'pipeline':
|
|
59
|
+
result = await this.createPipeline(params);
|
|
60
|
+
break;
|
|
61
|
+
|
|
62
|
+
case 'automate':
|
|
63
|
+
result = await this.setupAutomation(params);
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case 'schedule':
|
|
67
|
+
result = await this.setupScheduler(params);
|
|
68
|
+
break;
|
|
69
|
+
|
|
70
|
+
case 'template':
|
|
71
|
+
result = await this.manageTemplates(params);
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
case 'trigger':
|
|
75
|
+
result = await this.setupTriggers(params);
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case 'export':
|
|
79
|
+
result = await this.exportWorkflow(params);
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case 'batch':
|
|
83
|
+
result = await this.batchProcess(params);
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case 'parallel':
|
|
87
|
+
result = await this.parallelExecute(params);
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
default:
|
|
91
|
+
result = {
|
|
92
|
+
success: false,
|
|
93
|
+
error: `Unknown action: ${action}`,
|
|
94
|
+
availableActions: [
|
|
95
|
+
'create', 'execute', 'pipeline', 'automate', 'schedule',
|
|
96
|
+
'template', 'trigger', 'export', 'batch', 'parallel'
|
|
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 createWorkflow(params) {
|
|
112
|
+
const name = params.join(' ');
|
|
113
|
+
|
|
114
|
+
if (!name) {
|
|
115
|
+
return {
|
|
116
|
+
success: false,
|
|
117
|
+
error: 'Workflow name required'
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
console.log(`⚙️ Creating workflow: ${name}`);
|
|
122
|
+
|
|
123
|
+
const prompt = `
|
|
124
|
+
⚙️ **CREATE WORKFLOW**
|
|
125
|
+
|
|
126
|
+
**Workflow Name:** ${name}
|
|
127
|
+
|
|
128
|
+
**Create custom workflow with MCP coordination:**
|
|
129
|
+
|
|
130
|
+
\`\`\`javascript
|
|
131
|
+
// Create custom workflow
|
|
132
|
+
mcp__claude-flow__workflow_create({
|
|
133
|
+
name: "${name}",
|
|
134
|
+
steps: [
|
|
135
|
+
{ name: "initialize", type: "setup" },
|
|
136
|
+
{ name: "execute", type: "main" },
|
|
137
|
+
{ name: "validate", type: "test" },
|
|
138
|
+
{ name: "finalize", type: "cleanup" }
|
|
139
|
+
],
|
|
140
|
+
triggers: ["manual", "scheduled", "event"]
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Spawn workflow coordination agents with Claude Code's Task tool
|
|
144
|
+
Task("Workflow Designer", "Design and structure workflow: ${name}", "architect")
|
|
145
|
+
Task("Automation Engineer", "Implement workflow automation", "cicd-engineer")
|
|
146
|
+
Task("Quality Assurance", "Validate workflow steps and outcomes", "tester")
|
|
147
|
+
Task("Documentation Lead", "Document workflow process and usage", "api-docs")
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
**Workflow Features:**
|
|
151
|
+
- 🔄 Event-driven execution
|
|
152
|
+
- ⚡ Parallel step processing
|
|
153
|
+
- 📊 Real-time monitoring
|
|
154
|
+
- 🚫 Error handling and recovery
|
|
155
|
+
- 💾 State persistence
|
|
156
|
+
- 📝 Comprehensive logging
|
|
157
|
+
|
|
158
|
+
**Execute workflow creation now**:
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
success: true,
|
|
163
|
+
prompt: prompt,
|
|
164
|
+
workflowName: name,
|
|
165
|
+
workflowId: `workflow-${Date.now()}`
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async executeWorkflow(params) {
|
|
170
|
+
const [workflowId, ...paramList] = params;
|
|
171
|
+
|
|
172
|
+
if (!workflowId) {
|
|
173
|
+
return {
|
|
174
|
+
success: false,
|
|
175
|
+
error: 'Workflow ID required'
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.log(`🚀 Executing workflow: ${workflowId}`);
|
|
180
|
+
|
|
181
|
+
const prompt = `
|
|
182
|
+
🚀 **EXECUTE WORKFLOW**
|
|
183
|
+
|
|
184
|
+
**Workflow ID:** ${workflowId}
|
|
185
|
+
**Parameters:** ${paramList.join(', ') || 'default'}
|
|
186
|
+
|
|
187
|
+
**Execute predefined workflow:**
|
|
188
|
+
|
|
189
|
+
\`\`\`javascript
|
|
190
|
+
// Execute predefined workflow
|
|
191
|
+
mcp__claude-flow__workflow_execute({
|
|
192
|
+
workflowId: "${workflowId}",
|
|
193
|
+
params: {
|
|
194
|
+
${paramList.map((p, i) => `param${i + 1}: "${p}"`).join(',\n ')}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// Monitor workflow execution
|
|
199
|
+
mcp__claude-flow__task_status({ taskId: "${workflowId}" });
|
|
200
|
+
\`\`\`
|
|
201
|
+
|
|
202
|
+
**Execution Monitoring:**
|
|
203
|
+
- 📉 Real-time progress tracking
|
|
204
|
+
- ⚡ Performance metrics
|
|
205
|
+
- 🚫 Error detection and handling
|
|
206
|
+
- 💾 State checkpoints
|
|
207
|
+
- 📝 Execution logs
|
|
208
|
+
|
|
209
|
+
**Execute workflow now**:
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
success: true,
|
|
214
|
+
prompt: prompt,
|
|
215
|
+
workflowId: workflowId,
|
|
216
|
+
parameters: paramList
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async createPipeline(params) {
|
|
221
|
+
const [projectType = 'nodejs', ...features] = params;
|
|
222
|
+
|
|
223
|
+
console.log(`🚀 Creating CI/CD pipeline for ${projectType}...`);
|
|
224
|
+
|
|
225
|
+
const prompt = `
|
|
226
|
+
🚀 **CREATE CI/CD PIPELINE**
|
|
227
|
+
|
|
228
|
+
**Project Type:** ${projectType}
|
|
229
|
+
**Features:** ${features.length > 0 ? features.join(', ') : 'standard'}
|
|
230
|
+
|
|
231
|
+
**Create comprehensive CI/CD pipeline:**
|
|
232
|
+
|
|
233
|
+
\`\`\`javascript
|
|
234
|
+
// Create CI/CD pipeline
|
|
235
|
+
mcp__claude-flow__pipeline_create({
|
|
236
|
+
config: {
|
|
237
|
+
projectType: "${projectType}",
|
|
238
|
+
features: [${features.length > 0 ? features.map(f => `"${f}"`).join(', ') : '"build", "test", "deploy"'}],
|
|
239
|
+
stages: ["lint", "test", "build", "security", "deploy"]
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// Spawn pipeline setup agents with Claude Code's Task tool
|
|
244
|
+
Task("DevOps Engineer", "Setup CI/CD pipeline for ${projectType}", "cicd-engineer")
|
|
245
|
+
Task("Security Engineer", "Configure security scanning in pipeline", "security-manager")
|
|
246
|
+
Task("Test Engineer", "Setup automated testing pipeline", "tester")
|
|
247
|
+
Task("Deployment Specialist", "Configure deployment automation", "coordinator")
|
|
248
|
+
\`\`\`
|
|
249
|
+
|
|
250
|
+
**Pipeline Stages:**
|
|
251
|
+
- 📝 Code quality checks (linting, formatting)
|
|
252
|
+
- ⚙️ Automated testing (unit, integration, e2e)
|
|
253
|
+
- 🛠️ Build and compilation
|
|
254
|
+
- 🔒 Security scanning and vulnerability assessment
|
|
255
|
+
- 🚀 Automated deployment
|
|
256
|
+
- 📈 Performance monitoring
|
|
257
|
+
|
|
258
|
+
**Execute pipeline creation now**:
|
|
259
|
+
`;
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
success: true,
|
|
263
|
+
prompt: prompt,
|
|
264
|
+
projectType: projectType,
|
|
265
|
+
features: features
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
async setupAutomation(params) {
|
|
270
|
+
const rules = params.join(' ');
|
|
271
|
+
|
|
272
|
+
if (!rules) {
|
|
273
|
+
return {
|
|
274
|
+
success: false,
|
|
275
|
+
error: 'Automation rules required'
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
console.log(`🤖 Setting up automation: ${rules}`);
|
|
280
|
+
|
|
281
|
+
const prompt = `
|
|
282
|
+
🤖 **SETUP AUTOMATION**
|
|
283
|
+
|
|
284
|
+
**Rules:** ${rules}
|
|
285
|
+
|
|
286
|
+
**Configure automation rules:**
|
|
287
|
+
|
|
288
|
+
\`\`\`javascript
|
|
289
|
+
// Setup automation rules
|
|
290
|
+
mcp__claude-flow__automation_setup({
|
|
291
|
+
rules: [
|
|
292
|
+
{ trigger: "file-change", action: "auto-test" },
|
|
293
|
+
{ trigger: "pr-opened", action: "code-review" },
|
|
294
|
+
{ trigger: "issue-created", action: "triage" },
|
|
295
|
+
{ trigger: "${rules}", action: "auto-execute" }
|
|
296
|
+
]
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// Spawn automation agents with Claude Code's Task tool
|
|
300
|
+
Task("Automation Specialist", "Configure automation for: ${rules}", "coordinator")
|
|
301
|
+
Task("Rule Engine", "Implement automation rules and triggers", "architect")
|
|
302
|
+
Task("Monitor Agent", "Monitor automation execution", "performance-benchmarker")
|
|
303
|
+
\`\`\`
|
|
304
|
+
|
|
305
|
+
**Automation Capabilities:**
|
|
306
|
+
- 🔄 Event-driven triggers
|
|
307
|
+
- ⚡ Real-time response
|
|
308
|
+
- 📊 Performance monitoring
|
|
309
|
+
- 🚫 Error handling and recovery
|
|
310
|
+
- 📝 Audit logging
|
|
311
|
+
- 💾 State management
|
|
312
|
+
|
|
313
|
+
**Execute automation setup now**:
|
|
314
|
+
`;
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
success: true,
|
|
318
|
+
prompt: prompt,
|
|
319
|
+
rules: rules
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
async setupScheduler(params) {
|
|
324
|
+
const [frequency, ...taskParams] = params;
|
|
325
|
+
const task = taskParams.join(' ');
|
|
326
|
+
|
|
327
|
+
if (!frequency) {
|
|
328
|
+
return {
|
|
329
|
+
success: false,
|
|
330
|
+
error: 'Schedule frequency required',
|
|
331
|
+
examples: ['daily', 'weekly', 'hourly', 'cron:0 9 * * *']
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
console.log(`🕰️ Setting up ${frequency} scheduler${task ? ` for: ${task}` : ''}`);
|
|
336
|
+
|
|
337
|
+
const prompt = `
|
|
338
|
+
🕰️ **SETUP SCHEDULER**
|
|
339
|
+
|
|
340
|
+
**Frequency:** ${frequency}
|
|
341
|
+
**Task:** ${task || 'default maintenance'}
|
|
342
|
+
|
|
343
|
+
**Configure scheduled workflows:**
|
|
344
|
+
|
|
345
|
+
\`\`\`javascript
|
|
346
|
+
// Manage task scheduling
|
|
347
|
+
mcp__claude-flow__scheduler_manage({
|
|
348
|
+
action: "create",
|
|
349
|
+
schedule: {
|
|
350
|
+
frequency: "${frequency}",
|
|
351
|
+
task: "${task || 'maintenance'}",
|
|
352
|
+
enabled: true,
|
|
353
|
+
timezone: "UTC"
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
// Spawn scheduler agents with Claude Code's Task tool
|
|
358
|
+
Task("Scheduler", "Configure ${frequency} scheduling for: ${task || 'maintenance'}", "coordinator")
|
|
359
|
+
Task("Task Manager", "Manage scheduled task execution", "task-orchestrator")
|
|
360
|
+
Task("Monitor", "Monitor scheduled task performance", "performance-benchmarker")
|
|
361
|
+
\`\`\`
|
|
362
|
+
|
|
363
|
+
**Scheduler Features:**
|
|
364
|
+
- 🕰️ Flexible scheduling (cron, interval, event-based)
|
|
365
|
+
- 🌐 Timezone awareness
|
|
366
|
+
- 📈 Execution monitoring
|
|
367
|
+
- 🚫 Failure recovery
|
|
368
|
+
- 📝 Comprehensive logging
|
|
369
|
+
|
|
370
|
+
**Execute scheduler setup now**:
|
|
371
|
+
`;
|
|
372
|
+
|
|
373
|
+
return {
|
|
374
|
+
success: true,
|
|
375
|
+
prompt: prompt,
|
|
376
|
+
frequency: frequency,
|
|
377
|
+
task: task
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
async manageTemplates(params) {
|
|
382
|
+
const [action = 'list', ...templateParams] = params;
|
|
383
|
+
|
|
384
|
+
console.log(`📝 Managing workflow templates: ${action}`);
|
|
385
|
+
|
|
386
|
+
const prompt = `
|
|
387
|
+
📝 **WORKFLOW TEMPLATES**
|
|
388
|
+
|
|
389
|
+
**Action:** ${action}
|
|
390
|
+
|
|
391
|
+
**Manage workflow templates:**
|
|
392
|
+
|
|
393
|
+
\`\`\`javascript
|
|
394
|
+
// Manage workflow templates
|
|
395
|
+
mcp__claude-flow__workflow_template({
|
|
396
|
+
action: "${action}",
|
|
397
|
+
${templateParams.length > 0 ? `template: { ${templateParams.map(p => `"${p}"`).join(', ')} }` : ''}
|
|
398
|
+
});
|
|
399
|
+
\`\`\`
|
|
400
|
+
|
|
401
|
+
**Available Templates:**
|
|
402
|
+
- 🚀 CI/CD Pipeline Templates
|
|
403
|
+
- 🤖 Automation Workflow Templates
|
|
404
|
+
- 📈 Monitoring and Analytics Templates
|
|
405
|
+
- 🔒 Security Audit Templates
|
|
406
|
+
- 📝 Documentation Generation Templates
|
|
407
|
+
- ⚙️ Custom Integration Templates
|
|
408
|
+
|
|
409
|
+
**Execute template management now**:
|
|
410
|
+
`;
|
|
411
|
+
|
|
412
|
+
return {
|
|
413
|
+
success: true,
|
|
414
|
+
prompt: prompt,
|
|
415
|
+
action: action,
|
|
416
|
+
templates: templateParams
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
async setupTriggers(params) {
|
|
421
|
+
const [eventType, ...actions] = params;
|
|
422
|
+
|
|
423
|
+
if (!eventType) {
|
|
424
|
+
return {
|
|
425
|
+
success: false,
|
|
426
|
+
error: 'Event type required',
|
|
427
|
+
examples: ['push', 'pr', 'issue', 'schedule', 'webhook']
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
console.log(`⚡ Setting up ${eventType} triggers...`);
|
|
432
|
+
|
|
433
|
+
const prompt = `
|
|
434
|
+
⚡ **SETUP EVENT TRIGGERS**
|
|
435
|
+
|
|
436
|
+
**Event Type:** ${eventType}
|
|
437
|
+
**Actions:** ${actions.length > 0 ? actions.join(', ') : 'default'}
|
|
438
|
+
|
|
439
|
+
**Configure event-driven triggers:**
|
|
440
|
+
|
|
441
|
+
\`\`\`javascript
|
|
442
|
+
// Setup event triggers
|
|
443
|
+
mcp__claude-flow__trigger_setup({
|
|
444
|
+
events: ["${eventType}"],
|
|
445
|
+
actions: [${actions.length > 0 ? actions.map(a => `"${a}"`).join(', ') : '"auto-test", "notify"'}]
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
// Spawn trigger management agents with Claude Code's Task tool
|
|
449
|
+
Task("Event Handler", "Handle ${eventType} events and trigger actions", "coordinator")
|
|
450
|
+
Task("Action Executor", "Execute triggered actions", "task-orchestrator")
|
|
451
|
+
Task("Monitor", "Monitor trigger performance and reliability", "performance-benchmarker")
|
|
452
|
+
\`\`\`
|
|
453
|
+
|
|
454
|
+
**Trigger Events:**
|
|
455
|
+
- 📝 Git push/commit events
|
|
456
|
+
- 📝 Pull request events
|
|
457
|
+
- 📝 Issue creation/updates
|
|
458
|
+
- 🕰️ Scheduled events
|
|
459
|
+
- 🌐 Webhook events
|
|
460
|
+
- 📊 Performance thresholds
|
|
461
|
+
|
|
462
|
+
**Execute trigger setup now**:
|
|
463
|
+
`;
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
success: true,
|
|
467
|
+
prompt: prompt,
|
|
468
|
+
eventType: eventType,
|
|
469
|
+
actions: actions
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
async exportWorkflow(params) {
|
|
474
|
+
const [workflowId, format = 'yaml'] = params;
|
|
475
|
+
|
|
476
|
+
if (!workflowId) {
|
|
477
|
+
return {
|
|
478
|
+
success: false,
|
|
479
|
+
error: 'Workflow ID required'
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
const validFormats = ['yaml', 'json', 'xml'];
|
|
484
|
+
if (!validFormats.includes(format)) {
|
|
485
|
+
return {
|
|
486
|
+
success: false,
|
|
487
|
+
error: `Invalid format. Valid options: ${validFormats.join(', ')}`
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
console.log(`💾 Exporting workflow ${workflowId} as ${format}...`);
|
|
492
|
+
|
|
493
|
+
const prompt = `
|
|
494
|
+
💾 **EXPORT WORKFLOW**
|
|
495
|
+
|
|
496
|
+
**Workflow ID:** ${workflowId}
|
|
497
|
+
**Format:** ${format}
|
|
498
|
+
|
|
499
|
+
**Export workflow definition:**
|
|
500
|
+
|
|
501
|
+
\`\`\`javascript
|
|
502
|
+
// Export workflow definition
|
|
503
|
+
mcp__claude-flow__workflow_export({
|
|
504
|
+
workflowId: "${workflowId}",
|
|
505
|
+
format: "${format}"
|
|
506
|
+
});
|
|
507
|
+
\`\`\`
|
|
508
|
+
|
|
509
|
+
**Execute workflow export now**:
|
|
510
|
+
`;
|
|
511
|
+
|
|
512
|
+
return {
|
|
513
|
+
success: true,
|
|
514
|
+
prompt: prompt,
|
|
515
|
+
workflowId: workflowId,
|
|
516
|
+
format: format
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
async batchProcess(params) {
|
|
521
|
+
const [operation, ...items] = params;
|
|
522
|
+
|
|
523
|
+
if (!operation) {
|
|
524
|
+
return {
|
|
525
|
+
success: false,
|
|
526
|
+
error: 'Operation required for batch processing'
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
console.log(`📦 Batch processing: ${operation}`);
|
|
531
|
+
|
|
532
|
+
const prompt = `
|
|
533
|
+
📦 **BATCH PROCESSING**
|
|
534
|
+
|
|
535
|
+
**Operation:** ${operation}
|
|
536
|
+
**Items:** ${items.length > 0 ? items.join(', ') : 'auto-detect'}
|
|
537
|
+
|
|
538
|
+
**Execute batch processing:**
|
|
539
|
+
|
|
540
|
+
\`\`\`javascript
|
|
541
|
+
// Batch processing
|
|
542
|
+
mcp__claude-flow__batch_process({
|
|
543
|
+
operation: "${operation}",
|
|
544
|
+
items: [${items.length > 0 ? items.map(i => `"${i}"`).join(', ') : '"item1", "item2", "item3"'}]
|
|
545
|
+
});
|
|
546
|
+
\`\`\`
|
|
547
|
+
|
|
548
|
+
**Execute batch processing now**:
|
|
549
|
+
`;
|
|
550
|
+
|
|
551
|
+
return {
|
|
552
|
+
success: true,
|
|
553
|
+
prompt: prompt,
|
|
554
|
+
operation: operation,
|
|
555
|
+
items: items
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
async parallelExecute(params) {
|
|
560
|
+
const tasks = params.join(' ').split(',').map(t => t.trim());
|
|
561
|
+
|
|
562
|
+
if (tasks.length === 0 || tasks[0] === '') {
|
|
563
|
+
return {
|
|
564
|
+
success: false,
|
|
565
|
+
error: 'Task list required (comma-separated)'
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
console.log(`⚡ Executing tasks in parallel: ${tasks.join(', ')}`);
|
|
570
|
+
|
|
571
|
+
const prompt = `
|
|
572
|
+
⚡ **PARALLEL EXECUTION**
|
|
573
|
+
|
|
574
|
+
**Tasks:** ${tasks.join(', ')}
|
|
575
|
+
|
|
576
|
+
**Execute tasks in parallel:**
|
|
577
|
+
|
|
578
|
+
\`\`\`javascript
|
|
579
|
+
// Execute tasks in parallel
|
|
580
|
+
mcp__claude-flow__parallel_execute({
|
|
581
|
+
tasks: [${tasks.map(t => `"${t}"`).join(', ')}]
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
// Spawn parallel execution agents with Claude Code's Task tool
|
|
585
|
+
${tasks.map((task, i) => `Task("Parallel Worker ${i + 1}", "Execute: ${task}", "task-orchestrator")`).join('\n')}
|
|
586
|
+
\`\`\`
|
|
587
|
+
|
|
588
|
+
**Parallel Execution Benefits:**
|
|
589
|
+
- ⚡ 2.8-4.4x speed improvement
|
|
590
|
+
- 📊 Optimal resource utilization
|
|
591
|
+
- 🔄 Automatic load balancing
|
|
592
|
+
- 🚫 Error isolation
|
|
593
|
+
- 📈 Real-time progress tracking
|
|
594
|
+
|
|
595
|
+
**Execute parallel tasks now**:
|
|
596
|
+
`;
|
|
597
|
+
|
|
598
|
+
return {
|
|
599
|
+
success: true,
|
|
600
|
+
prompt: prompt,
|
|
601
|
+
tasks: tasks
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export default WorkflowCommand;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Simplified Claude Flow for beginners - AI agent orchestration made easy. Enhanced init command creates complete agent system (8 core agents), MCP configuration with 36 essential tools, and automated hooks. All memory leaks eliminated, zero deprecated dependencies, full project setup in one command.",
|
|
5
5
|
"mcpName": "io.github.ruvnet/claude-flow",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"claude-flow-novice": "dist/src/cli/main.js",
|
|
9
|
-
"claude-soul": "src/slash-commands/claude-soul.js"
|
|
9
|
+
"claude-soul": "dist/src/slash-commands/claude-soul.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "tsx src/cli/main.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"optimize:validate:hardware": "node scripts/optimization/config-validator.js validate hardware",
|
|
27
27
|
"optimize:validate:monitoring": "node scripts/optimization/config-validator.js validate monitoring",
|
|
28
28
|
"build": "scripts/build/unified-builder.sh safe",
|
|
29
|
-
"build:swc": "swc src -d dist --only='**/*.ts' --config-file .swcrc",
|
|
29
|
+
"build:swc": "swc src -d dist --only='**/*.ts' --config-file .swcrc && cp -r src/slash-commands dist/src/ && cp -r src/cli/simple-commands/hooks dist/src/cli/simple-commands/",
|
|
30
30
|
"build:types": "tsc --project config/typescript/tsconfig.json --emitDeclarationOnly --outDir dist --skipLibCheck",
|
|
31
|
-
"build:watch": "swc src -d dist --watch --config-file .swcrc",
|
|
31
|
+
"build:watch": "swc src -d dist --watch --config-file .swcrc && cp -r src/slash-commands dist/src/ && cp -r src/cli/simple-commands/hooks dist/src/cli/simple-commands/",
|
|
32
32
|
"build:legacy": "scripts/build/unified-builder.sh migration",
|
|
33
33
|
"build:workaround": "scripts/build/unified-builder.sh workaround",
|
|
34
34
|
"build:force": "scripts/build/unified-builder.sh force",
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"debug:swarm": "DEBUG=swarm* npm run dev",
|
|
125
125
|
"mcp:start": "node dist/mcp/mcp-server-novice.js",
|
|
126
126
|
"mcp:status": "node -e \"console.log('MCP Server Status: Ready')\"",
|
|
127
|
+
"mcp:verify": "node scripts/verify-mcp-server.js",
|
|
127
128
|
"security:audit": "node scripts/security/ruv-swarm-safe.js --audit",
|
|
128
129
|
"security:validate": "node scripts/security/ruv-swarm-safe.js",
|
|
129
130
|
"migrate": "node scripts/migration/migrate-hooks.js",
|
|
@@ -196,9 +197,9 @@
|
|
|
196
197
|
"./cli": "./dist/cli/index.js",
|
|
197
198
|
"./mcp": "./dist/mcp/mcp-server.js",
|
|
198
199
|
"./core": "./dist/core/index.js",
|
|
199
|
-
"./slash-commands/claude-soul": "./src/slash-commands/claude-soul.js",
|
|
200
|
-
"./slash-commands/register-claude-soul": "./src/slash-commands/register-claude-soul.js",
|
|
201
|
-
"./hooks/session-start-soul": "./src/cli/simple-commands/hooks/session-start-soul.js"
|
|
200
|
+
"./slash-commands/claude-soul": "./dist/src/slash-commands/claude-soul.js",
|
|
201
|
+
"./slash-commands/register-claude-soul": "./dist/src/slash-commands/register-claude-soul.js",
|
|
202
|
+
"./hooks/session-start-soul": "./dist/src/cli/simple-commands/hooks/session-start-soul.js"
|
|
202
203
|
},
|
|
203
204
|
"dependencies": {
|
|
204
205
|
"boxen": "^8.0.1",
|