claude-flow-novice 1.5.10 โ†’ 1.5.12

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-novice",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
4
4
  "description": "Standalone Claude Flow for beginners - AI agent orchestration made easy with enhanced TDD testing pipeline. Enhanced init command creates complete agent system, MCP configuration with 30 essential tools, and automated hooks with single-file testing, real-time coverage analysis, and advanced validation. Fully standalone with zero external dependencies, complete project setup in one command.",
5
5
  "mcpName": "io.github.ruvnet/claude-flow",
6
6
  "main": ".claude-flow-novice/dist/index.js",
@@ -2,24 +2,62 @@
2
2
 
3
3
  ## Core Orchestration Patterns
4
4
 
5
- ## ๐Ÿšจ CRITICAL: CONCURRENT EXECUTION & FILE MANAGEMENT
5
+ ## ๐Ÿšจ CRITICAL: MANDATORY AGENT-BASED EXECUTION
6
6
 
7
+ **YOU MUST USE AGENTS FOR ALL NON-TRIVIAL WORK - NO EXCEPTIONS**
7
8
 
8
9
  **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
10
+ 1. **ALWAYS USE AGENTS** - Tasks requiring >3 steps MUST use agent coordination
11
+ 2. **ALWAYS INITIALIZE SWARM** - ANY multi-agent task requires swarm_init FIRST
12
+ 3. **ALWAYS RUN POST-EDIT HOOKS** - After EVERY file edit without exception
13
+ 4. **ALWAYS BATCH OPERATIONS** - 1 MESSAGE = ALL RELATED OPERATIONS
14
+ 5. **NEVER WORK SOLO** - Spawn multiple agents in parallel for ALL significant tasks
15
+ 6. **NEVER SAVE TO ROOT** - Organize files in appropriate subdirectories
16
+ 7. **USE CLAUDE CODE'S TASK TOOL** - For spawning agents concurrently, not just MCP
17
+
18
+ ### ๐Ÿšซ WHEN YOU MUST USE AGENTS (MANDATORY)
19
+
20
+ **TRIGGER CONDITIONS - If ANY apply, you MUST spawn agents:**
21
+ - Task requires >3 distinct steps
22
+ - Multiple files need to be created or modified
23
+ - Need research + implementation + testing
24
+ - Architecture or design decisions required
25
+ - Code review or quality validation needed
26
+ - Security, performance, or compliance concerns
27
+ - Integration across multiple systems/components
28
+ - Documentation generation needed
29
+ - Refactoring or optimization work
30
+ - ANY feature development (even "simple" ones)
31
+
32
+ ### Agent Requirements by Task Complexity
33
+
34
+ | Task Size | Steps | Agent Count | Example Team Composition |
35
+ |-----------|-------|-------------|--------------------------|
36
+ | **Simple** | 3-5 | 2-3 agents | coder + tester + reviewer |
37
+ | **Medium** | 6-10 | 4-6 agents | + researcher + architect + security-specialist |
38
+ | **Complex** | 11-20 | 8-12 agents | Full specialist team with domain experts |
39
+ | **Enterprise** | 20+ | 15-20 agents | + devops + api-docs + perf-analyzer + coordinators |
13
40
 
14
41
  ### โšก GOLDEN RULE: "1 MESSAGE = ALL RELATED OPERATIONS"
15
42
 
16
43
  **MANDATORY PATTERNS:**
44
+ - **Agent Spawning**: ALWAYS spawn ALL required agents in ONE message using Task tool
17
45
  - **TodoWrite**: ALWAYS batch ALL todos in ONE call (5-10+ todos minimum)
18
46
  - **Task tool (Claude Code)**: ALWAYS spawn ALL agents in ONE message with full instructions
19
47
  - **File operations**: ALWAYS batch ALL reads/writes/edits in ONE message
20
48
  - **Bash commands**: ALWAYS batch ALL terminal operations in ONE message
