claude-flow-novice 2.4.2 → 2.5.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.
package/CLAUDE.md ADDED
@@ -0,0 +1,346 @@
1
+ # Claude Flow Novice — AI Agent Orchestration
2
+
3
+ **🚀 Production Status:** Redis coordination system fully deployed (Phase 7 - 2025-10-17)
4
+
5
+ ---
6
+
7
+ ## 1) Critical Rules (Single Source of Truth)
8
+
9
+ **Main Chat Role (Thin Orchestration Layer):**
10
+ * Main chat does ONLY: minimal investigation → determine task type → spawn coordinator + agents in single message → wait for results
11
+ * ALL coordination happens via Redis between coordinator and agents
12
+ * Main chat does NOT orchestrate agents directly - coordinator handles all agent coordination
13
+ * Agents communicate via Redis pub/sub with explicit dependencies (see `.claude/redis-agent-dependencies.md`)
14
+
15
+ **Core Principles:**
16
+ * Use agents for all non-trivial work (≥3 steps or multi-file/research/testing/architecture/security)
17
+ * **PRIMARY COORDINATOR: Use coordinator-hybrid for all multi-agent coordination** (cost-optimized CLI spawning with typed agents)
18
+ * Initialize swarm before multi-agent work
19
+ * Batch operations: spawn ALL agents (coordinator + workers) in single message
20
+ * Run post-edit hook after every file edit
21
+ * **REQUIRED: All CLI agent spawning must use explicit --agents flag with typed agents**
22
+ * **Context continuity:** Redis/SQLite persistence enables unlimited continuation — never stop due to context/token concerns
23
+
24
+ **Prohibited Patterns:**
25
+ * Main chat orchestrating agents directly — spawn coordinator to handle orchestration
26
+ * Spawning agents across multiple messages — use single message for coordinator + all agents
27
+ * Working solo on multi-step tasks — spawn parallel specialists via coordinator-hybrid
28
+ * Using generic "coordinator" fallback when coordinator-hybrid available
29
+ * Spawning agents without explicit --agents flag (must specify types from AVAILABLE-AGENTS.md)
30
+ * Agent coordination without Redis pub/sub messaging — ALL agents must use Redis
31
+ * Running tests inside agents — coordinator runs tests ONCE; workers read cached results from test-results.json
32
+ * Concurrent test runs — terminate previous runs first
33
+ * **Saving to project root — check `.artifacts/logs/post-edit-pipeline.log` after writes; move files if ROOT_WARNING**
34
+ * Creating guides/summaries/reports unless explicitly asked
35
+ * Asking permission to retry/advance when criteria/iterations allow — **relaunch agents immediately when consensus <threshold and iterations <max**
36
+ * Stopping work due to context/token concerns — Redis/SQLite persistence handles continuation automatically
37
+
38
+ **Communication:**
39
+ * Use spartan language
40
+ * Redis persistence enables swarm recovery — state survives interruptions
41
+ * ALL agent communication MUST use Redis pub/sub — no direct file coordination
42
+
43
+ **Consensus thresholds** (mode-dependent)
44
+
45
+ * Standard mode: Gate ≥0.75 • Consensus ≥0.90 • 4 validators • single PO
46
+ * MVP mode: Gate ≥0.65 • Consensus ≥0.85 • 2 validators • single PO
47
+ * Enterprise mode: Gate ≥0.85 • Consensus ≥0.95 • 5 validators • 4-person board • Loop 0.5 planning
48
+
49
+ ---
50
+
51
+ ## 2) When Agents Are Mandatory (Triggers)
52
+
53
+ If **any** apply, spawn coordinator-hybrid (which spawns typed specialist agents):
54
+
55
+ * > 3 distinct steps • multiple files • research+implement+test • design decisions • code review/quality • security/performance/compliance • system integration • docs generation • refactor/optimize • any feature work
56
+
57
+ **Coordinator Selection Priority:**
58
+ 1. **coordinator-hybrid** (PRIMARY) - All multi-agent work, CLI spawning with --agents flag, cost-optimized ($0 coordinator + $0.50 workers)
59
+ 2. **adaptive-coordinator** - Only for 8+ agents with dynamic topology switching
60
+ 3. **coordinator** - FALLBACK ONLY when specialized coordinators unavailable
61
+
62
+ **Required Spawning Pattern:**
63
+ ```bash
64
+ # ✅ CORRECT: Explicit typed agents
65
+ node src/cli/hybrid-routing/spawn-workers.js \
66
+ "Task description" \
67
+ --agents=analyst,architect,coder \
68
+ --provider zai
69
+
70
+ # ❌ WRONG: Missing --agents flag (will error)
71
+ node src/cli/hybrid-routing/spawn-workers.js "Task description" --max-agents 3
72
+ ```
73
+
74
+ ---
75
+
76
+ ## 3) Execution Patterns
77
+
78
+ ### 3.1 Swarm Init → Spawn (Single Message)
79
+
80
+ **Swarm Init Pattern: ONCE per phase, not per round**
81
+ ```bash
82
+ # Phase-level initialization (persistent through all loops)
83
+ executeSwarm({
84
+ swarmId: "phase-0-mcp-less-foundation",
85
+ objective: "Phase 0: MCP-Less Foundation",
86
+ strategy: "development",
87
+ mode: "mesh",
88
+ persistence: true
89
+ })
90
+ ```
91
+
92
+ **Redis-backed Swarm Execution**:
93
+ ```bash
94
+ npx claude-flow-novice swarm "Create REST API with authentication" --strategy development --max-agents 3
95
+ ```
96
+
97
+ **Topology**: mesh (2–7), hierarchical (8+)
98
+
99
+ ### 3.2 Post-Edit Hook (Mandatory)
100
+
101
+ ```bash
102
+ node config/hooks/post-edit-pipeline.js "[FILE]" --memory-key "swarm/[agent]/[step]"
103
+ ```
104
+
105
+ **Hook runs automatically after Edit/Write/MultiEdit** but output is NOT captured by default.
106
+
107
+ **Root Directory Warnings:**
108
+ If file created in root, hook returns `status: "ROOT_WARNING"` with `rootWarning.suggestions[]`. Agent MUST:
109
+ 1. Check log file: `.artifacts/logs/post-edit-pipeline.log` (last entry)
110
+ 2. If `status: "ROOT_WARNING"`, move file to suggested location
111
+ 3. Common suggestions: `src/`, `docs/`, `config/`, `tests/`, `scripts/`
112
+
113
+ **Example Response:**
114
+ ```json
115
+ {
116
+ "status": "ROOT_WARNING",
117
+ "rootWarning": {
118
+ "suggestions": [
119
+ {"location": "src/example.js", "reason": "Source code directory"},
120
+ {"location": "docs/example.md", "reason": "Documentation directory"}
121
+ ]
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### 3.3 Safe Test Execution
127
+
128
+ **Pattern: Coordinator runs tests ONCE before spawning workers**
129
+
130
+ ```bash
131
+ # 1. Coordinator terminates any existing test runs
132
+ pkill -f vitest; pkill -f "npm test"
133
+
134
+ # 2. Coordinator runs tests once and caches results
135
+ npm test -- --run --reporter=json > test-results.json 2>&1
136
+
137
+ # 3. Workers read cached results only (no test execution)
138
+ cat test-results.json
139
+
140
+ # 4. Cleanup after all work complete
141
+ pkill -f vitest; pkill -f "npm test"
142
+ ```
143
+
144
+ **Rules:**
145
+ * Coordinator executes tests before worker spawn
146
+ * Workers ONLY read test-results.json (never run tests)
147
+ * Single test execution prevents concurrent run conflicts
148
+ * Cache results in test-results.json for worker consumption
149
+
150
+ ### 3.4 Batching (One message = all related ops)
151
+
152
+ * Spawn all agents with Task tool in one message
153
+ * Batch file ops, bash, todos, memory ops
154
+
155
+ ---
156
+
157
+ ## 4) CFN Loop Overview
158
+
159
+ **→ Full CFN Loop rules: `.claude/cfn-loop-rules.md` (auto-injected by CFN commands)**
160
+
161
+ **Mode Comparison:**
162
+
163
+ | Mode | Gate | Consensus | Iterations | Validators |
164
+ |------|------|-----------|------------|------------|
165
+ | MVP | ≥0.65 | ≥0.85 | 5 | 2 |
166
+ | Standard | ≥0.75 | ≥0.90 | 10 | 4 |
167
+ | Enterprise | ≥0.85 | ≥0.95 | 15 | 5 |
168
+
169
+ **Coordinator Patterns:** See `.claude/coordinator-patterns.md`
170
+
171
+ ---
172
+
173
+ ## 5) Coordination Checklist
174
+
175
+ **Before**: initialize SQLite memory system → assess complexity → set agent count/types → choose topology → prepare single spawn message
176
+
177
+ **During**: coordinate via SwarmMemory → post-edit hook after every edit → self-validate and report confidence
178
+
179
+ **After**: achieve ≥0.80-0.95 validator consensus → store results → auto next steps
180
+
181
+ ---
182
+
183
+ ## 6) Hook Feedback System (Phase 4.5)
184
+
185
+ **Auto-enabled:** Agents receive real-time feedback from post-edit hook via Redis.
186
+
187
+ ### CLI Mode (Direct Subscription)
188
+ CLI-spawned agents auto-subscribe to `agent:{agentId}:feedback`:
189
+ - Feedback delivered within 100ms
190
+ - Written to `.artifacts/agents/{agentId}/pending-feedback.json`
191
+
192
+ ### Task Mode (Coordinator-Mediated)
193
+ Task-spawned agents receive feedback via coordinator wake:
194
+ - Coordinator polls `coordinator:{id}:feedback` every 5s
195
+ - On feedback: Coordinator wakes agent with system reminder
196
+
197
+ ### Feedback Types (Priority Order)
198
+
199
+ | Type | Severity | Action Required |
200
+ |------|----------|-----------------|
201
+ | `ROOT_WARNING` | High | Move file from root to suggested location |
202
+ | `TDD_VIOLATION` | High | Write tests before continuing |
203
+ | `LOW_COVERAGE` | Medium | Increase test coverage to threshold |
204
+ | `RUST_QUALITY` | Medium | Fix code quality issues |
205
+ | `LINT_ISSUES` | Low | Fix linting errors |
206
+
207
+ ### Handling Feedback (Agents)
208
+
209
+ **ROOT_WARNING example:**
210
+ ```bash
211
+ # Feedback: File created in root
212
+ mv test.txt src/test.txt # Move to suggested location
213
+ ```
214
+
215
+ **→ Pattern: `.claude/coordinator-feedback-pattern.md`**
216
+
217
+ ### 6.3 Dashboard Integration (Phase 5)
218
+
219
+ **Real-time Dashboard:**
220
+ - URL: http://localhost:3001 (RealtimeServer)
221
+ - WebSocket: ws://localhost:3001/ws
222
+ - Components: RedisCoordinationMonitor.tsx
223
+
224
+ **REST API Endpoints:**
225
+ | Endpoint | Method | Description |
226
+ |----------|--------|-------------|
227
+ | /api/redis/feedback | GET | Recent feedback (limit=100) |
228
+ | /api/redis/metrics | GET | Current metrics snapshot |
229
+ | /api/swarm/status | GET | Current swarm coordination status |
230
+
231
+ **CLI Monitoring Commands:**
232
+ ```bash
233
+ # Monitor feedback
234
+ ./scripts/monitor-swarm-redis.sh feedback
235
+
236
+ # Monitor CFN Loop
237
+ ./scripts/monitor-swarm-redis.sh coordination
238
+
239
+ # Realtime dashboard launch
240
+ npx claude-flow-novice dashboard --port 3001
241
+ ```
242
+
243
+ **Post-Spawn Validation:**
244
+ ```bash
245
+ # Validate CLI agent
246
+ node config/hooks/post-spawn-validation.js coder-1
247
+
248
+ # Validate Task agent
249
+ node config/hooks/post-spawn-validation.js task_abc123 --coordinator-id coordinator-cfn
250
+ ```
251
+
252
+ **WebSocket Event Types:**
253
+ - `swarm:coordination`
254
+ - `agent:feedback`
255
+ - `system:metrics`
256
+ - `dashboard:status`
257
+
258
+ ---
259
+
260
+ ## 7) Commands & Setup
261
+
262
+ **Swarm Execution:**
263
+ ```bash
264
+ npx claude-flow-novice swarm "Create REST API" --strategy development --max-agents 3
265
+ redis-cli publish "swarm:coordination" '{"agent":"id","status":"message"}'
266
+ ```
267
+
268
+ **CFN Loop Commands:**
269
+ ```bash
270
+ /cfn-loop "Task" --mode=mvp|standard|enterprise
271
+ /cfn-loop-sprints "Phase" --sprints=3
272
+ /cfn-loop-epic "Epic" --phases=4
273
+ ```
274
+
275
+ ---
276
+
277
+ ## 8) SQLite Memory System
278
+
279
+ **5-Level ACL:**
280
+
281
+ | Level | Scope | Encryption | Loop Use |
282
+ |-------|-------|------------|----------|
283
+ | 1 | Agent | AES-256 | Loop 3 |
284
+ | 2 | Team | AES-256 | Team sync |
285
+ | 3 | Swarm | None | Loop 2 |
286
+ | 4 | Project | None | Loop 4 |
287
+ | 5 | System | Master key | Audit |
288
+
289
+ **Agent Usage:**
290
+ ```javascript
291
+ const memory = new SQLiteMemorySystem({ swarmId, agentId, dbPath });
292
+ await memory.initialize();
293
+ await memory.memoryAdapter.set(key, value, { agentId, aclLevel, namespace });
294
+ const data = await memory.memoryAdapter.get(key, { agentId });
295
+ ```
296
+
297
+ **Architecture**: Redis (hot, 1h TTL) + SQLite (persistent, 30-365d)
298
+ **Performance**: Write <60ms, Read <5ms (Redis) / <20ms (SQLite)
299
+
300
+ **→ Detailed commands: `readme/additional-commands.md` Section "SQLite Memory & ACL Commands"**
301
+
302
+ ---
303
+
304
+ ## 8) Output & Telemetry (Concise)
305
+
306
+ **Agent confidence JSON (per agent)**
307
+ ```json
308
+ { "agent": "coder-1", "confidence": 0.85, "reasoning": "tests pass; security clean", "blockers": [] }
309
+ ```
310
+
311
+ **Next steps block**
312
+ * ✅ Completed: brief list
313
+ * 📊 Validation: confidence, coverage, consensus
314
+ * 🔍 Issues: debt/warnings
315
+ * 💡 Recommendations: prioritized
316
+
317
+ ---
318
+
319
+ ## 9) CLI Command Reference
320
+
321
+ ### Swarm Management
322
+ ```bash
323
+ # Initialize and execute swarms
324
+ npx claude-flow-novice swarm "Objective description" --strategy development --max-agents 5
325
+ npx claude-flow-novice swarm "Research cloud patterns" --strategy research
326
+
327
+ # Monitor swarm status
328
+ claude-flow-novice swarm status
329
+ claude-flow-novice metrics --format=json
330
+ ```
331
+
332
+ ### Development Workflows
333
+ ```bash
334
+ # Execute CFN Loop
335
+ /cfn-loop "Implement authentication system" --phase=auth --mode=standard
336
+ /cfn-loop "Build MVP prototype" --mode=mvp
337
+ /cfn-loop "Production API" --mode=enterprise
338
+
339
+ # Epic and sprint orchestration
340
+ /cfn-loop-sprints "E-commerce platform" --sprints=3 --mode=enterprise
341
+ /cfn-loop-epic "User management system" --phases=4 --mode=standard
342
+ ```
343
+
344
+ ---
345
+
346
+ For specialized commands (fullstack development, SPARC methodology, fleet management, event bus, compliance, performance, markdown validation, utilities, metrics reporting, WASM optimization, build/deployment, neural operations, GitHub integration, workflow automation, security/monitoring, debugging, and SDK integration), see `readme/additional-commands.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.4.2",
3
+ "version": "2.5.0",
4
4
  "description": "AI Agent Orchestration CLI",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
