claude-flow-novice 1.5.21 โ†’ 1.5.22

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 (25) hide show
  1. package/.claude/agents/CLAUDE.md +186 -2386
  2. package/.claude/agents/agent-principles/agent-type-guidelines.md +328 -0
  3. package/.claude/agents/agent-principles/format-selection.md +204 -0
  4. package/.claude/agents/agent-principles/prompt-engineering.md +371 -0
  5. package/.claude/agents/agent-principles/quality-metrics.md +294 -0
  6. package/.claude/agents/frontend/README.md +574 -53
  7. package/.claude/agents/frontend/interaction-tester.md +850 -108
  8. package/.claude/agents/frontend/react-frontend-engineer.md +130 -0
  9. package/.claude/agents/frontend/state-architect.md +240 -152
  10. package/.claude/agents/frontend/ui-designer.md +292 -68
  11. package/.claude/agents/researcher.md +1 -1
  12. package/.claude/agents/swarm/test-coordinator.md +383 -0
  13. package/.claude/agents/task-coordinator.md +126 -0
  14. package/.claude/settings.json +7 -7
  15. package/.claude-flow-novice/dist/src/hooks/enhanced-hooks-cli.js +168 -167
  16. package/.claude-flow-novice/dist/src/providers/tiered-router.js +118 -0
  17. package/.claude-flow-novice/dist/src/providers/tiered-router.js.map +1 -0
  18. package/.claude-flow-novice/dist/src/providers/types.js.map +1 -1
  19. package/.claude-flow-novice/dist/src/providers/zai-provider.js +268 -0
  20. package/.claude-flow-novice/dist/src/providers/zai-provider.js.map +1 -0
  21. package/package.json +1 -1
  22. package/src/cli/simple-commands/init/templates/CLAUDE.md +25 -0
  23. package/src/hooks/enhanced-hooks-cli.js +23 -3
  24. package/src/hooks/enhanced-post-edit-pipeline.js +154 -75
  25. /package/.claude/agents/{CLAUDE_AGENT_DESIGN_PRINCIPLES.md โ†’ agent-principles/CLAUDE_AGENT_DESIGN_PRINCIPLES.md} +0 -0
@@ -2,86 +2,301 @@
2
2
 
3
3
  Specialized agents for modern frontend development with MCP integration.
4
4
 
5
+ ---
6
+
5
7
  ## Agent Overview
6
8
 
7
9
  ### ๐ŸŽจ UI Designer
8
10
  **File**: `ui-designer.md`
11
+ **Format**: MINIMAL (200-400 lines)
9
12
  **MCP**: shadcn
10
13
  **Focus**: Component design, layouts, accessibility
11
14
 
12
- **Spawn Pattern**:
13
- ```javascript
14
- Task("UI Designer", "Design responsive dashboard using shadcn", "coder")
15
- ```
15
+ **Format Rationale**:
16
+ - UI design is COMPLEX (creative, open-ended, requires design reasoning)
17
+ - Minimal format avoids over-constraining design solutions
18
+ - Trusts AI to make contextual design decisions
19
+ - +31% quality improvement vs Code-Heavy for complex tasks
20
+
21
+ **Capabilities**:
22
+ - React/Vue/Svelte component architecture
23
+ - Responsive design with Tailwind CSS
24
+ - Accessibility (WCAG 2.1 AA compliance)
25
+ - Shadcn UI component integration
26
+ - Design system implementation
27
+
28
+ ---
16
29
 
17
30
  ### ๐Ÿงช Interaction Tester
18
31
  **File**: `interaction-tester.md`
32
+ **Format**: METADATA (400-700 lines)
19
33
  **MCP**: Playwright
20
34
  **Focus**: E2E testing, visual regression, a11y validation
21
35
 
22
- **Spawn Pattern**:
23
- ```javascript
24
- Task("Interaction Tester", "Test checkout flow with screenshots", "tester")
25
- ```
36
+ **Format Rationale**:
37
+ - E2E testing is MEDIUM complexity (structured workflows with clear steps)
38
+ - Metadata format provides test strategy scaffolding
39
+ - Balances guidance with flexibility for test scenarios
40
+ - Structured YAML for test patterns and requirements
41
+
42
+ **Capabilities**:
43
+ - Playwright E2E test automation
44
+ - Visual regression testing with screenshots
45
+ - Accessibility validation (axe-core)
46
+ - Cross-browser testing (Chrome, Firefox, Safari)
47
+ - CI/CD integration for test pipelines
48
+
49
+ ---
26
50
 