21
49
  - **Memory operations**: ALWAYS batch ALL memory store/retrieve in ONE message
22
50
 
51
+ ### โš ๏ธ PROHIBITED SOLO WORK
52
+
53
+ **YOU ARE FORBIDDEN FROM:**
54
+ - โŒ Working alone on multi-step tasks
55
+ - โŒ Implementing features without agent coordination
56
+ - โŒ Skipping agent spawning because "it's simple"
57
+ - โŒ Writing code without a tester agent
58
+ - โŒ Making architectural decisions without an architect agent
59
+ - โŒ Deploying without security review from security-specialist agent
60
+
23
61
  ## ๐ŸŽฏ Claude Code vs MCP Tools
24
62
 
25
63
  ### Claude Code Handles ALL EXECUTION:
@@ -144,26 +182,132 @@ npx enhanced-hooks post-edit "src/lib.rs" --memory-key "backend/rust" --minimum-
144
182
  # Generate summaries and persist state
145
183
  npx claude-flow-novice hooks session-end --generate-summary true --persist-state true --export-metrics true
146
184
  ```
147
- **Claude Code's Task tool is the PRIMARY way to spawn agents:**
185
+ ### ๐ŸŽฏ Swarm Initialization (MANDATORY for ALL Multi-Agent Tasks)
186
+
187
+ **CRITICAL**: You MUST initialize swarm BEFORE spawning ANY multiple agents:
188
+
148
189
  ```javascript
