claude-flow-novice 1.5.2 → 1.5.4

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 (138) hide show
  1. package/.claude/agents/SPARSE_LANGUAGE_FINDINGS.md +991 -0
  2. package/.claude/agents/architecture/system-architect.md +3 -44
  3. package/.claude/agents/benchmarking-tests/test-agent-code-heavy.md +747 -0
  4. package/.claude/agents/benchmarking-tests/test-agent-metadata.md +181 -0
  5. package/.claude/agents/benchmarking-tests/test-agent-minimal.md +67 -0
  6. package/.claude/agents/data/ml/data-ml-model.md +5 -119
  7. package/.claude/agents/development/backend/dev-backend-api.md +4 -115
  8. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +4 -114
  9. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +4 -113
  10. package/.claude/agents/github/multi-repo-swarm.md +1 -28
  11. package/.claude/agents/github/pr-manager.md +1 -29
  12. package/.claude/agents/github/project-board-sync.md +1 -32
  13. package/.claude/agents/github/release-manager.md +1 -32
  14. package/.claude/agents/github/release-swarm.md +1 -33
  15. package/.claude/agents/github/repo-architect.md +1 -34
  16. package/.claude/agents/github/swarm-issue.md +1 -26
  17. package/.claude/agents/github/swarm-pr.md +1 -30
  18. package/.claude/agents/github/sync-coordinator.md +1 -30
  19. package/.claude/agents/github/workflow-automation.md +1 -31
  20. package/.claude/agents/neural/neural-pattern-agent.md +2 -50
  21. package/.claude/agents/specialized/CODER_AGENT_GUIDELINES.md +1245 -0
  22. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +6 -142
  23. package/.claude/agents/sublinear/consciousness-evolution-agent.md +2 -18
  24. package/.claude/agents/sublinear/matrix-solver-agent.md +2 -16
  25. package/.claude/agents/sublinear/nanosecond-scheduler-agent.md +2 -19
  26. package/.claude/agents/sublinear/pagerank-agent.md +2 -19
  27. package/.claude/agents/sublinear/phi-calculator-agent.md +2 -19
  28. package/.claude/agents/sublinear/psycho-symbolic-agent.md +2 -19
  29. package/.claude/agents/sublinear/sublinear.md +2 -1
  30. package/.claude/agents/sublinear/temporal-advantage-agent.md +2 -16
  31. package/.claude/agents/testing/e2e/playwright-agent.md +7 -0
  32. package/.claude-flow-novice/.claude/agents/SPARSE_LANGUAGE_FINDINGS.md +991 -0
  33. package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +3 -44
  34. package/.claude-flow-novice/.claude/agents/benchmarking-tests/test-agent-code-heavy.md +747 -0
  35. package/.claude-flow-novice/.claude/agents/benchmarking-tests/test-agent-metadata.md +181 -0
  36. package/.claude-flow-novice/.claude/agents/benchmarking-tests/test-agent-minimal.md +67 -0
  37. package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +5 -119
  38. package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +4 -115
  39. package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +4 -114
  40. package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +4 -113
  41. package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +1 -28
  42. package/.claude-flow-novice/.claude/agents/github/pr-manager.md +1 -29
  43. package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +1 -32
  44. package/.claude-flow-novice/.claude/agents/github/release-manager.md +1 -32
  45. package/.claude-flow-novice/.claude/agents/github/release-swarm.md +1 -33
  46. package/.claude-flow-novice/.claude/agents/github/repo-architect.md +1 -34
  47. package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +1 -26
  48. package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +1 -30
  49. package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +1 -30
  50. package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +1 -31
  51. package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +2 -50
  52. package/.claude-flow-novice/.claude/agents/specialized/CODER_AGENT_GUIDELINES.md +1245 -0
  53. package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +6 -142
  54. package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +2 -18
  55. package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +2 -16
  56. package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +2 -19
  57. package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +2 -19
  58. package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +2 -19
  59. package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +2 -19
  60. package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +2 -1
  61. package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +2 -16
  62. package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +7 -0
  63. package/.claude-flow-novice/dist/src/cli/simple-commands/init/CLAUDE.md +188 -0
  64. package/.claude-flow-novice/dist/src/cli/simple-commands/init/claude-flow-universal +81 -0
  65. package/.claude-flow-novice/dist/src/cli/simple-commands/init/claude-flow.bat +18 -0
  66. package/.claude-flow-novice/dist/src/cli/simple-commands/init/claude-flow.ps1 +24 -0
  67. package/.claude-flow-novice/dist/src/cli/simple-commands/init/claude-md.js +982 -0
  68. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/analysis/bottleneck-detect.md +162 -0
  69. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/automation/auto-agent.md +122 -0
  70. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/coordination/swarm-init.md +85 -0
  71. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/github/github-swarm.md +121 -0
  72. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/helpers/standard-checkpoint-hooks.sh +179 -0
  73. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/notification.md +113 -0
  74. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/post-command.md +116 -0
  75. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/post-edit.md +117 -0
  76. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/post-task.md +112 -0
  77. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/pre-command.md +113 -0
  78. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/pre-edit.md +113 -0
  79. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/pre-search.md +112 -0
  80. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/pre-task.md +111 -0
  81. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/session-end.md +118 -0
  82. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/session-restore.md +118 -0
  83. package/.claude-flow-novice/dist/src/cli/simple-commands/init/commands/hooks/session-start.md +117 -0
  84. package/.claude-flow-novice/dist/src/cli/simple-commands/init/coordination-md.js +340 -0
  85. package/.claude-flow-novice/dist/src/cli/simple-commands/init/coordination.md +16 -0
  86. package/.claude-flow-novice/dist/src/cli/simple-commands/init/enhanced-templates.js +2347 -0
  87. package/.claude-flow-novice/dist/src/cli/simple-commands/init/github-safe-enhanced.js +331 -0
  88. package/.claude-flow-novice/dist/src/cli/simple-commands/init/github-safe.js +106 -0
  89. package/.claude-flow-novice/dist/src/cli/simple-commands/init/index.js +1896 -0
  90. package/.claude-flow-novice/dist/src/cli/simple-commands/init/memory-bank-md.js +259 -0
  91. package/.claude-flow-novice/dist/src/cli/simple-commands/init/memory-bank.md +16 -0
  92. package/.claude-flow-novice/dist/src/cli/simple-commands/init/readme-files.js +72 -0
  93. package/.claude-flow-novice/dist/src/cli/simple-commands/init/safe-hook-patterns.js +430 -0
  94. package/.claude-flow-novice/dist/src/cli/simple-commands/init/settings.json +109 -0
  95. package/.claude-flow-novice/dist/src/cli/simple-commands/init/settings.json.enhanced +35 -0
  96. package/.claude-flow-novice/dist/src/cli/simple-commands/init/sparc-modes.js +1401 -0
  97. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +188 -0
  98. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-flow-universal +81 -0
  99. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-flow.bat +18 -0
  100. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-flow.ps1 +24 -0
  101. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +982 -0
  102. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +162 -0
  103. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +122 -0
  104. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +85 -0
  105. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +121 -0
  106. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/helpers/standard-checkpoint-hooks.sh +179 -0
  107. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/notification.md +113 -0
  108. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +116 -0
  109. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +117 -0
  110. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +112 -0
  111. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +113 -0
  112. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +113 -0
  113. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +112 -0
  114. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +111 -0
  115. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +118 -0
  116. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +118 -0
  117. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +117 -0
  118. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/coordination-md.js +340 -0
  119. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/coordination.md +16 -0
  120. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +2347 -0
  121. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +331 -0
  122. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/github-safe.js +106 -0
  123. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +259 -0
  124. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
  125. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/readme-files.js +72 -0
  126. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +430 -0
  127. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/settings.json +109 -0
  128. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
  129. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/sparc-modes.js +1401 -0
  130. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +432 -0
  131. package/.claude-flow-novice/dist/src/cli/simple-commands/init/verification-claude-md.js +432 -0
  132. package/.claude-flow-novice/dist/src/cli/simple-commands/init.js +4 -0
  133. package/.claude-flow-novice/dist/src/slash-commands/benchmark-prompts.js +281 -0
  134. package/CLAUDE.md +1927 -127
  135. package/package.json +3 -3
  136. package/src/cli/simple-commands/init/index.js +39 -4
  137. package/src/cli/simple-commands/init/templates/CLAUDE.md +8 -10
  138. package/src/slash-commands/benchmark-prompts.js +281 -0