@@ -14,6 +14,7 @@
14
14
  "src",
15
15
  "README.md",
16
16
  "CHANGELOG.md",
17
+ "CLAUDE.md",
17
18
  "LICENSE",
18
19
  "SYNC_USAGE.md",
19
20
  "config",
@@ -22,6 +23,7 @@
22
23
  "readme"
23
24
  ],
24
25
  "scripts": {
26
+ "postinstall": "node scripts/postinstall.js",
25
27
  "build": "npm run clean && tsc && rollup -c",
26
28
  "clean": "rimraf dist",
27
29
  "lint": "eslint . --ext .ts",
@@ -74,6 +76,16 @@
74
76
  "typescript": "^5.9.3"
75
77
  },
76
78
  "dependencies": {
77
- "ioredis": "^5.8.1"
79
+ "ioredis": "^5.8.1",
80
+ "redis": "^4.7.0",
81
+ "socket.io-client": "^4.8.1"
82
+ },
83
+ "peerDependencies": {
84
+ "better-sqlite3": "^11.0.0"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "better-sqlite3": {
88
+ "optional": true
89
+ }
78
90
  }
79
91
  }
@@ -1,94 +1,122 @@
1
1
  #!/usr/bin/env node
2
+ const fs = require('node:fs');
3
+ const path = require('node:path');
4
+ const { execSync } = require('node:child_process');
5
+
6
+ // Logging utility
7
+ function log(message, type = 'info') {
8
+ const colors = {
9
+ info: '\x1b[36m', // Cyan
10
+ warn: '\x1b[33m', // Yellow
11
+ error: '\x1b[31m' // Red
12
+ };
13
+ console.log(`${colors[type]}[Claude Flow] ${message}\x1b[0m`);
14
+ }
2
15
 
