@cloudpftc/opencode-orchestrator 3.6.0 → 3.6.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.
- package/.opencode/helpers/auto-memory-hook.mjs +104 -0
- package/.opencode/helpers/hook-handler.cjs +223 -0
- package/.opencode/helpers/intelligence.cjs +197 -0
- package/.opencode/helpers/memory.js +83 -0
- package/.opencode/helpers/post-commit +16 -0
- package/.opencode/helpers/pre-commit +26 -0
- package/.opencode/helpers/router.js +66 -0
- package/.opencode/helpers/session.js +127 -0
- package/.opencode/helpers/statusline.cjs +774 -0
- package/.opencode/settings.json +319 -0
- package/package.json +1 -1
- package/v3/@claude-flow/cli/README.md +391 -534
- package/v3/@claude-flow/cli/dist/src/commands/benchmark.js +2 -2
- package/v3/@claude-flow/cli/dist/src/commands/claims.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/config.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/daemon.js +3 -3
- package/v3/@claude-flow/cli/dist/src/commands/deployment.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/doctor.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/embeddings.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/hooks.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/init.js +9 -9
- package/v3/@claude-flow/cli/dist/src/commands/neural.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/performance.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/plugins.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/providers.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/security.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/start.js +10 -10
- package/v3/@claude-flow/cli/dist/src/commands/status.js +2 -2
- package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js +1 -1
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +1 -1
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +1 -1
- package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js +1 -1
- package/v3/@claude-flow/cli/dist/src/runtime/headless.js +3 -3
- package/v3/@claude-flow/cli/dist/src/services/claim-service.js +1 -1
- package/v3/@claude-flow/cli/dist/src/types.d.ts +1 -1
- package/v3/@claude-flow/cli/dist/src/types.js +1 -1
- package/v3/@claude-flow/cli/package.json +1 -1
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +0 -25
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +0 -486
|
@@ -1,486 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLAUDE.md Generator
|
|
3
|
-
* Generates enforceable, analyzer-optimized Claude Code configuration
|
|
4
|
-
* with template variants for different usage patterns.
|
|
5
|
-
*
|
|
6
|
-
* Templates: minimal | standard | full | security | performance | solo
|
|
7
|
-
* All templates use bullet-format rules with imperative keywords for enforceability.
|
|
8
|
-
*/
|
|
9
|
-
// --- Section Generators (each returns enforceable markdown) ---
|
|
10
|
-
function behavioralRules() {
|
|
11
|
-
return `## Behavioral Rules (Always Enforced)
|
|
12
|
-
|
|
13
|
-
- Do what has been asked; nothing more, nothing less
|
|
14
|
-
- NEVER create files unless they're absolutely necessary for achieving your goal
|
|
15
|
-
- ALWAYS prefer editing an existing file to creating a new one
|
|
16
|
-
- NEVER proactively create documentation files (*.md) or README files unless explicitly requested
|
|
17
|
-
- NEVER save working files, text/mds, or tests to the root folder
|
|
18
|
-
- Never continuously check status after spawning a swarm — wait for results
|
|
19
|
-
- ALWAYS read a file before editing it
|
|
20
|
-
- NEVER commit secrets, credentials, or .env files`;
|
|
21
|
-
}
|
|
22
|
-
function fileOrganization() {
|
|
23
|
-
return `## File Organization
|
|
24
|
-
|
|
25
|
-
- NEVER save to root folder — use the directories below
|
|
26
|
-
- Use \`/src\` for source code files
|
|
27
|
-
- Use \`/tests\` for test files
|
|
28
|
-
- Use \`/docs\` for documentation and markdown files
|
|
29
|
-
- Use \`/config\` for configuration files
|
|
30
|
-
- Use \`/scripts\` for utility scripts
|
|
31
|
-
- Use \`/examples\` for example code`;
|
|
32
|
-
}
|
|
33
|
-
function projectArchitecture(options) {
|
|
34
|
-
return `## Project Architecture
|
|
35
|
-
|
|
36
|
-
- Follow Domain-Driven Design with bounded contexts
|
|
37
|
-
- Keep files under 500 lines
|
|
38
|
-
- Use typed interfaces for all public APIs
|
|
39
|
-
- Prefer TDD London School (mock-first) for new code
|
|
40
|
-
- Use event sourcing for state changes
|
|
41
|
-
- Ensure input validation at system boundaries
|
|
42
|
-
|
|
43
|
-
### Project Config
|
|
44
|
-
|
|
45
|
-
- **Topology**: ${options.runtime.topology}
|
|
46
|
-
- **Max Agents**: ${options.runtime.maxAgents}
|
|
47
|
-
- **Memory**: ${options.runtime.memoryBackend}
|
|
48
|
-
- **HNSW**: ${options.runtime.enableHNSW ? 'Enabled' : 'Disabled'}
|
|
49
|
-
- **Neural**: ${options.runtime.enableNeural ? 'Enabled' : 'Disabled'}`;
|
|
50
|
-
}
|
|
51
|
-
function concurrencyRules() {
|
|
52
|
-
return `## Concurrency: 1 MESSAGE = ALL RELATED OPERATIONS
|
|
53
|
-
|
|
54
|
-
- All operations MUST be concurrent/parallel in a single message
|
|
55
|
-
- Use Claude Code's Task tool for spawning agents, not just MCP
|
|
56
|
-
- ALWAYS batch ALL todos in ONE TodoWrite call (5-10+ minimum)
|
|
57
|
-
- ALWAYS spawn ALL agents in ONE message with full instructions via Task tool
|
|
58
|
-
- ALWAYS batch ALL file reads/writes/edits in ONE message
|
|
59
|
-
- ALWAYS batch ALL Bash commands in ONE message`;
|
|
60
|
-
}
|
|
61
|
-
function swarmOrchestration() {
|
|
62
|
-
return `## Swarm Orchestration
|
|
63
|
-
|
|
64
|
-
- MUST initialize the swarm using CLI tools when starting complex tasks
|
|
65
|
-
- MUST spawn concurrent agents using Claude Code's Task tool
|
|
66
|
-
- Never use CLI tools alone for execution — Task tool agents do the actual work
|
|
67
|
-
- MUST call CLI tools AND Task tool in ONE message for complex work
|
|
68
|
-
|
|
69
|
-
### 3-Tier Model Routing (ADR-026)
|
|
70
|
-
|
|
71
|
-
| Tier | Handler | Latency | Cost | Use Cases |
|
|
72
|
-
|------|---------|---------|------|-----------|
|
|
73
|
-
| **1** | Agent Booster (WASM) | <1ms | $0 | Simple transforms (var→const, add types) — Skip LLM |
|
|
74
|
-
| **2** | Haiku | ~500ms | $0.0002 | Simple tasks, low complexity (<30%) |
|
|
75
|
-
| **3** | Sonnet/Opus | 2-5s | $0.003-0.015 | Complex reasoning, architecture, security (>30%) |
|
|
76
|
-
|
|
77
|
-
- Always check for \`[AGENT_BOOSTER_AVAILABLE]\` or \`[TASK_MODEL_RECOMMENDATION]\` before spawning agents
|
|
78
|
-
- Use Edit tool directly when \`[AGENT_BOOSTER_AVAILABLE]\``;
|
|
79
|
-
}
|
|
80
|
-
function antiDriftConfig() {
|
|
81
|
-
return `## Swarm Configuration & Anti-Drift
|
|
82
|
-
|
|
83
|
-
- ALWAYS use hierarchical topology for coding swarms
|
|
84
|
-
- Keep maxAgents at 6-8 for tight coordination
|
|
85
|
-
- Use specialized strategy for clear role boundaries
|
|
86
|
-
- Use \`raft\` consensus for hive-mind (leader maintains authoritative state)
|
|
87
|
-
- Run frequent checkpoints via \`post-task\` hooks
|
|
88
|
-
- Keep shared memory namespace for all agents
|
|
89
|
-
|
|
90
|
-
\`\`\`bash
|
|
91
|
-
npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
|
|
92
|
-
\`\`\``;
|
|
93
|
-
}
|
|
94
|
-
function autoStartProtocol() {
|
|
95
|
-
return `## Swarm Protocols & Routing
|
|
96
|
-
|
|
97
|
-
### Auto-Start Swarm Protocol
|
|
98
|
-
|
|
99
|
-
When the user requests a complex task, spawn agents in background and WAIT:
|
|
100
|
-
|
|
101
|
-
\`\`\`javascript
|
|
102
|
-
// STEP 1: Initialize swarm coordination
|
|
103
|
-
Bash("npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized")
|
|
104
|
-
|
|
105
|
-
// STEP 2: Spawn ALL agents IN BACKGROUND in a SINGLE message
|
|
106
|
-
Task({prompt: "Research requirements...", subagent_type: "researcher", run_in_background: true})
|
|
107
|
-
Task({prompt: "Design architecture...", subagent_type: "system-architect", run_in_background: true})
|
|
108
|
-
Task({prompt: "Implement solution...", subagent_type: "coder", run_in_background: true})
|
|
109
|
-
Task({prompt: "Write tests...", subagent_type: "tester", run_in_background: true})
|
|
110
|
-
Task({prompt: "Review code quality...", subagent_type: "reviewer", run_in_background: true})
|
|
111
|
-
\`\`\`
|
|
112
|
-
|
|
113
|
-
### Agent Routing
|
|
114
|
-
|
|
115
|
-
| Code | Task | Agents |
|
|
116
|
-
|------|------|--------|
|
|
117
|
-
| 1 | Bug Fix | coordinator, researcher, coder, tester |
|
|
118
|
-
| 3 | Feature | coordinator, architect, coder, tester, reviewer |
|
|
119
|
-
| 5 | Refactor | coordinator, architect, coder, reviewer |
|
|
120
|
-
| 7 | Performance | coordinator, perf-engineer, coder |
|
|
121
|
-
| 9 | Security | coordinator, security-architect, auditor |
|
|
122
|
-
|
|
123
|
-
### Task Complexity Detection
|
|
124
|
-
|
|
125
|
-
- AUTO-INVOKE SWARM when task involves: 3+ files, new features, cross-module refactoring, API changes, security, or performance work
|
|
126
|
-
- SKIP SWARM for: single file edits, simple bug fixes (1-2 lines), documentation updates, configuration changes`;
|
|
127
|
-
}
|
|
128
|
-
function executionRules() {
|
|
129
|
-
return `## Swarm Execution Rules
|
|
130
|
-
|
|
131
|
-
- ALWAYS use \`run_in_background: true\` for all agent Task calls
|
|
132
|
-
- ALWAYS put ALL agent Task calls in ONE message for parallel execution
|
|
133
|
-
- After spawning, STOP — do NOT add more tool calls or check status
|
|
134
|
-
- Never poll TaskOutput or check swarm status — trust agents to return
|
|
135
|
-
- When agent results arrive, review ALL results before proceeding`;
|
|
136
|
-
}
|
|
137
|
-
function cliCommandsTable() {
|
|
138
|
-
return `## V3 CLI Commands
|
|
139
|
-
|
|
140
|
-
### Core Commands
|
|
141
|
-
|
|
142
|
-
| Command | Subcommands | Description |
|
|
143
|
-
|---------|-------------|-------------|
|
|
144
|
-
| \`init\` | 4 | Project initialization |
|
|
145
|
-
| \`agent\` | 8 | Agent lifecycle management |
|
|
146
|
-
| \`swarm\` | 6 | Multi-agent swarm coordination |
|
|
147
|
-
| \`memory\` | 11 | AgentDB memory with HNSW search |
|
|
148
|
-
| \`task\` | 6 | Task creation and lifecycle |
|
|
149
|
-
| \`session\` | 7 | Session state management |
|
|
150
|
-
| \`hooks\` | 17 | Self-learning hooks + 12 workers |
|
|
151
|
-
| \`hive-mind\` | 6 | Byzantine fault-tolerant consensus |
|
|
152
|
-
|
|
153
|
-
### Quick CLI Examples
|
|
154
|
-
|
|
155
|
-
\`\`\`bash
|
|
156
|
-
npx @claude-flow/cli@latest init --wizard
|
|
157
|
-
npx @claude-flow/cli@latest agent spawn -t coder --name my-coder
|
|
158
|
-
npx @claude-flow/cli@latest swarm init --v3-mode
|
|
159
|
-
npx @claude-flow/cli@latest memory search --query "authentication patterns"
|
|
160
|
-
npx @claude-flow/cli@latest doctor --fix
|
|
161
|
-
\`\`\``;
|
|
162
|
-
}
|
|
163
|
-
function agentTypes() {
|
|
164
|
-
return `## Available Agents (60+ Types)
|
|
165
|
-
|
|
166
|
-
### Core Development
|
|
167
|
-
\`coder\`, \`reviewer\`, \`tester\`, \`planner\`, \`researcher\`
|
|
168
|
-
|
|
169
|
-
### Specialized
|
|
170
|
-
\`security-architect\`, \`security-auditor\`, \`memory-specialist\`, \`performance-engineer\`
|
|
171
|
-
|
|
172
|
-
### Swarm Coordination
|
|
173
|
-
\`hierarchical-coordinator\`, \`mesh-coordinator\`, \`adaptive-coordinator\`
|
|
174
|
-
|
|
175
|
-
### GitHub & Repository
|
|
176
|
-
\`pr-manager\`, \`code-review-swarm\`, \`issue-tracker\`, \`release-manager\`
|
|
177
|
-
|
|
178
|
-
### SPARC Methodology
|
|
179
|
-
\`sparc-coord\`, \`sparc-coder\`, \`specification\`, \`pseudocode\`, \`architecture\``;
|
|
180
|
-
}
|
|
181
|
-
function hooksSystem() {
|
|
182
|
-
return `## Hooks System (27 Hooks + 12 Workers)
|
|
183
|
-
|
|
184
|
-
### Essential Hooks
|
|
185
|
-
|
|
186
|
-
| Hook | Description |
|
|
187
|
-
|------|-------------|
|
|
188
|
-
| \`pre-task\` / \`post-task\` | Task lifecycle with learning |
|
|
189
|
-
| \`pre-edit\` / \`post-edit\` | File editing with neural training |
|
|
190
|
-
| \`session-start\` / \`session-end\` | Session state persistence |
|
|
191
|
-
| \`route\` | Route task to optimal agent |
|
|
192
|
-
| \`intelligence\` | RuVector intelligence system |
|
|
193
|
-
| \`worker\` | Background worker management |
|
|
194
|
-
|
|
195
|
-
### 12 Background Workers
|
|
196
|
-
|
|
197
|
-
| Worker | Priority | Description |
|
|
198
|
-
|--------|----------|-------------|
|
|
199
|
-
| \`optimize\` | high | Performance optimization |
|
|
200
|
-
| \`audit\` | critical | Security analysis |
|
|
201
|
-
| \`testgaps\` | normal | Test coverage analysis |
|
|
202
|
-
| \`map\` | normal | Codebase mapping |
|
|
203
|
-
| \`deepdive\` | normal | Deep code analysis |
|
|
204
|
-
| \`document\` | normal | Auto-documentation |
|
|
205
|
-
|
|
206
|
-
\`\`\`bash
|
|
207
|
-
npx @claude-flow/cli@latest hooks pre-task --description "[task]"
|
|
208
|
-
npx @claude-flow/cli@latest hooks post-task --task-id "[id]" --success true
|
|
209
|
-
npx @claude-flow/cli@latest hooks worker dispatch --trigger audit
|
|
210
|
-
\`\`\``;
|
|
211
|
-
}
|
|
212
|
-
function learningProtocol() {
|
|
213
|
-
return `## Auto-Learning Protocol
|
|
214
|
-
|
|
215
|
-
### Before Starting Any Task
|
|
216
|
-
\`\`\`bash
|
|
217
|
-
npx @claude-flow/cli@latest memory search --query "[task keywords]" --namespace patterns
|
|
218
|
-
npx @claude-flow/cli@latest hooks route --task "[task description]"
|
|
219
|
-
\`\`\`
|
|
220
|
-
|
|
221
|
-
### After Completing Any Task Successfully
|
|
222
|
-
\`\`\`bash
|
|
223
|
-
npx @claude-flow/cli@latest memory store --namespace patterns --key "[pattern-name]" --value "[what worked]"
|
|
224
|
-
npx @claude-flow/cli@latest hooks post-task --task-id "[id]" --success true --store-results true
|
|
225
|
-
\`\`\`
|
|
226
|
-
|
|
227
|
-
- ALWAYS check memory before starting new features, debugging, or refactoring
|
|
228
|
-
- ALWAYS store patterns in memory after solving bugs, completing features, or finding optimizations`;
|
|
229
|
-
}
|
|
230
|
-
function memoryCommands() {
|
|
231
|
-
return `## Memory Commands Reference
|
|
232
|
-
|
|
233
|
-
\`\`\`bash
|
|
234
|
-
# Store (REQUIRED: --key, --value; OPTIONAL: --namespace, --ttl, --tags)
|
|
235
|
-
npx @claude-flow/cli@latest memory store --key "pattern-auth" --value "JWT with refresh" --namespace patterns
|
|
236
|
-
|
|
237
|
-
# Search (REQUIRED: --query; OPTIONAL: --namespace, --limit, --threshold)
|
|
238
|
-
npx @claude-flow/cli@latest memory search --query "authentication patterns"
|
|
239
|
-
|
|
240
|
-
# List (OPTIONAL: --namespace, --limit)
|
|
241
|
-
npx @claude-flow/cli@latest memory list --namespace patterns --limit 10
|
|
242
|
-
|
|
243
|
-
# Retrieve (REQUIRED: --key; OPTIONAL: --namespace)
|
|
244
|
-
npx @claude-flow/cli@latest memory retrieve --key "pattern-auth" --namespace patterns
|
|
245
|
-
\`\`\``;
|
|
246
|
-
}
|
|
247
|
-
function securityRulesLight() {
|
|
248
|
-
return `## Security Rules
|
|
249
|
-
|
|
250
|
-
- NEVER hardcode API keys, secrets, or credentials in source files
|
|
251
|
-
- NEVER commit .env files or any file containing secrets
|
|
252
|
-
- Always validate user input at system boundaries
|
|
253
|
-
- Always sanitize file paths to prevent directory traversal
|
|
254
|
-
- Run \`npx @claude-flow/cli@latest security scan\` after security-related changes`;
|
|
255
|
-
}
|
|
256
|
-
function buildAndTest() {
|
|
257
|
-
return `## Build & Test
|
|
258
|
-
|
|
259
|
-
\`\`\`bash
|
|
260
|
-
# Build
|
|
261
|
-
npm run build
|
|
262
|
-
|
|
263
|
-
# Test
|
|
264
|
-
npm test
|
|
265
|
-
|
|
266
|
-
# Lint
|
|
267
|
-
npm run lint
|
|
268
|
-
\`\`\`
|
|
269
|
-
|
|
270
|
-
- ALWAYS run tests after making code changes
|
|
271
|
-
- ALWAYS verify build succeeds before committing`;
|
|
272
|
-
}
|
|
273
|
-
function securitySection() {
|
|
274
|
-
return `## Security Protocol
|
|
275
|
-
|
|
276
|
-
- NEVER hardcode API keys, secrets, or credentials in source files
|
|
277
|
-
- NEVER commit .env files or any file containing secrets
|
|
278
|
-
- Always validate all user input at system boundaries using Zod schemas
|
|
279
|
-
- Always sanitize file paths to prevent directory traversal attacks
|
|
280
|
-
- Always use parameterized queries — never concatenate SQL strings
|
|
281
|
-
- Run security audit after any authentication or authorization changes
|
|
282
|
-
|
|
283
|
-
### Security Scanning
|
|
284
|
-
\`\`\`bash
|
|
285
|
-
npx @claude-flow/cli@latest security scan --depth full
|
|
286
|
-
npx @claude-flow/cli@latest security audit --report
|
|
287
|
-
npx @claude-flow/cli@latest security cve --check
|
|
288
|
-
\`\`\`
|
|
289
|
-
|
|
290
|
-
### Security Agents
|
|
291
|
-
- \`security-architect\` — threat modeling, architecture review
|
|
292
|
-
- \`security-auditor\` — code audit, vulnerability detection
|
|
293
|
-
- Use agent routing code 9 (hierarchical/specialized) for security tasks`;
|
|
294
|
-
}
|
|
295
|
-
function performanceSection() {
|
|
296
|
-
return `## Performance Optimization Protocol
|
|
297
|
-
|
|
298
|
-
- Always run benchmarks before and after performance changes
|
|
299
|
-
- Always profile before optimizing — never guess at bottlenecks
|
|
300
|
-
- Prefer algorithmic improvements over micro-optimizations
|
|
301
|
-
- Keep HNSW search within 150x-12,500x faster target
|
|
302
|
-
- Keep memory reduction within 50-75% target with quantization
|
|
303
|
-
|
|
304
|
-
### Performance Tooling
|
|
305
|
-
\`\`\`bash
|
|
306
|
-
npx @claude-flow/cli@latest performance benchmark --suite all
|
|
307
|
-
npx @claude-flow/cli@latest performance profile --target "[component]"
|
|
308
|
-
npx @claude-flow/cli@latest performance metrics --format table
|
|
309
|
-
\`\`\`
|
|
310
|
-
|
|
311
|
-
### Performance Agents
|
|
312
|
-
- \`performance-engineer\` — profiling, benchmarking, optimization
|
|
313
|
-
- \`perf-analyzer\` — bottleneck detection, analysis
|
|
314
|
-
- Use agent routing code 7 (hierarchical/specialized) for performance tasks`;
|
|
315
|
-
}
|
|
316
|
-
function intelligenceSystem() {
|
|
317
|
-
return `## Intelligence System (RuVector)
|
|
318
|
-
|
|
319
|
-
- **SONA**: Self-Optimizing Neural Architecture (<0.05ms adaptation)
|
|
320
|
-
- **HNSW**: 150x-12,500x faster pattern search
|
|
321
|
-
- **EWC++**: Elastic Weight Consolidation (prevents forgetting)
|
|
322
|
-
- **Flash Attention**: 2.49x-7.47x speedup
|
|
323
|
-
|
|
324
|
-
The 4-step intelligence pipeline:
|
|
325
|
-
1. **RETRIEVE** - Fetch relevant patterns via HNSW
|
|
326
|
-
2. **JUDGE** - Evaluate with verdicts (success/failure)
|
|
327
|
-
3. **DISTILL** - Extract key learnings via LoRA
|
|
328
|
-
4. **CONSOLIDATE** - Prevent catastrophic forgetting via EWC++`;
|
|
329
|
-
}
|
|
330
|
-
function envVars() {
|
|
331
|
-
return `## Environment Variables
|
|
332
|
-
|
|
333
|
-
\`\`\`bash
|
|
334
|
-
CLAUDE_FLOW_CONFIG=./claude-flow.config.json
|
|
335
|
-
CLAUDE_FLOW_LOG_LEVEL=info
|
|
336
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
337
|
-
CLAUDE_FLOW_MEMORY_BACKEND=hybrid
|
|
338
|
-
CLAUDE_FLOW_MEMORY_PATH=./data/memory
|
|
339
|
-
\`\`\``;
|
|
340
|
-
}
|
|
341
|
-
function setupAndBoundary() {
|
|
342
|
-
return `## Quick Setup
|
|
343
|
-
|
|
344
|
-
\`\`\`bash
|
|
345
|
-
claude mcp add claude-flow -- npx -y @claude-flow/cli@latest
|
|
346
|
-
npx @claude-flow/cli@latest daemon start
|
|
347
|
-
npx @claude-flow/cli@latest doctor --fix
|
|
348
|
-
\`\`\`
|
|
349
|
-
|
|
350
|
-
## Claude Code vs CLI Tools
|
|
351
|
-
|
|
352
|
-
- Claude Code's Task tool handles ALL execution: agents, file ops, code generation, git
|
|
353
|
-
- CLI tools handle coordination via Bash: swarm init, memory, hooks, routing
|
|
354
|
-
- NEVER use CLI tools as a substitute for Task tool agents
|
|
355
|
-
|
|
356
|
-
## Support
|
|
357
|
-
|
|
358
|
-
- Documentation: https://github.com/ruvnet/claude-flow
|
|
359
|
-
- Issues: https://github.com/ruvnet/claude-flow/issues`;
|
|
360
|
-
}
|
|
361
|
-
// --- Template Composers ---
|
|
362
|
-
/**
|
|
363
|
-
* Template section map — defines which sections are included per template.
|
|
364
|
-
*/
|
|
365
|
-
const TEMPLATE_SECTIONS = {
|
|
366
|
-
minimal: [
|
|
367
|
-
behavioralRules,
|
|
368
|
-
fileOrganization,
|
|
369
|
-
projectArchitecture,
|
|
370
|
-
(_opts) => buildAndTest(),
|
|
371
|
-
(_opts) => securityRulesLight(),
|
|
372
|
-
concurrencyRules,
|
|
373
|
-
(_opts) => antiDriftConfig(),
|
|
374
|
-
executionRules,
|
|
375
|
-
(_opts) => cliCommandsTable(),
|
|
376
|
-
(_opts) => setupAndBoundary(),
|
|
377
|
-
],
|
|
378
|
-
standard: [
|
|
379
|
-
behavioralRules,
|
|
380
|
-
fileOrganization,
|
|
381
|
-
projectArchitecture,
|
|
382
|
-
(_opts) => buildAndTest(),
|
|
383
|
-
(_opts) => securityRulesLight(),
|
|
384
|
-
concurrencyRules,
|
|
385
|
-
(_opts) => swarmOrchestration(),
|
|
386
|
-
(_opts) => antiDriftConfig(),
|
|
387
|
-
executionRules,
|
|
388
|
-
(_opts) => cliCommandsTable(),
|
|
389
|
-
(_opts) => agentTypes(),
|
|
390
|
-
(_opts) => memoryCommands(),
|
|
391
|
-
(_opts) => setupAndBoundary(),
|
|
392
|
-
],
|
|
393
|
-
full: [
|
|
394
|
-
behavioralRules,
|
|
395
|
-
fileOrganization,
|
|
396
|
-
projectArchitecture,
|
|
397
|
-
(_opts) => buildAndTest(),
|
|
398
|
-
(_opts) => securityRulesLight(),
|
|
399
|
-
concurrencyRules,
|
|
400
|
-
(_opts) => swarmOrchestration(),
|
|
401
|
-
(_opts) => antiDriftConfig(),
|
|
402
|
-
(_opts) => autoStartProtocol(),
|
|
403
|
-
executionRules,
|
|
404
|
-
(_opts) => cliCommandsTable(),
|
|
405
|
-
(_opts) => agentTypes(),
|
|
406
|
-
(_opts) => hooksSystem(),
|
|
407
|
-
(_opts) => learningProtocol(),
|
|
408
|
-
(_opts) => memoryCommands(),
|
|
409
|
-
(_opts) => intelligenceSystem(),
|
|
410
|
-
(_opts) => envVars(),
|
|
411
|
-
(_opts) => setupAndBoundary(),
|
|
412
|
-
],
|
|
413
|
-
security: [
|
|
414
|
-
behavioralRules,
|
|
415
|
-
fileOrganization,
|
|
416
|
-
projectArchitecture,
|
|
417
|
-
(_opts) => buildAndTest(),
|
|
418
|
-
concurrencyRules,
|
|
419
|
-
(_opts) => swarmOrchestration(),
|
|
420
|
-
(_opts) => antiDriftConfig(),
|
|
421
|
-
executionRules,
|
|
422
|
-
(_opts) => securitySection(),
|
|
423
|
-
(_opts) => cliCommandsTable(),
|
|
424
|
-
(_opts) => agentTypes(),
|
|
425
|
-
(_opts) => memoryCommands(),
|
|
426
|
-
(_opts) => setupAndBoundary(),
|
|
427
|
-
],
|
|
428
|
-
performance: [
|
|
429
|
-
behavioralRules,
|
|
430
|
-
fileOrganization,
|
|
431
|
-
projectArchitecture,
|
|
432
|
-
(_opts) => buildAndTest(),
|
|
433
|
-
(_opts) => securityRulesLight(),
|
|
434
|
-
concurrencyRules,
|
|
435
|
-
(_opts) => swarmOrchestration(),
|
|
436
|
-
(_opts) => antiDriftConfig(),
|
|
437
|
-
executionRules,
|
|
438
|
-
(_opts) => performanceSection(),
|
|
439
|
-
(_opts) => cliCommandsTable(),
|
|
440
|
-
(_opts) => agentTypes(),
|
|
441
|
-
(_opts) => memoryCommands(),
|
|
442
|
-
(_opts) => intelligenceSystem(),
|
|
443
|
-
(_opts) => setupAndBoundary(),
|
|
444
|
-
],
|
|
445
|
-
solo: [
|
|
446
|
-
behavioralRules,
|
|
447
|
-
fileOrganization,
|
|
448
|
-
projectArchitecture,
|
|
449
|
-
(_opts) => buildAndTest(),
|
|
450
|
-
(_opts) => securityRulesLight(),
|
|
451
|
-
concurrencyRules,
|
|
452
|
-
executionRules,
|
|
453
|
-
(_opts) => cliCommandsTable(),
|
|
454
|
-
(_opts) => memoryCommands(),
|
|
455
|
-
(_opts) => setupAndBoundary(),
|
|
456
|
-
],
|
|
457
|
-
};
|
|
458
|
-
// --- Public API ---
|
|
459
|
-
/**
|
|
460
|
-
* Generate CLAUDE.md content based on init options and template.
|
|
461
|
-
* Template is determined by: options.runtime.claudeMdTemplate > explicit param > 'standard'
|
|
462
|
-
*/
|
|
463
|
-
export function generateClaudeMd(options, template) {
|
|
464
|
-
const tmpl = template ?? options.runtime.claudeMdTemplate ?? 'standard';
|
|
465
|
-
const sections = TEMPLATE_SECTIONS[tmpl] ?? TEMPLATE_SECTIONS.standard;
|
|
466
|
-
const header = `# Claude Code Configuration - RuFlo V3\n`;
|
|
467
|
-
const body = sections.map(fn => fn(options)).join('\n\n');
|
|
468
|
-
return `${header}\n${body}\n`;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Generate minimal CLAUDE.md content (backward-compatible alias).
|
|
472
|
-
*/
|
|
473
|
-
export function generateMinimalClaudeMd(options) {
|
|
474
|
-
return generateClaudeMd(options, 'minimal');
|
|
475
|
-
}
|
|
476
|
-
/** Available template names for CLI wizard */
|
|
477
|
-
export const CLAUDE_MD_TEMPLATES = [
|
|
478
|
-
{ name: 'minimal', description: 'Quick start — behavioral rules, anti-drift config, CLI reference (~120 lines)' },
|
|
479
|
-
{ name: 'standard', description: 'Recommended — swarm orchestration, agents, memory commands (~250 lines)' },
|
|
480
|
-
{ name: 'full', description: 'Everything — hooks, learning protocol, intelligence system (~400 lines)' },
|
|
481
|
-
{ name: 'security', description: 'Security-focused — adds security scanning, audit protocols, CVE checks' },
|
|
482
|
-
{ name: 'performance', description: 'Performance-focused — adds benchmarking, profiling, optimization protocols' },
|
|
483
|
-
{ name: 'solo', description: 'Solo developer — no swarm, simple agent usage, memory commands (~150 lines)' },
|
|
484
|
-
];
|
|
485
|
-
export default generateClaudeMd;
|
|
486
|
-
//# sourceMappingURL=claudemd-generator.js.map
|