27
51
  ### ๐Ÿ—๏ธ State Architect
28
52
  **File**: `state-architect.md`
53
+ **Format**: MINIMAL (200-400 lines)
29
54
  **MCP**: Sequential Thinking
30
55
  **Focus**: State management, data fetching, architecture
31
56
 
32
- **Spawn Pattern**:
57
+ **Format Rationale**:
58
+ - State architecture is COMPLEX (requires strategic thinking, trade-off analysis)
59
+ - Minimal format prevents over-specification of solutions
60
+ - Allows context-specific state management decisions
61
+ - Sequential Thinking MCP enables deep reasoning
62
+
63
+ **Capabilities**:
64
+ - State management design (Redux, Zustand, Context API, Jotai)
65
+ - Data fetching strategies (React Query, SWR, RTK Query)
66
+ - Architectural patterns (Flux, CQRS, Event Sourcing)
67
+ - Performance optimization (memoization, selectors)
68
+ - Integration with backend APIs
69
+
70
+ ---
71
+
72
+ ## Agent Capabilities Matrix
73
+
74
+ | Capability | UI Designer | Tester | Architect |
75
+ |------------|------------|--------|-----------|
76
+ | **Component Design** | โœ… Expert | โŒ | ๐ŸŸก Review |
77
+ | **State Management** | ๐ŸŸก Hooks | โŒ | โœ… Expert |
78
+ | **E2E Testing** | โŒ | โœ… Expert | ๐ŸŸก Strategy |
79
+ | **Visual Regression** | ๐ŸŸก Validate | โœ… Expert | โŒ |
80
+ | **Accessibility** | โœ… Expert | โœ… Validate | ๐ŸŸก Standards |
81
+ | **Performance Optimization** | ๐ŸŸก Implement | ๐ŸŸก Validate | โœ… Expert |
82
+ | **API Integration** | ๐ŸŸก Consume | โœ… Test | โœ… Design |
83
+ | **Architecture Design** | โŒ | โŒ | โœ… Expert |
84
+ | **CI/CD Integration** | โŒ | โœ… Expert | ๐ŸŸก Strategy |
85
+
86
+ Legend: โœ… Expert | ๐ŸŸก Supporting | โŒ Not responsible
87
+
88
+ ---
89
+
90
+ ## Team Coordination Patterns
91
+
92
+ ### ๐Ÿšจ CRITICAL: ALWAYS Initialize Swarm BEFORE Spawning Agents
93
+
94
+ **MANDATORY PATTERN:**
33
95
  ```javascript
34
- Task("State Architect", "Design cart state with Zustand", "architect")
96
+ [Single Message]:
97
+ // Step 1: ALWAYS initialize swarm first
98
+ mcp__claude-flow-novice__swarm_init({
99
+ topology: "mesh", // mesh for 2-7, hierarchical for 8+
100
+ maxAgents: 3, // match your actual agent count
101
+ strategy: "balanced" // ensures coordination and consistency
102
+ })
103
+
104
+ // Step 2: Spawn ALL agents concurrently
105
+ Task("UI Designer", "Design responsive dashboard using shadcn", "coder")
106
+ Task("Interaction Tester", "Test checkout flow with screenshots", "tester")
107
+ Task("State Architect", "Design cart state with Zustand", "architect")
35
108
  ```
36
109
 
37
- ## Team Coordination Patterns
110
+ **WHY THIS MATTERS:**
111
+ - โœ… Prevents inconsistency: Without swarm, 3 agents fixing the same bug will use 3 different approaches
112
+ - โœ… Ensures coordination: Agents share findings via SwarmMemory
113
+ - โœ… Byzantine consensus: Final validation ensures all agents agree
114
+
115
+ ---
116
+
117
+ ### Simple Project (2-3 agents)
38
118
 