@@ -0,0 +1,188 @@
1
+ # Claude Flow Novice - AI Agent Orchestration
2
+
3
+ ## Core Orchestration Patterns
4
+
5
+ ## 🚨 CRITICAL: CONCURRENT EXECUTION & FILE MANAGEMENT
6
+
7
+
8
+ **ABSOLUTE RULES**:
9
+ 1. ALL operations MUST be concurrent/parallel in a single message
10
+ 2. **NEVER save working files, text/mds and tests to the root folder**
11
+ 3. ALWAYS organize files in appropriate subdirectories
12
+ 4. **USE CLAUDE CODE'S TASK TOOL** for spawning agents concurrently, not just MCP
13
+
14
+ ### ⚡ GOLDEN RULE: "1 MESSAGE = ALL RELATED OPERATIONS"
15
+
16
+ **MANDATORY PATTERNS:**
17
+ - **TodoWrite**: ALWAYS batch ALL todos in ONE call (5-10+ todos minimum)
18
+ - **Task tool (Claude Code)**: ALWAYS spawn ALL agents in ONE message with full instructions
19
+ - **File operations**: ALWAYS batch ALL reads/writes/edits in ONE message
20
+ - **Bash commands**: ALWAYS batch ALL terminal operations in ONE message
21
+ - **Memory operations**: ALWAYS batch ALL memory store/retrieve in ONE message
22
+
23
+ ## 🎯 Claude Code vs MCP Tools
24
+
25
+ ### Claude Code Handles ALL EXECUTION:
26
+ - **Task tool**: Spawn and run agents concurrently for actual work
27
+ - File operations (Read, Write, Edit, MultiEdit, Glob, Grep)
28
+ - Code generation and programming
29
+ - Bash commands and system operations
30
+ - Implementation work
31
+ - Project navigation and analysis
32
+ - TodoWrite and task management
33
+ - Git operations
34
+ - Package management
35
+ - Testing and debugging
36
+
37
+ ### MCP Tools ONLY COORDINATE:
38
+ - Swarm initialization (topology setup)
39
+ - Agent type definitions (coordination patterns)
40
+ - Task orchestration (high-level planning)
41
+ - Memory management
42
+ - Neural features
43
+ - Performance tracking
44
+ - GitHub integration
45
+
46
+ **KEY**: MCP coordinates the strategy, Claude Code's Task tool executes with real agents.
47
+
48
+ ### Agent Coordination Framework
49
+
50
+ #### Pre-Task Hooks (Setup & Validation)
51
+ ```bash
52
+ # Validate safety and prepare resources
53
+ npx claude-flow-novice hooks pre-command --command "[command]" --validate-safety true --prepare-resources true
54
+
55
+ # Auto-assign agents and load context
56
+ npx claude-flow-novice hooks pre-edit --file "[file]" --auto-assign-agents true --load-context true
57
+ ```
58
+
59
+ #### Post-Task Hooks (Validation & Quality)
60
+ ```bash
61
+ # Track metrics and store results
62
+ npx claude-flow-novice hooks post-command --command "[command]" --track-metrics true --store-results true
63
+
64
+ # Enhanced post-edit pipeline with comprehensive TDD validation
65
+ npx enhanced-hooks post-edit "[file]" --memory-key "swarm/[agent]/[step]" --minimum-coverage 80 --structured
66
+
67
+ # Manual hook execution (guaranteed working)
68
+ node src/hooks/enhanced-hooks-cli.js post-edit "[file]" --memory-key "[key]" --structured
69
+
70
+ # Validates: formatting, linting, type checking, dependencies, security, tests, TDD compliance
71
+ # Progressive validation: graceful degradation when dependencies missing (beginner-friendly)
72
+ ```
73
+
74
+ ## 🎯 **Enhanced Post-Edit Hook System**
75
+
76
+ ### **🚨 MANDATORY: Manual Hook Execution After Every File Edit**
77
+
78
+ **CRITICAL RULE**: After **EVERY** file edit operation, you **MUST** run the enhanced post-edit hook:
79
+
80
+ ```bash
81
+ # After editing any file, IMMEDIATELY run:
82
+ npx enhanced-hooks post-edit "[FILE_PATH]" --memory-key "swarm/[AGENT]/[STEP]" --minimum-coverage 80 --structured
83
+
84
+ # Or via slash command:
85
+ /hooks post-edit [FILE_PATH] --memory-key "[CONTEXT]" --structured
86
+ ```
87
+
88
+ **⚠️ NO EXCEPTIONS**: This applies to:
89
+ - All JavaScript/TypeScript files
90
+ - All Rust files
91
+ - All Python files
92
+ - All configuration files
93
+ - ALL file modifications
94
+
95
+ ### **Enhanced Post-Edit Pipeline Features:**
96
+ - **🧪 TDD Testing**: Single-file testing without full system compilation
97
+ - **📊 Real-time Coverage**: Coverage analysis with configurable thresholds (default: 80%)
98
+ - **🌐 Multi-Language Support**:
99
+ - **JavaScript/TypeScript**: Jest, Mocha, Prettier, ESLint integration
100
+ - **Rust**: cargo check, cargo test, cargo-tarpaulin, rustfmt
101
+ - **Python**: pytest, unittest, black, pylint
102
+ - **Go**: go test, go fmt, go vet
103
+ - **Java**: JUnit, TestNG, google-java-format
104
+ - **C/C++**: GTest, Catch2, clang-format
105
+ - **🎨 Formatting**: Prettier, Black, RustFmt, GoFmt with diff preview
106
+ - **🔒 Security Analysis**: XSS, eval(), hardcoded credentials, SQL injection detection
107
+ - **✅ TDD Compliance**: Red-Green-Refactor phase detection and enforcement
108
+ - **🔍 Framework Detection**: Automatic test framework identification
109
+ - **🤖 Agent Feedback**: Structured JSON with actionable recommendations
110
+ - **💾 Memory Coordination**: Cross-agent state sharing and enhanced persistence
111
+ - **🚫 Blocking Mechanisms**: Quality gates for critical validation failures
112
+
113
+ ### **Usage Examples:**
114
+ ```bash
115
+ # For JavaScript/TypeScript files
116
+ npx enhanced-hooks post-edit "src/components/Button.tsx" --memory-key "frontend/button" --structured
117
+
118
+ # For Rust files (full cargo integration)
119
+ npx enhanced-hooks post-edit "src/lib.rs" --memory-key "backend/rust" --minimum-coverage 90 --structured
120
+
121
+ # Via slash commands in Claude Code
122
+ /hooks post-edit your-file.js --memory-key "agent-memory-key" --structured
123
+ ```
124
+
125
+ ### **Response Structure:**
126
+ ```json
127
+ {
128
+ "success": true,
129
+ "file": "src/component.js",
130
+ "validation": { "passed": true, "issues": [], "coverage": "advanced" },
131
+ "formatting": { "needed": true, "changes": 12, "formatter": "prettier" },
132
+ "testing": { "executed": true, "framework": "jest", "results": {...} },
133
+ "tddCompliance": { "hasTests": true, "coverage": 85, "recommendations": [...] },
134
+ "recommendations": [
135
+ { "type": "security", "priority": "high", "message": "...", "action": "..." },
136
+ { "type": "formatting", "priority": "medium", "action": "prettier file.js" }
137
+ ],
138
+ "memory": { "stored": true, "enhancedStore": true }
139
+ }
140
+ ```
141
+
142
+ #### Session Management
143
+ ```bash
144
+ # Generate summaries and persist state
145
+ npx claude-flow-novice hooks session-end --generate-summary true --persist-state true --export-metrics true
146
+ ```
147
+ **Claude Code's Task tool is the PRIMARY way to spawn agents:**
148
+ ```javascript
149
+ // ✅ CORRECT: Use Claude Code's Task tool for parallel agent execution
150
+ [Single Message]:
151
+ Task("Research agent", "Analyze requirements and patterns...", "researcher")
152
+ Task("Coder agent", "Implement core features...", "coder")
153
+ Task("Tester agent", "Create comprehensive tests...", "tester")
154
+ Task("Reviewer agent", "Review code quality...", "reviewer")
155
+ Task("Architect agent", "Design system architecture...", "system-architect")
156
+ ```
157
+
158
+ **MCP tools are ONLY for coordination setup:**
159
+ ### MCP Integration
160
+ **TRIGGER WORDS: SWARM, SPAWN, COORDINATE, TEAM**
161
+ - `mcp__claude-flow-novice__swarm_init` - Initialize coordination topology
162
+ - `mcp__claude-flow-novice__agent_spawn` - Define agent types for coordination
163
+ - `mcp__claude-flow-novice__task_orchestrate` - Orchestrate high-level workflows
164
+ - **Monitoring**: `swarm_status`, `agent_metrics`, `task_results`
165
+ - **Memory**: `memory_usage`, `memory_search`
166
+
167
+ ## File Organization
168
+ - **Never save working files to root**
169
+
170
+ # Add MCP server
171
+ claude mcp add claude-flow-novice npx claude-flow-novice mcp start
172
+
173
+
174
+ ## Essential Commands
175
+ - `npx claude-flow-novice status` - System health
176
+ - `npx claude-flow-novice --help` - Available commands
177
+ - `/fullstack "goal"` - Launch full-stack development team with consensus validation
178
+ - `/swarm`, `/sparc`, `/hooks` - Other slash commands (auto-discovered)
179
+
180
+ ## DEVELOPMENT FLOW LOOP
181
+ 1. Execute - Primary swarm (3-8 agents) produces deliverables with confidence score. Each agent MUST be using the enhanced post edit pipeline after file edits.
182
+ 2. When the swarm believes its done with all tasks, move to step 4
183
+ 3. If swarm does not believe it's done (confidence scores < 75%, relaunch agents for step 1)
184
+ 4. Verify - Consensus swarm (2-4 validators) runs comprehensive checks with Byzantine voting
185
+ 5. Decision - PASS (≥90% agreement + critical criteria) OR FAIL
186
+ 6. Action -
187
+ - PASS → Store results → Move to next task
188
+ - FAIL → Round++ → If <10: inject feedback → Relaunch swarm on step 1 | If ≥10: Escalate to human
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Claude Flow CLI - Universal Wrapper
5
+ * Works in both CommonJS and ES Module projects
6
+ */
7
+
8
+ // Use dynamic import to work in both CommonJS and ES modules
9
+ (async () => {
10
+ const { spawn } = await import('child_process');
11
+ const { resolve } = await import('path');
12
+ const { fileURLToPath } = await import('url');
13
+
14
+ // Detect if we're running in ES module context
15
+ let __dirname;
16
+ try {
17
+ // Check if import.meta is available (ES modules)
18
+ if (typeof import.meta !== 'undefined' && import.meta.url) {
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ __dirname = resolve(__filename, '..');
21
+ } else {
22
+ // Fallback for CommonJS
23
+ __dirname = process.cwd();
24
+ }
25
+ } catch {
26
+ // Fallback for CommonJS
27
+ __dirname = process.cwd();
28
+ }
29
+
30
+ // Try multiple strategies to find claude-flow
31
+ const strategies = [
32
+ // 1. Local node_modules
33
+ async () => {
34
+ try {
35
+ const localPath = resolve(process.cwd(), 'node_modules/.bin/claude-flow');
36
+ const { existsSync } = await import('fs');
37
+ if (existsSync(localPath)) {
38
+ return spawn(localPath, process.argv.slice(2), { stdio: 'inherit' });
39
+ }
40
+ } catch {}
41
+ },
42
+
43
+ // 2. Parent node_modules (monorepo)
44
+ async () => {
45
+ try {
46
+ const parentPath = resolve(process.cwd(), '../node_modules/.bin/claude-flow');
47
+ const { existsSync } = await import('fs');
48
+ if (existsSync(parentPath)) {
49
+ return spawn(parentPath, process.argv.slice(2), { stdio: 'inherit' });
50
+ }
51
+ } catch {}
52
+ },
53
+
54
+ // 3. NPX with latest alpha version (prioritized over global)
55
+ async () => {
56
+ return spawn('npx', ['claude-flow@alpha', ...process.argv.slice(2)], {
57
+ stdio: 'inherit',
58
+ });
59
+ },
60
+ ];
61
+
62
+ // Try each strategy
63
+ for (const strategy of strategies) {
64
+ try {
65
+ const child = await strategy();
66
+ if (child) {
67
+ child.on('exit', (code) => process.exit(code || 0));
68
+ child.on('error', (err) => {
69
+ if (err.code !== 'ENOENT') {
70
+ console.error('Error:', err);
71
+ process.exit(1);
72
+ }
73
+ });
74
+ return;
75
+ }
76
+ } catch {}
77
+ }
78
+
79
+ console.error('Could not find claude-flow. Please install it with: npm install claude-flow');
80
+ process.exit(1);
81
+ })();
@@ -0,0 +1,18 @@
1
+ @echo off
2
+ :: Claude Flow CLI for Windows
3
+ :: AI-Driven Development Toolkit
4
+
5
+ setlocal
6
+
7
+ :: Check if Node.js is installed
8
+ where node >nul 2>nul
9
+ if %errorlevel% neq 0 (
10
+ echo Error: Node.js is not installed or not in PATH
11
+ echo Please install Node.js from https://nodejs.org/
12
+ exit /b 1
13
+ )
14
+
15
+ :: Run Claude Flow CLI
16
+ node "%~dp0claude-flow" %*
17
+
18
+ endlocal
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env pwsh
2
+ # Claude Flow CLI for PowerShell
3
+ # AI-Driven Development Toolkit
4
+
5
+ param(
6
+ [Parameter(ValueFromRemainingArguments=$true)]
7
+ [string[]]$Arguments
8
+ )
9
+
10
+ # Check if Node.js is installed
11
+ if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
12
+ Write-Error "Node.js is not installed or not in PATH"
13
+ Write-Error "Please install Node.js from https://nodejs.org/"
14
+ exit 1
15
+ }
16
+
17
+ # Get the script directory
18
+ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
19
+
20
+ # Run Claude Flow CLI
21
+ & node "$scriptDir\claude-flow" @Arguments
22
+
23
+ # Forward the exit code
24
+ exit $LASTEXITCODE