3
- /**
4
- * Post-installation script for claude-flow-novice
5
- * Copies .claude directory from package to project root
6
- * Overwrites existing files to ensure updates work correctly
7
- */
16
+ // Generate timestamped backup filename
17
+ function getBackupFilename(basePath) {
18
+ const timestamp = new Date().toISOString()
19
+ .replace(/:/g, '-')
20
+ .replace(/\./g, '_');
21
+ return `${basePath}_backup_${timestamp}`;
22
+ }
8
23
 
9
- import { existsSync, readdirSync, statSync, copyFileSync, mkdirSync } from 'fs';
10
- import { dirname, join, relative } from 'path';
11
- import { fileURLToPath } from 'url';
24
+ // Check if running in development mode (not as installed dependency)
25
+ function isDevMode() {
26
+ try {
27
+ const packageJson = require(path.resolve(process.cwd(), 'package.json'));
28
+ // We're in dev mode if the package name matches (developing the package itself)
29
+ return packageJson.name === 'claude-flow-novice';
30
+ } catch {
31
+ return false;
32
+ }
33
+ }
12
34
 
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = dirname(__filename);
35
+ // Perform backup before sync
36
+ async function backupDirectory(sourcePath, targetPath) {
37
+ if (fs.existsSync(targetPath)) {
38
+ const backupPath = getBackupFilename(targetPath);
39
+ try {
40
+ fs.renameSync(targetPath, backupPath);
41
+ log(`Created backup: ${backupPath}`, 'info');
42
+ } catch (err) {
43
+ log(`Failed to create backup: ${err.message}`, 'warn');
44
+ }
45
+ }
46
+ }
15
47
 
