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.
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 +18 -6
  60. package/src/slash-commands/mcp-slash-integration.js +146 -0
@@ -0,0 +1,216 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CLI Integration for Slash Commands
5
+ *
6
+ * Integrates slash commands with the main CLI system
7
+ */
8
+
9
+ import { globalRegistry, executeSlashCommand } from './register-all-commands.js';
10
+ import { SlashCommand } from '../core/slash-command.js';
11
+
12
+ /**
13
+ * CLI Slash Command Handler
14
+ */
15
+ export class CliSlashHandler {
16
+ constructor() {
17
+ this.registry = globalRegistry;
18
+ }
19
+
20
+ /**
21
+ * Handle CLI input and execute slash commands
22
+ * @param {string[]} args - CLI arguments
23
+ */
24
+ async handleCliInput(args) {
25
+ if (args.length === 0) {
26
+ this.showHelp();
27
+ return;
28
+ }
29
+
30
+ const command = args[0];
31
+
32
+ // Handle help commands
33
+ if (command === 'help' || command === '--help' || command === '-h') {
34
+ if (args.length > 1) {
35
+ this.showCommandHelp(args[1]);
36
+ } else {
37
+ this.showHelp();
38
+ }
39
+ return;
40
+ }
41
+
42
+ // Handle list commands
43
+ if (command === 'list' || command === 'ls') {
44
+ this.listCommands();
45
+ return;
46
+ }
47
+
48
+ // Execute slash command
49
+ const slashCommand = `/${command}`;
50
+ const slashArgs = args.slice(1);
51
+ const input = `${slashCommand} ${slashArgs.join(' ')}`.trim();
52
+
53
+ try {
54
+ const result = await executeSlashCommand(input);
55
+
56
+ if (result.success) {
57
+ if (result.result && result.result.prompt) {
58
+ console.log(result.result.prompt);
59
+ } else {
60
+ console.log('✅ Command executed successfully');
61
+ if (result.result) {
62
+ console.log(JSON.stringify(result.result, null, 2));
63
+ }
64
+ }
65
+ } else {
66
+ console.error(`❌ ${result.error}`);
67
+ if (result.suggestions && result.suggestions.length > 0) {
68
+ console.log(`Did you mean: ${result.suggestions.join(', ')}?`);
69
+ }
70
+ }
71
+ } catch (error) {
72
+ console.error(`❌ CLI Error: ${error.message}`);
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Show general help
78
+ */
79
+ showHelp() {
80
+ console.log(this.registry.generateHelpText());
81
+ }
82
+
83
+ /**
84
+ * Show help for specific command
85
+ * @param {string} commandName - Command name
86
+ */
87
+ showCommandHelp(commandName) {
88
+ const helpResult = this.registry.getHelp(commandName);
89
+
90
+ if (helpResult.success) {
91
+ const help = helpResult.help;
92
+ console.log(`
93
+ 🚀 **${help.name.toUpperCase()} COMMAND**
94
+ `);
95
+ console.log(`**Description:** ${help.description}`);
96
+ console.log(`**Usage:** ${help.usage}`);
97
+
98
+ if (help.examples && help.examples.length > 0) {
99
+ console.log(`
100
+ **Examples:**`);
101
+ help.examples.forEach(example => {
102
+ console.log(` ${example}`);
103
+ });
104
+ }
105
+ } else {
106
+ console.error(`❌ ${helpResult.error}`);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * List all available commands
112
+ */
113
+ listCommands() {
114
+ const commands = this.registry.listCommands();
115
+
116
+ console.log('
117
+ 🚀 **AVAILABLE SLASH COMMANDS**
118
+ ');
119
+
120
+ commands.forEach(cmd => {
121
+ console.log(`/${cmd.name} - ${cmd.description}`);
122
+ if (cmd.aliases.length > 0) {
123
+ console.log(` Aliases: ${cmd.aliases.map(a => `/${a}`).join(', ')}`);
124
+ }
125
+ });
126
+
127
+ console.log(`
128
+ Total: ${commands.length} commands available`);
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Interactive CLI mode
134
+ */
135
+ export class InteractiveCliMode {
136
+ constructor() {
137
+ this.handler = new CliSlashHandler();
138
+ this.running = false;
139
+ }
140
+
141
+ /**
142
+ * Start interactive mode
143
+ */
144
+ async start() {
145
+ this.running = true;
146
+
147
+ console.log('🚀 Claude-Flow Interactive Slash Command Mode');
148
+ console.log('Type commands without the leading "/" or "help" for assistance');
149
+ console.log('Type "exit" to quit\n');
150
+
151
+ // Note: In a real implementation, you would use readline or similar
152
+ // This is a simplified version for demonstration
153
+ process.stdin.setEncoding('utf8');
154
+
155
+ process.stdin.on('readable', async () => {
156
+ const chunk = process.stdin.read();
157
+ if (chunk !== null) {
158
+ const input = chunk.trim();
159
+
160
+ if (input === 'exit' || input === 'quit') {
161
+ this.stop();
162
+ return;
163
+ }
164
+
165
+ if (input) {
166
+ const args = input.split(' ');
167
+ await this.handler.handleCliInput(args);
168
+ }
169
+
170
+ if (this.running) {
171
+ process.stdout.write('claude-flow> ');
172
+ }
173
+ }
174
+ });
175
+
176
+ process.stdout.write('claude-flow> ');
177
+ }
178
+
179
+ /**
180
+ * Stop interactive mode
181
+ */
182
+ stop() {
183
+ this.running = false;
184
+ console.log('\n👋 Goodbye!');
185
+ process.exit(0);
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Main CLI entry point
191
+ * @param {string[]} args - Command line arguments
192
+ */
193
+ export async function runCliSlashCommands(args = process.argv.slice(2)) {
194
+ const handler = new CliSlashHandler();
195
+
196
+ // Check for interactive mode
197
+ if (args.includes('--interactive') || args.includes('-i')) {
198
+ const interactive = new InteractiveCliMode();
199
+ await interactive.start();
200
+ return;
201
+ }
202
+
203
+ // Handle standard CLI input
204
+ await handler.handleCliInput(args);
205
+ }
206
+
207
+ // Auto-run if this script is executed directly
208
+ if (import.meta.url === `file://${process.argv[1]}`) {
209
+ runCliSlashCommands();
210
+ }
211
+
212
+ export default {
213
+ CliSlashHandler,
214
+ InteractiveCliMode,
215
+ runCliSlashCommands
216
+ };
@@ -0,0 +1,171 @@
1
+ ---
2
+ description: "Smart dependency analysis with security scanning and performance-focused updates"
3
+ argument-hint: "[--security|--performance|--outdated|--audit|--interactive]"
4
+ allowed-tools: ["Bash", "Read", "Grep", "mcp__claude-flow__dependency_analyze", "mcp__claude-flow__language_detect", "mcp__claude-flow__framework_detect", "mcp__claude-flow__memory_usage"]
5
+ ---
6
+
7
+ # Smart Dependency Recommendations
8
+
9
+ Analyze your project dependencies and provide intelligent recommendations for updates, security fixes, and performance improvements.
10
+
11
+ **Analysis Type**: $ARGUMENTS
12
+
13
+ ## Analysis Options
14
+
15
+ - `--security` - Focus on security vulnerabilities and CVE scanning
16
+ - `--performance` - Analyze bundle size and performance impact
17
+ - `--outdated` - Show outdated packages with safe update paths
18
+ - `--audit` - Comprehensive security audit with risk assessment
19
+ - `--interactive` - Interactive update wizard with explanations
20
+
21
+ ## What This Command Does
22
+
23
+ ### 🔍 Intelligent Dependency Analysis
24
+ - **Multi-Language Support**: npm, Cargo, pip, composer, bundler
25
+ - **Security Scanning**: CVE database integration and vulnerability detection
26
+ - **Performance Impact**: Bundle size analysis and optimization opportunities
27
+ - **Breaking Change Detection**: Semantic version analysis and migration guides
28
+ - **License Compliance**: License compatibility and legal risk assessment
29
+
30
+ ### 🛡️ Security Analysis
31
+
32
+ #### Vulnerability Scanning
33
+ - **CVE Database**: Real-time vulnerability scanning
34
+ - **Severity Assessment**: Critical, High, Medium, Low risk classification
35
+ - **Exploit Availability**: Known exploits and proof-of-concept detection
36
+ - **Patch Availability**: Available fixes and update recommendations
37
+
38
+ #### Security Best Practices
39
+ - **Minimal Dependencies**: Suggest lighter alternatives
40
+ - **Trusted Sources**: Verify package maintainer reputation
41
+ - **License Scanning**: Identify problematic licenses
42
+ - **Supply Chain**: Analyze dependency chains for risks
43
+
44
+ ### 🚀 Performance Optimization
45
+
46
+ #### Bundle Analysis
47
+ - **Size Impact**: Before/after size comparison
48
+ - **Tree Shaking**: Dead code elimination opportunities
49
+ - **Alternative Packages**: Lighter alternatives with same functionality
50
+ - **Lazy Loading**: Code splitting recommendations
51
+
52
+ #### Runtime Performance
53
+ - **Startup Time**: Dependency impact on application startup
54
+ - **Memory Usage**: Memory footprint analysis
55
+ - **CPU Impact**: Performance benchmarks and comparisons
56
+
57
+ ## Language-Specific Features
58
+
59
+ ### JavaScript/Node.js (npm/yarn/pnpm)
60
+ ```bash
61
+ # Security audit with fix suggestions
62
+ /dependency-recommendations --security
63
+ # Output: npm audit fix, specific CVE details, manual update guides
64
+
65
+ # Performance analysis
66
+ /dependency-recommendations --performance
67
+ # Output: Bundle analyzer results, tree-shaking opportunities
68
+ ```
69
+
70
+ ### Rust (Cargo)
71
+ ```bash
72
+ # Cargo audit with vulnerability scanning
73
+ /dependency-recommendations --audit
74
+ # Output: cargo audit, rustsec advisory database
75
+
76
+ # Outdated crates analysis
77
+ /dependency-recommendations --outdated
78
+ # Output: cargo outdated, semver compatibility, feature changes
79
+ ```
80
+
81
+ ### Python (pip/poetry/pipenv)
82
+ ```bash
83
+ # Security scanning with safety
84
+ /dependency-recommendations --security
85
+ # Output: safety check, known vulnerabilities, update commands
86
+
87
+ # Performance and compatibility
88
+ /dependency-recommendations --performance
89
+ # Output: Wheel vs source installs, Python version compatibility
90
+ ```
91
+
92
+ ## Sample Recommendation Output
93
+
94
+ ```markdown
95
+ ## 🚨 Critical Security Issues (2)
96
+
97
+ ### 1. lodash@4.17.15 → 4.17.21
98
+ - **CVE-2021-23337**: Prototype pollution vulnerability
99
+ - **Risk**: High - Remote code execution possible
100
+ - **Fix**: `npm update lodash@^4.17.21`
101
+ - **Breaking Changes**: None
102
+ - **Affected Files**: src/utils/helpers.js, src/components/
103
+
104
+ ### 2. express@4.17.1 → 4.18.2
105
+ - **Multiple CVEs**: Security vulnerabilities in older versions
106
+ - **Risk**: Medium - Information disclosure
107
+ - **Fix**: `npm install express@^4.18.2`
108
+ - **Migration Guide**: Check middleware compatibility
109
+
110
+ ## 🚀 Performance Opportunities (3)
111
+
112
+ ### 1. moment.js → date-fns
113
+ - **Bundle Size**: 67KB → 13KB (80% reduction)
114
+ - **Tree Shaking**: Full support vs none
115
+ - **Migration**: Auto-migration available
116
+ - **Effort**: Medium (2-3 hours)
117
+
118
+ ### 2. lodash → Native ES6+ / lodash-es
119
+ - **Bundle Size**: 71KB → 15KB (selective imports)
120
+ - **Performance**: 15% faster with native methods
121
+ - **Migration**: Gradual replacement possible
122
+
123
+ ## 🔄 Recommended Updates (5)
124
+
125
+ ### Safe Updates (No Breaking Changes)
126
+ - react@18.2.0 → 18.2.45 (patch updates)
127
+ - typescript@4.9.4 → 4.9.5 (bug fixes)
128
+ - jest@29.3.1 → 29.5.0 (new features)
129
+
130
+ ### Major Version Updates (Review Required)
131
+ - webpack@4.46.0 → 5.88.2
132
+ - **Breaking Changes**: Module federation, asset modules
133
+ - **Migration Guide**: https://webpack.js.org/migrate/5/
134
+ - **Estimated Effort**: 1-2 days
135
+ ```
136
+
137
+ ## Interactive Update Wizard
138
+
139
+ ```bash
140
+ /dependency-recommendations --interactive
141
+ ```
142
+
143
+ Provides step-by-step guidance:
144
+ 1. **Prioritization**: Security first, then performance, then features
145
+ 2. **Impact Assessment**: Explains what each update affects
146
+ 3. **Testing Strategy**: Suggests test scenarios after updates
147
+ 4. **Rollback Plan**: Provides rollback commands if issues occur
148
+ 5. **Documentation**: Updates package.json comments and documentation
149
+
150
+ ## Educational Features
151
+
152
+ ### Why Updates Matter
153
+ - **Security**: Explains specific vulnerabilities and their impact
154
+ - **Performance**: Shows measurable improvements with benchmarks
155
+ - **Maintenance**: Discusses long-term maintenance benefits
156
+ - **Ecosystem**: Explains how updates affect the broader ecosystem
157
+
158
+ ### Best Practices
159
+ - **Update Strategy**: Guidance on when and how to update
160
+ - **Testing**: Recommendations for testing after updates
161
+ - **Monitoring**: Tools for tracking dependency health
162
+ - **Documentation**: Keeping dependency decisions documented
163
+
164
+ ## Integration Features
165
+
166
+ - **CI/CD Integration**: Generate update PRs with full analysis
167
+ - **Team Notifications**: Share recommendations with team members
168
+ - **Scheduled Analysis**: Regular dependency health checks
169
+ - **Custom Policies**: Configure update policies and approval workflows
170
+
171
+ Get intelligent, actionable dependency recommendations that balance security, performance, and stability.