149
- // โœ… CORRECT: Use Claude Code's Task tool for parallel agent execution
150
190
  [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")
191
+ // Step 1: ALWAYS initialize swarm first
192
+ mcp__claude-flow-novice__swarm_init({
193
+ topology: "mesh", // mesh (2-7 agents), hierarchical (8+)
194
+ maxAgents: 3, // Match your actual agent count
195
+ strategy: "balanced" // ensures agents coordinate and stay consistent
196
+ })
197
+
198
+ // Step 2: Spawn working agents via Task tool
199
+ Task("Agent 1", "Specific instructions...", "type")
200
+ Task("Agent 2", "Specific instructions...", "type")
201
+ Task("Agent 3", "Specific instructions...", "type")
156
202
  ```
157
203
 
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
204
+ **WHY THIS MATTERS:**
205
+ - โœ… **Prevents inconsistency**: Without swarm, 3 agents fixing JWT secrets will use 3 different methods
206
+ - โœ… **Ensures coordination**: Agents share findings and agree on approach
207
+ - โœ… **Memory coordination**: Agents access shared context via SwarmMemory
208
+ - โœ… **Byzantine consensus**: Final validation ensures all agents agree
209
+
210
+ **TOPOLOGY SELECTION:**
211
+ - **2-7 agents**: Use `topology: "mesh"` (peer-to-peer, equal collaboration)
212
+ - **8+ agents**: Use `topology: "hierarchical"` (coordinator-led structure)
213
+
214
+ **MCP Integration Tools:**
215
+ - `mcp__claude-flow-novice__swarm_init` - Initialize swarm topology (REQUIRED for ALL multi-agent tasks)
216
+ - `mcp__claude-flow-novice__agent_spawn` - Spawn coordination agents (recommended for consistency)
163
217
  - `mcp__claude-flow-novice__task_orchestrate` - Orchestrate high-level workflows
164
218
  - **Monitoring**: `swarm_status`, `agent_metrics`, `task_results`
165
219
  - **Memory**: `memory_usage`, `memory_search`
166
220
 
221
+ ---
222
+
223
+ ## ๐Ÿ“‹ AGENT COORDINATION RULES
224
+
225
+ ### Universal Agent Spawning Pattern
226
+
227
+ **EVERY multi-agent task follows this structure:**
228
+
229
+ ```javascript
230
+ [Single Message]:
231
+ // Step 1: ALWAYS initialize swarm first
232
+ mcp__claude-flow-novice__swarm_init({
233
+ topology: "mesh", // or "hierarchical" for 8+ agents
234
+ maxAgents: X, // match your actual agent count
235
+ strategy: "balanced" // or "adaptive" for complex tasks
236
+ })
237
+
238
+ // Step 2: Spawn ALL agents concurrently
239
+ Task("Agent Name", "Specific task instructions", "agent-type")
240
+ Task("Agent Name", "Specific task instructions", "agent-type")
241
+ Task("Agent Name", "Specific task instructions", "agent-type")
242
+ // ... continue for all agents
243
+ ```
244
+
245
+ ### Coordination Checklist
246
+
247
+ **Before spawning agents, ensure:**
248
+ - โœ… Task analyzed and complexity assessed (Simple/Medium/Complex/Enterprise)
249
+ - โœ… Agent count determined from requirements table
250
+ - โœ… Agent types selected for specific needs (not generic roles)
251
+ - โœ… Topology chosen: mesh (2-7) or hierarchical (8+)
252
+ - โœ… All agents will spawn in SINGLE message
253
+ - โœ… Each agent has specific, non-overlapping instructions
254
+
255
+ **During execution:**
256
+ - โœ… Agents coordinate through SwarmMemory
257
+ - โœ… Self-validation runs before consensus
258
+ - โœ… Each agent runs Post-edit hooks execute after file changes
259
+
260
+ **After completion:**
261
+ - โœ… Consensus validation achieved (โ‰ฅ90% agreement)
262
+ - โœ… Results stored in memory
263
+ - โœ… Next steps provided with claude code continuing to the next documented phase or next steps provided to user if no todos left
264
+
265
+ ### Agent Selection Guide
266
+
267
+ **Core Development**: coder, tester, reviewer
268
+ **Backend**: backend-dev, api-docs, system-architect
269
+ **Frontend**: coder (specialized), mobile-dev
270
+ **Quality**: tester, reviewer, security-specialist, perf-analyzer
271
+ **Planning**: researcher, planner, architect
272
+ **Operations**: devops-engineer, cicd-engineer
273
+ **Documentation**: api-docs, researcher
274
+
275
+ **Select agents based on actual task needs, not predefined patterns.**
276
+
277
+ ---
278
+
279
+ ### โš ๏ธ Real-World Example: Why Swarm Coordination Matters
280
+
281
+ **WITHOUT swarm_init (problematic):**
282
+ ```javascript
283
+ // โŒ BAD: Agents work independently with no coordination
284
+ [Single Message]:
285
+ Task("Agent 1", "Fix JWT secret issue", "coder")
286
+ Task("Agent 2", "Fix JWT secret issue", "coder")
287
+ Task("Agent 3", "Fix JWT secret issue", "coder")
288
+
289
+ // Result: 3 different solutions - environment variable, config file, hardcoded
290
+ // Problem: Inconsistent approach, wasted effort, integration conflicts
291
+ ```
292
+
293
+ **WITH swarm_init (correct):**
294
+ ```javascript
295
+ // โœ… GOOD: Agents coordinate through swarm
296
+ [Single Message]:
297
+ mcp__claude-flow-novice__swarm_init({
298
+ topology: "mesh",
299
+ maxAgents: 3,
300
+ strategy: "balanced"
301
+ })
302
+
303
+ Task("Agent 1", "Fix JWT secret issue", "coder")
304
+ Task("Agent 2", "Fix JWT secret issue", "coder")
305
+ Task("Agent 3", "Fix JWT secret issue", "coder")
306
+
307
+ // Result: All 3 agents agree on environment variable approach
308
+ // Benefit: Consistent solution, shared context, coordinated implementation
309
+ ```
310
+
167
311
  ## File Organization
168
312
  - **Never save working files to root**
169
313
 
@@ -177,12 +321,82 @@ claude mcp add claude-flow-novice npx claude-flow-novice mcp start
177
321
  - `/fullstack "goal"` - Launch full-stack development team with consensus validation
178
322
  - `/swarm`, `/sparc`, `/hooks` - Other slash commands (auto-discovered)
179
323
 
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
324
+ ## ๐Ÿ”„ MANDATORY DEVELOPMENT FLOW LOOP
325
+
326
+ **YOU MUST FOLLOW THIS LOOP FOR ALL NON-TRIVIAL WORK:**
327
+
328
+ ### Step 1: Initialize Swarm (ALWAYS for multi-agent tasks)
329
+ ```javascript
330
+ [Single Message]:
331
+ // ALWAYS initialize swarm when spawning multiple agents
332
+ mcp__claude-flow-novice__swarm_init({
333
+ topology: "mesh", // mesh for 2-7, hierarchical for 8+
334
+ maxAgents: 3, // match your actual agent count
335
+ strategy: "balanced" // ensures coordination and consistency
336
+ })
337
+
338
+ // Then spawn all agents - they will coordinate via swarm
339
+ Task("Agent 1", "Specific instructions", "type")
340
+ Task("Agent 2", "Specific instructions", "type")
341
+ Task("Agent 3", "Specific instructions", "type")
342
+ ```
343
+
344
+ **CRITICAL**: Without swarm_init, agents work independently and produce inconsistent results!
345
+
346
+ ### Step 2: Execute - Primary Swarm (3-20 agents)
347
+ - **Primary swarm** (3-8 agents minimum) produces deliverables with confidence scores
348
+ - **Self-validation**: Each agent validates own work (confidence threshold: 0.75)
349
+ - **Cross-agent coordination**: Agents share findings via SwarmMemory
350
+
351
+ ### Step 3: Self-Assessment Gate
352
+ - **If confidence scores โ‰ฅ75%** โ†’ Proceed to Step 4 (Consensus Verification)
353
+ - **If confidence scores <75%** โ†’ Relaunch agents for Step 2 with feedback
354
+ - **Maximum iterations**: 3 attempts before escalation
355
+
356
+ ### Step 4: Verify - Consensus Swarm (2-4 validators REQUIRED)
357
+ ```javascript
358
+ // MANDATORY: Spawn consensus validation swarm
359
+ [Single Message]:
360
+ Task("Validator 1", "Comprehensive quality review", "reviewer")
361
+ Task("Validator 2", "Security and performance audit", "security-specialist")
362
+ Task("Validator 3", "Architecture validation", "system-architect")
363
+ Task("Validator 4", "Integration testing", "tester")
364
+ ```
365
+ - **Byzantine consensus voting** across all validators
366
+ - **Multi-dimensional checks**: quality, security, performance, tests, docs
367
+
368
+ ### Step 5: Decision Gate
369
+ - **PASS**: โ‰ฅ90% validator agreement + all critical criteria met
370
+ - **FAIL**: <90% agreement OR any critical criterion failed
371
+
372
+ ### Step 6: Action Based on Decision
373
+ - **PASS** โ†’
374
+ 1. Store results in SwarmMemory
375
+ 2. Update documentation
376
+ 3. Update todos and move to next task
377
+
378
+ - **FAIL** โ†’
379
+ 1. Round counter++
380
+ 2. If Round < 10: Inject validator feedback โ†’ Return to Step 2
381
+ 3. If Round โ‰ฅ 10: Escalate to human with comprehensive report
382
+
383
+ ### ๐Ÿšจ ENFORCEMENT CHECKPOINTS
384
+
385
+ **MANDATORY before proceeding:**
386
+ 1. โœ… Agents spawned
387
+ 2. โœ… Each file edit followed by enhanced post-edit hook
388
+ 3. โœ… Self-validation confidence scores recorded
389
+ 4. โœ… Consensus swarm spawned for verification
390
+ 5. โœ… Byzantine voting completed
391
+ 6. โœ… Results stored in SwarmMemory
392
+
393
+ ---
394
+
395
+ ## ๐ŸŽฏ MANDATORY: NEXT STEPS GUIDANCE
396
+
397
+ **After completing ANY task, you MUST provide:**
398
+
399
+ 1. **โœ… What was completed**: Brief summary of delivered work
400
+ 2. **๐Ÿ“Š Validation results**: Confidence scores, test coverage, consensus approval
401
+ 3. **๐Ÿ” Identified issues**: Any technical debt, warnings, or concerns discovered
402
+ 4. **๐Ÿ’ก Recommended next steps**: Prioritized suggestions for logical continuation
@@ -19,8 +19,7 @@ const loadTemplate = (filename) => {
19
19
  export function createEnhancedClaudeMd() {
20
20
  const template = loadTemplate('CLAUDE.md');
21
21
  if (!template) {
22
- // Fallback to hardcoded if template file not found
23
- return createEnhancedClaudeMdFallback();
22
+ throw new Error('CLAUDE.md template file not found! Templates must be included in build.');
24
23
  }
25
24
  return template;
26
25
  }
@@ -2180,45 +2179,9 @@ if (Test-Path "$scriptPath\\package.json") {
2180
2179
  return '';
2181
2180
  }
2182
2181
 
2183
- // Fallback functions for when templates can't be loaded
2182
+ // DEPRECATED: Fallback functions removed - use template files only
2184
2183
  function createEnhancedClaudeMdFallback() {
2185
- // Read from the actual template file we created
2186
- try {
2187
- return readFileSync(join(__dirname, 'CLAUDE.md'), 'utf8');
2188
- } catch (error) {
2189
- // If that fails, return a minimal version
2190
- return `# Claude Code Configuration for Claude Flow
2191
-
2192
- ## ๐Ÿš€ IMPORTANT: Claude Flow AI-Driven Development
2193
-
2194
- ### Claude Code Handles:
2195
- - โœ… **ALL file operations** (Read, Write, Edit, MultiEdit)
2196
- - โœ… **ALL code generation** and development tasks
2197
- - โœ… **ALL bash commands** and system operations
2198
- - โœ… **ALL actual implementation** work
2199
- - โœ… **Project navigation** and code analysis
2200
-
2201
- ### Claude Flow MCP Tools Handle:
2202
- - ๐Ÿง  **Coordination only** - Orchestrating Claude Code's actions
2203
- - ๐Ÿ’พ **Memory management** - Persistent state across sessions
2204
- - ๐Ÿค– **Neural features** - Cognitive patterns and learning
2205
- - ๐Ÿ“Š **Performance tracking** - Monitoring and metrics
2206
- - ๐Ÿ **Swarm orchestration** - Multi-agent coordination
2207
- - ๐Ÿ”— **GitHub integration** - Advanced repository management
2208
-
2209
- ### โš ๏ธ Key Principle:
2210
- **MCP tools DO NOT create content or write code.** They coordinate and enhance Claude Code's native capabilities.
2211
-
2212
- ## Quick Start
2213
-
2214
- 1. Add MCP server: \`claude mcp add claude-flow-novice npx claude-flow-novice mcp start\`
2215
- 2. Initialize swarm: \`mcp__claude-flow__swarm_init { topology: "hierarchical" }\`
2216
- 3. Spawn agents: \`mcp__claude-flow__agent_spawn { type: "coder" }\`
2217
- 4. Orchestrate: \`mcp__claude-flow__task_orchestrate { task: "Build feature" }\`
2218
-
2219
- See full documentation in \`.claude/commands/\`
2220
- `;
2221
- }
2184
+ throw new Error('Template-only approach: createEnhancedClaudeMdFallback() is deprecated and removed.');
2222
2185
  }
2223
2186
 
2224
2187
  function createEnhancedSettingsJsonFallback() {
@@ -1,188 +0,0 @@
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