claude-flow-novice 1.0.2 → 1.1.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.
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Slash Command Registration for /claude-soul
3
+ *
4
+ * Register the claude-soul.md generation command
5
+ */
6
+
7
+ import { executeClaudeSoulCommand } from './claude-soul.js';
8
+
9
+ /**
10
+ * Register the /claude-soul slash command
11
+ */
12
+ export function registerClaudeSoulCommand(slashCommandRegistry) {
13
+ slashCommandRegistry.register('claude-soul', {
14
+ description: 'Generate claude-soul.md - project essence and philosophy document',
15
+ usage: '/claude-soul [--preview] [--force] [--no-backup]',
16
+ options: [
17
+ { name: '--preview', description: 'Show what would be generated without writing file' },
18
+ { name: '--force', description: 'Overwrite existing claude-soul.md without confirmation' },
19
+ { name: '--no-backup', description: 'Skip creating backup of existing file' }
20
+ ],
21
+ examples: [
22
+ '/claude-soul',
23
+ '/claude-soul --preview',
24
+ '/claude-soul --force',
25
+ '/claude-soul --no-backup'
26
+ ],
27
+ async execute(args, context) {
28
+ try {
29
+ // Parse slash command arguments
30
+ const options = {
31
+ preview: args.includes('--preview'),
32
+ force: args.includes('--force'),
33
+ backup: !args.includes('--no-backup')
34
+ };
35
+
36
+ console.log('🎯 Executing /claude-soul slash command...');
37
+
38
+ const result = await executeClaudeSoulCommand(options);
39
+
40
+ // Format response for slash command system
41
+ if (result.success) {
42
+ return {
43
+ success: true,
44
+ message: result.message || 'claude-soul.md operation completed successfully',
45
+ data: {
46
+ action: result.action,
47
+ file: result.file,
48
+ length: result.length,
49
+ lineCount: result.lineCount
50
+ }
51
+ };
52
+ } else {
53
+ return {
54
+ success: false,
55
+ error: result.error || 'claude-soul.md operation failed',
56
+ action: result.action
57
+ };
58
+ }
59
+
60
+ } catch (error) {
61
+ console.error('❌ Slash command execution failed:', error.message);
62
+ return {
63
+ success: false,
64
+ error: `Slash command failed: ${error.message}`
65
+ };
66
+ }
67
+ }
68
+ });
69
+
70
+ console.log('✅ /claude-soul slash command registered');
71
+ }
72
+
73
+ /**
74
+ * Auto-registration if this module is imported
75
+ */
76
+ export default function autoRegister(registry) {
77
+ if (registry) {
78
+ registerClaudeSoulCommand(registry);
79
+ }
80
+ }