claude-flow-novice 1.5.19 โ 1.5.21
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/agents/frontend/README.md +119 -0
- package/.claude/agents/frontend/interaction-tester.md +137 -0
- package/.claude/agents/frontend/state-architect.md +162 -0
- package/.claude/agents/frontend/ui-designer.md +101 -0
- package/.claude-flow-novice/dist/src/agents/frontend/index.js +124 -0
- package/.claude-flow-novice/dist/src/agents/frontend/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/frontend/interaction-tester.js +146 -0
- package/.claude-flow-novice/dist/src/agents/frontend/interaction-tester.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/frontend/state-architect.js +146 -0
- package/.claude-flow-novice/dist/src/agents/frontend/state-architect.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/frontend/ui-designer.js +100 -0
- package/.claude-flow-novice/dist/src/agents/frontend/ui-designer.js.map +1 -0
- package/package.json +1 -1
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +20 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Frontend Agent Team
|
|
2
|
+
|
|
3
|
+
Specialized agents for modern frontend development with MCP integration.
|
|
4
|
+
|
|
5
|
+
## Agent Overview
|
|
6
|
+
|
|
7
|
+
### ๐จ UI Designer
|
|
8
|
+
**File**: `ui-designer.md`
|
|
9
|
+
**MCP**: shadcn
|
|
10
|
+
**Focus**: Component design, layouts, accessibility
|
|
11
|
+
|
|
12
|
+
**Spawn Pattern**:
|
|
13
|
+
```javascript
|
|
14
|
+
Task("UI Designer", "Design responsive dashboard using shadcn", "coder")
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### ๐งช Interaction Tester
|
|
18
|
+
**File**: `interaction-tester.md`
|
|
19
|
+
**MCP**: Playwright
|
|
20
|
+
**Focus**: E2E testing, visual regression, a11y validation
|
|
21
|
+
|
|
22
|
+
**Spawn Pattern**:
|
|
23
|
+
```javascript
|
|
24
|
+
Task("Interaction Tester", "Test checkout flow with screenshots", "tester")
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### ๐๏ธ State Architect
|
|
28
|
+
**File**: `state-architect.md`
|
|
29
|
+
**MCP**: Sequential Thinking
|
|
30
|
+
**Focus**: State management, data fetching, architecture
|
|
31
|
+
|
|
32
|
+
**Spawn Pattern**:
|
|
33
|
+
```javascript
|
|
34
|
+
Task("State Architect", "Design cart state with Zustand", "architect")
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Team Coordination Patterns
|
|
38
|
+
|
|
39
|
+
### Simple Project (2 agents)
|
|
40
|
+
```javascript
|
|
41
|
+
mcp__claude-flow-novice__swarm_init({
|
|
42
|
+
topology: "mesh",
|
|
43
|
+
maxAgents: 2,
|
|
44
|
+
strategy: "balanced"
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
Task("UI Designer", "Landing page components", "coder")
|
|
48
|
+
Task("Interaction Tester", "User registration flow", "tester")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Medium Project (3 agents)
|
|
52
|
+
```javascript
|
|
53
|
+
mcp__claude-flow-novice__swarm_init({
|
|
54
|
+
topology: "mesh",
|
|
55
|
+
maxAgents: 3,
|
|
56
|
+
strategy: "balanced"
|
|
57
|
+
})
|
|
58
|
+
|
|
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")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Complex Project (5+ agents)
|
|
65
|
+
```javascript
|
|
66
|
+
mcp__claude-flow-novice__swarm_init({
|
|
67
|
+
topology: "hierarchical",
|
|
68
|
+
maxAgents: 5,
|
|
69
|
+
strategy: "adaptive"
|
|
70
|
+
})
|
|
71
|
+
|
|
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")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## MCP Requirements
|
|
80
|
+
|
|
81
|
+
Add to `.claude/settings.json`:
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"sequential-thinking": {
|
|
86
|
+
"command": "npx",
|
|
87
|
+
"args": ["@modelcontextprotocol/server-sequential-thinking@latest"],
|
|
88
|
+
"type": "stdio"
|
|
89
|
+
},
|
|
90
|
+
"playwright": {
|
|
91
|
+
"command": "npx",
|
|
92
|
+
"args": ["@playwright/mcp@latest"],
|
|
93
|
+
"type": "stdio"
|
|
94
|
+
},
|
|
95
|
+
"shadcn": {
|
|
96
|
+
"command": "npx",
|
|
97
|
+
"args": ["@shadcn/mcp@latest"],
|
|
98
|
+
"type": "stdio"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Workflow Examples
|
|
105
|
+
|
|
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
|
|
110
|
+
|
|
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
|
|
115
|
+
|
|
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
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Interaction Tester Agent
|
|
2
|
+
|
|
3
|
+
**Type**: Frontend Testing - E2E & Automation
|
|
4
|
+
**MCP Integration**: Playwright
|
|
5
|
+
**Expertise**: Browser Automation, Visual Testing, Accessibility Testing
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Specialized agent for end-to-end testing, user flow validation, and visual regression testing using Playwright MCP integration.
|
|
9
|
+
|
|
10
|
+
## Core Capabilities
|
|
11
|
+
|
|
12
|
+
### ๐งช User Flow Testing
|
|
13
|
+
- Multi-step user journey validation
|
|
14
|
+
- Form interaction testing
|
|
15
|
+
- Navigation flow verification
|
|
16
|
+
- Error state handling
|
|
17
|
+
|
|
18
|
+
### ๐ธ Visual Testing
|
|
19
|
+
- Screenshot comparison
|
|
20
|
+
- Visual regression detection
|
|
21
|
+
- Cross-browser rendering
|
|
22
|
+
- Responsive viewport testing
|
|
23
|
+
|
|
24
|
+
### โฟ Accessibility Testing
|
|
25
|
+
- Automated a11y scans
|
|
26
|
+
- Keyboard navigation validation
|
|
27
|
+
- Screen reader compatibility
|
|
28
|
+
- WCAG compliance checks
|
|
29
|
+
|
|
30
|
+
### โก Performance Testing
|
|
31
|
+
- Page load metrics
|
|
32
|
+
- First Contentful Paint
|
|
33
|
+
- Largest Contentful Paint
|
|
34
|
+
- Cumulative Layout Shift
|
|
35
|
+
|
|
36
|
+
## MCP Tools
|
|
37
|
+
|
|
38
|
+
### Playwright Integration
|
|
39
|
+
```javascript
|
|
40
|
+
// Navigate to pages
|
|
41
|
+
mcp__playwright__browser_navigate({ url: "https://..." })
|
|
42
|
+
|
|
43
|
+
// Interact with elements
|
|
44
|
+
mcp__playwright__browser_click({ element: "Login button", ref: "..." })
|
|
45
|
+
mcp__playwright__browser_type({ element: "Email input", ref: "...", text: "user@example.com" })
|
|
46
|
+
|
|
47
|
+
// Capture state
|
|
48
|
+
mcp__playwright__browser_snapshot()
|
|
49
|
+
mcp__playwright__browser_take_screenshot({ filename: "test-result.png" })
|
|
50
|
+
|
|
51
|
+
// Form interactions
|
|
52
|
+
mcp__playwright__browser_fill_form({ fields: [...] })
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage Pattern
|
|
56
|
+
|
|
57
|
+
When spawned via Task tool, this agent:
|
|
58
|
+
1. Navigates to target URLs using Playwright MCP
|
|
59
|
+
2. Executes user interaction flows
|
|
60
|
+
3. Captures accessibility snapshots
|
|
61
|
+
4. Takes screenshots for visual validation
|
|
62
|
+
5. Reports test results with evidence
|
|
63
|
+
|
|
64
|
+
## Example Invocation
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
Task(
|
|
68
|
+
"Interaction Tester",
|
|
69
|
+
"Test the checkout flow: add item to cart, fill shipping info, complete payment. Validate accessibility and take screenshots at each step.",
|
|
70
|
+
"tester"
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Team Coordination
|
|
75
|
+
|
|
76
|
+
**Works well with**:
|
|
77
|
+
- UI Designer (tests designed components)
|
|
78
|
+
- State Architect (validates state changes)
|
|
79
|
+
- Backend Dev (tests API integration)
|
|
80
|
+
|
|
81
|
+
**Outputs**:
|
|
82
|
+
- Test result reports (pass/fail)
|
|
83
|
+
- Screenshots (success/failure states)
|
|
84
|
+
- Accessibility audit findings
|
|
85
|
+
- Performance metrics
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
Default settings (customizable via swarm memory):
|
|
90
|
+
```typescript
|
|
91
|
+
{
|
|
92
|
+
browsers: ["chromium"],
|
|
93
|
+
viewports: [
|
|
94
|
+
{ width: 1920, height: 1080 }, // Desktop
|
|
95
|
+
{ width: 1366, height: 768 }, // Laptop
|
|
96
|
+
{ width: 375, height: 667 } // Mobile
|
|
97
|
+
],
|
|
98
|
+
screenshotOnFailure: true,
|
|
99
|
+
recordVideo: false
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Test Scenarios
|
|
104
|
+
|
|
105
|
+
### Login Flow
|
|
106
|
+
```javascript
|
|
107
|
+
1. Navigate to /login
|
|
108
|
+
2. Fill email + password
|
|
109
|
+
3. Click login button
|
|
110
|
+
4. Verify redirect to /dashboard
|
|
111
|
+
5. Check for auth token in cookies
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Checkout Flow
|
|
115
|
+
```javascript
|
|
116
|
+
1. Add product to cart
|
|
117
|
+
2. Navigate to /checkout
|
|
118
|
+
3. Fill shipping address
|
|
119
|
+
4. Select payment method
|
|
120
|
+
5. Confirm order
|
|
121
|
+
6. Verify order confirmation
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Best Practices
|
|
125
|
+
|
|
126
|
+
1. **Snapshot before actions** - Capture state for debugging
|
|
127
|
+
2. **Wait for elements** - Ensure elements are visible/enabled
|
|
128
|
+
3. **Screenshot on failure** - Visual evidence for debugging
|
|
129
|
+
4. **Test across viewports** - Validate responsive behavior
|
|
130
|
+
5. **Accessibility first** - Check a11y before visual tests
|
|
131
|
+
|
|
132
|
+
## Error Handling
|
|
133
|
+
|
|
134
|
+
- Element not found โ Retry with increased timeout
|
|
135
|
+
- Navigation timeout โ Check network conditions
|
|
136
|
+
- Screenshot failure โ Fallback to HTML snapshot
|
|
137
|
+
- Accessibility violations โ Report with severity levels
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# State Architect Agent
|
|
2
|
+
|
|
3
|
+
**Type**: Frontend Architecture - State Management
|
|
4
|
+
**MCP Integration**: Sequential Thinking
|
|
5
|
+
**Expertise**: Zustand, React Query, State Design, Data Flow
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Specialized agent for designing state management architecture, data fetching strategies, and state synchronization patterns using sequential planning.
|
|
9
|
+
|
|
10
|
+
## Core Capabilities
|
|
11
|
+
|
|
12
|
+
### ๐๏ธ State Architecture
|
|
13
|
+
- State domain decomposition
|
|
14
|
+
- Store design (Zustand, Redux, Jotai, Recoil)
|
|
15
|
+
- Action/mutation planning
|
|
16
|
+
- Selector optimization
|
|
17
|
+
|
|
18
|
+
### ๐ Data Fetching
|
|
19
|
+
- React Query/SWR integration
|
|
20
|
+
- Cache strategy design
|
|
21
|
+
- Optimistic updates
|
|
22
|
+
- Real-time synchronization
|
|
23
|
+
|
|
24
|
+
### ๐ Sequential Planning
|
|
25
|
+
- Step-by-step state design via `mcp__sequential-thinking`
|
|
26
|
+
- Complex state flow mapping
|
|
27
|
+
- Dependency analysis
|
|
28
|
+
- Conflict resolution
|
|
29
|
+
|
|
30
|
+
### ๐พ Persistence
|
|
31
|
+
- LocalStorage/SessionStorage
|
|
32
|
+
- IndexedDB integration
|
|
33
|
+
- State hydration
|
|
34
|
+
- Migration strategies
|
|
35
|
+
|
|
36
|
+
## MCP Tools
|
|
37
|
+
|
|
38
|
+
### Sequential Thinking Integration
|
|
39
|
+
```javascript
|
|
40
|
+
// Use for complex state planning
|
|
41
|
+
mcp__sequential-thinking({
|
|
42
|
+
task: "Design cart state management with multi-step checkout",
|
|
43
|
+
steps: [
|
|
44
|
+
"1. Identify state domains (cart, user, checkout)",
|
|
45
|
+
"2. Define state shape for each domain",
|
|
46
|
+
"3. Plan actions and mutations",
|
|
47
|
+
"4. Design selectors for derived state",
|
|
48
|
+
"5. Configure persistence middleware"
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage Pattern
|
|
54
|
+
|
|
55
|
+
When spawned via Task tool, this agent:
|
|
56
|
+
1. Uses sequential-thinking MCP to break down requirements
|
|
57
|
+
2. Designs state architecture step-by-step
|
|
58
|
+
3. Creates store configurations
|
|
59
|
+
4. Plans data fetching strategies
|
|
60
|
+
5. Defines state synchronization logic
|
|
61
|
+
|
|
62
|
+
## Example Invocation
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
Task(
|
|
66
|
+
"State Architect",
|
|
67
|
+
"Design state management for e-commerce app: product catalog, shopping cart, user auth, order history. Use Zustand + React Query with localStorage persistence.",
|
|
68
|
+
"architect"
|
|
69
|
+
)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Team Coordination
|
|
73
|
+
|
|
74
|
+
**Works well with**:
|
|
75
|
+
- UI Designer (provides state hooks)
|
|
76
|
+
- Backend Dev (coordinates API contracts)
|
|
77
|
+
- Interaction Tester (validates state transitions)
|
|
78
|
+
|
|
79
|
+
**Outputs**:
|
|
80
|
+
- Store configurations (Zustand/Redux)
|
|
81
|
+
- Data fetching setup (React Query/SWR)
|
|
82
|
+
- State persistence logic
|
|
83
|
+
- Architecture documentation
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
Default settings (customizable via swarm memory):
|
|
88
|
+
```typescript
|
|
89
|
+
{
|
|
90
|
+
stateLibrary: "zustand",
|
|
91
|
+
dataFetchingLibrary: "react-query",
|
|
92
|
+
persistenceStrategy: "localStorage"
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## State Patterns
|
|
97
|
+
|
|
98
|
+
### Zustand Store
|
|
99
|
+
```typescript
|
|
100
|
+
// Generated by State Architect
|
|
101
|
+
import { create } from 'zustand';
|
|
102
|
+
import { persist } from 'zustand/middleware';
|
|
103
|
+
|
|
104
|
+
interface CartState {
|
|
105
|
+
items: CartItem[];
|
|
106
|
+
actions: {
|
|
107
|
+
addItem: (item: CartItem) => void;
|
|
108
|
+
removeItem: (id: string) => void;
|
|
109
|
+
clearCart: () => void;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const useCartStore = create<CartState>()(
|
|
114
|
+
persist(
|
|
115
|
+
(set, get) => ({
|
|
116
|
+
items: [],
|
|
117
|
+
actions: {
|
|
118
|
+
addItem: (item) => set(state => ({
|
|
119
|
+
items: [...state.items, item]
|
|
120
|
+
})),
|
|
121
|
+
// ... more actions
|
|
122
|
+
}
|
|
123
|
+
}),
|
|
124
|
+
{ name: 'cart-storage' }
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### React Query Setup
|
|
130
|
+
```typescript
|
|
131
|
+
// Generated by State Architect
|
|
132
|
+
const queryClient = new QueryClient({
|
|
133
|
+
defaultOptions: {
|
|
134
|
+
queries: {
|
|
135
|
+
staleTime: 300000, // 5 minutes
|
|
136
|
+
refetchOnWindowFocus: false
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Product query
|
|
142
|
+
export const useProducts = () => useQuery({
|
|
143
|
+
queryKey: ['products'],
|
|
144
|
+
queryFn: fetchProducts,
|
|
145
|
+
staleTime: 600000 // 10 minutes
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Best Practices
|
|
150
|
+
|
|
151
|
+
1. **Sequential planning first** - Use MCP to break down complex state
|
|
152
|
+
2. **Domain separation** - Separate concerns (auth, cart, products)
|
|
153
|
+
3. **Derived state via selectors** - Avoid redundant state
|
|
154
|
+
4. **Optimistic updates** - Better UX for mutations
|
|
155
|
+
5. **Persistence strategy** - Plan for offline/hydration
|
|
156
|
+
|
|
157
|
+
## Error Handling
|
|
158
|
+
|
|
159
|
+
- State hydration failure โ Fallback to initial state
|
|
160
|
+
- Persistence quota exceeded โ Implement cleanup strategy
|
|
161
|
+
- Concurrent updates โ Use atomic operations
|
|
162
|
+
- Network failure โ Queue mutations with retry logic
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# UI Designer Agent
|
|
2
|
+
|
|
3
|
+
**Type**: Frontend Development - UI/UX Design
|
|
4
|
+
**MCP Integration**: shadcn
|
|
5
|
+
**Expertise**: React, Tailwind CSS, Accessibility, Component Design
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Specialized agent for designing and implementing user interface components with a focus on design systems, accessibility, and responsive layouts.
|
|
9
|
+
|
|
10
|
+
## Core Capabilities
|
|
11
|
+
|
|
12
|
+
### ๐จ Component Design
|
|
13
|
+
- Design components using shadcn/ui specifications via `mcp__shadcn__getComponent`
|
|
14
|
+
- Create responsive layouts with Tailwind CSS
|
|
15
|
+
- Implement design token systems
|
|
16
|
+
- Build component hierarchies
|
|
17
|
+
|
|
18
|
+
### โฟ Accessibility
|
|
19
|
+
- WCAG AA/AAA compliance validation
|
|
20
|
+
- Screen reader optimization
|
|
21
|
+
- Keyboard navigation support
|
|
22
|
+
- Color contrast analysis
|
|
23
|
+
- ARIA attribute management
|
|
24
|
+
|
|
25
|
+
### ๐ฑ Responsive Design
|
|
26
|
+
- Mobile-first approach
|
|
27
|
+
- Breakpoint-based layouts (sm, md, lg, xl, 2xl)
|
|
28
|
+
- Flexible grid systems
|
|
29
|
+
- Adaptive component behavior
|
|
30
|
+
|
|
31
|
+
## MCP Tools
|
|
32
|
+
|
|
33
|
+
### shadcn Integration
|
|
34
|
+
```javascript
|
|
35
|
+
// Query available components
|
|
36
|
+
mcp__shadcn__getComponents()
|
|
37
|
+
|
|
38
|
+
// Get component specifications
|
|
39
|
+
mcp__shadcn__getComponent({
|
|
40
|
+
component: "dialog" | "button" | "card" | ...
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage Pattern
|
|
45
|
+
|
|
46
|
+
When spawned via Task tool, this agent:
|
|
47
|
+
1. Queries shadcn MCP for component specifications
|
|
48
|
+
2. Designs component structure with accessibility
|
|
49
|
+
3. Implements responsive layouts
|
|
50
|
+
4. Validates WCAG compliance
|
|
51
|
+
5. Creates design token systems
|
|
52
|
+
|
|
53
|
+
## Example Invocation
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
Task(
|
|
57
|
+
"UI Designer",
|
|
58
|
+
"Design a responsive dashboard layout using shadcn components with WCAG AA compliance",
|
|
59
|
+
"coder"
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Team Coordination
|
|
64
|
+
|
|
65
|
+
**Works well with**:
|
|
66
|
+
- State Architect (receives state hooks)
|
|
67
|
+
- Interaction Tester (provides components for testing)
|
|
68
|
+
- Backend Dev (integrates with API contracts)
|
|
69
|
+
|
|
70
|
+
**Outputs**:
|
|
71
|
+
- Component implementations (.tsx/.jsx)
|
|
72
|
+
- Style configurations (Tailwind)
|
|
73
|
+
- Design token definitions
|
|
74
|
+
- Accessibility audit reports
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
Default settings (customizable via swarm memory):
|
|
79
|
+
```typescript
|
|
80
|
+
{
|
|
81
|
+
framework: "react",
|
|
82
|
+
designSystem: "shadcn",
|
|
83
|
+
responsiveBreakpoints: ["sm", "md", "lg", "xl", "2xl"],
|
|
84
|
+
accessibilityLevel: "wcag-aa"
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Best Practices
|
|
89
|
+
|
|
90
|
+
1. **Always query shadcn MCP first** for component specs
|
|
91
|
+
2. **Design system consistency** - use design tokens
|
|
92
|
+
3. **Accessibility by default** - validate WCAG compliance
|
|
93
|
+
4. **Mobile-first** - start with smallest breakpoint
|
|
94
|
+
5. **Component composition** - build complex UIs from primitives
|
|
95
|
+
|
|
96
|
+
## Error Handling
|
|
97
|
+
|
|
98
|
+
- Missing ARIA labels โ Auto-suggest based on component type
|
|
99
|
+
- Low color contrast โ Recommend accessible alternatives
|
|
100
|
+
- Non-keyboard accessible โ Add tabIndex and handlers
|
|
101
|
+
- Missing responsive breakpoints โ Default to mobile-first
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend Agent Team
|
|
3
|
+
* Coordinates UI design, interaction testing, and state architecture
|
|
4
|
+
*/ export { UIDesigner } from './ui-designer';
|
|
5
|
+
export { InteractionTester } from './interaction-tester';
|
|
6
|
+
export { StateArchitect } from './state-architect';
|
|
7
|
+
export const FRONTEND_TEAM_CAPABILITIES = {
|
|
8
|
+
uiDesigner: {
|
|
9
|
+
name: 'UI Designer',
|
|
10
|
+
description: 'Component design, layout, accessibility, shadcn integration',
|
|
11
|
+
mcpTools: [
|
|
12
|
+
'mcp__shadcn__getComponents',
|
|
13
|
+
'mcp__shadcn__getComponent'
|
|
14
|
+
],
|
|
15
|
+
expertise: [
|
|
16
|
+
'react',
|
|
17
|
+
'tailwindcss',
|
|
18
|
+
'shadcn/ui',
|
|
19
|
+
'responsive-design',
|
|
20
|
+
'accessibility'
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
interactionTester: {
|
|
24
|
+
name: 'Interaction Tester',
|
|
25
|
+
description: 'Browser automation, user flows, visual regression, Playwright integration',
|
|
26
|
+
mcpTools: [
|
|
27
|
+
'mcp__playwright__browser_navigate',
|
|
28
|
+
'mcp__playwright__browser_click',
|
|
29
|
+
'mcp__playwright__browser_snapshot',
|
|
30
|
+
'mcp__playwright__browser_take_screenshot'
|
|
31
|
+
],
|
|
32
|
+
expertise: [
|
|
33
|
+
'playwright',
|
|
34
|
+
'e2e-testing',
|
|
35
|
+
'visual-testing',
|
|
36
|
+
'accessibility-testing'
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
stateArchitect: {
|
|
40
|
+
name: 'State Architect',
|
|
41
|
+
description: 'State management, data flow, sequential planning',
|
|
42
|
+
mcpTools: [
|
|
43
|
+
'mcp__sequential-thinking'
|
|
44
|
+
],
|
|
45
|
+
expertise: [
|
|
46
|
+
'zustand',
|
|
47
|
+
'react-query',
|
|
48
|
+
'state-management',
|
|
49
|
+
'data-fetching',
|
|
50
|
+
'architecture'
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Frontend team coordination
|
|
56
|
+
*/ export class FrontendTeam {
|
|
57
|
+
/**
|
|
58
|
+
* Coordinate full frontend implementation
|
|
59
|
+
*/ static async coordinateImplementation(requirements) {
|
|
60
|
+
return {
|
|
61
|
+
phase: 'coordination',
|
|
62
|
+
teams: [
|
|
63
|
+
{
|
|
64
|
+
agent: 'state-architect',
|
|
65
|
+
task: 'Design state architecture',
|
|
66
|
+
priority: 1
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
agent: 'ui-designer',
|
|
70
|
+
task: 'Design component hierarchy',
|
|
71
|
+
priority: 2
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
agent: 'interaction-tester',
|
|
75
|
+
task: 'Plan test scenarios',
|
|
76
|
+
priority: 3
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
mcpIntegration: {
|
|
80
|
+
sequentialThinking: 'Planning agent coordination',
|
|
81
|
+
shadcn: 'Component specifications',
|
|
82
|
+
playwright: 'Interaction validation'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Recommended agent spawning pattern
|
|
88
|
+
*/ static getSpawnPattern(complexity) {
|
|
89
|
+
const patterns = {
|
|
90
|
+
simple: {
|
|
91
|
+
agents: [
|
|
92
|
+
'ui-designer',
|
|
93
|
+
'interaction-tester'
|
|
94
|
+
],
|
|
95
|
+
topology: 'mesh',
|
|
96
|
+
maxAgents: 2
|
|
97
|
+
},
|
|
98
|
+
medium: {
|
|
99
|
+
agents: [
|
|
100
|
+
'state-architect',
|
|
101
|
+
'ui-designer',
|
|
102
|
+
'interaction-tester'
|
|
103
|
+
],
|
|
104
|
+
topology: 'mesh',
|
|
105
|
+
maxAgents: 3
|
|
106
|
+
},
|
|
107
|
+
complex: {
|
|
108
|
+
agents: [
|
|
109
|
+
'state-architect',
|
|
110
|
+
'ui-designer',
|
|
111
|
+
'ui-designer',
|
|
112
|
+
'interaction-tester',
|
|
113
|
+
'interaction-tester'
|
|
114
|
+
],
|
|
115
|
+
topology: 'hierarchical',
|
|
116
|
+
maxAgents: 5
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return patterns[complexity];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export default FrontendTeam;
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/agents/frontend/index.ts"],"names":["UIDesigner","InteractionTester","StateArchitect","FRONTEND_TEAM_CAPABILITIES","uiDesigner","name","description","mcpTools","expertise","interactionTester","stateArchitect","FrontendTeam","coordinateImplementation","requirements","phase","teams","agent","task","priority","mcpIntegration","sequentialThinking","shadcn","playwright","getSpawnPattern","complexity","patterns","simple","agents","topology","maxAgents","medium","complex"],"mappings":"AAAA;;;CAGC,GAED,SAASA,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,OAAO,MAAMC,6BAA6B;IACxCC,YAAY;QACVC,MAAM;QACNC,aAAa;QACbC,UAAU;YAAC;YAA8B;SAA4B;QACrEC,WAAW;YAAC;YAAS;YAAe;YAAa;YAAqB;SAAgB;IACxF;IACAC,mBAAmB;QACjBJ,MAAM;QACNC,aAAa;QACbC,UAAU;YACR;YACA;YACA;YACA;SACD;QACDC,WAAW;YAAC;YAAc;YAAe;YAAkB;SAAwB;IACrF;IACAE,gBAAgB;QACdL,MAAM;QACNC,aAAa;QACbC,UAAU;YAAC;SAA2B;QACtCC,WAAW;YAAC;YAAW;YAAe;YAAoB;YAAiB;SAAe;IAC5F;AACF,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMG;IACX;;GAEC,GACD,aAAaC,yBAAyBC,YAAiB,EAAgB;QACrE,OAAO;YACLC,OAAO;YACPC,OAAO;gBACL;oBAAEC,OAAO;oBAAmBC,MAAM;oBAA6BC,UAAU;gBAAE;gBAC3E;oBAAEF,OAAO;oBAAeC,MAAM;oBAA8BC,UAAU;gBAAE;gBACxE;oBAAEF,OAAO;oBAAsBC,MAAM;oBAAuBC,UAAU;gBAAE;aACzE;YACDC,gBAAgB;gBACdC,oBAAoB;gBACpBC,QAAQ;gBACRC,YAAY;YACd;QACF;IACF;IAEA;;GAEC,GACD,OAAOC,gBAAgBC,UAA2C,EAAO;QACvE,MAAMC,WAAW;YACfC,QAAQ;gBACNC,QAAQ;oBAAC;oBAAe;iBAAqB;gBAC7CC,UAAU;gBACVC,WAAW;YACb;YACAC,QAAQ;gBACNH,QAAQ;oBAAC;oBAAmB;oBAAe;iBAAqB;gBAChEC,UAAU;gBACVC,WAAW;YACb;YACAE,SAAS;gBACPJ,QAAQ;oBACN;oBACA;oBACA;oBACA;oBACA;iBACD;gBACDC,UAAU;gBACVC,WAAW;YACb;QACF;QAEA,OAAOJ,QAAQ,CAACD,WAAW;IAC7B;AACF;AAEA,eAAeb,aAAa"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction Tester Agent
|
|
3
|
+
* Specializes in browser automation testing using Playwright MCP
|
|
4
|
+
* Validates user flows, component interactions, and visual regressions
|
|
5
|
+
*/ export class InteractionTester {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config = {}){
|
|
8
|
+
this.config = {
|
|
9
|
+
browsers: config.browsers || [
|
|
10
|
+
'chromium'
|
|
11
|
+
],
|
|
12
|
+
viewports: config.viewports || [
|
|
13
|
+
{
|
|
14
|
+
width: 1920,
|
|
15
|
+
height: 1080
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
width: 1366,
|
|
19
|
+
height: 768
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
width: 375,
|
|
23
|
+
height: 667
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
screenshotOnFailure: config.screenshotOnFailure ?? true,
|
|
27
|
+
recordVideo: config.recordVideo ?? false
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Test user interaction flow using Playwright MCP
|
|
32
|
+
*/ async testUserFlow(flowName, steps) {
|
|
33
|
+
const testResults = {
|
|
34
|
+
flowName,
|
|
35
|
+
passed: true,
|
|
36
|
+
steps: [],
|
|
37
|
+
screenshots: [],
|
|
38
|
+
errors: []
|
|
39
|
+
};
|
|
40
|
+
for (const step of steps){
|
|
41
|
+
try {
|
|
42
|
+
// Use Playwright MCP tools:
|
|
43
|
+
// - mcp__playwright__browser_navigate
|
|
44
|
+
// - mcp__playwright__browser_click
|
|
45
|
+
// - mcp__playwright__browser_type
|
|
46
|
+
// - mcp__playwright__browser_snapshot
|
|
47
|
+
// - mcp__playwright__browser_take_screenshot
|
|
48
|
+
const stepResult = {
|
|
49
|
+
action: step.action,
|
|
50
|
+
selector: step.selector,
|
|
51
|
+
status: 'passed',
|
|
52
|
+
duration: 0
|
|
53
|
+
};
|
|
54
|
+
testResults.steps.push(stepResult);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
testResults.passed = false;
|
|
57
|
+
testResults.errors.push(`Step "${step.action}" failed: ${error}`);
|
|
58
|
+
if (this.config.screenshotOnFailure) {
|
|
59
|
+
// Take screenshot on failure
|
|
60
|
+
testResults.screenshots.push(`failure-${flowName}-${step.action}.png`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return testResults;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Test form interactions
|
|
68
|
+
*/ async testForm(formConfig) {
|
|
69
|
+
return {
|
|
70
|
+
formName: formConfig.name,
|
|
71
|
+
fields: formConfig.fields.map((field)=>({
|
|
72
|
+
name: field.name,
|
|
73
|
+
type: field.type,
|
|
74
|
+
validation: 'pending',
|
|
75
|
+
accessibility: 'pending'
|
|
76
|
+
})),
|
|
77
|
+
submitTest: 'pending'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Visual regression testing
|
|
82
|
+
*/ async testVisualRegression(componentName, baselineUrl) {
|
|
83
|
+
const results = {
|
|
84
|
+
component: componentName,
|
|
85
|
+
viewportTests: [],
|
|
86
|
+
passed: true
|
|
87
|
+
};
|
|
88
|
+
for (const viewport of this.config.viewports){
|
|
89
|
+
const test = {
|
|
90
|
+
width: viewport.width,
|
|
91
|
+
height: viewport.height,
|
|
92
|
+
pixelDifference: 0,
|
|
93
|
+
passed: true
|
|
94
|
+
};
|
|
95
|
+
results.viewportTests.push(test);
|
|
96
|
+
}
|
|
97
|
+
return results;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Test component accessibility
|
|
101
|
+
*/ async testAccessibility(component) {
|
|
102
|
+
return {
|
|
103
|
+
component,
|
|
104
|
+
violations: [],
|
|
105
|
+
warnings: [],
|
|
106
|
+
passed: true,
|
|
107
|
+
wcagLevel: 'AA',
|
|
108
|
+
tests: [
|
|
109
|
+
{
|
|
110
|
+
name: 'keyboard-navigation',
|
|
111
|
+
passed: true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'screen-reader',
|
|
115
|
+
passed: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'color-contrast',
|
|
119
|
+
passed: true
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'focus-management',
|
|
123
|
+
passed: true
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Performance testing
|
|
130
|
+
*/ async testPerformance(url) {
|
|
131
|
+
return {
|
|
132
|
+
url,
|
|
133
|
+
metrics: {
|
|
134
|
+
firstContentfulPaint: 0,
|
|
135
|
+
largestContentfulPaint: 0,
|
|
136
|
+
timeToInteractive: 0,
|
|
137
|
+
cumulativeLayoutShift: 0
|
|
138
|
+
},
|
|
139
|
+
score: 0,
|
|
140
|
+
recommendations: []
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export default InteractionTester;
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=interaction-tester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/agents/frontend/interaction-tester.ts"],"names":["InteractionTester","config","browsers","viewports","width","height","screenshotOnFailure","recordVideo","testUserFlow","flowName","steps","testResults","passed","screenshots","errors","step","stepResult","action","selector","status","duration","push","error","testForm","formConfig","formName","name","fields","map","field","type","validation","accessibility","submitTest","testVisualRegression","componentName","baselineUrl","results","component","viewportTests","viewport","test","pixelDifference","testAccessibility","violations","warnings","wcagLevel","tests","testPerformance","url","metrics","firstContentfulPaint","largestContentfulPaint","timeToInteractive","cumulativeLayoutShift","score","recommendations"],"mappings":"AAAA;;;;CAIC,GASD,OAAO,MAAMA;IACHC,OAA8B;IAEtC,YAAYA,SAAyC,CAAC,CAAC,CAAE;QACvD,IAAI,CAACA,MAAM,GAAG;YACZC,UAAUD,OAAOC,QAAQ,IAAI;gBAAC;aAAW;YACzCC,WAAWF,OAAOE,SAAS,IAAI;gBAC7B;oBAAEC,OAAO;oBAAMC,QAAQ;gBAAK;gBAC5B;oBAAED,OAAO;oBAAMC,QAAQ;gBAAI;gBAC3B;oBAAED,OAAO;oBAAKC,QAAQ;gBAAI;aAC3B;YACDC,qBAAqBL,OAAOK,mBAAmB,IAAI;YACnDC,aAAaN,OAAOM,WAAW,IAAI;QACrC;IACF;IAEA;;GAEC,GACD,MAAMC,aAAaC,QAAgB,EAAEC,KAAY,EAAgB;QAC/D,MAAMC,cAAc;YAClBF;YACAG,QAAQ;YACRF,OAAO,EAAE;YACTG,aAAa,EAAE;YACfC,QAAQ,EAAE;QACZ;QAEA,KAAK,MAAMC,QAAQL,MAAO;YACxB,IAAI;gBACF,4BAA4B;gBAC5B,sCAAsC;gBACtC,mCAAmC;gBACnC,kCAAkC;gBAClC,sCAAsC;gBACtC,6CAA6C;gBAE7C,MAAMM,aAAa;oBACjBC,QAAQF,KAAKE,MAAM;oBACnBC,UAAUH,KAAKG,QAAQ;oBACvBC,QAAQ;oBACRC,UAAU;gBACZ;gBAEAT,YAAYD,KAAK,CAACW,IAAI,CAACL;YACzB,EAAE,OAAOM,OAAO;gBACdX,YAAYC,MAAM,GAAG;gBACrBD,YAAYG,MAAM,CAACO,IAAI,CAAC,CAAC,MAAM,EAAEN,KAAKE,MAAM,CAAC,UAAU,EAAEK,OAAO;gBAEhE,IAAI,IAAI,CAACrB,MAAM,CAACK,mBAAmB,EAAE;oBACnC,6BAA6B;oBAC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,sBAAsB;gBACtBC,wBAAwB;gBACxBC,mBAAmB;gBACnBC,uBAAuB;YACzB;YACAC,OAAO;YACPC,iBAAiB,EAAE;QACrB;IACF;AACF;AAEA,eAAexD,kBAAkB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Architect Agent
|
|
3
|
+
* Specializes in state management architecture and data flow
|
|
4
|
+
* Uses sequential-thinking MCP for complex state planning
|
|
5
|
+
*/ export class StateArchitect {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config = {}){
|
|
8
|
+
this.config = {
|
|
9
|
+
stateLibrary: config.stateLibrary || 'zustand',
|
|
10
|
+
dataFetchingLibrary: config.dataFetchingLibrary || 'react-query',
|
|
11
|
+
persistenceStrategy: config.persistenceStrategy || 'localStorage'
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Design state architecture using sequential-thinking MCP
|
|
16
|
+
* Breaks down complex state requirements into logical steps
|
|
17
|
+
*/ async designStateArchitecture(requirements) {
|
|
18
|
+
// Use sequential-thinking MCP for step-by-step state design
|
|
19
|
+
const stateDesign = {
|
|
20
|
+
library: this.config.stateLibrary,
|
|
21
|
+
stores: [],
|
|
22
|
+
actions: [],
|
|
23
|
+
selectors: [],
|
|
24
|
+
middleware: []
|
|
25
|
+
};
|
|
26
|
+
// Sequential thinking steps:
|
|
27
|
+
// 1. Identify state domains (user, cart, products, etc.)
|
|
28
|
+
// 2. Define state shape for each domain
|
|
29
|
+
// 3. Determine actions and mutations
|
|
30
|
+
// 4. Design selectors for derived state
|
|
31
|
+
// 5. Configure middleware (logging, persistence, etc.)
|
|
32
|
+
return stateDesign;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create store configuration
|
|
36
|
+
*/ async createStore(storeName, initialState) {
|
|
37
|
+
const storeConfig = {
|
|
38
|
+
name: storeName,
|
|
39
|
+
library: this.config.stateLibrary,
|
|
40
|
+
initialState,
|
|
41
|
+
actions: {},
|
|
42
|
+
middleware: [],
|
|
43
|
+
persistence: this.config.persistenceStrategy
|
|
44
|
+
};
|
|
45
|
+
if (this.config.stateLibrary === 'zustand') {
|
|
46
|
+
return this.createZustandStore(storeConfig);
|
|
47
|
+
} else if (this.config.stateLibrary === 'redux') {
|
|
48
|
+
return this.createReduxStore(storeConfig);
|
|
49
|
+
}
|
|
50
|
+
return storeConfig;
|
|
51
|
+
}
|
|
52
|
+
createZustandStore(config) {
|
|
53
|
+
return {
|
|
54
|
+
...config,
|
|
55
|
+
template: `
|
|
56
|
+
import { create } from 'zustand';
|
|
57
|
+
import { persist } from 'zustand/middleware';
|
|
58
|
+
|
|
59
|
+
interface ${config.name}State {
|
|
60
|
+
// State shape
|
|
61
|
+
${Object.keys(config.initialState).map((key)=>`${key}: ${typeof config.initialState[key]};`).join('\n ')}
|
|
62
|
+
|
|
63
|
+
// Actions
|
|
64
|
+
actions: {
|
|
65
|
+
// Define actions here
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const use${config.name}Store = create<${config.name}State>()(
|
|
70
|
+
persist(
|
|
71
|
+
(set, get) => ({
|
|
72
|
+
...${JSON.stringify(config.initialState, null, 2)},
|
|
73
|
+
actions: {
|
|
74
|
+
// Implement actions here
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
{
|
|
78
|
+
name: '${config.name.toLowerCase()}-storage',
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
`.trim()
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
createReduxStore(config) {
|
|
86
|
+
return {
|
|
87
|
+
...config,
|
|
88
|
+
template: `
|
|
89
|
+
import { createSlice, configureStore } from '@reduxjs/toolkit';
|
|
90
|
+
|
|
91
|
+
const ${config.name.toLowerCase()}Slice = createSlice({
|
|
92
|
+
name: '${config.name.toLowerCase()}',
|
|
93
|
+
initialState: ${JSON.stringify(config.initialState, null, 2)},
|
|
94
|
+
reducers: {
|
|
95
|
+
// Define reducers here
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export const { actions } = ${config.name.toLowerCase()}Slice;
|
|
100
|
+
export default ${config.name.toLowerCase()}Slice.reducer;
|
|
101
|
+
`.trim()
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Design data fetching strategy
|
|
106
|
+
*/ async designDataFetching(entityName, endpoints) {
|
|
107
|
+
return {
|
|
108
|
+
entity: entityName,
|
|
109
|
+
library: this.config.dataFetchingLibrary,
|
|
110
|
+
endpoints: endpoints.map((endpoint)=>({
|
|
111
|
+
name: endpoint.name,
|
|
112
|
+
method: endpoint.method,
|
|
113
|
+
caching: true,
|
|
114
|
+
refetchInterval: endpoint.realtime ? 5000 : 0,
|
|
115
|
+
staleTime: endpoint.staleTime || 300000
|
|
116
|
+
}))
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Plan state synchronization
|
|
121
|
+
*/ async planStateSynchronization(sources) {
|
|
122
|
+
// Use sequential-thinking MCP to plan synchronization strategy
|
|
123
|
+
return {
|
|
124
|
+
sources,
|
|
125
|
+
strategy: 'optimistic-updates',
|
|
126
|
+
conflictResolution: 'last-write-wins',
|
|
127
|
+
offlineSupport: true,
|
|
128
|
+
syncInterval: 30000
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Design derived state selectors
|
|
133
|
+
*/ async createSelectors(storeName, derivedValues) {
|
|
134
|
+
return {
|
|
135
|
+
store: storeName,
|
|
136
|
+
selectors: derivedValues.map((dv)=>({
|
|
137
|
+
name: dv.name,
|
|
138
|
+
dependencies: dv.dependencies || [],
|
|
139
|
+
memoized: true
|
|
140
|
+
}))
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export default StateArchitect;
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=state-architect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/agents/frontend/state-architect.ts"],"names":["StateArchitect","config","stateLibrary","dataFetchingLibrary","persistenceStrategy","designStateArchitecture","requirements","stateDesign","library","stores","actions","selectors","middleware","createStore","storeName","initialState","storeConfig","name","persistence","createZustandStore","createReduxStore","template","Object","keys","map","key","join","JSON","stringify","toLowerCase","trim","designDataFetching","entityName","endpoints","entity","endpoint","method","caching","refetchInterval","realtime","staleTime","planStateSynchronization","sources","strategy","conflictResolution","offlineSupport","syncInterval","createSelectors","derivedValues","store","dv","dependencies","memoized"],"mappings":"AAAA;;;;CAIC,GAQD,OAAO,MAAMA;IACHC,OAA6B;IAErC,YAAYA,SAAwC,CAAC,CAAC,CAAE;QACtD,IAAI,CAACA,MAAM,GAAG;YACZC,cAAcD,OAAOC,YAAY,IAAI;YACrCC,qBAAqBF,OAAOE,mBAAmB,IAAI;YACnDC,qBAAqBH,OAAOG,mBAAmB,IAAI;QACrD;IACF;IAEA;;;GAGC,GACD,MAAMC,wBAAwBC,YAAiB,EAAgB;QAC7D,4DAA4D;QAC5D,MAAMC,cAAc;YAClBC,SAAS,IAAI,CAACP,MAAM,CAACC,YAAY;YACjCO,QAAQ,EAAE;YACVC,SAAS,EAAE;YACXC,WAAW,EAAE;YACbC,YAAY,EAAE;QAChB;QAEA,6BAA6B;QAC7B,yDAAyD;QACzD,wCAAwC;QACxC,qCAAqC;QACrC,wCAAwC;QACxC,uDAAuD;QAEvD,OAAOL;IACT;IAEA;;GAEC,GACD,MAAMM,YAAYC,SAAiB,EAAEC,YAAiB,EAAgB;QACpE,MAAMC,cAAc;YAClBC,MAAMH;YACNN,SAAS,IAAI,CAACP,MAAM,CAACC,YAAY;YACjCa;YACAL,SAAS,CAAC;YACVE,YAAY,EAAE;YACdM,aAAa,IAAI,CAACjB,MAAM,CAACG,mBAAmB;QAC9C;QAEA,IAAI,IAAI,CAACH,MAAM,CAACC,YAAY,KAAK,WAAW;YAC1C,OAAO,IAAI,CA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,CAAC,CAACW,WAAc,CAAA;oBACtClB,MAAMkB,SAASlB,IAAI;oBACnBmB,QAAQD,SAASC,MAAM;oBACvBC,SAAS;oBACTC,iBAAiBH,SAASI,QAAQ,GAAG,OAAO;oBAC5CC,WAAWL,SAASK,SAAS,IAAI;gBACnC,CAAA;QACF;IACF;IAEA;;GAEC,GACD,MAAMC,yBAAyBC,OAAiB,EAAgB;QAC9D,+DAA+D;QAC/D,OAAO;YACLA;YACAC,UAAU;YACVC,oBAAoB;YACpBC,gBAAgB;YAChBC,cAAc;QAChB;IACF;IAEA;;GAEC,GACD,MAAMC,gBAAgBjC,SAAiB,EAAEkC,aAAoB,EAAgB;QAC3E,OAAO;YACLC,OAAOnC;YACPH,WAAWqC,cAAcxB,GAAG,CAAC,CAAC0B,KAAQ,CAAA;oBACpCjC,MAAMiC,GAAGjC,IAAI;oBACbkC,cAAcD,GAAGC,YAAY,IAAI,EAAE;oBACnCC,UAAU;gBACZ,CAAA;QACF;IACF;AACF;AAEA,eAAepD,eAAe"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Designer Agent
|
|
3
|
+
* Specializes in component design, layout, and visual hierarchy
|
|
4
|
+
* Uses shadcn MCP for component specs
|
|
5
|
+
*/ export class UIDesigner {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config = {}){
|
|
8
|
+
this.config = {
|
|
9
|
+
framework: config.framework || 'react',
|
|
10
|
+
designSystem: config.designSystem || 'shadcn',
|
|
11
|
+
responsiveBreakpoints: config.responsiveBreakpoints || [
|
|
12
|
+
'sm',
|
|
13
|
+
'md',
|
|
14
|
+
'lg',
|
|
15
|
+
'xl',
|
|
16
|
+
'2xl'
|
|
17
|
+
],
|
|
18
|
+
accessibilityLevel: config.accessibilityLevel || 'wcag-aa'
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Design component structure using shadcn MCP
|
|
23
|
+
*/ async designComponent(componentType, requirements) {
|
|
24
|
+
// Query shadcn MCP for component specs
|
|
25
|
+
const componentSpec = {
|
|
26
|
+
type: componentType,
|
|
27
|
+
framework: this.config.framework,
|
|
28
|
+
designSystem: this.config.designSystem,
|
|
29
|
+
accessibility: this.config.accessibilityLevel,
|
|
30
|
+
responsive: true,
|
|
31
|
+
requirements
|
|
32
|
+
};
|
|
33
|
+
return componentSpec;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate responsive layout
|
|
37
|
+
*/ async createLayout(layoutType, components) {
|
|
38
|
+
return {
|
|
39
|
+
layoutType,
|
|
40
|
+
components,
|
|
41
|
+
breakpoints: this.config.responsiveBreakpoints,
|
|
42
|
+
spacing: 'responsive',
|
|
43
|
+
container: 'max-w-7xl mx-auto px-4 sm:px-6 lg:px-8'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validate accessibility compliance
|
|
48
|
+
*/ async validateAccessibility(component) {
|
|
49
|
+
const issues = [];
|
|
50
|
+
// Check ARIA labels
|
|
51
|
+
if (!component.ariaLabel && !component.ariaLabelledBy) {
|
|
52
|
+
issues.push('Missing ARIA label for screen readers');
|
|
53
|
+
}
|
|
54
|
+
// Check color contrast (mock validation)
|
|
55
|
+
if (component.colorContrast && component.colorContrast < 4.5) {
|
|
56
|
+
issues.push(`Color contrast ${component.colorContrast} below WCAG AA minimum (4.5:1)`);
|
|
57
|
+
}
|
|
58
|
+
// Check keyboard navigation
|
|
59
|
+
if (component.interactive && !component.tabIndex) {
|
|
60
|
+
issues.push('Interactive element not keyboard accessible');
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
compliant: issues.length === 0,
|
|
64
|
+
issues
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Design token system
|
|
69
|
+
*/ async createDesignTokens() {
|
|
70
|
+
return {
|
|
71
|
+
colors: {
|
|
72
|
+
primary: 'hsl(var(--primary))',
|
|
73
|
+
secondary: 'hsl(var(--secondary))',
|
|
74
|
+
accent: 'hsl(var(--accent))',
|
|
75
|
+
background: 'hsl(var(--background))',
|
|
76
|
+
foreground: 'hsl(var(--foreground))'
|
|
77
|
+
},
|
|
78
|
+
spacing: {
|
|
79
|
+
xs: '0.25rem',
|
|
80
|
+
sm: '0.5rem',
|
|
81
|
+
md: '1rem',
|
|
82
|
+
lg: '1.5rem',
|
|
83
|
+
xl: '2rem'
|
|
84
|
+
},
|
|
85
|
+
typography: {
|
|
86
|
+
fontFamily: 'var(--font-sans)',
|
|
87
|
+
fontSize: {
|
|
88
|
+
xs: '0.75rem',
|
|
89
|
+
sm: '0.875rem',
|
|
90
|
+
base: '1rem',
|
|
91
|
+
lg: '1.125rem',
|
|
92
|
+
xl: '1.25rem'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export default UIDesigner;
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=ui-designer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/agents/frontend/ui-designer.ts"],"names":["UIDesigner","config","framework","designSystem","responsiveBreakpoints","accessibilityLevel","designComponent","componentType","requirements","componentSpec","type","accessibility","responsive","createLayout","layoutType","components","breakpoints","spacing","container","validateAccessibility","component","issues","ariaLabel","ariaLabelledBy","push","colorContrast","interactive","tabIndex","compliant","length","createDesignTokens","colors","primary","secondary","accent","background","foreground","xs","sm","md","lg","xl","typography","fontFamily","fontSize","base"],"mappings":"AAAA;;;;CAIC,GASD,OAAO,MAAMA;IACHC,OAAyB;IAEjC,YAAYA,SAAoC,CAAC,CAAC,CAAE;QAClD,IAAI,CAACA,MAAM,GAAG;YACZC,WAAWD,OAAOC,SAAS,IAAI;YAC/BC,cAAcF,OAAOE,YAAY,IAAI;YACrCC,uBAAuBH,OAAOG,qBAAqB,IAAI;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;aAAM;YACtFC,oBAAoBJ,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C,YAAY;gBACVC,YAAY;gBACZC,UAAU;oBACRP,IAAI;oBACJC,IAAI;oBACJO,MAAM;oBACNL,IAAI;oBACJC,IAAI;gBACN;YACF;QACF;IACF;AACF;AAEA,eAAezC,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.21",
|
|
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",
|
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
"session-end": ".claude/commands/hooks/session-end.md"
|
|
9
9
|
},
|
|
10
10
|
"permissions": {
|
|
11
|
-
"allow": ["mcp__ruv-swarm", "mcp__claude-flow"],
|
|
11
|
+
"allow": ["mcp__ruv-swarm", "mcp__claude-flow", "mcp__sequential-thinking", "mcp__playwright", "mcp__shadcn"],
|
|
12
12
|
"autoApprove": {
|
|
13
13
|
"mcp__ruv-swarm": ["*"],
|
|
14
|
-
"mcp__claude-flow": ["*"]
|
|
14
|
+
"mcp__claude-flow": ["*"],
|
|
15
|
+
"mcp__sequential-thinking": ["*"],
|
|
16
|
+
"mcp__playwright": ["*"],
|
|
17
|
+
"mcp__shadcn": ["*"]
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
"mcpServers": {
|
|
@@ -24,6 +27,21 @@
|
|
|
24
27
|
"command": "npx",
|
|
25
28
|
"args": ["ruv-swarm@latest", "mcp", "start"],
|
|
26
29
|
"type": "stdio"
|
|
30
|
+
},
|
|
31
|
+
"sequential-thinking": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["@modelcontextprotocol/server-sequential-thinking@latest"],
|
|
34
|
+
"type": "stdio"
|
|
35
|
+
},
|
|
36
|
+
"playwright": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["@playwright/mcp@latest"],
|
|
39
|
+
"type": "stdio"
|
|
40
|
+
},
|
|
41
|
+
"shadcn": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["@shadcn/mcp@latest"],
|
|
44
|
+
"type": "stdio"
|
|
27
45
|
}
|
|
28
46
|
},
|
|
29
47
|
"features": {
|