@flydocs/cli 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/cli.js +2666 -0
- package/package.json +32 -0
- package/template/.claude/CLAUDE.md +90 -0
- package/template/.claude/agents/README.md +19 -0
- package/template/.claude/agents/implementation-agent.md +29 -0
- package/template/.claude/agents/pm-agent.md +29 -0
- package/template/.claude/agents/research-agent.md +25 -0
- package/template/.claude/agents/review-agent.md +29 -0
- package/template/.claude/commands/activate.md +10 -0
- package/template/.claude/commands/attach.md +9 -0
- package/template/.claude/commands/block.md +10 -0
- package/template/.claude/commands/capture.md +10 -0
- package/template/.claude/commands/close.md +10 -0
- package/template/.claude/commands/flydocs-setup.md +598 -0
- package/template/.claude/commands/flydocs-update.md +27 -0
- package/template/.claude/commands/implement.md +10 -0
- package/template/.claude/commands/new-project.md +11 -0
- package/template/.claude/commands/project-update.md +10 -0
- package/template/.claude/commands/refine.md +10 -0
- package/template/.claude/commands/review.md +10 -0
- package/template/.claude/commands/start-session.md +10 -0
- package/template/.claude/commands/status.md +10 -0
- package/template/.claude/commands/validate.md +10 -0
- package/template/.claude/commands/wrap-session.md +10 -0
- package/template/.claude/settings.json +49 -0
- package/template/.claude/skills/README.md +293 -0
- package/template/.claude/skills/flydocs-cloud/SKILL.md +96 -0
- package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +50 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +44 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +44 -0
- package/template/.claude/skills/flydocs-cloud/scripts/comment.py +39 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +100 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +46 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +40 -0
- package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +277 -0
- package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +77 -0
- package/template/.claude/skills/flydocs-cloud/scripts/link.py +47 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +35 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +105 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +40 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +45 -0
- package/template/.claude/skills/flydocs-cloud/scripts/priority.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +59 -0
- package/template/.claude/skills/flydocs-cloud/scripts/transition.py +67 -0
- package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +47 -0
- package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +111 -0
- package/template/.claude/skills/flydocs-context-graph/SKILL.md +87 -0
- package/template/.claude/skills/flydocs-context-graph/schema.md +78 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_build.py +299 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +338 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_query.py +191 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_session.py +161 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_update.py +194 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_utils.py +118 -0
- package/template/.claude/skills/flydocs-estimates/SKILL.md +384 -0
- package/template/.claude/skills/flydocs-estimates/references/provider-costs.md +152 -0
- package/template/.claude/skills/flydocs-figma/SKILL.md +377 -0
- package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +108 -0
- package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +112 -0
- package/template/.claude/skills/flydocs-local/SKILL.md +103 -0
- package/template/.claude/skills/flydocs-local/cursor-rule.mdc +43 -0
- package/template/.claude/skills/flydocs-local/scripts/assign.py +20 -0
- package/template/.claude/skills/flydocs-local/scripts/comment.py +27 -0
- package/template/.claude/skills/flydocs-local/scripts/create_issue.py +44 -0
- package/template/.claude/skills/flydocs-local/scripts/estimate.py +37 -0
- package/template/.claude/skills/flydocs-local/scripts/flydocs_api.py +272 -0
- package/template/.claude/skills/flydocs-local/scripts/get_issue.py +20 -0
- package/template/.claude/skills/flydocs-local/scripts/link.py +41 -0
- package/template/.claude/skills/flydocs-local/scripts/list_issues.py +34 -0
- package/template/.claude/skills/flydocs-local/scripts/priority.py +37 -0
- package/template/.claude/skills/flydocs-local/scripts/project_update.py +67 -0
- package/template/.claude/skills/flydocs-local/scripts/status_summary.py +16 -0
- package/template/.claude/skills/flydocs-local/scripts/transition.py +24 -0
- package/template/.claude/skills/flydocs-local/scripts/update_description.py +35 -0
- package/template/.claude/skills/flydocs-local/scripts/update_issue.py +84 -0
- package/template/.claude/skills/flydocs-workflow/SKILL.md +85 -0
- package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +53 -0
- package/template/.claude/skills/flydocs-workflow/reference/comment-templates.md +131 -0
- package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +76 -0
- package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +28 -0
- package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +50 -0
- package/template/.claude/skills/flydocs-workflow/session.md +128 -0
- package/template/.claude/skills/flydocs-workflow/stages/activate.md +46 -0
- package/template/.claude/skills/flydocs-workflow/stages/capture.md +50 -0
- package/template/.claude/skills/flydocs-workflow/stages/close.md +32 -0
- package/template/.claude/skills/flydocs-workflow/stages/implement.md +124 -0
- package/template/.claude/skills/flydocs-workflow/stages/refine.md +51 -0
- package/template/.claude/skills/flydocs-workflow/stages/review.md +86 -0
- package/template/.claude/skills/flydocs-workflow/stages/validate.md +90 -0
- package/template/.claude/skills/flydocs-workflow/templates/bug.md +95 -0
- package/template/.claude/skills/flydocs-workflow/templates/chore.md +75 -0
- package/template/.claude/skills/flydocs-workflow/templates/feature.md +93 -0
- package/template/.claude/skills/flydocs-workflow/templates/idea.md +84 -0
- package/template/.cursor/agents/implementation-agent.md +28 -0
- package/template/.cursor/agents/pm-agent.md +27 -0
- package/template/.cursor/agents/research-agent.md +23 -0
- package/template/.cursor/agents/review-agent.md +27 -0
- package/template/.cursor/hooks.json +29 -0
- package/template/.cursor/mcp.json +16 -0
- package/template/.env.example +44 -0
- package/template/.flydocs/config.json +104 -0
- package/template/.flydocs/hooks/auto-approve.py +71 -0
- package/template/.flydocs/hooks/post-edit.py +72 -0
- package/template/.flydocs/hooks/prefer-scripts.py +89 -0
- package/template/.flydocs/hooks/prompt-submit.py +277 -0
- package/template/.flydocs/scripts/generate_manifest.py +287 -0
- package/template/.flydocs/scripts/skill_manager.py +541 -0
- package/template/.flydocs/templates/README.md +46 -0
- package/template/.flydocs/templates/bug.md +166 -0
- package/template/.flydocs/templates/chore.md +110 -0
- package/template/.flydocs/templates/design-system/README.md +27 -0
- package/template/.flydocs/templates/design-system/component-patterns.md +92 -0
- package/template/.flydocs/templates/design-system/token-mapping.md +168 -0
- package/template/.flydocs/templates/feature.md +173 -0
- package/template/.flydocs/templates/idea.md +122 -0
- package/template/.flydocs/templates/instructions.md +228 -0
- package/template/.flydocs/templates/quick-capture.md +35 -0
- package/template/.flydocs/templates/scripts/check-design-system.template.mjs +179 -0
- package/template/.flydocs/version +1 -0
- package/template/AGENTS.md +95 -0
- package/template/CHANGELOG.md +271 -0
- package/template/flydocs/README.md +186 -0
- package/template/flydocs/context/project.md +51 -0
- package/template/flydocs/design-system/README.md +126 -0
- package/template/flydocs/design-system/component-patterns.md +173 -0
- package/template/flydocs/design-system/token-mapping.md +114 -0
- package/template/flydocs/knowledge/INDEX.md +100 -0
- package/template/flydocs/knowledge/README.md +62 -0
- package/template/flydocs/knowledge/product/personas.md +79 -0
- package/template/flydocs/knowledge/product/user-flows.md +88 -0
- package/template/manifest.json +221 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flydocs-figma
|
|
3
|
+
description: "FlyDocs premium: Build pixel-perfect UI from Figma designs. Use when building components, extracting designs, or implementing screens from Figma. v1.0: Guidance-only. Future: Scripts via API relay for premium functionality."
|
|
4
|
+
tools: mcp__figma__get_screenshot, mcp__figma__get_design_context, mcp__figma__get_variable_defs, mcp__figma__get_metadata
|
|
5
|
+
triggers:
|
|
6
|
+
- Figma
|
|
7
|
+
- design
|
|
8
|
+
- screenshot
|
|
9
|
+
- token mapping
|
|
10
|
+
- component from design
|
|
11
|
+
- pixel-perfect
|
|
12
|
+
- design system
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# FlyDocs Figma Integration
|
|
16
|
+
|
|
17
|
+
Build pixel-perfect UI components from Figma designs.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🚨 Golden Rules
|
|
22
|
+
|
|
23
|
+
**The Figma design is the ONLY source of truth.**
|
|
24
|
+
|
|
25
|
+
### ALWAYS
|
|
26
|
+
- Get screenshot FIRST - this is your visual truth
|
|
27
|
+
- Download ALL assets before writing any code
|
|
28
|
+
- Create specification table before implementing
|
|
29
|
+
- Validate implementation against screenshot element-by-element
|
|
30
|
+
- Use project design tokens when a design system is configured
|
|
31
|
+
|
|
32
|
+
### NEVER
|
|
33
|
+
- Hardcode colors, spacing, or font values when tokens exist
|
|
34
|
+
- Use placeholder images - download actual assets from Figma
|
|
35
|
+
- Use icon libraries (lucide, heroicons, etc.) unless project explicitly allows
|
|
36
|
+
- Guess values - extract exact values from Figma
|
|
37
|
+
- Skip visual validation
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Design System Enhancement
|
|
42
|
+
|
|
43
|
+
**Check for design system configuration:**
|
|
44
|
+
|
|
45
|
+
If `.flydocs/config.json` has `designSystem.enabled: true`:
|
|
46
|
+
1. Load `{paths.content}/design-system/token-mapping.md` for translations
|
|
47
|
+
2. All Figma values MUST map to project tokens
|
|
48
|
+
3. Run validation script before marking complete
|
|
49
|
+
4. Document any values without tokens as exceptions
|
|
50
|
+
|
|
51
|
+
If no design system configured:
|
|
52
|
+
- Document all Figma values in specification table
|
|
53
|
+
- Use exact values from Figma
|
|
54
|
+
- Note where tokens could be created for consistency
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Workflow: 5 Phases
|
|
59
|
+
|
|
60
|
+
### Phase 1: Get Visual Reference (MANDATORY FIRST STEP)
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
mcp__figma__get_screenshot(fileKey, nodeId)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**This is your visual truth. Keep it visible throughout the entire process.**
|
|
67
|
+
|
|
68
|
+
The screenshot tells you:
|
|
69
|
+
- Color scheme and visual hierarchy
|
|
70
|
+
- Layout structure
|
|
71
|
+
- What the final result MUST look like
|
|
72
|
+
|
|
73
|
+
### Phase 2: Extract Design Data
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
mcp__figma__get_design_context(fileKey, nodeId)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Extract ALL of these from the output:**
|
|
80
|
+
|
|
81
|
+
| Data Type | What to Extract |
|
|
82
|
+
|-----------|-----------------|
|
|
83
|
+
| **Dimensions** | width, height, padding, margin, gap (px values) |
|
|
84
|
+
| **Colors** | All hex values for backgrounds, text, borders |
|
|
85
|
+
| **Typography** | font-family, font-size, font-weight, line-height |
|
|
86
|
+
| **Assets** | const declarations at TOP of output (logo, icons, images) |
|
|
87
|
+
| **Border Radius** | cornerRadius values |
|
|
88
|
+
| **Shadows** | boxShadow definitions |
|
|
89
|
+
| **Layout** | flex direction, alignment, spacing |
|
|
90
|
+
|
|
91
|
+
**For precise token values:**
|
|
92
|
+
```
|
|
93
|
+
mcp__figma__get_variable_defs(fileKey, nodeId)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**For large/complex designs:**
|
|
97
|
+
```
|
|
98
|
+
mcp__figma__get_metadata(fileKey, nodeId)
|
|
99
|
+
```
|
|
100
|
+
Then target specific sub-nodes.
|
|
101
|
+
|
|
102
|
+
### Phase 3: Create Specification Table
|
|
103
|
+
|
|
104
|
+
**MANDATORY before writing any code.**
|
|
105
|
+
|
|
106
|
+
Map every Figma value to implementation:
|
|
107
|
+
|
|
108
|
+
| Element | Figma Value | Token/Class | Notes |
|
|
109
|
+
|---------|-------------|-------------|-------|
|
|
110
|
+
| Container bg | #f8f6f0 | `bg-[color]` | Map to token if available |
|
|
111
|
+
| Heading font | Inter Medium | `font-sans font-medium` | |
|
|
112
|
+
| Heading size | 60px / 72px | `text-6xl` | |
|
|
113
|
+
| Heading color | #181d27 | `text-gray-900` | |
|
|
114
|
+
| Button bg | #026aa2 | `bg-[color]` | Brand color |
|
|
115
|
+
| Button padding | 12px 18px | `py-3 px-[18px]` | |
|
|
116
|
+
| Gap | 12px | `gap-3` | |
|
|
117
|
+
| Border radius | 8px | `rounded-lg` | |
|
|
118
|
+
|
|
119
|
+
**If design system configured:** Replace generic values with project tokens.
|
|
120
|
+
|
|
121
|
+
**Document ANY value without a token as an exception.**
|
|
122
|
+
|
|
123
|
+
### Phase 4: Download Assets & Implement
|
|
124
|
+
|
|
125
|
+
**Download ALL assets FIRST:**
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
curl -o public/images/logo.svg "[figma-localhost-url]"
|
|
129
|
+
curl -o public/images/icon-arrow.svg "[figma-localhost-url]"
|
|
130
|
+
curl -o public/images/hero-image.png "[figma-localhost-url]"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**NEVER proceed without downloading assets. NEVER use placeholders.**
|
|
134
|
+
|
|
135
|
+
**Then implement using specification table:**
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
// Every value comes from the specification table
|
|
139
|
+
<section className="bg-[#f8f6f0] py-12">
|
|
140
|
+
<div className="flex flex-col gap-3">
|
|
141
|
+
<h1 className="font-sans text-6xl font-medium text-gray-900">
|
|
142
|
+
Title
|
|
143
|
+
</h1>
|
|
144
|
+
<Button>Get Started</Button>
|
|
145
|
+
</div>
|
|
146
|
+
</section>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Phase 5: Validate (MANDATORY)
|
|
150
|
+
|
|
151
|
+
Compare implementation to Figma screenshot element by element:
|
|
152
|
+
|
|
153
|
+
| Check | What to Compare |
|
|
154
|
+
|-------|-----------------|
|
|
155
|
+
| Logo | Correct asset, exact dimensions, position |
|
|
156
|
+
| Typography | Font, size, weight, color, line-height for EVERY text |
|
|
157
|
+
| Spacing | Gap, padding, margin values |
|
|
158
|
+
| Colors | Background, text, border colors |
|
|
159
|
+
| Sizing | Width, height, max-width |
|
|
160
|
+
| Borders | Radius, width, color |
|
|
161
|
+
| Shadows | All shadow values |
|
|
162
|
+
| Alignment | Element positioning |
|
|
163
|
+
|
|
164
|
+
**If ANY element doesn't match → FIX before marking complete.**
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Figma Property → CSS/Tailwind Translation
|
|
169
|
+
|
|
170
|
+
### Layout Properties
|
|
171
|
+
|
|
172
|
+
| Figma Property | Value | CSS/Tailwind |
|
|
173
|
+
|----------------|-------|--------------|
|
|
174
|
+
| `layoutMode` | `"VERTICAL"` | `flex flex-col` |
|
|
175
|
+
| `layoutMode` | `"HORIZONTAL"` | `flex flex-row` |
|
|
176
|
+
| `primaryAxisAlignItems` | `"MIN"` | `justify-start` |
|
|
177
|
+
| `primaryAxisAlignItems` | `"CENTER"` | `justify-center` |
|
|
178
|
+
| `primaryAxisAlignItems` | `"MAX"` | `justify-end` |
|
|
179
|
+
| `primaryAxisAlignItems` | `"SPACE_BETWEEN"` | `justify-between` |
|
|
180
|
+
| `counterAxisAlignItems` | `"MIN"` | `items-start` |
|
|
181
|
+
| `counterAxisAlignItems` | `"CENTER"` | `items-center` |
|
|
182
|
+
| `counterAxisAlignItems` | `"MAX"` | `items-end` |
|
|
183
|
+
| `counterAxisAlignItems` | `"STRETCH"` | `items-stretch` |
|
|
184
|
+
|
|
185
|
+
### Sizing Properties
|
|
186
|
+
|
|
187
|
+
| Figma Property | Value | CSS/Tailwind |
|
|
188
|
+
|----------------|-------|--------------|
|
|
189
|
+
| `layoutSizingHorizontal` | `"FIXED"` | `w-[Xpx]` |
|
|
190
|
+
| `layoutSizingHorizontal` | `"FILL"` | `w-full` |
|
|
191
|
+
| `layoutSizingHorizontal` | `"HUG"` | `w-fit` |
|
|
192
|
+
| `layoutSizingVertical` | `"FIXED"` | `h-[Xpx]` |
|
|
193
|
+
| `layoutSizingVertical` | `"FILL"` | `h-full` |
|
|
194
|
+
| `layoutSizingVertical` | `"HUG"` | `h-fit` |
|
|
195
|
+
|
|
196
|
+
### Fill & Stroke Properties
|
|
197
|
+
|
|
198
|
+
| Figma Property | CSS/Tailwind |
|
|
199
|
+
|----------------|--------------|
|
|
200
|
+
| `fills: [{ color: hex }]` | `bg-[#hex]` or use token |
|
|
201
|
+
| `fills: [{ color, opacity: 0.5 }]` | `bg-[#hex]/50` |
|
|
202
|
+
| `strokes: [{ color }]` | `border border-[#hex]` |
|
|
203
|
+
| `strokeWeight: 1` | `border` |
|
|
204
|
+
| `strokeWeight: 2` | `border-2` |
|
|
205
|
+
|
|
206
|
+
### Padding Translation
|
|
207
|
+
|
|
208
|
+
| Figma Padding | CSS/Tailwind |
|
|
209
|
+
|---------------|--------------|
|
|
210
|
+
| `padding: 16` (all same) | `p-4` |
|
|
211
|
+
| `paddingTop: 16, paddingBottom: 16` | `py-4` |
|
|
212
|
+
| `paddingLeft: 24, paddingRight: 24` | `px-6` |
|
|
213
|
+
| `py: 12, px: 16` | `py-3 px-4` |
|
|
214
|
+
| `py: 10, px: 18` | `py-[10px] px-[18px]` |
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Common Mistakes & Fixes
|
|
219
|
+
|
|
220
|
+
### ❌ Hardcoded Colors (when tokens exist)
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
// WRONG (if design system configured)
|
|
224
|
+
className="bg-[#026aa2] text-[#414651]"
|
|
225
|
+
|
|
226
|
+
// CORRECT (use project tokens)
|
|
227
|
+
className="bg-brand-solid text-text-secondary"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### ❌ Placeholder Images
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
// WRONG
|
|
234
|
+
<img src="/placeholder.svg" alt="Logo" />
|
|
235
|
+
|
|
236
|
+
// CORRECT
|
|
237
|
+
<img src="/images/logo.svg" alt="Company Name" />
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### ❌ Icon Libraries (unless project allows)
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
// WRONG
|
|
244
|
+
import { ArrowRight } from 'lucide-react'
|
|
245
|
+
<ArrowRight className="w-5 h-5" />
|
|
246
|
+
|
|
247
|
+
// CORRECT - Extract SVG from Figma
|
|
248
|
+
<img src="/images/icon-arrow-right.svg" alt="" className="w-5 h-5" />
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### ❌ Text-Only Logo
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
// WRONG
|
|
255
|
+
<span className="font-bold text-xl">Company</span>
|
|
256
|
+
|
|
257
|
+
// CORRECT
|
|
258
|
+
<img src="/images/logo.svg" alt="Company" className="h-8" />
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### ❌ Raw Figma CSS Variables
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
// WRONG
|
|
265
|
+
className="px-[var(--spacing-lg,12px)]"
|
|
266
|
+
style={{ fontFamily: "'Inter', sans-serif" }}
|
|
267
|
+
|
|
268
|
+
// CORRECT
|
|
269
|
+
className="px-3 font-sans"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Validation Checklist
|
|
275
|
+
|
|
276
|
+
Before marking any component complete:
|
|
277
|
+
|
|
278
|
+
### Design Extraction
|
|
279
|
+
- [ ] Got `get_screenshot` output (FIRST)
|
|
280
|
+
- [ ] Got `get_design_context` output
|
|
281
|
+
- [ ] Created specification table with all values
|
|
282
|
+
- [ ] Mapped to project tokens (if design system configured)
|
|
283
|
+
|
|
284
|
+
### Assets
|
|
285
|
+
- [ ] ALL assets downloaded (not placeholders)
|
|
286
|
+
- [ ] Logo uses actual SVG from Figma
|
|
287
|
+
- [ ] All icons extracted from Figma (unless library allowed)
|
|
288
|
+
- [ ] All images downloaded from Figma URLs
|
|
289
|
+
|
|
290
|
+
### Implementation
|
|
291
|
+
- [ ] Colors use tokens or documented values
|
|
292
|
+
- [ ] Spacing matches exactly
|
|
293
|
+
- [ ] Typography matches exactly (font, size, weight, color)
|
|
294
|
+
- [ ] Border radius matches exactly
|
|
295
|
+
- [ ] Shadows match exactly
|
|
296
|
+
- [ ] Layout and alignment match
|
|
297
|
+
|
|
298
|
+
### Visual Comparison
|
|
299
|
+
- [ ] Side-by-side comparison with Figma screenshot
|
|
300
|
+
- [ ] Every element matches design
|
|
301
|
+
- [ ] Interactive states implemented (hover, focus, active, disabled)
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Troubleshooting
|
|
306
|
+
|
|
307
|
+
### Output Doesn't Match Figma
|
|
308
|
+
|
|
309
|
+
1. Re-run `get_screenshot` for fresh visual reference
|
|
310
|
+
2. Check token mapping is correct (if using design system)
|
|
311
|
+
3. Verify all spacing and sizing values translated
|
|
312
|
+
4. Compare interactive states
|
|
313
|
+
|
|
314
|
+
### Missing Styles
|
|
315
|
+
|
|
316
|
+
1. Run `get_variable_defs` to extract specific tokens
|
|
317
|
+
2. Check if style is in a parent node
|
|
318
|
+
3. Verify node selection is correct in Figma URL
|
|
319
|
+
|
|
320
|
+
### Incomplete Response
|
|
321
|
+
|
|
322
|
+
1. Selection is too large → break it down
|
|
323
|
+
2. Run `get_metadata` first to understand structure
|
|
324
|
+
3. Target smaller, specific nodes
|
|
325
|
+
|
|
326
|
+
### Assets Not Loading
|
|
327
|
+
|
|
328
|
+
1. Verify Figma desktop app is running
|
|
329
|
+
2. Check localhost URLs are being used correctly
|
|
330
|
+
3. Assets should be at `http://127.0.0.1:3845/assets/...`
|
|
331
|
+
|
|
332
|
+
### Slow Responses
|
|
333
|
+
|
|
334
|
+
1. Reduce selection size
|
|
335
|
+
2. Target specific components instead of full pages
|
|
336
|
+
3. Use `get_metadata` to identify specific nodes first
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Breaking Down Large Designs
|
|
341
|
+
|
|
342
|
+
### Strategy
|
|
343
|
+
|
|
344
|
+
1. Start with smallest logical component (button, card, input)
|
|
345
|
+
2. Build up to sections (header, hero, footer)
|
|
346
|
+
3. Compose sections into full pages
|
|
347
|
+
|
|
348
|
+
### Example
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
Full Page (too large)
|
|
352
|
+
├── Header (manageable)
|
|
353
|
+
│ ├── Logo
|
|
354
|
+
│ ├── Nav Links
|
|
355
|
+
│ └── CTA Button
|
|
356
|
+
├── Hero Section (manageable)
|
|
357
|
+
│ ├── Headline
|
|
358
|
+
│ ├── Subheadline
|
|
359
|
+
│ └── CTA Group
|
|
360
|
+
└── Features Grid (break down further)
|
|
361
|
+
├── Feature Card 1
|
|
362
|
+
├── Feature Card 2
|
|
363
|
+
└── Feature Card 3
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Supporting Files
|
|
369
|
+
|
|
370
|
+
When design system is configured, also reference:
|
|
371
|
+
- **`{paths.content}/design-system/token-mapping.md`** - Project-specific translations
|
|
372
|
+
- **`{paths.content}/design-system/component-patterns.md`** - Reusable component patterns
|
|
373
|
+
|
|
374
|
+
See also:
|
|
375
|
+
- Installed community skills for React component patterns and testing
|
|
376
|
+
|
|
377
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Figma MCP Prompting Strategies
|
|
2
|
+
|
|
3
|
+
Get better output by using the right tools and prompts.
|
|
4
|
+
|
|
5
|
+
## Tool Selection
|
|
6
|
+
|
|
7
|
+
| Situation | Tool to Use |
|
|
8
|
+
|-----------|-------------|
|
|
9
|
+
| Building a component | `get_screenshot` → `get_design_context` |
|
|
10
|
+
| Need specific token values | `get_variable_defs` |
|
|
11
|
+
| Large/complex design | `get_metadata` first, then target sub-nodes |
|
|
12
|
+
| Visual validation | `get_screenshot` |
|
|
13
|
+
|
|
14
|
+
## Framework Customization
|
|
15
|
+
|
|
16
|
+
Default output is **React + Tailwind**. Customize with prompts:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
"Generate this in Vue"
|
|
20
|
+
"Generate this in plain HTML + CSS"
|
|
21
|
+
"Generate this for iOS SwiftUI"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Using Existing Components
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
"Generate using components from src/components/"
|
|
28
|
+
"Use the existing Button and Card components"
|
|
29
|
+
"Compose this with our design system components"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Breaking Down Large Selections
|
|
33
|
+
|
|
34
|
+
Large selections cause slow responses or incomplete output. Break them down:
|
|
35
|
+
|
|
36
|
+
### Strategy
|
|
37
|
+
|
|
38
|
+
1. Start with smallest logical component (button, card, input)
|
|
39
|
+
2. Build up to sections (header, hero, footer)
|
|
40
|
+
3. Compose sections into full pages
|
|
41
|
+
|
|
42
|
+
### Example
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Full Page (too large)
|
|
46
|
+
├── Header (manageable)
|
|
47
|
+
│ ├── Logo
|
|
48
|
+
│ ├── Nav Links
|
|
49
|
+
│ └── CTA Button
|
|
50
|
+
├── Hero Section (manageable)
|
|
51
|
+
│ ├── Headline
|
|
52
|
+
│ ├── Subheadline
|
|
53
|
+
│ └── CTA Group
|
|
54
|
+
└── Features Grid (break down further)
|
|
55
|
+
├── Feature Card 1
|
|
56
|
+
├── Feature Card 2
|
|
57
|
+
└── Feature Card 3
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### When to Break Down
|
|
61
|
+
|
|
62
|
+
- Response seems slow → reduce selection size
|
|
63
|
+
- Output is truncated → use `get_metadata`, target sub-nodes
|
|
64
|
+
- Complex nested elements → handle pieces separately
|
|
65
|
+
|
|
66
|
+
## Asset Handling
|
|
67
|
+
|
|
68
|
+
The MCP server hosts assets at `http://localhost:3845/assets/...`
|
|
69
|
+
|
|
70
|
+
### Do
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
// Download assets using curl, then reference locally
|
|
74
|
+
<img src="/images/feature.png" alt="Feature" />
|
|
75
|
+
|
|
76
|
+
// Use SVGs from MCP response
|
|
77
|
+
<svg>...</svg>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Don't
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
// Don't use placeholders
|
|
84
|
+
<img src="/placeholder.png" />
|
|
85
|
+
|
|
86
|
+
// Don't import icon packages (unless project allows)
|
|
87
|
+
import { Icon } from 'lucide-react'
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Token Extraction
|
|
91
|
+
|
|
92
|
+
When you need specific token values:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
"Get the variables used in this selection"
|
|
96
|
+
"What color and spacing variables are used here?"
|
|
97
|
+
"List the variable names and their values"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Quality Prompts
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
"Build this with 1:1 visual parity to Figma"
|
|
104
|
+
"Match all interactive states (hover, focus, active, disabled)"
|
|
105
|
+
"Use only project design tokens, no hardcoded values"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Figma MCP Troubleshooting
|
|
2
|
+
|
|
3
|
+
Common issues and fixes.
|
|
4
|
+
|
|
5
|
+
## Output Doesn't Match Figma
|
|
6
|
+
|
|
7
|
+
**Symptoms:** Colors, spacing, or layout differ from design.
|
|
8
|
+
|
|
9
|
+
**Fixes:**
|
|
10
|
+
1. Re-run `get_screenshot` for fresh visual reference
|
|
11
|
+
2. Check token mapping is correct (if design system configured)
|
|
12
|
+
3. Verify all spacing and sizing values translated
|
|
13
|
+
4. Compare interactive states (hover, focus)
|
|
14
|
+
|
|
15
|
+
## Missing Styles
|
|
16
|
+
|
|
17
|
+
**Symptoms:** Some styles missing from output.
|
|
18
|
+
|
|
19
|
+
**Fixes:**
|
|
20
|
+
1. Run `get_variable_defs` to extract specific tokens
|
|
21
|
+
2. Check if style is in a parent node
|
|
22
|
+
3. Verify node selection is correct in Figma URL
|
|
23
|
+
|
|
24
|
+
## Incomplete Response
|
|
25
|
+
|
|
26
|
+
**Symptoms:** Output is truncated or missing sections.
|
|
27
|
+
|
|
28
|
+
**Fixes:**
|
|
29
|
+
1. Selection is too large → break it down
|
|
30
|
+
2. Run `get_metadata` first to understand structure
|
|
31
|
+
3. Target smaller, specific nodes
|
|
32
|
+
|
|
33
|
+
## Assets Not Loading
|
|
34
|
+
|
|
35
|
+
**Symptoms:** Images don't appear or show broken links.
|
|
36
|
+
|
|
37
|
+
**Fixes:**
|
|
38
|
+
1. Verify Figma desktop app is running (for local MCP)
|
|
39
|
+
2. Check localhost URLs are being used correctly
|
|
40
|
+
3. Assets should be at `http://127.0.0.1:3845/assets/...`
|
|
41
|
+
4. Don't use placeholders - use actual asset URLs
|
|
42
|
+
|
|
43
|
+
## Slow Responses
|
|
44
|
+
|
|
45
|
+
**Symptoms:** Tool calls taking very long or timing out.
|
|
46
|
+
|
|
47
|
+
**Fixes:**
|
|
48
|
+
1. Reduce selection size
|
|
49
|
+
2. Target specific components instead of full pages
|
|
50
|
+
3. Use `get_metadata` to identify specific nodes first
|
|
51
|
+
|
|
52
|
+
## Wrong Node Selected
|
|
53
|
+
|
|
54
|
+
**Symptoms:** Getting design for wrong component.
|
|
55
|
+
|
|
56
|
+
**Fixes:**
|
|
57
|
+
1. Verify nodeId from Figma URL (format: `123:456` or `123-456`)
|
|
58
|
+
2. Use `get_metadata` to see node structure
|
|
59
|
+
3. Check you're using correct fileKey
|
|
60
|
+
|
|
61
|
+
## Extracting Figma URL Components
|
|
62
|
+
|
|
63
|
+
Figma URL format:
|
|
64
|
+
```
|
|
65
|
+
https://www.figma.com/file/{fileKey}/{fileName}?node-id={nodeId}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- `fileKey` - The file identifier (e.g., `yAln8XH1UxkgKaFuJspT6d`)
|
|
69
|
+
- `nodeId` - The specific frame/component, URL decoded (e.g., `123:456` or `123-456`)
|
|
70
|
+
|
|
71
|
+
## Red Flags in Code
|
|
72
|
+
|
|
73
|
+
If you see these patterns, STOP and fix:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
// ❌ Hardcoded colors (when tokens exist)
|
|
77
|
+
className="bg-[#026aa2] text-[#414651]"
|
|
78
|
+
|
|
79
|
+
// ❌ Inline font styles
|
|
80
|
+
style={{ fontFamily: "'Inter', sans-serif" }}
|
|
81
|
+
|
|
82
|
+
// ❌ Raw Figma variables (not translated)
|
|
83
|
+
className="px-[var(--spacing-lg,12px)]"
|
|
84
|
+
|
|
85
|
+
// ❌ Placeholder images
|
|
86
|
+
<img src="/placeholder.svg" />
|
|
87
|
+
|
|
88
|
+
// ❌ Icon library imports (unless project allows)
|
|
89
|
+
import { ChevronRight } from 'lucide-react'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Pre-Implementation Checklist
|
|
93
|
+
|
|
94
|
+
### Before Starting
|
|
95
|
+
- [ ] Have Figma URL with node ID
|
|
96
|
+
- [ ] Know the file key
|
|
97
|
+
- [ ] Figma desktop app running (if using local MCP)
|
|
98
|
+
|
|
99
|
+
### During Implementation
|
|
100
|
+
- [ ] Got `get_screenshot` for visual reference
|
|
101
|
+
- [ ] Got `get_design_context` output
|
|
102
|
+
- [ ] Created specification table
|
|
103
|
+
- [ ] Downloaded actual assets (no placeholders)
|
|
104
|
+
- [ ] Reused existing components where possible
|
|
105
|
+
|
|
106
|
+
### After Implementation
|
|
107
|
+
- [ ] Visual comparison to Figma screenshot passes
|
|
108
|
+
- [ ] All interactive states work
|
|
109
|
+
- [ ] Follows project token conventions (if design system configured)
|
|
110
|
+
- [ ] Tests written and passing
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flydocs-local
|
|
3
|
+
description: |
|
|
4
|
+
File-based issue management. No accounts, no API keys, no network.
|
|
5
|
+
Implements the FlyDocs mechanism contract using local markdown files.
|
|
6
|
+
triggers:
|
|
7
|
+
- create issue
|
|
8
|
+
- transition
|
|
9
|
+
- comment
|
|
10
|
+
- list issues
|
|
11
|
+
- assign
|
|
12
|
+
- update description
|
|
13
|
+
- update issue
|
|
14
|
+
- project update
|
|
15
|
+
- estimate
|
|
16
|
+
- priority
|
|
17
|
+
- link
|
|
18
|
+
- status summary
|
|
19
|
+
- local
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# FlyDocs Local Mechanism
|
|
23
|
+
|
|
24
|
+
Issues stored as markdown files with YAML frontmatter in `flydocs/issues/`.
|
|
25
|
+
Transitions are file moves between status directories.
|
|
26
|
+
|
|
27
|
+
## Script Catalog
|
|
28
|
+
|
|
29
|
+
### Shared Contract Scripts
|
|
30
|
+
|
|
31
|
+
All scripts: `python3 .claude/skills/flydocs-local/scripts/<script>`
|
|
32
|
+
|
|
33
|
+
| Script | Usage | Output |
|
|
34
|
+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
35
|
+
| `create_issue.py` | `--title "..." --type feature [--description "..."] [--description-file PATH] [--priority 0-4] [--estimate 1-5] [--assignee STR] [--triage] \| stdin` | `{id, identifier, title}` |
|
|
36
|
+
| `transition.py` | `<ref> <STATUS> "<comment>"` | `{success, issue, previousStatus, newStatus}` |
|
|
37
|
+
| `comment.py` | `<ref> ["<comment>"] \| stdin` | `{success, commentId}` |
|
|
38
|
+
| `list_issues.py` | `[--status STATUS] [--active] [--assignee STR] [--mine] [--limit N]` | `[{id, identifier, title, status, assignee, priority}]` |
|
|
39
|
+
| `get_issue.py` | `<ref>` | `{id, identifier, title, description, status, assignee, priority, estimate, comments[]}` |
|
|
40
|
+
| `assign.py` | `<ref> <assignee>` | `{success, issue, assignee}` |
|
|
41
|
+
| `update_description.py` | `<ref> --text "..." \| --file PATH \| stdin` | `{success, issue}` |
|
|
42
|
+
| `status_summary.py` | `[--project ID]` | `{statuses: {STATUS: count}, total}` |
|
|
43
|
+
|
|
44
|
+
### Extended Scripts
|
|
45
|
+
|
|
46
|
+
| Script | Usage | Output |
|
|
47
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
48
|
+
| `update_issue.py` | `<ref> [--title "..."] [--priority 0-4] [--estimate 1-5] [--assignee STR] [--state STATUS] [--description "..."] [--description-file PATH] [--comment "..."]` | `{success, issue, updated[]}` |
|
|
49
|
+
| `estimate.py` | `<ref> <1-5>` | `{success, issue, estimate}` |
|
|
50
|
+
| `priority.py` | `<ref> <0-4>` | `{success, issue, priority}` |
|
|
51
|
+
| `link.py` | `<ref> <related_ref> <type>` | `{success, type}` |
|
|
52
|
+
| `project_update.py` | `--health STATUS --body "..." [--body-file PATH]` | `{success, id}` |
|
|
53
|
+
|
|
54
|
+
### Link Types
|
|
55
|
+
|
|
56
|
+
`blocks`, `related`, `duplicate`
|
|
57
|
+
|
|
58
|
+
### Script Notes
|
|
59
|
+
|
|
60
|
+
- **`update_issue.py`**: Bulk update -- sets multiple fields in a single operation. Prefer over separate `estimate.py`/`priority.py`/`assign.py` calls when updating more than one field.
|
|
61
|
+
- **`link.py`**: Records relationships as comments on both issues. Supports `blocks` (with inverse `blocked by`), `related`, and `duplicate`.
|
|
62
|
+
- **`project_update.py`**: Saves health updates as markdown files in `flydocs/updates/`. Accepts `--body`, `--body-file`, or stdin.
|
|
63
|
+
- **Shell-safe text input**: For descriptions, comments, or any text with special characters (apostrophes, quotes, parentheses), pipe via stdin with a single-quoted heredoc instead of `--text`:
|
|
64
|
+
```bash
|
|
65
|
+
python3 update_description.py FD-001 <<'EOF'
|
|
66
|
+
Description with 'apostrophes', (parens), and "quotes"
|
|
67
|
+
EOF
|
|
68
|
+
```
|
|
69
|
+
Scripts supporting stdin: `update_description.py`, `comment.py`, `project_update.py`.
|
|
70
|
+
|
|
71
|
+
### Status Values
|
|
72
|
+
|
|
73
|
+
`BACKLOG`, `READY`, `IMPLEMENTING`, `BLOCKED`, `REVIEW`, `TESTING`, `COMPLETE`, `ARCHIVED`, `CANCELED`, `DUPLICATE`
|
|
74
|
+
|
|
75
|
+
### Issue Types
|
|
76
|
+
|
|
77
|
+
`feature`, `bug`, `chore`, `idea`
|
|
78
|
+
|
|
79
|
+
### Issue Reference
|
|
80
|
+
|
|
81
|
+
`<ref>`: Local identifier, e.g., `FD-001`. Found by scanning status directories.
|
|
82
|
+
|
|
83
|
+
## Error Handling
|
|
84
|
+
|
|
85
|
+
Exit 0 = success (JSON on stdout). Exit 1 = error (message on stderr).
|
|
86
|
+
|
|
87
|
+
## Storage
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
flydocs/issues/
|
|
91
|
+
backlog/ # New and triaged issues
|
|
92
|
+
ready/ # Refined, ready for work
|
|
93
|
+
implementing/ # Active development
|
|
94
|
+
review/ # Code review
|
|
95
|
+
testing/ # QE validation
|
|
96
|
+
done/ # Completed
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Issues: `FD-XXX-slug.md` with YAML frontmatter. IDs auto-increment via `.flydocs/issues/.counter`.
|
|
100
|
+
|
|
101
|
+
## Configuration
|
|
102
|
+
|
|
103
|
+
Reads `tier` from `.flydocs/config.json`. Requires `"tier": "local"`.
|