agentic-sdlc 1.5.1 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/rules/agent-execution.md +55 -0
- package/.agent/rules/ai-enforcement.md +4 -3
- package/.agent/rules/artifacts.md +79 -77
- package/.agent/rules/auto-learning.md +78 -0
- package/.agent/rules/code-quality.md +40 -0
- package/.agent/rules/git-workflow.md +44 -24
- package/.agent/rules/global.md +10 -6
- package/.agent/rules/naming-conventions.md +55 -0
- package/.agent/skills/role-ba.md +6 -2
- package/.agent/skills/role-brain.md +5 -1
- package/.agent/skills/role-cloud.md +38 -0
- package/.agent/skills/role-dev.md +31 -5
- package/.agent/skills/role-devops.md +9 -0
- package/.agent/skills/role-game.md +35 -0
- package/.agent/skills/role-mobile.md +55 -0
- package/.agent/skills/role-orchestrator.md +4 -0
- package/.agent/skills/role-pm.md +4 -0
- package/.agent/skills/role-po.md +4 -0
- package/.agent/skills/role-reporter.md +4 -0
- package/.agent/skills/role-research.md +78 -0
- package/.agent/skills/role-sa.md +4 -0
- package/.agent/skills/role-seca.md +4 -0
- package/.agent/skills/role-stakeholder.md +4 -0
- package/.agent/skills/role-tester.md +15 -3
- package/.agent/skills/role-uiux.md +4 -0
- package/.agent/templates/CHANGELOG-Template.md +2 -2
- package/.agent/templates/Design-Verification-Report-Template.md +4 -4
- package/.agent/templates/DevOps-Plan-Template.md +7 -0
- package/.agent/templates/Specification-Template.md +38 -0
- package/.agent/templates/ab-comparison-report.md +175 -0
- package/.agent/templates/observer-report.md +131 -0
- package/.agent/templates/quality-score-report.md +197 -0
- package/.agent/templates/self-learning-digest.md +268 -0
- package/.agent/templates/system-health-report.md +330 -0
- package/.agent/workflows/ab.md +101 -0
- package/.agent/workflows/autogen.md +65 -0
- package/.agent/workflows/brain.md +52 -42
- package/.agent/workflows/commit.md +61 -0
- package/.agent/workflows/cycle.md +36 -15
- package/.agent/workflows/debug.md +123 -0
- package/.agent/workflows/deep-search.md +82 -0
- package/.agent/workflows/docs.md +144 -0
- package/.agent/workflows/emergency.md +17 -15
- package/.agent/workflows/explore.md +15 -9
- package/.agent/workflows/housekeeping.md +24 -11
- package/.agent/workflows/metrics.md +14 -12
- package/.agent/workflows/monitor.md +98 -0
- package/.agent/workflows/observe.md +84 -0
- package/.agent/workflows/onboarding.md +135 -0
- package/.agent/workflows/orchestrator.md +21 -14
- package/.agent/workflows/planning.md +126 -0
- package/.agent/workflows/refactor.md +132 -0
- package/.agent/workflows/release.md +19 -12
- package/.agent/workflows/review.md +99 -0
- package/.agent/workflows/score.md +104 -0
- package/.agent/workflows/sprint.md +16 -14
- package/.agent/workflows/validate.md +13 -11
- package/.agent/workflows/worktree.md +154 -0
- package/CHANGELOG.md +88 -0
- package/README.md +12 -4
- package/bin/cli.js +143 -13
- package/docs/.brain-health-history.json +42 -0
- package/docs/.brain-improvements.json +53 -0
- package/docs/.brain-learner-log.json +27 -0
- package/docs/.brain-scores.json +310 -0
- package/docs/architecture/system-flow.mermaid +81 -0
- package/docs/artifacts/2026-01-05-enforcement-gates-plan.md +80 -0
- package/docs/artifacts/2026-01-05-workflow-analysis.md +231 -0
- package/docs/artifacts/README.md +26 -0
- package/docs/guides/MCP-GUIDE.md +1 -0
- package/docs/reports/2026-01-05-autogen-evaluation.md +64 -0
- package/docs/reports/2026-01-05-brain-layer-analysis.md +109 -0
- package/docs/reports/2026-01-05-repository-audit.md +253 -0
- package/docs/reports/Metrics-Dashboard-2026-01-08.md +29 -0
- package/docs/reports/Metrics-Dashboard-Final.md +29 -0
- package/docs/reports/Validation-Report-2026-01-05.md +40 -0
- package/docs/reports/Validation-Report-2026-01-08.md +40 -0
- package/docs/reports/worktrunk-audit.md +94 -0
- package/docs/solutions/README.md +96 -0
- package/docs/walkthroughs/2026-01-05-audit-implementation.md +36 -0
- package/docs/walkthroughs/2026-01-05-autonomy-release.md +54 -0
- package/docs/walkthroughs/2026-01-05-enforcement-gates.md +33 -0
- package/docs/walkthroughs/2026-01-05-judge-enhancement.md +30 -0
- package/docs/walkthroughs/2026-01-05-landing-page-orchestrator.md +52 -0
- package/docs/walkthroughs/2026-01-05-validation.md +32 -0
- package/docs/walkthroughs/2026-01-05-workflow-audit.md +89 -0
- package/docs/walkthroughs/2026-01-05-workflow-refactoring.md +44 -0
- package/docs/walkthroughs/2026-01-06-worktrunk-integration.md +41 -0
- package/docs/walkthroughs/README.md +25 -0
- package/package.json +33 -19
- package/.agent/knowledge-base/AUTO-LEARNING-GUIDE.md +0 -327
- package/.agent/knowledge-base/HOW-IT-WORKS.md +0 -365
- package/.agent/knowledge-base/INDEX.md +0 -43
- package/.agent/knowledge-base/README.md +0 -242
- package/.agent/knowledge-base/architecture/.gitkeep +0 -1
- package/.agent/knowledge-base/architecture/KB-2026-01-01-003-neo4j-graph-database-skills.md +0 -1146
- package/.agent/knowledge-base/architecture/README.md +0 -98
- package/.agent/knowledge-base/bugs/.gitkeep +0 -1
- package/.agent/knowledge-base/bugs/KB-2026-01-02-yaml-special-character-escaping.md +0 -56
- package/.agent/knowledge-base/bugs/medium/KB-2026-01-01-001-example-auto-learned.md +0 -198
- package/.agent/knowledge-base/features/.gitkeep +0 -1
- package/.agent/knowledge-base/features/KB-2026-01-01-001-landing-page-design-trends-2026.md +0 -646
- package/.agent/knowledge-base/features/KB-2026-01-01-004-uiux-design-skills-2026.md +0 -945
- package/.agent/knowledge-base/features/KB-2026-01-01-005-modern-ai-landing-page-ui.md +0 -310
- package/.agent/knowledge-base/features/KB-2026-01-01-006-award-winning-landing-page-patterns.md +0 -324
- package/.agent/knowledge-base/features/KB-2026-01-02-001-cleanup-workflow.md +0 -242
- package/.agent/knowledge-base/features/KB-2026-01-02-002-landing-page-monorepo-architecture.md +0 -148
- package/.agent/knowledge-base/features/KB-2026-01-02-003-premium-glassmorphism-patterns.md +0 -58
- package/.agent/knowledge-base/features/KB-2026-01-04-ai-agent-enforcement.md +0 -46
- package/.agent/knowledge-base/features/README.md +0 -83
- package/.agent/knowledge-base/features/figma-landing-page-workflow.md +0 -311
- package/.agent/knowledge-base/features/figma-mcp-sa-guide.md +0 -673
- package/.agent/knowledge-base/features/figma-mcp-uiux-guide.md +0 -459
- package/.agent/knowledge-base/performance/.gitkeep +0 -1
- package/.agent/knowledge-base/performance/KB-2026-01-02-lazy-loading-optimization.md +0 -80
- package/.agent/knowledge-base/platform-specific/.gitkeep +0 -1
- package/.agent/knowledge-base/platform-specific/KB-2026-01-02-windows-console-encoding.md +0 -56
- package/.agent/knowledge-base/role-guides/DEV-KB-Guide.md +0 -527
- package/.agent/knowledge-base/role-guides/DEVOPS-KB-Guide.md +0 -491
- package/.agent/knowledge-base/role-guides/PM-KB-Guide.md +0 -299
- package/.agent/knowledge-base/role-guides/SECA-KB-Guide.md +0 -555
- package/.agent/knowledge-base/role-guides/TESTER-KB-Guide.md +0 -519
- package/.agent/knowledge-base/security/.gitkeep +0 -1
- package/.agent/knowledge-base/security/KB-2026-01-02-input-validation-sanitization.md +0 -74
- package/.agent/rules/AUTO-LEARNING.md +0 -418
- package/.agent/rules/KNOWLEDGE-BASE.md +0 -45
- package/.agent/skills/role-qa.md +0 -81
- package/.agent/workflows/compound.md +0 -51
- package/.agent/workflows/preflight.md +0 -35
- package/.agent/workflows/route.md +0 -160
- package/bin/kb +0 -34
- package/bin/kb.bat +0 -28
- package/bin/kb_cli.py +0 -226
- package/bin/lib/README.md +0 -411
- package/bin/lib/__init__.py +0 -7
- package/bin/lib/__pycache__/kb_add.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_common.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_compound.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_index.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_list.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_search.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_stats.cpython-313.pyc +0 -0
- package/bin/lib/kb_add.py +0 -203
- package/bin/lib/kb_common.py +0 -224
- package/bin/lib/kb_compound.py +0 -250
- package/bin/lib/kb_index.py +0 -193
- package/bin/lib/kb_list.py +0 -144
- package/bin/lib/kb_search.py +0 -121
- package/bin/lib/kb_stats.py +0 -153
|
@@ -1,673 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Figma MCP Integration for @SA"
|
|
3
|
-
category: feature
|
|
4
|
-
priority: high
|
|
5
|
-
date: 2026-01-02
|
|
6
|
-
tags: [figma, mcp, sa, architecture, api-design]
|
|
7
|
-
related_files: [.agent/roles/role-sa.md]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Figma MCP Integration for @SA
|
|
11
|
-
|
|
12
|
-
## Overview
|
|
13
|
-
|
|
14
|
-
Figma MCP tools enable @SA to:
|
|
15
|
-
- Understand UI requirements from Figma designs
|
|
16
|
-
- Extract component structure for API design
|
|
17
|
-
- Create architecture diagrams in FigJam
|
|
18
|
-
- Map design components to backend services
|
|
19
|
-
- Generate data models from design patterns
|
|
20
|
-
|
|
21
|
-
## Key Figma MCP Tools for @SA
|
|
22
|
-
|
|
23
|
-
### 1. Get Metadata
|
|
24
|
-
**Tool:** `mcp_figma_get_metadata`
|
|
25
|
-
**Purpose:** Understand design structure to inform API design
|
|
26
|
-
|
|
27
|
-
**Use Case:** Before designing APIs, understand what UI components need
|
|
28
|
-
|
|
29
|
-
**Usage:**
|
|
30
|
-
```javascript
|
|
31
|
-
// Get page structure to understand UI needs
|
|
32
|
-
mcp_figma_get_metadata({
|
|
33
|
-
fileKey: "pqrs",
|
|
34
|
-
nodeId: "0:1", // Page ID
|
|
35
|
-
clientLanguages: "typescript",
|
|
36
|
-
clientFrameworks: "react,nextjs"
|
|
37
|
-
})
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Output:** XML structure showing:
|
|
41
|
-
- Component hierarchy
|
|
42
|
-
- Layer types and names
|
|
43
|
-
- Positions and sizes
|
|
44
|
-
- Node IDs for detailed inspection
|
|
45
|
-
|
|
46
|
-
### 2. Get Design Context
|
|
47
|
-
**Tool:** `mcp_figma_get_design_context`
|
|
48
|
-
**Purpose:** Understand component props and data requirements
|
|
49
|
-
|
|
50
|
-
**Use Case:** Design APIs that match UI component needs
|
|
51
|
-
|
|
52
|
-
**Usage:**
|
|
53
|
-
```javascript
|
|
54
|
-
// Analyze component to understand data needs
|
|
55
|
-
mcp_figma_get_design_context({
|
|
56
|
-
fileKey: "pqrs",
|
|
57
|
-
nodeId: "user-profile-card",
|
|
58
|
-
clientLanguages: "typescript",
|
|
59
|
-
clientFrameworks: "react,nextjs"
|
|
60
|
-
})
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Analysis:**
|
|
64
|
-
- What data does this component display?
|
|
65
|
-
- What actions does it trigger?
|
|
66
|
-
- What API endpoints are needed?
|
|
67
|
-
|
|
68
|
-
### 3. Generate Diagram
|
|
69
|
-
**Tool:** `mcp_figma_generate_diagram`
|
|
70
|
-
**Purpose:** Create architecture diagrams in FigJam
|
|
71
|
-
|
|
72
|
-
**Supported Diagrams:**
|
|
73
|
-
- **Flowchart:** System architecture, data flows
|
|
74
|
-
- **Sequence Diagram:** API interactions, request/response flows
|
|
75
|
-
- **State Diagram:** Application state management
|
|
76
|
-
- **Gantt Chart:** Implementation timeline
|
|
77
|
-
|
|
78
|
-
**Usage:**
|
|
79
|
-
```javascript
|
|
80
|
-
// Create architecture diagram
|
|
81
|
-
mcp_figma_generate_diagram({
|
|
82
|
-
name: "Microservices Architecture",
|
|
83
|
-
mermaidSyntax: `
|
|
84
|
-
flowchart LR
|
|
85
|
-
A["API Gateway"] --> B["Auth Service"]
|
|
86
|
-
A --> C["User Service"]
|
|
87
|
-
A --> D["Payment Service"]
|
|
88
|
-
B --> E["Database"]
|
|
89
|
-
C --> E
|
|
90
|
-
D --> F["Payment Gateway"]
|
|
91
|
-
`,
|
|
92
|
-
userIntent: "Document microservices architecture"
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
// Create API sequence diagram
|
|
96
|
-
mcp_figma_generate_diagram({
|
|
97
|
-
name: "Authentication Flow",
|
|
98
|
-
mermaidSyntax: `
|
|
99
|
-
sequenceDiagram
|
|
100
|
-
participant Client
|
|
101
|
-
participant API
|
|
102
|
-
participant Auth
|
|
103
|
-
participant DB
|
|
104
|
-
|
|
105
|
-
Client->>API: POST /login
|
|
106
|
-
API->>Auth: Validate credentials
|
|
107
|
-
Auth->>DB: Query user
|
|
108
|
-
DB-->>Auth: User data
|
|
109
|
-
Auth-->>API: JWT token
|
|
110
|
-
API-->>Client: 200 OK + token
|
|
111
|
-
`,
|
|
112
|
-
userIntent: "Document authentication API flow"
|
|
113
|
-
})
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### 4. Get Variable Definitions
|
|
117
|
-
**Tool:** `mcp_figma_get_variable_defs`
|
|
118
|
-
**Purpose:** Extract design tokens to inform API response structure
|
|
119
|
-
|
|
120
|
-
**Use Case:** Design API responses that match design system
|
|
121
|
-
|
|
122
|
-
**Usage:**
|
|
123
|
-
```javascript
|
|
124
|
-
// Get design tokens
|
|
125
|
-
mcp_figma_get_variable_defs({
|
|
126
|
-
fileKey: "pqrs",
|
|
127
|
-
nodeId: "design-tokens"
|
|
128
|
-
})
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Application:**
|
|
132
|
-
```json
|
|
133
|
-
// API response includes design tokens
|
|
134
|
-
{
|
|
135
|
-
"user": {
|
|
136
|
-
"name": "John Doe",
|
|
137
|
-
"status": "active",
|
|
138
|
-
"statusColor": "#00FF00" // From design tokens
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### 5. Code Connect Map
|
|
144
|
-
**Tool:** `mcp_figma_get_code_connect_map`
|
|
145
|
-
**Purpose:** Understand which components exist and their data needs
|
|
146
|
-
|
|
147
|
-
**Usage:**
|
|
148
|
-
```javascript
|
|
149
|
-
// Get component mappings
|
|
150
|
-
mcp_figma_get_code_connect_map({
|
|
151
|
-
fileKey: "pqrs",
|
|
152
|
-
nodeId: "1:2"
|
|
153
|
-
})
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Analysis:**
|
|
157
|
-
- Which components are implemented?
|
|
158
|
-
- What data structures do they expect?
|
|
159
|
-
- What APIs are already defined?
|
|
160
|
-
|
|
161
|
-
## @SA Workflow with Figma MCP
|
|
162
|
-
|
|
163
|
-
### Phase 1: Requirements Analysis
|
|
164
|
-
```bash
|
|
165
|
-
# 1. Get design structure
|
|
166
|
-
mcp_figma_get_metadata({
|
|
167
|
-
fileKey: "project-file",
|
|
168
|
-
nodeId: "0:1", # Main page
|
|
169
|
-
clientLanguages: "typescript",
|
|
170
|
-
clientFrameworks: "react,nextjs"
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
# 2. Analyze key components
|
|
174
|
-
mcp_figma_get_design_context({
|
|
175
|
-
fileKey: "project-file",
|
|
176
|
-
nodeId: "dashboard-component",
|
|
177
|
-
clientLanguages: "typescript",
|
|
178
|
-
clientFrameworks: "react,nextjs"
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
# 3. Extract design tokens
|
|
182
|
-
mcp_figma_get_variable_defs({
|
|
183
|
-
fileKey: "project-file",
|
|
184
|
-
nodeId: "tokens-page"
|
|
185
|
-
})
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Phase 2: API Design
|
|
189
|
-
```bash
|
|
190
|
-
# Based on component analysis, design APIs
|
|
191
|
-
|
|
192
|
-
# Example: Dashboard component needs:
|
|
193
|
-
# - GET /api/user/profile
|
|
194
|
-
# - GET /api/user/stats
|
|
195
|
-
# - GET /api/user/recent-activity
|
|
196
|
-
|
|
197
|
-
# Document in Backend-Design-Spec
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Phase 3: Architecture Documentation
|
|
201
|
-
```bash
|
|
202
|
-
# 1. Create system architecture diagram
|
|
203
|
-
mcp_figma_generate_diagram({
|
|
204
|
-
name: "System Architecture",
|
|
205
|
-
mermaidSyntax: `
|
|
206
|
-
flowchart LR
|
|
207
|
-
A["Frontend"] --> B["API Gateway"]
|
|
208
|
-
B --> C["Auth Service"]
|
|
209
|
-
B --> D["User Service"]
|
|
210
|
-
B --> E["Data Service"]
|
|
211
|
-
C --> F["Redis Cache"]
|
|
212
|
-
D --> G["PostgreSQL"]
|
|
213
|
-
E --> G
|
|
214
|
-
`
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
# 2. Create API flow diagrams
|
|
218
|
-
mcp_figma_generate_diagram({
|
|
219
|
-
name: "User Registration Flow",
|
|
220
|
-
mermaidSyntax: `
|
|
221
|
-
sequenceDiagram
|
|
222
|
-
participant UI
|
|
223
|
-
participant API
|
|
224
|
-
participant Auth
|
|
225
|
-
participant DB
|
|
226
|
-
participant Email
|
|
227
|
-
|
|
228
|
-
UI->>API: POST /register
|
|
229
|
-
API->>Auth: Validate input
|
|
230
|
-
Auth->>DB: Create user
|
|
231
|
-
DB-->>Auth: User created
|
|
232
|
-
Auth->>Email: Send verification
|
|
233
|
-
Auth-->>API: Success
|
|
234
|
-
API-->>UI: 201 Created
|
|
235
|
-
`
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
# 3. Create state diagrams
|
|
239
|
-
mcp_figma_generate_diagram({
|
|
240
|
-
name: "Order State Machine",
|
|
241
|
-
mermaidSyntax: `
|
|
242
|
-
stateDiagram-v2
|
|
243
|
-
[*] --> Pending
|
|
244
|
-
Pending --> Processing: Payment confirmed
|
|
245
|
-
Processing --> Shipped: Items packed
|
|
246
|
-
Shipped --> Delivered: Received
|
|
247
|
-
Delivered --> [*]
|
|
248
|
-
|
|
249
|
-
Pending --> Cancelled: User cancels
|
|
250
|
-
Processing --> Cancelled: Payment fails
|
|
251
|
-
Cancelled --> [*]
|
|
252
|
-
`
|
|
253
|
-
})
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Phase 4: Data Model Design
|
|
257
|
-
```bash
|
|
258
|
-
# Based on component analysis and design tokens
|
|
259
|
-
|
|
260
|
-
# Example: User Profile component needs:
|
|
261
|
-
interface UserProfile {
|
|
262
|
-
id: string;
|
|
263
|
-
name: string;
|
|
264
|
-
email: string;
|
|
265
|
-
avatar: string;
|
|
266
|
-
status: 'active' | 'inactive';
|
|
267
|
-
statusColor: string; // From design tokens
|
|
268
|
-
createdAt: Date;
|
|
269
|
-
stats: {
|
|
270
|
-
posts: number;
|
|
271
|
-
followers: number;
|
|
272
|
-
following: number;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
# Document in Backend-Design-Spec
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
## Best Practices
|
|
280
|
-
|
|
281
|
-
### 1. Analyze Before Designing
|
|
282
|
-
```javascript
|
|
283
|
-
// Step 1: Get design overview
|
|
284
|
-
const structure = await mcp_figma_get_metadata({
|
|
285
|
-
fileKey: "project",
|
|
286
|
-
nodeId: "0:1"
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
// Step 2: Identify key components
|
|
290
|
-
// Look for: forms, lists, cards, dashboards
|
|
291
|
-
|
|
292
|
-
// Step 3: Analyze each component
|
|
293
|
-
for (const component of keyComponents) {
|
|
294
|
-
const context = await mcp_figma_get_design_context({
|
|
295
|
-
fileKey: "project",
|
|
296
|
-
nodeId: component.id
|
|
297
|
-
})
|
|
298
|
-
|
|
299
|
-
// Extract data requirements
|
|
300
|
-
// Design corresponding APIs
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### 2. Design APIs to Match UI Needs
|
|
305
|
-
```javascript
|
|
306
|
-
// Component shows: User card with avatar, name, bio, stats
|
|
307
|
-
// Design API response to match:
|
|
308
|
-
|
|
309
|
-
GET /api/users/:id
|
|
310
|
-
Response:
|
|
311
|
-
{
|
|
312
|
-
"id": "123",
|
|
313
|
-
"avatar": "https://...",
|
|
314
|
-
"name": "John Doe",
|
|
315
|
-
"bio": "Software engineer",
|
|
316
|
-
"stats": {
|
|
317
|
-
"posts": 42,
|
|
318
|
-
"followers": 150,
|
|
319
|
-
"following": 89
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### 3. Document Architecture Visually
|
|
325
|
-
```javascript
|
|
326
|
-
// Create comprehensive architecture diagrams
|
|
327
|
-
|
|
328
|
-
// System overview
|
|
329
|
-
mcp_figma_generate_diagram({
|
|
330
|
-
name: "High-Level Architecture",
|
|
331
|
-
mermaidSyntax: "flowchart LR..."
|
|
332
|
-
})
|
|
333
|
-
|
|
334
|
-
// API interactions
|
|
335
|
-
mcp_figma_generate_diagram({
|
|
336
|
-
name: "API Sequence Diagrams",
|
|
337
|
-
mermaidSyntax: "sequenceDiagram..."
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
// State management
|
|
341
|
-
mcp_figma_generate_diagram({
|
|
342
|
-
name: "State Machines",
|
|
343
|
-
mermaidSyntax: "stateDiagram-v2..."
|
|
344
|
-
})
|
|
345
|
-
|
|
346
|
-
// Include diagram URLs in Backend-Design-Spec
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
### 4. Coordinate with @UIUX
|
|
350
|
-
```markdown
|
|
351
|
-
### Design-API Alignment
|
|
352
|
-
|
|
353
|
-
**Component:** User Dashboard
|
|
354
|
-
**Figma Node:** 1:2
|
|
355
|
-
**Data Requirements:**
|
|
356
|
-
- User profile: GET /api/user/profile
|
|
357
|
-
- Activity feed: GET /api/user/activity?limit=10
|
|
358
|
-
- Statistics: GET /api/user/stats
|
|
359
|
-
|
|
360
|
-
**Design Tokens Used:**
|
|
361
|
-
- Status colors: From Figma variables
|
|
362
|
-
- Spacing: 8px grid system
|
|
363
|
-
- Typography: Inter font family
|
|
364
|
-
|
|
365
|
-
### Questions for @UIUX:
|
|
366
|
-
- Does dashboard need real-time updates? (WebSocket vs polling)
|
|
367
|
-
- What's the pagination strategy for activity feed?
|
|
368
|
-
- Are stats cached or real-time?
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## Integration with @SA Workflow
|
|
372
|
-
|
|
373
|
-
### In Backend-Design-Spec
|
|
374
|
-
```markdown
|
|
375
|
-
## Design Analysis
|
|
376
|
-
|
|
377
|
-
**Figma Design Reference:** [Link to Figma]
|
|
378
|
-
- File Key: `abc123`
|
|
379
|
-
- Analyzed Components: Dashboard (1:2), Profile (3:4), Settings (5:6)
|
|
380
|
-
|
|
381
|
-
### Component-to-API Mapping
|
|
382
|
-
|
|
383
|
-
| Component | Node ID | Data Needs | API Endpoints |
|
|
384
|
-
|-----------|---------|------------|---------------|
|
|
385
|
-
| Dashboard | 1:2 | User stats, activity | GET /api/user/stats, GET /api/user/activity |
|
|
386
|
-
| Profile | 3:4 | User details, posts | GET /api/user/:id, GET /api/user/:id/posts |
|
|
387
|
-
| Settings | 5:6 | User preferences | GET /api/user/settings, PUT /api/user/settings |
|
|
388
|
-
|
|
389
|
-
### Architecture Diagrams
|
|
390
|
-
|
|
391
|
-
**System Architecture:**
|
|
392
|
-
[FigJam Diagram URL]
|
|
393
|
-
|
|
394
|
-
**API Flow Diagrams:**
|
|
395
|
-
- Authentication: [FigJam URL]
|
|
396
|
-
- Data Fetching: [FigJam URL]
|
|
397
|
-
- Real-time Updates: [FigJam URL]
|
|
398
|
-
|
|
399
|
-
**State Machines:**
|
|
400
|
-
- User Session: [FigJam URL]
|
|
401
|
-
- Data Sync: [FigJam URL]
|
|
402
|
-
|
|
403
|
-
## API Specifications
|
|
404
|
-
|
|
405
|
-
### GET /api/user/stats
|
|
406
|
-
**Purpose:** Provide data for dashboard stats component (Node: 1:2)
|
|
407
|
-
|
|
408
|
-
**Response:**
|
|
409
|
-
```json
|
|
410
|
-
{
|
|
411
|
-
"posts": 42,
|
|
412
|
-
"followers": 150,
|
|
413
|
-
"following": 89,
|
|
414
|
-
"engagement": 0.85
|
|
415
|
-
}
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
**Design Alignment:**
|
|
419
|
-
- Matches dashboard component data structure
|
|
420
|
-
- Includes design token for engagement color
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
### Handoff to @DEV
|
|
424
|
-
```markdown
|
|
425
|
-
### Implementation Guidance
|
|
426
|
-
|
|
427
|
-
**Figma Integration:**
|
|
428
|
-
- Component code available via `mcp_figma_get_design_context`
|
|
429
|
-
- Design tokens extracted and documented
|
|
430
|
-
- Architecture diagrams in FigJam for reference
|
|
431
|
-
|
|
432
|
-
**API Implementation Priority:**
|
|
433
|
-
1. Authentication endpoints (see sequence diagram)
|
|
434
|
-
2. User profile endpoints (dashboard dependency)
|
|
435
|
-
3. Activity feed endpoints (pagination required)
|
|
436
|
-
|
|
437
|
-
**Architecture Diagrams:**
|
|
438
|
-
- System overview: [FigJam URL]
|
|
439
|
-
- API flows: [FigJam URL]
|
|
440
|
-
- State machines: [FigJam URL]
|
|
441
|
-
|
|
442
|
-
### Next Step:
|
|
443
|
-
- @DEV - Implement APIs per specification
|
|
444
|
-
- @UIUX - Confirm API responses match component needs
|
|
445
|
-
- @DEVOPS - Review architecture for deployment strategy
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
## Common Patterns
|
|
449
|
-
|
|
450
|
-
### Pattern 1: Component-Driven API Design
|
|
451
|
-
```javascript
|
|
452
|
-
// 1. Analyze UI component
|
|
453
|
-
const component = await mcp_figma_get_design_context({
|
|
454
|
-
fileKey: "project",
|
|
455
|
-
nodeId: "product-card"
|
|
456
|
-
})
|
|
457
|
-
|
|
458
|
-
// 2. Extract data requirements
|
|
459
|
-
// Component shows: image, title, price, rating, stock status
|
|
460
|
-
|
|
461
|
-
// 3. Design API
|
|
462
|
-
GET /api/products/:id
|
|
463
|
-
{
|
|
464
|
-
"id": "123",
|
|
465
|
-
"image": "https://...",
|
|
466
|
-
"title": "Product Name",
|
|
467
|
-
"price": 29.99,
|
|
468
|
-
"rating": 4.5,
|
|
469
|
-
"inStock": true
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// 4. Document in spec
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
### Pattern 2: Architecture Documentation
|
|
476
|
-
```javascript
|
|
477
|
-
// Create comprehensive architecture docs
|
|
478
|
-
|
|
479
|
-
// 1. High-level architecture
|
|
480
|
-
const archUrl = await mcp_figma_generate_diagram({
|
|
481
|
-
name: "System Architecture",
|
|
482
|
-
mermaidSyntax: `
|
|
483
|
-
flowchart LR
|
|
484
|
-
A["Client"] --> B["CDN"]
|
|
485
|
-
A --> C["API Gateway"]
|
|
486
|
-
C --> D["Microservices"]
|
|
487
|
-
D --> E["Databases"]
|
|
488
|
-
D --> F["Cache"]
|
|
489
|
-
`
|
|
490
|
-
})
|
|
491
|
-
|
|
492
|
-
// 2. API sequence diagrams
|
|
493
|
-
const apiUrl = await mcp_figma_generate_diagram({
|
|
494
|
-
name: "API Interactions",
|
|
495
|
-
mermaidSyntax: "sequenceDiagram..."
|
|
496
|
-
})
|
|
497
|
-
|
|
498
|
-
// 3. State machines
|
|
499
|
-
const stateUrl = await mcp_figma_generate_diagram({
|
|
500
|
-
name: "Application States",
|
|
501
|
-
mermaidSyntax: "stateDiagram-v2..."
|
|
502
|
-
})
|
|
503
|
-
|
|
504
|
-
// 4. Include all URLs in Backend-Design-Spec
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
### Pattern 3: Design Token Integration
|
|
508
|
-
```javascript
|
|
509
|
-
// 1. Extract design tokens
|
|
510
|
-
const tokens = await mcp_figma_get_variable_defs({
|
|
511
|
-
fileKey: "design-system",
|
|
512
|
-
nodeId: "tokens"
|
|
513
|
-
})
|
|
514
|
-
|
|
515
|
-
// 2. Design API to include tokens
|
|
516
|
-
GET /api/config/theme
|
|
517
|
-
{
|
|
518
|
-
"colors": {
|
|
519
|
-
"primary": "#007AFF",
|
|
520
|
-
"success": "#00FF00",
|
|
521
|
-
"error": "#FF0000"
|
|
522
|
-
},
|
|
523
|
-
"spacing": {
|
|
524
|
-
"base": 8,
|
|
525
|
-
"small": 4,
|
|
526
|
-
"large": 16
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// 3. Frontend uses tokens from API
|
|
531
|
-
// Ensures design-code consistency
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
### Pattern 4: Real-time Requirements Analysis
|
|
535
|
-
```javascript
|
|
536
|
-
// 1. Analyze component for real-time needs
|
|
537
|
-
const dashboard = await mcp_figma_get_design_context({
|
|
538
|
-
fileKey: "project",
|
|
539
|
-
nodeId: "dashboard"
|
|
540
|
-
})
|
|
541
|
-
|
|
542
|
-
// 2. Identify real-time elements
|
|
543
|
-
// - Live notifications
|
|
544
|
-
// - Activity feed updates
|
|
545
|
-
// - Status changes
|
|
546
|
-
|
|
547
|
-
// 3. Design WebSocket API
|
|
548
|
-
WebSocket /ws/updates
|
|
549
|
-
Events:
|
|
550
|
-
- notification.new
|
|
551
|
-
- activity.update
|
|
552
|
-
- status.change
|
|
553
|
-
|
|
554
|
-
// 4. Document in sequence diagram
|
|
555
|
-
mcp_figma_generate_diagram({
|
|
556
|
-
name: "WebSocket Flow",
|
|
557
|
-
mermaidSyntax: `
|
|
558
|
-
sequenceDiagram
|
|
559
|
-
participant Client
|
|
560
|
-
participant WS
|
|
561
|
-
participant Server
|
|
562
|
-
|
|
563
|
-
Client->>WS: Connect
|
|
564
|
-
WS->>Server: Authenticate
|
|
565
|
-
Server-->>WS: Connected
|
|
566
|
-
Server->>WS: notification.new
|
|
567
|
-
WS->>Client: Push notification
|
|
568
|
-
`
|
|
569
|
-
})
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
## Mermaid Diagram Examples
|
|
573
|
-
|
|
574
|
-
### System Architecture
|
|
575
|
-
```mermaid
|
|
576
|
-
flowchart LR
|
|
577
|
-
A["Frontend<br/>React/Next.js"] --> B["API Gateway<br/>Kong/Nginx"]
|
|
578
|
-
B --> C["Auth Service<br/>JWT"]
|
|
579
|
-
B --> D["User Service<br/>REST API"]
|
|
580
|
-
B --> E["Data Service<br/>GraphQL"]
|
|
581
|
-
C --> F["Redis<br/>Session Store"]
|
|
582
|
-
D --> G["PostgreSQL<br/>User DB"]
|
|
583
|
-
E --> G
|
|
584
|
-
E --> H["Elasticsearch<br/>Search"]
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
### API Sequence Diagram
|
|
588
|
-
```mermaid
|
|
589
|
-
sequenceDiagram
|
|
590
|
-
participant Client
|
|
591
|
-
participant Gateway
|
|
592
|
-
participant Auth
|
|
593
|
-
participant Service
|
|
594
|
-
participant DB
|
|
595
|
-
|
|
596
|
-
Client->>Gateway: POST /api/resource
|
|
597
|
-
Gateway->>Auth: Verify token
|
|
598
|
-
Auth-->>Gateway: Valid
|
|
599
|
-
Gateway->>Service: Process request
|
|
600
|
-
Service->>DB: Query data
|
|
601
|
-
DB-->>Service: Result
|
|
602
|
-
Service-->>Gateway: Response
|
|
603
|
-
Gateway-->>Client: 200 OK
|
|
604
|
-
```
|
|
605
|
-
|
|
606
|
-
### State Machine
|
|
607
|
-
```mermaid
|
|
608
|
-
stateDiagram-v2
|
|
609
|
-
[*] --> Idle
|
|
610
|
-
Idle --> Loading: Fetch data
|
|
611
|
-
Loading --> Success: Data received
|
|
612
|
-
Loading --> Error: Request failed
|
|
613
|
-
Success --> Idle: Reset
|
|
614
|
-
Error --> Idle: Retry
|
|
615
|
-
Success --> [*]
|
|
616
|
-
Error --> [*]
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
### Gantt Chart (Implementation Timeline)
|
|
620
|
-
```mermaid
|
|
621
|
-
gantt
|
|
622
|
-
title API Implementation Timeline
|
|
623
|
-
dateFormat YYYY-MM-DD
|
|
624
|
-
section Phase 1
|
|
625
|
-
Auth APIs :2026-01-03, 3d
|
|
626
|
-
User APIs :2026-01-06, 5d
|
|
627
|
-
section Phase 2
|
|
628
|
-
Data APIs :2026-01-11, 7d
|
|
629
|
-
Search APIs :2026-01-18, 5d
|
|
630
|
-
section Phase 3
|
|
631
|
-
WebSocket :2026-01-23, 4d
|
|
632
|
-
Testing :2026-01-27, 3d
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
## Troubleshooting
|
|
636
|
-
|
|
637
|
-
### Issue: Can't Understand Component Data Needs
|
|
638
|
-
**Solution:**
|
|
639
|
-
1. Use `get_metadata` to see component structure
|
|
640
|
-
2. Use `get_design_context` to see generated code
|
|
641
|
-
3. Analyze props and data structures
|
|
642
|
-
4. Ask @UIUX for clarification
|
|
643
|
-
|
|
644
|
-
### Issue: Design Tokens Don't Match API
|
|
645
|
-
**Solution:**
|
|
646
|
-
1. Extract tokens with `get_variable_defs`
|
|
647
|
-
2. Include tokens in API responses
|
|
648
|
-
3. Document token usage in spec
|
|
649
|
-
4. Coordinate with @UIUX on token structure
|
|
650
|
-
|
|
651
|
-
### Issue: Complex Architecture Hard to Document
|
|
652
|
-
**Solution:**
|
|
653
|
-
1. Break into multiple diagrams
|
|
654
|
-
2. Use flowchart for high-level
|
|
655
|
-
3. Use sequence diagrams for interactions
|
|
656
|
-
4. Use state diagrams for state management
|
|
657
|
-
5. Link all diagrams in spec
|
|
658
|
-
|
|
659
|
-
## Metrics to Track
|
|
660
|
-
|
|
661
|
-
- **Components Analyzed:** Number of Figma components reviewed
|
|
662
|
-
- **APIs Designed:** Number of endpoints created
|
|
663
|
-
- **Architecture Diagrams:** Number of diagrams created
|
|
664
|
-
- **Design-API Alignment:** % of APIs matching UI needs
|
|
665
|
-
- **Time Saved:** Hours saved by analyzing designs first
|
|
666
|
-
|
|
667
|
-
## Related Documentation
|
|
668
|
-
|
|
669
|
-
- `.agent/roles/role-sa.md` - Full @SA role documentation
|
|
670
|
-
- `.agent/knowledge-base/features/figma-mcp-uiux-guide.md` - @UIUX Figma integration
|
|
671
|
-
- Architecture Decision Records (ADRs) in KB
|
|
672
|
-
|
|
673
|
-
#figma #mcp #sa #architecture #api-design #compound-learning
|