claude-flow 1.0.19 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Advanced AI agent orchestration system for Claude Code",
5
5
  "main": "src/cli/main.ts",
6
6
  "bin": {
@@ -177,6 +177,67 @@ const HELP_TOPICS: HelpTopic[] = [
177
177
  ],
178
178
  related: ['agents', 'workflows', 'coordination']
179
179
  },
180
+ {
181
+ name: 'claude',
182
+ description: 'Spawning Claude instances with specific configurations',
183
+ category: 'basic',
184
+ examples: [
185
+ {
186
+ description: 'Spawn Claude with web research capabilities',
187
+ command: 'claude-flow claude spawn "implement user authentication" --research --parallel',
188
+ explanation: 'Creates a Claude instance with WebFetchTool and BatchTool for parallel web research'
189
+ },
190
+ {
191
+ description: 'Spawn Claude without permission prompts',
192
+ command: 'claude-flow claude spawn "fix payment bug" --no-permissions',
193
+ explanation: 'Runs Claude with --dangerously-skip-permissions flag to avoid interruptions'
194
+ },
195
+ {
196
+ description: 'Spawn Claude with custom tools',
197
+ command: 'claude-flow claude spawn "analyze codebase" --tools "View,Edit,GrepTool,LS"',
198
+ explanation: 'Specifies exactly which tools Claude can use for the task'
199
+ },
200
+ {
201
+ description: 'Spawn Claude with test coverage target',
202
+ command: 'claude-flow claude spawn "write unit tests" --coverage 95 --commit feature',
203
+ explanation: 'Sets test coverage goal to 95% and commits after each feature'
204
+ },
205
+ {
206
+ description: 'Dry run to preview command',
207
+ command: 'claude-flow claude spawn "build API" --mode backend-only --dry-run',
208
+ explanation: 'Shows what would be executed without actually running Claude'
209
+ }
210
+ ],
211
+ tutorial: [
212
+ 'The claude spawn command launches Claude instances with specific configurations.',
213
+ '',
214
+ 'Available Options:',
215
+ '• --tools, -t: Specify allowed tools (default: View,Edit,Replace,GlobTool,GrepTool,LS,Bash)',
216
+ '• --no-permissions: Skip permission prompts with --dangerously-skip-permissions',
217
+ '• --config, -c: Path to MCP configuration file',
218
+ '• --mode, -m: Development mode (full, backend-only, frontend-only, api-only)',
219
+ '• --parallel: Enable BatchTool and dispatch_agent for parallel execution',
220
+ '• --research: Enable WebFetchTool for web research capabilities',
221
+ '• --coverage: Test coverage target percentage (default: 80)',
222
+ '• --commit: Commit frequency (phase, feature, manual)',
223
+ '• --verbose, -v: Enable verbose output',
224
+ '• --dry-run, -d: Preview what would be executed',
225
+ '',
226
+ 'Environment Variables Set:',
227
+ '• CLAUDE_INSTANCE_ID: Unique identifier for the Claude instance',
228
+ '• CLAUDE_FLOW_MODE: Development mode setting',
229
+ '• CLAUDE_FLOW_COVERAGE: Target test coverage percentage',
230
+ '• CLAUDE_FLOW_COMMIT: Commit frequency setting',
231
+ '',
232
+ 'Common Use Cases:',
233
+ '• Full-stack development: --mode full --parallel',
234
+ '• API development: --mode backend-only --coverage 90',
235
+ '• Bug fixing: --no-permissions --verbose',
236
+ '• Research tasks: --research --parallel',
237
+ '• Test writing: --coverage 95 --commit feature'
238
+ ],
239
+ related: ['agents', 'tasks', 'workflows']
240
+ },
180
241
  {
181
242
  name: 'workflows',
182
243
  description: 'Building complex multi-step workflows',
@@ -14,6 +14,7 @@ USAGE:
14
14
  claude-flow [COMMAND] [OPTIONS]
15
15
 
16
16
  COMMANDS:
17
+ init Initialize Claude Code integration files
17
18
  start Start the orchestration system
18
19
  agent Manage agents (spawn, list, terminate, info)
19
20
  task Manage tasks (create, list, status, cancel, workflow)
@@ -35,9 +36,12 @@ GLOBAL OPTIONS:
35
36
  --help Show help for specific command
36
37
 
37
38
  EXAMPLES:
39
+ claude-flow init # Initialize Claude integration files
38
40
  claude-flow start # Start orchestrator
39
41
  claude-flow agent spawn researcher --name "Bot" # Spawn research agent
40
42
  claude-flow task create research "Analyze data" # Create task
43
+ claude-flow claude spawn "implement auth" --research # Spawn Claude with web research
44
+ claude-flow claude spawn "fix bug" --no-permissions # Spawn Claude without permission prompts
41
45
  claude-flow config init # Initialize config
42
46
  claude-flow status # Show system status
43
47
  claude-flow workflow my-workflow.json # Execute workflow
@@ -92,6 +96,100 @@ async function main() {
92
96
  printHelp();
93
97
  break;
94
98
 
99
+ case 'init':
100
+ // Parse init options
101
+ const initForce = subArgs.includes('--force') || subArgs.includes('-f');
102
+ const initMinimal = subArgs.includes('--minimal') || subArgs.includes('-m');
103
+
104
+ try {
105
+ printSuccess('Initializing Claude Code integration files...');
106
+
107
+ // Check if files already exist
108
+ const files = ['CLAUDE.md', 'memory-bank.md', 'coordination.md'];
109
+ const existingFiles = [];
110
+
111
+ for (const file of files) {
112
+ try {
113
+ await Deno.stat(file);
114
+ existingFiles.push(file);
115
+ } catch {
116
+ // File doesn't exist, which is what we want
117
+ }
118
+ }
119
+
120
+ if (existingFiles.length > 0 && !initForce) {
121
+ printWarning(`The following files already exist: ${existingFiles.join(', ')}`);
122
+ console.log('Use --force to overwrite existing files');
123
+ break;
124
+ }
125
+
126
+ // Create CLAUDE.md
127
+ const claudeMd = initMinimal ? createMinimalClaudeMd() : createFullClaudeMd();
128
+ await Deno.writeTextFile('CLAUDE.md', claudeMd);
129
+ console.log(' ✓ Created CLAUDE.md');
130
+
131
+ // Create memory-bank.md
132
+ const memoryBankMd = initMinimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
133
+ await Deno.writeTextFile('memory-bank.md', memoryBankMd);
134
+ console.log(' ✓ Created memory-bank.md');
135
+
136
+ // Create coordination.md
137
+ const coordinationMd = initMinimal ? createMinimalCoordinationMd() : createFullCoordinationMd();
138
+ await Deno.writeTextFile('coordination.md', coordinationMd);
139
+ console.log(' ✓ Created coordination.md');
140
+
141
+ // Create directory structure
142
+ const directories = [
143
+ 'memory',
144
+ 'memory/agents',
145
+ 'memory/sessions',
146
+ 'coordination',
147
+ 'coordination/memory_bank',
148
+ 'coordination/subtasks',
149
+ 'coordination/orchestration'
150
+ ];
151
+
152
+ for (const dir of directories) {
153
+ try {
154
+ await Deno.mkdir(dir, { recursive: true });
155
+ console.log(` ✓ Created ${dir}/ directory`);
156
+ } catch (err) {
157
+ if (!(err instanceof Deno.errors.AlreadyExists)) {
158
+ throw err;
159
+ }
160
+ }
161
+ }
162
+
163
+ // Create placeholder files
164
+ const agentsReadme = createAgentsReadme();
165
+ await Deno.writeTextFile('memory/agents/README.md', agentsReadme);
166
+ console.log(' ✓ Created memory/agents/README.md');
167
+
168
+ const sessionsReadme = createSessionsReadme();
169
+ await Deno.writeTextFile('memory/sessions/README.md', sessionsReadme);
170
+ console.log(' ✓ Created memory/sessions/README.md');
171
+
172
+ // Initialize persistence database
173
+ const initialData = {
174
+ agents: [],
175
+ tasks: [],
176
+ lastUpdated: Date.now()
177
+ };
178
+ await Deno.writeTextFile('memory/claude-flow-data.json', JSON.stringify(initialData, null, 2));
179
+ console.log(' ✓ Created memory/claude-flow-data.json (persistence database)');
180
+
181
+ printSuccess('Claude Code integration files initialized successfully!');
182
+ console.log('\nNext steps:');
183
+ console.log('1. Review and customize the generated files for your project');
184
+ console.log('2. Run \'npx claude-flow start\' to begin the orchestration system');
185
+ console.log('3. Use \'claude --dangerously-skip-permissions\' for unattended operation');
186
+ console.log('\nNote: Persistence database initialized at memory/claude-flow-data.json');
187
+
188
+ } catch (err) {
189
+ printError(`Failed to initialize files: ${err.message}`);
190
+ }
191
+ break;
192
+
95
193
  case 'start':
96
194
  printSuccess('Starting Claude-Flow orchestration system...');
97
195
  printWarning('Full orchestrator implementation coming soon!');
@@ -348,6 +446,319 @@ async function main() {
348
446
  }
349
447
  }
350
448
 
449
+ // Helper functions for init command
450
+ function createMinimalClaudeMd() {
451
+ return `# Claude Code Integration
452
+
453
+ This file provides guidance to Claude when working with this codebase.
454
+
455
+ ## Project Overview
456
+ [Describe your project here]
457
+
458
+ ## Key Conventions
459
+ - Code style guidelines
460
+ - Naming conventions
461
+ - Architecture patterns
462
+
463
+ ## Important Notes
464
+ - Special considerations
465
+ - Areas to be careful with
466
+ `;
467
+ }
468
+
469
+ function createFullClaudeMd() {
470
+ return `# Claude Code Integration Guide
471
+
472
+ This document provides comprehensive guidance to Claude when working with this codebase.
473
+
474
+ ## Project Overview
475
+ [Provide a detailed description of your project, its purpose, and main features]
476
+
477
+ ## Architecture
478
+ [Describe the overall architecture, main components, and how they interact]
479
+
480
+ ## Code Conventions
481
+ - **Naming**: [Describe naming conventions for files, functions, variables, etc.]
482
+ - **Style**: [Code formatting preferences, linting rules]
483
+ - **Patterns**: [Design patterns used in the project]
484
+ - **Testing**: [Testing approach and requirements]
485
+
486
+ ## Directory Structure
487
+ \`\`\`
488
+ project/
489
+ ├── src/ # Source code
490
+ ├── tests/ # Test files
491
+ ├── docs/ # Documentation
492
+ └── ... # Other directories
493
+ \`\`\`
494
+
495
+ ## Development Workflow
496
+ 1. [Step-by-step development process]
497
+ 2. [How to run tests]
498
+ 3. [How to build/deploy]
499
+
500
+ ## Important Considerations
501
+ - [Security considerations]
502
+ - [Performance requirements]
503
+ - [Compatibility requirements]
504
+
505
+ ## Common Tasks
506
+ - **Add a new feature**: [Instructions]
507
+ - **Fix a bug**: [Process]
508
+ - **Update documentation**: [Guidelines]
509
+
510
+ ## Dependencies
511
+ [List key dependencies and their purposes]
512
+
513
+ ## Troubleshooting
514
+ [Common issues and solutions]
515
+ `;
516
+ }
517
+
518
+ function createMinimalMemoryBankMd() {
519
+ return `# Memory Bank
520
+
521
+ Session memory and context storage.
522
+
523
+ ## Current Session
524
+ - Started: ${new Date().toISOString()}
525
+ - Context: [Current work context]
526
+
527
+ ## Key Information
528
+ - [Important facts to remember]
529
+
530
+ ## Progress Log
531
+ - [Track progress here]
532
+ `;
533
+ }
534
+
535
+ function createFullMemoryBankMd() {
536
+ return `# Memory Bank
537
+
538
+ This file serves as persistent memory storage for Claude across sessions.
539
+
540
+ ## Session Information
541
+ - **Current Session**: Started ${new Date().toISOString()}
542
+ - **Project Phase**: [Development/Testing/Production]
543
+ - **Active Tasks**: [List current tasks]
544
+
545
+ ## Project Context
546
+ ### Technical Stack
547
+ - Languages: [List languages used]
548
+ - Frameworks: [List frameworks]
549
+ - Tools: [Development tools]
550
+
551
+ ### Architecture Decisions
552
+ - [Record key architectural decisions]
553
+ - [Rationale for technology choices]
554
+
555
+ ## Important Information
556
+ ### API Keys and Secrets
557
+ - [Never store actual secrets here, just references]
558
+
559
+ ### External Services
560
+ - [List integrated services]
561
+ - [Configuration requirements]
562
+
563
+ ### Database Schema
564
+ - [Current schema version]
565
+ - [Recent migrations]
566
+
567
+ ## Progress Tracking
568
+ ### Completed Tasks
569
+ - [x] [Completed task 1]
570
+ - [x] [Completed task 2]
571
+
572
+ ### In Progress
573
+ - [ ] [Current task 1]
574
+ - [ ] [Current task 2]
575
+
576
+ ### Upcoming
577
+ - [ ] [Future task 1]
578
+ - [ ] [Future task 2]
579
+
580
+ ## Code Patterns
581
+ ### Established Patterns
582
+ \`\`\`javascript
583
+ // Example pattern
584
+ \`\`\`
585
+
586
+ ### Anti-patterns to Avoid
587
+ - [List anti-patterns]
588
+
589
+ ## Meeting Notes
590
+ ### [Date]
591
+ - Participants: [Names]
592
+ - Decisions: [Key decisions]
593
+ - Action items: [Tasks assigned]
594
+
595
+ ## Debugging History
596
+ ### Issue: [Issue name]
597
+ - **Date**: [Date]
598
+ - **Symptoms**: [What was observed]
599
+ - **Root Cause**: [What caused it]
600
+ - **Solution**: [How it was fixed]
601
+
602
+ ## Performance Metrics
603
+ - [Baseline metrics]
604
+ - [Optimization goals]
605
+
606
+ ## Documentation Links
607
+ - [API Documentation]: [URL]
608
+ - [Design Documents]: [URL]
609
+ - [Issue Tracker]: [URL]
610
+ `;
611
+ }
612
+
613
+ function createMinimalCoordinationMd() {
614
+ return `# Coordination
615
+
616
+ Task and workflow coordination.
617
+
618
+ ## Active Tasks
619
+ 1. [Current task]
620
+
621
+ ## Workflow
622
+ - [ ] Step 1
623
+ - [ ] Step 2
624
+
625
+ ## Resources
626
+ - [Available resources]
627
+ `;
628
+ }
629
+
630
+ function createFullCoordinationMd() {
631
+ return `# Coordination Center
632
+
633
+ Central coordination for multi-agent collaboration and task management.
634
+
635
+ ## Active Agents
636
+ | Agent ID | Type | Status | Assigned Tasks | Last Active |
637
+ |----------|------|--------|----------------|-------------|
638
+ | [ID] | [Type] | [Status] | [Tasks] | [Timestamp] |
639
+
640
+ ## Task Queue
641
+ ### High Priority
642
+ 1. **[Task Name]**
643
+ - Description: [What needs to be done]
644
+ - Assigned to: [Agent ID]
645
+ - Dependencies: [Other tasks]
646
+ - Deadline: [Date/Time]
647
+
648
+ ### Medium Priority
649
+ 1. [Task details]
650
+
651
+ ### Low Priority
652
+ 1. [Task details]
653
+
654
+ ## Workflow Definitions
655
+ ### [Workflow Name]
656
+ \`\`\`yaml
657
+ name: [Workflow Name]
658
+ description: [What this workflow does]
659
+ steps:
660
+ - name: [Step 1]
661
+ agent: [Agent type]
662
+ action: [What to do]
663
+ - name: [Step 2]
664
+ agent: [Agent type]
665
+ action: [What to do]
666
+ depends_on: [Step 1]
667
+ \`\`\`
668
+
669
+ ## Resource Allocation
670
+ ### Computational Resources
671
+ - CPU: [Usage/Limits]
672
+ - Memory: [Usage/Limits]
673
+ - Storage: [Usage/Limits]
674
+
675
+ ### External Resources
676
+ - API Rate Limits: [Service: limit]
677
+ - Database Connections: [Current/Max]
678
+
679
+ ## Communication Channels
680
+ ### Inter-Agent Messages
681
+ - [Agent A → Agent B]: [Message type]
682
+
683
+ ### External Communications
684
+ - Webhooks: [Configured webhooks]
685
+ - Notifications: [Notification settings]
686
+
687
+ ## Synchronization Points
688
+ - [Sync Point 1]: [Description]
689
+ - [Sync Point 2]: [Description]
690
+
691
+ ## Conflict Resolution
692
+ ### Strategy
693
+ - [How conflicts are resolved]
694
+
695
+ ### Recent Conflicts
696
+ - [Date]: [Conflict description] → [Resolution]
697
+
698
+ ## Performance Metrics
699
+ ### Task Completion
700
+ - Average time: [Time]
701
+ - Success rate: [Percentage]
702
+
703
+ ### Agent Efficiency
704
+ - [Agent Type]: [Metrics]
705
+
706
+ ## Scheduled Maintenance
707
+ - [Date/Time]: [What will be done]
708
+
709
+ ## Emergency Procedures
710
+ ### System Overload
711
+ 1. [Step 1]
712
+ 2. [Step 2]
713
+
714
+ ### Agent Failure
715
+ 1. [Recovery procedure]
716
+ `;
717
+ }
718
+
719
+ function createAgentsReadme() {
720
+ return `# Agents Directory
721
+
722
+ This directory stores agent-specific memory and state information.
723
+
724
+ ## Structure
725
+ Each agent gets its own subdirectory named by agent ID:
726
+ - \`agent-001/\`: First agent's memory
727
+ - \`agent-002/\`: Second agent's memory
728
+ - etc.
729
+
730
+ ## Files per Agent
731
+ - \`profile.json\`: Agent configuration and capabilities
732
+ - \`memory.md\`: Agent's working memory
733
+ - \`tasks.json\`: Assigned tasks and their status
734
+ - \`metrics.json\`: Performance metrics
735
+
736
+ ## Usage
737
+ Files in this directory are automatically managed by the Claude-Flow system.
738
+ `;
739
+ }
740
+
741
+ function createSessionsReadme() {
742
+ return `# Sessions Directory
743
+
744
+ This directory stores session-specific information and terminal states.
745
+
746
+ ## Structure
747
+ Each session gets a unique directory:
748
+ - \`session-[timestamp]/\`: Session data
749
+ - \`metadata.json\`: Session metadata
750
+ - \`terminal.log\`: Terminal output
751
+ - \`commands.history\`: Command history
752
+ - \`state.json\`: Session state snapshot
753
+
754
+ ## Retention Policy
755
+ Sessions are retained for 30 days by default, then archived or deleted based on configuration.
756
+
757
+ ## Usage
758
+ The Claude-Flow system automatically manages session files. Do not modify these files manually.
759
+ `;
760
+ }
761
+
351
762
  if (import.meta.main) {
352
763
  await main();
353
764
  }