48
+ // Sync directories
49
+ async function syncDirectories() {
50
+ // Skip if we're in development mode (developing the package itself)
51
+ if (isDevMode()) {
52
+ log('Development mode detected - skipping auto-sync', 'info');
53
+ return;
54
+ }
16
55
 
17
- /**
18
- * Copy .claude directory from node_modules to project root
19
- * Shows progress for each file copied
20
- */
21
- function copyClaudeDirectory() {
22
- try {
23
- const projectRoot = process.cwd();
24
-
25
- // Try multiple source locations (handles both dev and installed package scenarios)
26
- const possibleSources = [
27
- join(__dirname, '../dist/.claude'), // Installed package: node_modules/claude-flow-novice/scripts/ → dist/.claude
28
- join(__dirname, '../.claude'), // Direct execution from repo root
29
- join(__dirname, '../../.claude'), // Execution from dist/scripts/
30
- ];
31
-
32
- const sourceDir = possibleSources.find(dir => existsSync(dir));
33
- const targetDir = join(projectRoot, '.claude');
34
-
35
- console.log('🚀 claude-flow-novice post-install: Setting up .claude directory...');
36
- console.log('📂 Source:', sourceDir);
37
- console.log('📁 Target:', targetDir);
38
- console.log('');
39
-
40
- // Check if source directory was found
41
- if (!sourceDir) {
42
- console.error('❌ Source .claude directory not found. Tried:');
43
- possibleSources.forEach(dir => console.error(` - ${dir}`));
44
- console.log(' This indicates a broken npm package installation.');
45
- process.exit(1);
56
+ log('Auto-syncing agents, commands, and hooks to your project...', 'info');
57
+
58
+ const projectRoot = process.cwd();
59
+
60
+ const syncConfigs = [
61
+ {
62
+ source: path.join(__dirname, '..', '.claude', 'agents'),
63
+ target: path.join(projectRoot, '.claude', 'agents')
64
+ },
65
+ {
66
+ source: path.join(__dirname, '..', '.claude', 'commands'),
67
+ target: path.join(projectRoot, '.claude', 'commands')
68
+ },
69
+ {
70
+ source: path.join(__dirname, '..', 'config', 'hooks'),
71
+ target: path.join(projectRoot, 'config', 'hooks')
46
72
  }
47
-
48
- let fileCount = 0;
49
-
50
- /**
51
- * Recursively copy directory with progress output
52
- */
53
- function copyWithProgress(source, target) {
54
- const stat = statSync(source);
55
-
56
- if (stat.isDirectory()) {
57
- // Create directory if it doesn't exist
58
- if (!existsSync(target)) {
59
- mkdirSync(target, { recursive: true });
60
- }
61
-
62
- // Copy all entries in directory
63
- const entries = readdirSync(source);
64
- for (const entry of entries) {
65
- copyWithProgress(join(source, entry), join(target, entry));
66
- }
67
- } else {
68
- // Copy file and show progress
69
- const relativePath = relative(sourceDir, source);
70
- const status = existsSync(target) ? '♻️ Overwriting' : '📄 Copying';
71
- console.log(`${status}: ${relativePath}`);
72
-
73
- copyFileSync(source, target);
74
- fileCount++;
73
+ ];
74
+
75
+ for (const config of syncConfigs) {
76
+ try {
77
+ // Create target directory if it doesn't exist
78
+ fs.mkdirSync(path.dirname(config.target), { recursive: true });
79
+
80
+ // Backup existing directory
81
+ await backupDirectory(config.source, config.target);
82
+
83
+ // Perform directory copy using cp command
84
+ const sourcePath = config.source;
85
+ const targetPath = config.target;
86
+
87
+ try {
88
+ execSync(`cp -r "${sourcePath}" "${targetPath}"`, { stdio: 'ignore' });
89
+ log(`Synced ${path.basename(config.source)}/ to project`, 'info');
90
+ } catch (cpError) {
91
+ // Fallback to recursive copy for Windows
92
+ copyDirRecursive(sourcePath, targetPath);
93
+ log(`Synced ${path.basename(config.source)}/ to project`, 'info');
75
94
  }
95
+ } catch (err) {
96
+ log(`Sync failed for ${path.basename(config.source)}: ${err.message}`, 'error');
76
97
  }
98
+ }
99
+ }
77
100
 
78
- // Start copying
79
- copyWithProgress(sourceDir, targetDir);
101
+ // Fallback recursive copy for Windows
102
+ function copyDirRecursive(src, dest) {
103
+ fs.mkdirSync(dest, { recursive: true });
104
+ const entries = fs.readdirSync(src, { withFileTypes: true });
80
105
 
81
- console.log('');
82
- console.log(`✅ Successfully copied ${fileCount} files`);
83
- console.log('📁 Location:', targetDir);
84
- console.log('🎉 Installation complete! claude-flow-novice is ready to use.');
106
+ for (const entry of entries) {
107
+ const srcPath = path.join(src, entry.name);
108
+ const destPath = path.join(dest, entry.name);
85
109
 
86
- } catch (error) {
87
- console.error('❌ Post-install script failed:', error.message);
88
- console.error(' Please run manually: cp -r node_modules/claude-flow-novice/dist/.claude .claude');
89
- process.exit(1);
110
+ if (entry.isDirectory()) {
111
+ copyDirRecursive(srcPath, destPath);
112
+ } else {
113
+ fs.copyFileSync(srcPath, destPath);
114
+ }
90
115
  }
91
116
  }
92
117
 
93
- // Run the installation
94
- copyClaudeDirectory();
118
+ // Run sync
119
+ syncDirectories().catch(err => {
120
+ log(`Sync encountered an error: ${err.message}`, 'error');
121
+ process.exit(1);
122
+ });
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  /**
3
3
  * Cost-Savings Mode Toggle Script
4
4
  * Switches between CLI-based (cost-savings) and Task-tool coordination
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * Agent Lifecycle Hooks Validator
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * Real Hybrid Routing CLI - Spawns actual Claude agents with bash execution