39
- ### Simple Project (2 agents)
40
119
  ```javascript
41
- mcp__claude-flow-novice__swarm_init({
42
- topology: "mesh",
43
- maxAgents: 2,
44
- strategy: "balanced"
45
- })
120
+ [Single Message]:
121
+ // Initialize swarm topology
122
+ mcp__claude-flow-novice__swarm_init({
123
+ topology: "mesh",
124
+ maxAgents: 2,
125
+ strategy: "balanced"
126
+ })
127
+
128
+ // Spawn agents concurrently
129
+ Task("UI Designer", `
130
+ Design landing page components using shadcn:
131
+ - Hero section with responsive layout
132
+ - Feature cards with hover states
133
+ - Contact form with validation UI
134
+ - Accessibility: WCAG 2.1 AA
135
+ - Run post-edit hook after each file
136
+ `, "coder")
46
137
 
47
- Task("UI Designer", "Landing page components", "coder")
48
- Task("Interaction Tester", "User registration flow", "tester")
138
+ Task("Interaction Tester", `
139
+ Test user registration flow:
140
+ - E2E test with Playwright
141
+ - Visual regression screenshots
142
+ - Accessibility validation (axe-core)
143
+ - Cross-browser: Chrome, Firefox
144
+ - Run post-edit hook after test creation
145
+ `, "tester")
49
146
  ```
50
147
 
51
- ### Medium Project (3 agents)
148
+ **Topology Rationale**: Mesh (peer-to-peer) for 2 agents ensures direct coordination
149
+
150
+ ---
151
+
152
+ ### Medium Project (3-5 agents)
153
+
52
154
  ```javascript
53
- mcp__claude-flow-novice__swarm_init({
54
- topology: "mesh",
55
- maxAgents: 3,
56
- strategy: "balanced"
57
- })
155
+ [Single Message]:
156
+ // Initialize swarm topology
157
+ mcp__claude-flow-novice__swarm_init({
158
+ topology: "mesh",
159
+ maxAgents: 3,
160
+ strategy: "balanced"
161
+ })
162
+
163
+ // Spawn agents concurrently
164
+ Task("State Architect", `
165
+ Design cart state management:
166
+ - Evaluate Zustand vs Redux vs Context API
167
+ - Design cart operations (add, remove, update quantity)
168
+ - Optimistic updates strategy
169
+ - Persistence strategy (localStorage vs server sync)
170
+ - Share design via SwarmMemory
171
+ `, "architect")
58
172
 
59
- Task("State Architect", "Cart state management", "architect")
60
- Task("UI Designer", "Product card components", "coder")
61
- Task("Interaction Tester", "Add-to-cart flow", "tester")
173
+ Task("UI Designer", `
174
+ Design product card components:
175
+ - Product grid with responsive layout
176
+ - Product detail modal
177
+ - Add to cart interaction
178
+ - Price display and quantity selector
179
+ - Integrate with cart state from architect
180
+ - Run post-edit hook after each component
181
+ `, "coder")
182
+
183
+ Task("Interaction Tester", `
184
+ Test add-to-cart flow:
185
+ - E2E test: browse โ†’ select โ†’ add โ†’ checkout
186
+ - Visual regression for cart UI states
187
+ - Test cart persistence across sessions
188
+ - Performance: measure interaction delays
189
+ - Run post-edit hook after test suite
190
+ `, "tester")
62
191
  ```
63
192
 
64
- ### Complex Project (5+ agents)
193
+ **Topology Rationale**: Mesh for 3 agents enables full peer collaboration
194
+
195
+ ---
196
+
197
+ ### Complex Project (6-8 agents)
198
+
65
199
  ```javascript
66
- mcp__claude-flow-novice__swarm_init({
67
- topology: "hierarchical",
68
- maxAgents: 5,
69
- strategy: "adaptive"
70
- })
200
+ [Single Message]:
201
+ // Initialize hierarchical swarm for 8 agents
202
+ mcp__claude-flow-novice__swarm_init({
203
+ topology: "hierarchical",
204
+ maxAgents: 8,
205
+ strategy: "adaptive"
206
+ })
71
207
 
72
- Task("State Architect", "Full app state architecture", "architect")
73
- Task("UI Designer 1", "Dashboard components", "coder")
74
- Task("UI Designer 2", "Settings components", "coder")
75
- Task("Tester 1", "Dashboard flows", "tester")
76
- Task("Tester 2", "Settings flows", "tester")
208
+ // Spawn all agents concurrently
209
+ Task("State Architect", `
210
+ Design full app state architecture:
211
+ - Global state (auth, user profile, notifications)
212
+ - Feature state (dashboard, settings, analytics)
213
+ - Data fetching strategy (React Query vs SWR)
214
+ - Cache invalidation and optimistic updates
215
+ - State synchronization across tabs
216
+ - Share architecture via SwarmMemory
217
+ `, "architect")
218
+
219
+ Task("UI Designer - Dashboard", `
220
+ Design dashboard components:
221
+ - Dashboard layout with widget grid
222
+ - Chart components (line, bar, pie)
223
+ - Real-time data display
224
+ - Responsive layout for mobile/tablet
225
+ - Dark mode support
226
+ - Run post-edit hook after each component
227
+ `, "coder")
228
+
229
+ Task("UI Designer - Settings", `
230
+ Design settings components:
231
+ - Settings navigation sidebar
232
+ - Form components (profile, preferences, billing)
233
+ - Validation UI with error states
234
+ - Success/error toast notifications
235
+ - Run post-edit hook after each component
236
+ `, "coder")
237
+
238
+ Task("Tester - Dashboard Flows", `
239
+ Test dashboard user flows:
240
+ - E2E: login โ†’ view dashboard โ†’ interact with widgets
241
+ - Visual regression for all dashboard states
242
+ - Performance: measure chart render times
243
+ - Accessibility validation
244
+ - Run post-edit hook after test suite
245
+ `, "tester")
246
+
247
+ Task("Tester - Settings Flows", `
248
+ Test settings user flows:
249
+ - E2E: navigate settings โ†’ update profile โ†’ save
250
+ - Form validation testing
251
+ - Error state handling
252
+ - Cross-browser compatibility
253
+ - Run post-edit hook after test suite
254
+ `, "tester")
255
+
256
+ Task("Performance Analyzer", `
257
+ Analyze frontend performance:
258
+ - Bundle size analysis
259
+ - Lighthouse performance audit
260
+ - Core Web Vitals measurement
261
+ - Identify optimization opportunities
262
+ - Share findings via SwarmMemory
263
+ `, "perf-analyzer")
264
+
265
+ Task("Security Specialist", `
266
+ Frontend security review:
267
+ - XSS vulnerability analysis
268
+ - CSRF protection validation
269
+ - Dependency security audit
270
+ - Authentication token handling review
271
+ - Share findings via SwarmMemory
272
+ `, "security-specialist")
273
+
274
+ Task("Code Reviewer", `
275
+ Comprehensive code review:
276
+ - Review all component implementations
277
+ - Validate state architecture integration
278
+ - Check test coverage completeness
279
+ - Ensure accessibility standards
280
+ - Final Byzantine consensus validation
281
+ `, "reviewer")
77
282
  ```
78
283
 
79
- ## MCP Requirements
284
+ **Topology Rationale**: Hierarchical for 8 agents enables coordinator-led structure
285
+
286
+ ---
287
+
288
+ ## MCP Configuration
289
+
290
+ Add to `~/.config/claude/settings.json`:
80
291
 
81
- Add to `.claude/settings.json`:
82
292
  ```json
83
293
  {
84
294
  "mcpServers": {
295
+ "claude-flow-novice": {
296
+ "command": "npx",
297
+ "args": ["claude-flow-novice", "mcp", "start"],
298
+ "type": "stdio"
299
+ },
85
300
  "sequential-thinking": {
86
301
  "command": "npx",
87
302
  "args": ["@modelcontextprotocol/server-sequential-thinking@latest"],
@@ -101,19 +316,325 @@ Add to `.claude/settings.json`:
101
316
  }
102
317
  ```
103
318
 
319
+ **MCP Roles**:
320
+ - **claude-flow-novice**: Swarm coordination, memory management, Byzantine consensus
321
+ - **sequential-thinking**: Deep reasoning for State Architect
322
+ - **playwright**: E2E testing automation for Tester
323
+ - **shadcn**: Component library integration for UI Designer
324
+
325
+ ---
326
+
104
327
  ## Workflow Examples
105
328
 
106
- ### Feature Implementation Flow
107
- 1. **State Architect** designs state management
108
- 2. **UI Designer** creates components with state hooks
109
- 3. **Interaction Tester** validates user flows
329
+ ### Feature Implementation Flow (3 agents)
330
+
331
+ ```javascript
332
+ [Single Message]:
333
+ // 1. Initialize swarm
334
+ mcp__claude-flow-novice__swarm_init({
335
+ topology: "mesh",
336
+ maxAgents: 3,
337
+ strategy: "balanced"
338
+ })
339
+
340
+ // 2. Spawn agents sequentially by dependency
341
+ Task("State Architect", `
342
+ Design shopping cart state management:
343
+ - Choose state library (Zustand recommended)
344
+ - Define cart operations and selectors
345
+ - Design persistence strategy
346
+ - Share design document via SwarmMemory: "frontend/cart/design"
347
+ `, "architect")
348
+
349
+ Task("UI Designer", `
350
+ Create cart components with state hooks:
351
+ - Retrieve design from SwarmMemory: "frontend/cart/design"
352
+ - Implement CartButton, CartDrawer, CartItem components
353
+ - Integrate Zustand hooks from architect's design
354
+ - Responsive layout and dark mode support
355
+ - Run post-edit hook after each component file
356
+ `, "coder")
357
+
358
+ Task("Interaction Tester", `
359
+ Validate cart user flows:
360
+ - E2E tests for add/remove/update cart operations
361
+ - Test cart persistence across page reloads
362
+ - Visual regression for cart drawer states
363
+ - Accessibility validation
364
+ - Run post-edit hook after test file
365
+ `, "tester")
366
+ ```
367
+
368
+ **Execution Flow**:
369
+ 1. State Architect designs โ†’ stores in SwarmMemory
370
+ 2. UI Designer retrieves design โ†’ implements โ†’ runs post-edit hooks
371
+ 3. Tester validates implementation โ†’ runs post-edit hooks
372
+ 4. Byzantine consensus validation ensures all agents agree
373
+
374
+ ---
375
+
376
+ ### Bug Fix Flow (2 agents)
377
+
378
+ ```javascript
379
+ [Single Message]:
380
+ // 1. Initialize swarm
381
+ mcp__claude-flow-novice__swarm_init({
382
+ topology: "mesh",
383
+ maxAgents: 2,
384
+ strategy: "balanced"
385
+ })
386
+
387
+ // 2. Spawn agents concurrently
388
+ Task("Interaction Tester", `
389
+ Reproduce cart quantity bug:
390
+ - Create failing E2E test demonstrating the issue
391
+ - Visual regression to capture incorrect state
392
+ - Store test case in SwarmMemory: "frontend/bug/cart-quantity"
393
+ - Run post-edit hook after test file
394
+ `, "tester")
395
+
396
+ Task("UI Designer", `
397
+ Fix cart quantity component:
398
+ - Review bug test from SwarmMemory: "frontend/bug/cart-quantity"
399
+ - Fix quantity increment/decrement logic
400
+ - Update component with proper state handling
401
+ - Run post-edit hook after fix
402
+ - Coordinate with tester for regression test
403
+ `, "coder")
404
+
405
+ // 3. Tester validates fix (sequential dependency)
406
+ Task("Interaction Tester", `
407
+ Verify cart quantity fix:
408
+ - Run regression test to confirm fix
409
+ - Visual regression to validate correct state
410
+ - Add edge case tests (min/max quantity)
411
+ - Run post-edit hook after test updates
412
+ `, "tester")
413
+ ```
414
+
415
+ **Execution Flow**:
416
+ 1. Tester reproduces bug โ†’ stores in SwarmMemory
417
+ 2. UI Designer fixes bug โ†’ runs post-edit hook
418
+ 3. Tester validates fix โ†’ runs post-edit hook
419
+ 4. Byzantine consensus confirms fix quality
420
+
421
+ ---
422
+
423
+ ### Performance Optimization Flow (4 agents)
424
+
425
+ ```javascript
426
+ [Single Message]:
427
+ // 1. Initialize swarm
428
+ mcp__claude-flow-novice__swarm_init({
429
+ topology: "mesh",
430
+ maxAgents: 4,
431
+ strategy: "adaptive"
432
+ })
433
+
434
+ // 2. Spawn all agents concurrently
435
+ Task("Performance Analyzer", `
436
+ Analyze dashboard performance:
437
+ - Lighthouse audit for performance score
438
+ - Measure Core Web Vitals (LCP, FID, CLS)
439
+ - Profile component render times
440
+ - Identify optimization opportunities
441
+ - Store findings in SwarmMemory: "frontend/perf/analysis"
442
+ `, "perf-analyzer")
443
+
444
+ Task("State Architect", `
445
+ Optimize data fetching:
446
+ - Review perf analysis from SwarmMemory: "frontend/perf/analysis"
447
+ - Design lazy loading strategy for dashboard widgets
448
+ - Implement memoization for expensive selectors
449
+ - Optimize React Query cache configuration
450
+ - Run post-edit hook after changes
451
+ `, "architect")
452
+
453
+ Task("UI Designer", `
454
+ Implement lazy loading:
455
+ - Review perf analysis from SwarmMemory: "frontend/perf/analysis"
456
+ - Implement code splitting for dashboard routes
457
+ - Add React.lazy() for heavy components
458
+ - Optimize image loading with next/image
459
+ - Run post-edit hook after each file
460
+ `, "coder")
461
+
462
+ Task("Interaction Tester", `
463
+ Validate performance improvements:
464
+ - E2E tests measuring page load times
465
+ - Visual regression to ensure no UI breakage
466
+ - Lighthouse CI integration for performance gates
467
+ - Compare before/after metrics
468
+ - Run post-edit hook after test updates
469
+ `, "tester")
470
+ ```
471
+
472
+ **Execution Flow**:
473
+ 1. Performance Analyzer identifies issues โ†’ SwarmMemory
474
+ 2. State Architect + UI Designer implement optimizations in parallel โ†’ post-edit hooks
475
+ 3. Tester validates improvements โ†’ post-edit hook
476
+ 4. Byzantine consensus validates performance gains
477
+
478
+ ---
479
+
480
+ ## Post-Edit Hook Requirements
481
+
482
+ **MANDATORY**: After EVERY file edit, agents MUST run:
483
+
484
+ ```bash
485
+ npx enhanced-hooks post-edit [FILE_PATH] --memory-key "frontend/[agent]/[step]" --structured
486
+ ```
487
+
488
+ **Enhanced Hook Validation**:
489
+ - ๐Ÿงช **TDD Compliance**: Validates test-first development
490
+ - ๐Ÿ”’ **Security Analysis**: Detects XSS, eval(), hardcoded credentials
491
+ - ๐ŸŽจ **Formatting**: Prettier analysis with diff preview
492
+ - ๐Ÿ“Š **Coverage Analysis**: Test coverage with 80% default threshold
493
+ - ๐Ÿค– **Actionable Recommendations**: Specific improvement steps
494
+ - ๐Ÿ’พ **Memory Coordination**: Stores results for cross-agent collaboration
495
+
496
+ **Example Usage**:
497
+ ```bash
498
+ # After UI Designer edits Button.tsx
499
+ npx enhanced-hooks post-edit src/components/Button.tsx \
500
+ --memory-key "frontend/ui-designer/button" \
501
+ --structured
502
+
503
+ # After Tester creates E2E test
504
+ npx enhanced-hooks post-edit tests/e2e/cart.spec.ts \
505
+ --memory-key "frontend/tester/cart-e2e" \
506
+ --minimum-coverage 90 \
507
+ --structured
508
+
509
+ # After State Architect updates store
510
+ npx enhanced-hooks post-edit src/store/cart.ts \
511
+ --memory-key "frontend/architect/cart-store" \
512
+ --structured
513
+ ```
514
+
515
+ ---
516
+
517
+ ## Success Metrics
518
+
519
+ ### Per-Agent Metrics
520
+
521
+ **UI Designer**:
522
+ - [ ] All components have TypeScript types
523
+ - [ ] Accessibility score โ‰ฅ95 (Lighthouse)
524
+ - [ ] Responsive design (mobile, tablet, desktop)
525
+ - [ ] Post-edit hooks pass for all files
526
+
527
+ **Interaction Tester**:
528
+ - [ ] E2E test coverage โ‰ฅ70% of user flows
529
+ - [ ] Visual regression baseline established
530
+ - [ ] Accessibility validation integrated
531
+ - [ ] Post-edit hooks pass for all test files
532
+
533
+ **State Architect**:
534
+ - [ ] State architecture documented in ADRs
535
+ - [ ] Performance benchmarks established
536
+ - [ ] Data fetching strategy implemented
537
+ - [ ] Post-edit hooks pass for state files
538
+
539
+ ### Team Metrics
540
+
541
+ - [ ] Byzantine consensus โ‰ฅ90% agreement
542
+ - [ ] All agents coordinated via SwarmMemory
543
+ - [ ] Swarm initialized before agent spawning
544
+ - [ ] All file edits followed by post-edit hooks
545
+ - [ ] No solo work on multi-step tasks
546
+
547
+ ---
548
+
549
+ ## Common Pitfalls to Avoid
550
+
551
+ ### โŒ DON'T: Skip Swarm Initialization
552
+
553
+ ```javascript
554
+ // BAD - Agents work independently
555
+ Task("Agent 1", "Fix issue", "coder")
556
+ Task("Agent 2", "Fix issue", "coder")
557
+ Task("Agent 3", "Fix issue", "coder")
558
+
559
+ // Result: 3 different solutions, no coordination
560
+ ```
561
+
562
+ ### โœ… DO: Always Initialize Swarm First
563
+
564
+ ```javascript
565
+ // GOOD - Agents coordinate
566
+ [Single Message]:
567
+ mcp__claude-flow-novice__swarm_init({
568
+ topology: "mesh",
569
+ maxAgents: 3,
570
+ strategy: "balanced"
571
+ })
572
+
573
+ Task("Agent 1", "Fix issue", "coder")
574
+ Task("Agent 2", "Fix issue", "coder")
575
+ Task("Agent 3", "Fix issue", "coder")
576
+
577
+ // Result: Coordinated solution, consistent approach
578
+ ```
579
+
580
+ ---
581
+
582
+ ### โŒ DON'T: Spawn Agents Across Multiple Messages
583
+
584
+ ```javascript
585
+ // BAD - Sequential spawning across messages
586
+ [Message 1]: Task("Agent 1", "...", "coder")
587
+ [Message 2]: Task("Agent 2", "...", "tester")
588
+ [Message 3]: Task("Agent 3", "...", "reviewer")
589
+ ```
590
+
591
+ ### โœ… DO: Spawn All Agents in Single Message
592
+
593
+ ```javascript
594
+ // GOOD - All agents spawned concurrently
595
+ [Single Message]:
596
+ mcp__claude-flow-novice__swarm_init({...})
597
+ Task("Agent 1", "...", "coder")
598
+ Task("Agent 2", "...", "tester")
599
+ Task("Agent 3", "...", "reviewer")
600
+ ```
601
+
602
+ ---
603
+
604
+ ### โŒ DON'T: Skip Post-Edit Hooks
605
+
606
+ ```javascript
607
+ // BAD - No validation after edits
608
+ Task("UI Designer", "Create Button component", "coder")
609
+ // No post-edit hook = no validation
610
+ ```
611
+
612
+ ### โœ… DO: Include Post-Edit Hook Instructions
613
+
614
+ ```javascript
615
+ // GOOD - Hook execution mandated
616
+ Task("UI Designer", `
617
+ Create Button component:
618
+ - Implement with TypeScript
619
+ - Add accessibility attributes
620
+ - Run post-edit hook: npx enhanced-hooks post-edit src/components/Button.tsx
621
+ `, "coder")
622
+ ```
623
+
624
+ ---
625
+
626
+ ## Next Steps
627
+
628
+ After deploying frontend agents:
629
+
630
+ 1. **โœ… Validate setup**: Ensure MCP servers configured correctly
631
+ 2. **๐Ÿ“Š Monitor metrics**: Track agent coordination and quality scores
632
+ 3. **๐Ÿ” Review results**: Check Byzantine consensus approval rates
633
+ 4. **๐Ÿ’ก Iterate**: Refine agent instructions based on outcomes
634
+ 5. **๐Ÿ“ˆ Scale**: Add specialized agents as needed (mobile-dev, animation-specialist)
110
635
 
111
- ### Bug Fix Flow
112
- 1. **Interaction Tester** reproduces bug with test
113
- 2. **UI Designer** fixes component
114
- 3. **Interaction Tester** verifies fix with regression test
636
+ ---
115
637
 
116
- ### Performance Optimization Flow
117
- 1. **State Architect** optimizes data fetching
118
- 2. **UI Designer** implements lazy loading
119
- 3. **Interaction Tester** validates performance metrics
638
+ **Document Version**: 2.0.0
639
+ **Last Updated**: 2025-10-01
640
+ **Maintained By**: Claude Flow Frontend Team