opencode-pair-autonomy 1.0.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 +90 -0
- package/bin/opencode-pair-autonomy.js +20 -0
- package/dist/__tests__/comment-guard.test.d.ts +1 -0
- package/dist/__tests__/config.test.d.ts +1 -0
- package/dist/__tests__/learning.test.d.ts +1 -0
- package/dist/__tests__/plan-mode.test.d.ts +1 -0
- package/dist/agents.d.ts +2 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +15351 -0
- package/dist/commands.d.ts +2 -0
- package/dist/config.d.ts +3 -0
- package/dist/hooks/comment-guard.d.ts +15 -0
- package/dist/hooks/file-edited.d.ts +7 -0
- package/dist/hooks/index.d.ts +46 -0
- package/dist/hooks/post-tool-use.d.ts +5 -0
- package/dist/hooks/pre-compact.d.ts +4 -0
- package/dist/hooks/pre-tool-use.d.ts +5 -0
- package/dist/hooks/prompt-refiner.d.ts +38 -0
- package/dist/hooks/runtime.d.ts +91 -0
- package/dist/hooks/sdk.d.ts +6 -0
- package/dist/hooks/session-end.d.ts +4 -0
- package/dist/hooks/session-start.d.ts +19 -0
- package/dist/hooks/stop.d.ts +5 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17823 -0
- package/dist/installer.d.ts +12 -0
- package/dist/learning/analyzer.d.ts +15 -0
- package/dist/learning/store.d.ts +4 -0
- package/dist/learning/types.d.ts +32 -0
- package/dist/mcp.d.ts +4 -0
- package/dist/project-facts.d.ts +8 -0
- package/dist/prompts/coordinator.d.ts +2 -0
- package/dist/prompts/shared.d.ts +5 -0
- package/dist/prompts/workers.d.ts +8 -0
- package/dist/types.d.ts +81 -0
- package/dist/utils.d.ts +6 -0
- package/examples/opencode-pair-autonomy.jsonc +35 -0
- package/examples/opencode.jsonc +17 -0
- package/package.json +103 -0
- package/vendor/mcp/pg-mcp/README.md +91 -0
- package/vendor/mcp/pg-mcp/config.example.json +26 -0
- package/vendor/mcp/pg-mcp/config.json +15 -0
- package/vendor/mcp/pg-mcp/package-lock.json +1288 -0
- package/vendor/mcp/pg-mcp/package.json +18 -0
- package/vendor/mcp/pg-mcp/src/config.js +71 -0
- package/vendor/mcp/pg-mcp/src/db.js +85 -0
- package/vendor/mcp/pg-mcp/src/index.js +203 -0
- package/vendor/mcp/pg-mcp/src/sqlGuard.js +75 -0
- package/vendor/mcp/pg-mcp/src/tools.js +89 -0
- package/vendor/mcp/ssh-mcp/README.md +46 -0
- package/vendor/mcp/ssh-mcp/config.example.json +23 -0
- package/vendor/mcp/ssh-mcp/config.json +6 -0
- package/vendor/mcp/ssh-mcp/package-lock.json +1142 -0
- package/vendor/mcp/ssh-mcp/package.json +18 -0
- package/vendor/mcp/ssh-mcp/src/config.js +140 -0
- package/vendor/mcp/ssh-mcp/src/index.js +130 -0
- package/vendor/mcp/ssh-mcp/src/ssh.js +163 -0
- package/vendor/mcp/sudo-mcp/README.md +51 -0
- package/vendor/mcp/sudo-mcp/config.example.json +28 -0
- package/vendor/mcp/sudo-mcp/config.json +28 -0
- package/vendor/mcp/sudo-mcp/package-lock.json +1145 -0
- package/vendor/mcp/sudo-mcp/package.json +18 -0
- package/vendor/mcp/sudo-mcp/src/config.js +57 -0
- package/vendor/mcp/sudo-mcp/src/index.js +267 -0
- package/vendor/mcp/sudo-mcp/src/runner.js +168 -0
- package/vendor/mcp/web-agent-mcp/package-lock.json +2886 -0
- package/vendor/mcp/web-agent-mcp/package.json +28 -0
- package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/adapter.ts +335 -0
- package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/auth-heuristics.ts +324 -0
- package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/launcher.ts +1340 -0
- package/vendor/mcp/web-agent-mcp/src/config/env.ts +107 -0
- package/vendor/mcp/web-agent-mcp/src/core/action-flow.ts +82 -0
- package/vendor/mcp/web-agent-mcp/src/core/artifact-store.ts +109 -0
- package/vendor/mcp/web-agent-mcp/src/core/errors.ts +108 -0
- package/vendor/mcp/web-agent-mcp/src/core/observation-flow.ts +38 -0
- package/vendor/mcp/web-agent-mcp/src/core/policy-engine.ts +113 -0
- package/vendor/mcp/web-agent-mcp/src/core/retry-policy.ts +42 -0
- package/vendor/mcp/web-agent-mcp/src/core/session-manager.ts +670 -0
- package/vendor/mcp/web-agent-mcp/src/core/session-restart-policy.ts +34 -0
- package/vendor/mcp/web-agent-mcp/src/core/task-history.ts +97 -0
- package/vendor/mcp/web-agent-mcp/src/index.ts +3 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/act.ts +167 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/common.ts +56 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/observe.ts +214 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/page.ts +21 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/policy.ts +42 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/runtime.ts +21 -0
- package/vendor/mcp/web-agent-mcp/src/schemas/session.ts +63 -0
- package/vendor/mcp/web-agent-mcp/src/server.ts +75 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/click.ts +68 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/drag.ts +57 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/enter-code.ts +78 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/fill.ts +65 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/pinch.ts +58 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/press.ts +67 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/shared.ts +73 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/swipe.ts +59 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/wait-for.ts +56 -0
- package/vendor/mcp/web-agent-mcp/src/tools/act/wheel.ts +59 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/a11y.ts +60 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/auth-state.ts +92 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/boxes.ts +66 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/console.ts +67 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/dom.ts +60 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/network.ts +67 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/page-state.ts +93 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/screenshot.ts +73 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/text.ts +70 -0
- package/vendor/mcp/web-agent-mcp/src/tools/observe/wait-for-network.ts +70 -0
- package/vendor/mcp/web-agent-mcp/src/tools/page/navigate.ts +59 -0
- package/vendor/mcp/web-agent-mcp/src/tools/policy/recommend-observation.ts +40 -0
- package/vendor/mcp/web-agent-mcp/src/tools/register-tools.ts +55 -0
- package/vendor/mcp/web-agent-mcp/src/tools/runtime/evaluate-js.ts +83 -0
- package/vendor/mcp/web-agent-mcp/src/tools/session/close.ts +41 -0
- package/vendor/mcp/web-agent-mcp/src/tools/session/create.ts +86 -0
- package/vendor/mcp/web-agent-mcp/src/tools/session/restart.ts +72 -0
- package/vendor/mcp/web-agent-mcp/src/utils/fs.ts +28 -0
- package/vendor/mcp/web-agent-mcp/src/utils/ids.ts +9 -0
- package/vendor/mcp/web-agent-mcp/src/utils/time.ts +7 -0
- package/vendor/mcp/web-agent-mcp/tsconfig.json +22 -0
- package/vendor/skills/editorial-technical-ui/SKILL.md +84 -0
- package/vendor/skills/figma-console/SKILL.md +839 -0
- package/vendor/skills/go-fiber-postgres/SKILL.md +31 -0
- package/vendor/skills/opencode-plugin-dev/SKILL.md +31 -0
- package/vendor/skills/rust-media-desktop/SKILL.md +30 -0
- package/vendor/skills/vue-vite-ui/SKILL.md +31 -0
- package/vendor/skills/web-agent-browser/SKILL.md +140 -0
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: figma-console
|
|
3
|
+
description: Design in Figma Desktop via figma-console-mcp (63+ tools). Covers connection setup, design system creation (tokens, styles, components), screen design, linting, accessibility audits, variable management, and visual validation workflows. Use when the user asks to work with Figma — creating designs, editing components, auditing files, or managing design tokens.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
Use this skill for all Figma Desktop work via the `figma-console` MCP server. This server bridges AI to Figma Desktop through a WebSocket Desktop Bridge plugin, providing 63+ tools for design creation, variable management, component instantiation, screenshots, linting, and console debugging.
|
|
9
|
+
|
|
10
|
+
## Use When
|
|
11
|
+
|
|
12
|
+
- User asks to create, edit, or audit a Figma design
|
|
13
|
+
- User asks to set up a design system (tokens, components, styles)
|
|
14
|
+
- User mentions Figma, design, or UI/UX work
|
|
15
|
+
- Tools prefixed with `figma-console_figma_*` are relevant
|
|
16
|
+
|
|
17
|
+
## Do Not Use When
|
|
18
|
+
|
|
19
|
+
- User needs static mockups or wireframes in code (use frontend-design skill)
|
|
20
|
+
- User wants Figma Dev Mode API data (that was the old figma-developer-mcp, now removed)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Execution Philosophy: Keep Moving, Don't Wait
|
|
25
|
+
|
|
26
|
+
**The #1 rule of Figma work: NEVER stop and wait for approval in the middle of a design task.**
|
|
27
|
+
|
|
28
|
+
When the user gives you a design task (e.g. "redesign this app", "create 10 design directions", "build the screens"):
|
|
29
|
+
|
|
30
|
+
1. **Do the FULL task end-to-end.** If they said "create 10 design directions then build screens for the best one" — create all 10 directions AND then pick the strongest one and start building screens. Don't stop after step 1 to ask "which one do you like?"
|
|
31
|
+
2. **Make design decisions yourself.** You are the designer. If you need to choose a color palette, font, layout — choose it. Pick the best option based on your research and move on.
|
|
32
|
+
3. **Only stop for true blockers:** missing credentials, ambiguous project scope, or explicitly requested checkpoints ("show me before you continue").
|
|
33
|
+
4. **Present results, not options.** Instead of "here are 10 directions, which do you prefer?" → create all 10, pick the best 2-3, and BUILD the actual screens for those. The user can always ask for changes.
|
|
34
|
+
5. **Screenshots are checkpoints, not gates.** Take a screenshot to verify YOUR work looks correct, then immediately continue to the next step. Don't present the screenshot and wait.
|
|
35
|
+
|
|
36
|
+
**BAD pattern (stops momentum):**
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
→ Create 10 design cards
|
|
40
|
+
→ Screenshot all 10
|
|
41
|
+
→ "Here are 10 directions! Which one do you like?"
|
|
42
|
+
→ ... wait for user ...
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**GOOD pattern (continuous execution):**
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
→ Create 10 design cards
|
|
49
|
+
→ Quick screenshot to verify (1 shot, scale=0.5)
|
|
50
|
+
→ Analyze: directions 3, 5, 8 are strongest
|
|
51
|
+
→ Immediately start building full screens for direction 5
|
|
52
|
+
→ Build Start Screen → Home Screen → Subscription → Profile
|
|
53
|
+
→ Final screenshot of all completed screens
|
|
54
|
+
→ "Here's the full redesign. I chose direction 5 (Lavender Dream) because [reasons]. Want me to try a different direction or adjust anything?"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**The user hired you to DESIGN, not to present menus.**
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Connection Lifecycle
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
1. figma_get_status → verify connection + identify active file
|
|
65
|
+
2. figma_get_file_data (depth=1) → understand file structure
|
|
66
|
+
3. ... do work ...
|
|
67
|
+
4. figma_capture_screenshot → verify changes visually
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Always check status first.** The server may run locally or via SSH to a remote Mac. Connection issues surface immediately from `figma_get_status`.
|
|
71
|
+
|
|
72
|
+
### Troubleshooting Connection
|
|
73
|
+
|
|
74
|
+
- If status shows no WebSocket connection → Desktop Bridge plugin needs to be running in Figma
|
|
75
|
+
- If SSH transport fails → check `figma_console.ssh_host` in harness config
|
|
76
|
+
- Port fallback is normal (9223 → 9224, etc.) when multiple instances exist
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Tool Categories & When to Use Each
|
|
81
|
+
|
|
82
|
+
### Observation (read-only, cheap)
|
|
83
|
+
|
|
84
|
+
| Tool | When | Cost |
|
|
85
|
+
| ------------------------------------- | ----------------------------------------------------------------- | ------- |
|
|
86
|
+
| `figma_get_status` | Start of session, verify connection | Low |
|
|
87
|
+
| `figma_get_file_data` | Understand file structure, find node IDs | Low-Med |
|
|
88
|
+
| `figma_capture_screenshot` | **Visual validation after ANY change** | Med |
|
|
89
|
+
| `figma_observe_a11y` | Accessibility tree inspection | Med |
|
|
90
|
+
| `figma_get_design_system_summary` | Quick overview of existing design system | Low |
|
|
91
|
+
| `figma_get_variables` | Read design tokens/variables | Med |
|
|
92
|
+
| `figma_get_styles` | Read text/color/effect styles | Med |
|
|
93
|
+
| `figma_get_component` | Single component metadata | Med |
|
|
94
|
+
| `figma_get_component_for_development` | Component specs + image for code gen | High |
|
|
95
|
+
| `figma_get_design_system_kit` | **Full design system extraction** (preferred over separate calls) | High |
|
|
96
|
+
| `figma_lint_design` | Accessibility + design quality audit | Med |
|
|
97
|
+
| `figma_get_selection` | What user has selected in Figma | Low |
|
|
98
|
+
| `figma_get_comments` | File comments/feedback | Low |
|
|
99
|
+
|
|
100
|
+
### Creation & Editing
|
|
101
|
+
|
|
102
|
+
| Tool | When |
|
|
103
|
+
| ---------------------- | ------------------------------------------------------------------------------- |
|
|
104
|
+
| `figma_execute` | **Complex operations** — create pages, sections, custom shapes, bulk operations |
|
|
105
|
+
| `figma_create_child` | Create simple child nodes (rect, ellipse, frame, text, line) |
|
|
106
|
+
| `figma_set_fills` | Change fill colors |
|
|
107
|
+
| `figma_set_strokes` | Change borders |
|
|
108
|
+
| `figma_set_text` | Change text content |
|
|
109
|
+
| `figma_set_image_fill` | Apply image to a node (base64 or file path) |
|
|
110
|
+
| `figma_resize_node` | Change dimensions |
|
|
111
|
+
| `figma_move_node` | Reposition a node |
|
|
112
|
+
| `figma_clone_node` | Duplicate a node |
|
|
113
|
+
| `figma_delete_node` | Remove a node |
|
|
114
|
+
| `figma_rename_node` | Fix naming |
|
|
115
|
+
|
|
116
|
+
### Design System
|
|
117
|
+
|
|
118
|
+
| Tool | When |
|
|
119
|
+
| -------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
120
|
+
| `figma_setup_design_tokens` | **Create complete token structure in one call** (collection + modes + variables) |
|
|
121
|
+
| `figma_create_variable_collection` | Create empty collection |
|
|
122
|
+
| `figma_create_variable` / `figma_batch_create_variables` | Add variables to collection |
|
|
123
|
+
| `figma_update_variable` / `figma_batch_update_variables` | Change variable values |
|
|
124
|
+
| `figma_add_mode` | Add modes (Light/Dark) |
|
|
125
|
+
| `figma_search_components` | Find components by name |
|
|
126
|
+
| `figma_instantiate_component` | Create component instance |
|
|
127
|
+
| `figma_set_instance_properties` | Update instance props (text, boolean, variant) |
|
|
128
|
+
| `figma_arrange_component_set` | Organize variant grid |
|
|
129
|
+
|
|
130
|
+
### Console & Debugging
|
|
131
|
+
|
|
132
|
+
| Tool | When |
|
|
133
|
+
| ------------------------ | ------------------------------ |
|
|
134
|
+
| `figma_get_console_logs` | Read plugin console output |
|
|
135
|
+
| `figma_watch_console` | Stream logs during testing |
|
|
136
|
+
| `figma_clear_console` | Clear log buffer |
|
|
137
|
+
| `figma_reload_plugin` | Reload plugin for code changes |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Critical Patterns
|
|
142
|
+
|
|
143
|
+
### Pattern 1: Screenshot Discipline — Validate, Don't Spam
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
1. Make a change (set_fills, create_child, execute, etc.)
|
|
147
|
+
2. figma_capture_screenshot (nodeId of changed area)
|
|
148
|
+
3. Analyze the screenshot
|
|
149
|
+
4. If wrong → fix and screenshot again (up to 3 iterations)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`figma_capture_screenshot` shows the CURRENT plugin runtime state — guaranteed to reflect recent changes. This is more reliable than REST API screenshots.
|
|
153
|
+
|
|
154
|
+
**CRITICAL: Do NOT screenshot excessively.**
|
|
155
|
+
|
|
156
|
+
- Take ONE overview screenshot per completed section, not one per element
|
|
157
|
+
- When building multiple similar items (e.g. 10 design cards), take 1-2 screenshots of the full grid at low scale (scale=0.5), NOT individual screenshots of each item
|
|
158
|
+
- Screenshots are for YOUR validation — if the design looks correct, move on immediately
|
|
159
|
+
- Never take more than 3 screenshots in a row without making actual progress
|
|
160
|
+
|
|
161
|
+
### Pattern 2: Use figma_execute for Complex Operations
|
|
162
|
+
|
|
163
|
+
Simple tools (`create_child`, `set_fills`) are fine for single operations. For anything involving:
|
|
164
|
+
|
|
165
|
+
- Creating pages (`figma.createPage()`)
|
|
166
|
+
- Multiple related nodes
|
|
167
|
+
- Auto-layout setup
|
|
168
|
+
- Gradient fills
|
|
169
|
+
- Font loading
|
|
170
|
+
- Complex positioning
|
|
171
|
+
|
|
172
|
+
Use `figma_execute` with JavaScript:
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
// IMPORTANT: Use setCurrentPageAsync, not set currentPage
|
|
176
|
+
await figma.setCurrentPageAsync(page);
|
|
177
|
+
|
|
178
|
+
// IMPORTANT: Load fonts before setting text
|
|
179
|
+
await figma.loadFontAsync({ family: "Inter", style: "Regular" });
|
|
180
|
+
|
|
181
|
+
// Create with auto-layout
|
|
182
|
+
const frame = figma.createFrame();
|
|
183
|
+
frame.layoutMode = "VERTICAL";
|
|
184
|
+
frame.primaryAxisAlignItems = "CENTER";
|
|
185
|
+
frame.counterAxisAlignItems = "CENTER";
|
|
186
|
+
frame.paddingTop = 24;
|
|
187
|
+
frame.itemSpacing = 16;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Pattern 3: Design System Creation Order
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
1. Create color tokens → figma_setup_design_tokens (collection: "Colors")
|
|
194
|
+
2. Create spacing tokens → figma_setup_design_tokens (collection: "Spacing")
|
|
195
|
+
3. Create typography tokens → figma_setup_design_tokens (collection: "Typography")
|
|
196
|
+
4. Create components → figma_execute (buttons, cards, nav bars)
|
|
197
|
+
5. Build screens → figma_execute (compose components into screens)
|
|
198
|
+
6. Validate → figma_lint_design + figma_capture_screenshot
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Pattern 4: Component Instances (Not Direct Text Editing)
|
|
202
|
+
|
|
203
|
+
When working with component instances:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
BAD: figma_set_text on a text node inside an instance → may fail silently
|
|
207
|
+
GOOD: figma_set_instance_properties with property overrides
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Always check `instance.componentProperties` for available props first.
|
|
211
|
+
|
|
212
|
+
### Pattern 5: Placement Hygiene
|
|
213
|
+
|
|
214
|
+
- **Always create inside a Section or Frame**, never on bare canvas
|
|
215
|
+
- **Screenshot the target area first** to find clear space
|
|
216
|
+
- **Position BELOW or AWAY from existing content** — never overlap
|
|
217
|
+
- **Clean up partial artifacts** on failure (empty frames, orphaned layers)
|
|
218
|
+
- **Never create a page if one with that name already exists**
|
|
219
|
+
|
|
220
|
+
### Pattern 6: Full Design Audit
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
1. figma_lint_design (rules: ["all"], maxFindings: 200)
|
|
224
|
+
2. figma_get_design_system_kit (format: "full")
|
|
225
|
+
3. figma_capture_screenshot for key screens
|
|
226
|
+
4. Compile findings into categorized report
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Lint categories: `wcag-contrast`, `wcag-text-size`, `wcag-line-height`, `hardcoded-color`, `no-text-style`, `default-name`, `no-autolayout`, `empty-container`
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Design Quality: Creating Beautiful, Modern Interfaces
|
|
234
|
+
|
|
235
|
+
**This is not a wireframing tool. You are expected to produce polished, production-grade designs.**
|
|
236
|
+
|
|
237
|
+
### Mindset: Research Before You Design
|
|
238
|
+
|
|
239
|
+
Before creating any screen, research what best-in-class apps look like. You have full access to the internet — USE IT.
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
1. jina_search_web / jina_search_images → find design inspiration
|
|
243
|
+
2. jina_read_url → study specific design references
|
|
244
|
+
3. jina_capture_screenshot_url → capture visual references from live apps
|
|
245
|
+
4. grep_app_searchGitHub → find real component implementations
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### Where to Find Inspiration
|
|
249
|
+
|
|
250
|
+
Use `jina_search_images` and `jina_search_web` with queries like:
|
|
251
|
+
|
|
252
|
+
- `"[app category] mobile app UI design 2025 dribbble"` — e.g. "fashion tryon app mobile UI design 2025 dribbble"
|
|
253
|
+
- `"[screen type] screen design inspiration behance"` — e.g. "subscription paywall screen design inspiration behance"
|
|
254
|
+
- `"[component] component modern design"` — e.g. "bottom navigation bar modern design iOS"
|
|
255
|
+
- `"[app name] app redesign concept"` — study redesign concepts of popular apps
|
|
256
|
+
|
|
257
|
+
**Top design reference sites:**
|
|
258
|
+
|
|
259
|
+
- **Dribbble** (dribbble.com) — UI shots, component details
|
|
260
|
+
- **Behance** (behance.net) — full case studies
|
|
261
|
+
- **Mobbin** (mobbin.com) — real app screenshots organized by pattern
|
|
262
|
+
- **Screenlane** (screenlane.com) — mobile UI patterns
|
|
263
|
+
- **Refero** (refero.design) — curated real product screenshots
|
|
264
|
+
|
|
265
|
+
#### Research Workflow for a New Screen
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
1. jina_search_images("modern [screen type] mobile app UI 2025")
|
|
269
|
+
→ Study 3-5 top results for layout patterns, color usage, spacing
|
|
270
|
+
2. jina_search_web("[app category] best app design award")
|
|
271
|
+
→ Find award-winning apps in the same category
|
|
272
|
+
3. jina_capture_screenshot_url on a reference app
|
|
273
|
+
→ Get pixel-level reference for spacing, typography, component density
|
|
274
|
+
4. NOW design — with concrete references, not from imagination
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Deep Design Research with Browser Automation
|
|
278
|
+
|
|
279
|
+
When the user says "internetten bak", "tasarımlara bak", "browse for inspiration", or similar — **actively browse real design sites** using all available tools:
|
|
280
|
+
|
|
281
|
+
**Dribbble / Behance / Mobbin browsing with web-agent-mcp:**
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
1. web-agent-mcp → session_create
|
|
285
|
+
2. page_navigate("https://dribbble.com/search/[category]-app-design")
|
|
286
|
+
3. observe_screenshot → study the search results grid visually
|
|
287
|
+
4. act_click on promising shots → navigate to detail page
|
|
288
|
+
5. observe_screenshot → capture the full design in detail
|
|
289
|
+
6. Repeat for 3-5 top results
|
|
290
|
+
7. session_close
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Faster approach with jina (no browser session needed):**
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
1. jina_search_images("[app category] app UI design", num=10)
|
|
297
|
+
→ visual thumbnails of top designs
|
|
298
|
+
2. jina_read_url("https://dribbble.com/shots/[id]")
|
|
299
|
+
→ read shot description, tags, designer notes
|
|
300
|
+
3. jina_capture_screenshot_url("https://dribbble.com/shots/[id]")
|
|
301
|
+
→ full-resolution capture
|
|
302
|
+
4. jina_search_web("site:mobbin.com [screen type]")
|
|
303
|
+
→ real app screenshots for that pattern
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Live app screenshots for pixel-perfect reference:**
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
1. web-agent-mcp → session_create (viewport: {width: 393, height: 852} for mobile)
|
|
310
|
+
2. page_navigate to a live app or competitor website
|
|
311
|
+
3. observe_screenshot → capture the real UI at mobile scale
|
|
312
|
+
4. Study spacing, colors, typography, component density
|
|
313
|
+
5. Apply learnings to your Figma design
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Tool selection guide:**
|
|
317
|
+
| Scenario | Tool | Why |
|
|
318
|
+
|----------|------|-----|
|
|
319
|
+
| Quick visual inspiration | `jina_search_images` | Fast, returns thumbnails |
|
|
320
|
+
| Read design article / case study | `jina_read_url` | Clean markdown extraction |
|
|
321
|
+
| Full-page screenshot of a site | `jina_capture_screenshot_url` | No browser needed |
|
|
322
|
+
| Interactive browsing (login walls, filtering, scrolling) | `web-agent-mcp` | Full browser control |
|
|
323
|
+
| Mobile viewport of a live app | `web-agent-mcp` with `viewport: {width:393, height:852}` | Realistic mobile view |
|
|
324
|
+
| Find design system documentation | `context7` or `jina_read_url` | Structured docs |
|
|
325
|
+
| Real code examples of a component | `grep_app_searchGitHub` | Production implementations |
|
|
326
|
+
|
|
327
|
+
### Icons & SVG Assets
|
|
328
|
+
|
|
329
|
+
**Never use placeholder rectangles for icons.** Find and use real SVGs.
|
|
330
|
+
|
|
331
|
+
#### Icon Libraries (Free, High Quality)
|
|
332
|
+
|
|
333
|
+
Use `jina_read_url` to fetch SVG code directly:
|
|
334
|
+
|
|
335
|
+
| Library | URL Pattern | Style |
|
|
336
|
+
| ------------- | ------------------------------------------------------------------------------------------------- | ------------------------- |
|
|
337
|
+
| **Lucide** | `https://lucide.dev/api/icons/[name]` | Clean, minimal line icons |
|
|
338
|
+
| **Phosphor** | `https://raw.githubusercontent.com/phosphor-icons/core/main/assets/regular/[name].svg` | Flexible, 6 weights |
|
|
339
|
+
| **Heroicons** | `https://raw.githubusercontent.com/tailwindlabs/heroicons/master/optimized/24/outline/[name].svg` | Tailwind ecosystem |
|
|
340
|
+
| **Tabler** | `https://raw.githubusercontent.com/tabler/tabler-icons/main/icons/outline/[name].svg` | 5400+ icons |
|
|
341
|
+
| **Feather** | `https://raw.githubusercontent.com/feathericons/feather/main/icons/[name].svg` | Simple, clean |
|
|
342
|
+
|
|
343
|
+
#### How to Use Icons in Figma
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
1. jina_read_url("https://lucide.dev/api/icons/home") → get SVG string
|
|
347
|
+
2. figma_execute with figma.createNodeFromSvg(svgString) → insert into Figma
|
|
348
|
+
3. Resize, recolor as needed
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Finding the right icon name:**
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
jina_search_web("lucide icons [concept]") → find icon names
|
|
355
|
+
jina_read_url("https://lucide.dev/icons") → browse full icon list
|
|
356
|
+
jina_search_images("[concept] icon svg minimal") → visual search
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### SVG Insertion Pattern in figma_execute
|
|
360
|
+
|
|
361
|
+
```javascript
|
|
362
|
+
// Fetch SVG from URL and create in Figma
|
|
363
|
+
const svgString =
|
|
364
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>';
|
|
365
|
+
const icon = figma.createNodeFromSvg(svgString);
|
|
366
|
+
icon.name = "icon/home";
|
|
367
|
+
icon.resize(24, 24);
|
|
368
|
+
// Recolor: find all vectors inside and change fills
|
|
369
|
+
const vectors = icon.findAll((n) => n.type === "VECTOR");
|
|
370
|
+
vectors.forEach((v) => {
|
|
371
|
+
v.strokes = [{ type: "SOLID", color: { r: 0.42, g: 0.24, b: 0.88 } }];
|
|
372
|
+
});
|
|
373
|
+
parent.appendChild(icon);
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Modern Design Principles (2024-2026)
|
|
377
|
+
|
|
378
|
+
**Follow these principles for every screen you create:**
|
|
379
|
+
|
|
380
|
+
#### Visual Hierarchy & Depth
|
|
381
|
+
|
|
382
|
+
- Use **subtle shadows** (not flat, not skeuomorphic) — `0 2px 8px rgba(0,0,0,0.06)` for cards
|
|
383
|
+
- Apply **background blur** on overlays and nav bars for glassmorphism
|
|
384
|
+
- Layer depth: background → surface → elevated surface → overlay
|
|
385
|
+
- **Large, generous whitespace** — let content breathe. More space = more premium
|
|
386
|
+
|
|
387
|
+
#### Typography
|
|
388
|
+
|
|
389
|
+
- **One font family maximum** (two if there's a clear display/body split)
|
|
390
|
+
- Prefer modern sans-serif fonts: **Inter, SF Pro, Satoshi, Plus Jakarta Sans, Outfit, Manrope, Geist**
|
|
391
|
+
- Create clear typographic hierarchy with **size + weight contrast**, not just size
|
|
392
|
+
- Display text: bold/black weight. Body: regular/medium. Never use light weight under 16px
|
|
393
|
+
- **Letter-spacing:** -0.02em to -0.04em on large headings (tighter = more modern)
|
|
394
|
+
|
|
395
|
+
#### Color
|
|
396
|
+
|
|
397
|
+
- **One primary brand color + neutrals.** That's it. Don't use a rainbow.
|
|
398
|
+
- Modern palettes use **muted, sophisticated tones** — not pure saturated colors
|
|
399
|
+
- Background should be warm-white (`#FAFAF8`) or cool-white (`#F8F9FC`), NOT pure `#FFFFFF`
|
|
400
|
+
- Dark text should be near-black (`#111111` or `#1A1A2E`), NOT pure `#000000`
|
|
401
|
+
- Use **subtle tints of brand color** for backgrounds, badges, selected states
|
|
402
|
+
- Gradient usage: subtle, 2-color, on brand elements only. Not everywhere.
|
|
403
|
+
|
|
404
|
+
#### Spacing & Layout
|
|
405
|
+
|
|
406
|
+
- Base everything on **8px grid** (or 4px for fine adjustments)
|
|
407
|
+
- Screen padding: **20-24px** horizontal on mobile (393px width)
|
|
408
|
+
- Section gaps: **32-48px** vertical
|
|
409
|
+
- Card padding: **16-20px** internal
|
|
410
|
+
- Touch targets: **minimum 44px** height
|
|
411
|
+
- Use **auto-layout everywhere** — no manual positioning
|
|
412
|
+
|
|
413
|
+
### Component Design Standards
|
|
414
|
+
|
|
415
|
+
Every component you create must be **production-ready** — not a rough sketch. Follow these specs precisely.
|
|
416
|
+
|
|
417
|
+
#### Button Component
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
Structure: Frame (auto-layout HORIZONTAL, center-aligned)
|
|
421
|
+
Heights: Large: 56px | Medium: 48px | Small: 40px
|
|
422
|
+
H-Padding: Large: 32px | Medium: 24px | Small: 16px
|
|
423
|
+
Corner: 12-16px radius (or fully round for pill style)
|
|
424
|
+
Font: Body/Base weight=SemiBold or Bold (never Regular)
|
|
425
|
+
Icon: Optional, 20px, 8px gap from text
|
|
426
|
+
|
|
427
|
+
Variants every button MUST have:
|
|
428
|
+
├─ Style: Primary (brand fill + white text)
|
|
429
|
+
│ Secondary (transparent + brand border + brand text)
|
|
430
|
+
│ Ghost (transparent + text only, no border)
|
|
431
|
+
│ Destructive (error fill + white text)
|
|
432
|
+
├─ Size: Large, Medium, Small
|
|
433
|
+
├─ State: Default, Hover, Pressed, Disabled, Loading
|
|
434
|
+
└─ Icon: None, Leading, Trailing
|
|
435
|
+
|
|
436
|
+
Primary fill: bg/brand solid or brand gradient
|
|
437
|
+
Pressed state: 10% darker than default (multiply overlay)
|
|
438
|
+
Disabled state: 40% opacity, pointer-events none
|
|
439
|
+
Loading state: text replaced with spinner, same dimensions
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
#### Card Component
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
Structure: Frame (auto-layout VERTICAL)
|
|
446
|
+
Padding: 16-20px all sides
|
|
447
|
+
Corner: 16-24px radius
|
|
448
|
+
Background: bg/surface (#FFFFFF or warm-white)
|
|
449
|
+
Elevation: EITHER subtle shadow (0 2px 8px rgba(0,0,0,0.06))
|
|
450
|
+
OR 1px border (border/default)
|
|
451
|
+
NEVER both shadow + border together
|
|
452
|
+
Gap: 12-16px between content sections
|
|
453
|
+
Width: Fill container (never fixed unless grid item)
|
|
454
|
+
|
|
455
|
+
Card should contain:
|
|
456
|
+
├─ Header area (optional: image, icon, badge)
|
|
457
|
+
├─ Content area (title, subtitle, body text)
|
|
458
|
+
└─ Action area (optional: buttons, links)
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### Input Field Component
|
|
462
|
+
|
|
463
|
+
```
|
|
464
|
+
Structure: Frame (auto-layout HORIZONTAL, center-aligned vertically)
|
|
465
|
+
Height: 48-56px
|
|
466
|
+
Padding: 0 16px horizontal
|
|
467
|
+
Corner: 12px radius
|
|
468
|
+
Border: 1px border/default
|
|
469
|
+
Background: bg/surface
|
|
470
|
+
Font: Body/Base Regular for value, text/tertiary for placeholder
|
|
471
|
+
Icon: Optional leading/trailing, 20px, muted color
|
|
472
|
+
|
|
473
|
+
States:
|
|
474
|
+
├─ Default: border/default border
|
|
475
|
+
├─ Focused: brand border (2px), subtle brand tint background
|
|
476
|
+
├─ Error: accent/error border, error message below (12px, error color)
|
|
477
|
+
├─ Disabled: 50% opacity, bg/surface-elevated background
|
|
478
|
+
└─ Filled: text/primary color, no placeholder
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
#### Bottom Navigation / Tab Bar
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
Structure: Frame (auto-layout HORIZONTAL, space-between, center-aligned)
|
|
485
|
+
Height: 64-80px (includes safe area on iOS)
|
|
486
|
+
Safe area: 34px bottom padding on iPhone (home indicator)
|
|
487
|
+
Items: 3-5 items max
|
|
488
|
+
Item: Frame (auto-layout VERTICAL, center, 4px gap)
|
|
489
|
+
Icon: 24px, above label
|
|
490
|
+
Label: 10-12px Medium weight
|
|
491
|
+
Touch: Each item minimum 44x44px tap target
|
|
492
|
+
|
|
493
|
+
Active state:
|
|
494
|
+
├─ Icon: text/brand color (filled variant, not outline)
|
|
495
|
+
├─ Label: text/brand color
|
|
496
|
+
├─ Optional: dot indicator below icon, or tint background pill
|
|
497
|
+
Inactive state:
|
|
498
|
+
├─ Icon: text/tertiary color (outline variant)
|
|
499
|
+
├─ Label: text/tertiary color
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
#### Subscription / Pricing Card
|
|
503
|
+
|
|
504
|
+
```
|
|
505
|
+
Structure: Frame (auto-layout VERTICAL)
|
|
506
|
+
Padding: 20-24px
|
|
507
|
+
Corner: 20-24px radius
|
|
508
|
+
Gap: 16px between sections
|
|
509
|
+
|
|
510
|
+
Must include:
|
|
511
|
+
├─ Plan name (Heading/H3 weight=Bold)
|
|
512
|
+
├─ Price (Display or H1 size, brand color for emphasized plan)
|
|
513
|
+
├─ Billing cycle (Body/Small, text/secondary)
|
|
514
|
+
├─ Feature list (checkmark icon + text, 12px gap between items)
|
|
515
|
+
├─ CTA button (full-width Primary button)
|
|
516
|
+
└─ Optional: "Best value" / "Most popular" badge
|
|
517
|
+
|
|
518
|
+
Selected/recommended plan:
|
|
519
|
+
├─ Brand color border (2px) or gradient border
|
|
520
|
+
├─ Subtle brand tint background
|
|
521
|
+
├─ Badge with brand gradient
|
|
522
|
+
Unselected plan:
|
|
523
|
+
├─ Default border, no fill, muted styling
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
#### Avatar / Profile Image
|
|
527
|
+
|
|
528
|
+
```
|
|
529
|
+
Shape: Ellipse (circle clip)
|
|
530
|
+
Sizes: XS: 24px | S: 32px | M: 40px | L: 56px | XL: 80px | XXL: 120px
|
|
531
|
+
Border: Optional 2px white border (for overlapping stacks)
|
|
532
|
+
Fallback: Initials on brand-tint background when no photo
|
|
533
|
+
Status dot: 8-12px circle, positioned bottom-right, green/gray/red
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
#### Badge / Chip / Tag
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
Structure: Frame (auto-layout HORIZONTAL, center-aligned)
|
|
540
|
+
Height: 24-32px
|
|
541
|
+
Padding: 4-6px vertical, 8-12px horizontal
|
|
542
|
+
Corner: Fully round (999px) for pills, or 8px for tags
|
|
543
|
+
Font: Caption or Label size, Medium weight
|
|
544
|
+
Types: Status (success/warning/error/info tint + text)
|
|
545
|
+
Category (neutral bg + text)
|
|
546
|
+
Brand (brand tint + brand text)
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
#### List Item / Row
|
|
550
|
+
|
|
551
|
+
```
|
|
552
|
+
Structure: Frame (auto-layout HORIZONTAL, center-aligned, space-between)
|
|
553
|
+
Height: 56-72px
|
|
554
|
+
Padding: 0 20px horizontal
|
|
555
|
+
Separator: 1px border/subtle at bottom, or use spacing (preferred)
|
|
556
|
+
|
|
557
|
+
Layout: [Leading icon/avatar] [Content: title + subtitle] [Trailing: icon/value]
|
|
558
|
+
Leading: Icon (24px) or Avatar (40px), 12px gap to content
|
|
559
|
+
Content: Auto-layout VERTICAL, 2-4px gap
|
|
560
|
+
Title: Body/Base, text/primary
|
|
561
|
+
Subtitle: Body/Small, text/secondary
|
|
562
|
+
Trailing: Chevron icon, switch toggle, or value text
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
#### Modal / Bottom Sheet
|
|
566
|
+
|
|
567
|
+
```
|
|
568
|
+
Structure: Frame (auto-layout VERTICAL)
|
|
569
|
+
Width: Full screen width (393px on mobile)
|
|
570
|
+
Corner: 24px top-left and top-right (bottom corners: 0)
|
|
571
|
+
Background: bg/surface
|
|
572
|
+
Padding: 24px horizontal, 20px top, 34px bottom (safe area)
|
|
573
|
+
|
|
574
|
+
Must include:
|
|
575
|
+
├─ Handle bar: 36x4px, centered, bg/surface-elevated, rounded
|
|
576
|
+
├─ Optional header: title + close button
|
|
577
|
+
├─ Content area: scrollable
|
|
578
|
+
└─ Optional footer: sticky action buttons
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### Empty State
|
|
582
|
+
|
|
583
|
+
```
|
|
584
|
+
Structure: Frame (auto-layout VERTICAL, center-center)
|
|
585
|
+
Padding: 40px horizontal
|
|
586
|
+
|
|
587
|
+
Must include:
|
|
588
|
+
├─ Illustration or icon (64-120px, muted or brand color)
|
|
589
|
+
├─ Headline (Heading/H3, text/primary)
|
|
590
|
+
├─ Description (Body/Base, text/secondary, centered, max 280px width)
|
|
591
|
+
└─ CTA button (Primary or Secondary)
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
### Figma Component Construction Rules
|
|
595
|
+
|
|
596
|
+
When building components in `figma_execute`:
|
|
597
|
+
|
|
598
|
+
1. **Always use auto-layout** — `layoutMode: "VERTICAL"` or `"HORIZONTAL"`. No exceptions.
|
|
599
|
+
2. **Use `layoutSizingHorizontal/Vertical`** — `"FILL"` to stretch, `"HUG"` to fit content, `"FIXED"` only for specific sizes
|
|
600
|
+
3. **Name every layer meaningfully** — `"btn/primary"`, `"card/pricing"`, `"nav/tab-item"`, never `"Frame 1"`
|
|
601
|
+
4. **Create as Component** — `const comp = figma.createComponent()` not `figma.createFrame()` for reusable elements
|
|
602
|
+
5. **Add component properties** for variant control:
|
|
603
|
+
```javascript
|
|
604
|
+
// After creating the component:
|
|
605
|
+
comp.addComponentProperty("Label", "TEXT", "Button");
|
|
606
|
+
comp.addComponentProperty("Show Icon", "BOOLEAN", true);
|
|
607
|
+
```
|
|
608
|
+
6. **Group related variants into Component Sets** for proper Figma variant panel:
|
|
609
|
+
```javascript
|
|
610
|
+
const variants = [defaultVariant, hoverVariant, pressedVariant];
|
|
611
|
+
const set = figma.combineAsVariants(variants, parentFrame);
|
|
612
|
+
set.name = "Button";
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### Screen Composition Standards
|
|
616
|
+
|
|
617
|
+
#### Mobile Screen Frame (iPhone 14/15 — 393×852)
|
|
618
|
+
|
|
619
|
+
```
|
|
620
|
+
Structure:
|
|
621
|
+
├─ Status Bar (54px height, contains time + icons)
|
|
622
|
+
├─ Navigation Bar (44-56px, optional back button + title)
|
|
623
|
+
├─ Content Area (scrollable, fills remaining space)
|
|
624
|
+
│ ├─ Horizontal padding: 20-24px
|
|
625
|
+
│ ├─ Section gap: 32-48px
|
|
626
|
+
│ └─ Content sections...
|
|
627
|
+
├─ Bottom Action (optional: sticky button area, 20px padding + safe area)
|
|
628
|
+
└─ Tab Bar (64-80px including 34px safe area)
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
#### Screen Padding System
|
|
632
|
+
|
|
633
|
+
```
|
|
634
|
+
Screen horizontal: 20-24px (CONSISTENT across ALL screens)
|
|
635
|
+
Content to nav bar: 16-24px
|
|
636
|
+
Section to section: 32-48px
|
|
637
|
+
Card to card: 12-16px
|
|
638
|
+
Text block internal: 8-12px line gap
|
|
639
|
+
Bottom safe area: 34px (iPhone home indicator)
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
#### iOS Status Bar
|
|
643
|
+
|
|
644
|
+
Always include. 54px height. Contains:
|
|
645
|
+
|
|
646
|
+
- Time (left), camera dot (center), signal + wifi + battery (right)
|
|
647
|
+
- Use text/primary color for dark-on-light, white for light-on-dark
|
|
648
|
+
|
|
649
|
+
### States & Edge Cases
|
|
650
|
+
|
|
651
|
+
**Design ALL of these for every screen, not just the happy path:**
|
|
652
|
+
|
|
653
|
+
| State | What to Show | Design Notes |
|
|
654
|
+
| ------------- | ---------------------------------------------- | ---------------------------------- |
|
|
655
|
+
| **Empty** | Illustration + title + description + CTA | Friendly, encouraging tone |
|
|
656
|
+
| **Loading** | Skeleton screens (animated shimmer rectangles) | Match the layout of loaded state |
|
|
657
|
+
| **Error** | Error icon + message + retry button | Red accent, clear action |
|
|
658
|
+
| **Success** | Checkmark animation + confirmation text | Green accent, celebrate the action |
|
|
659
|
+
| **Partial** | Content with "load more" or pagination | Gradual disclosure |
|
|
660
|
+
| **Offline** | Banner or overlay explaining connectivity | Non-blocking if possible |
|
|
661
|
+
| **First use** | Onboarding hints, tooltips, coach marks | Subtle, dismissible |
|
|
662
|
+
|
|
663
|
+
### Micro-interactions & Polish
|
|
664
|
+
|
|
665
|
+
These details separate amateur from professional:
|
|
666
|
+
|
|
667
|
+
- **Active/selected states** use brand color tint background + brand text, not just a color swap on the icon
|
|
668
|
+
- **Inactive icons**: outline style in `text/tertiary`. **Active icons**: filled style in `text/brand`
|
|
669
|
+
- **Pressed states**: slightly darker, 1-2px downward shift or scale to 0.97
|
|
670
|
+
- **Dividers**: prefer spacing over lines. If lines needed, `border/subtle` at 1px
|
|
671
|
+
- **Skeleton screens**: match the exact layout with rounded `bg/surface-elevated` rectangles where content will load
|
|
672
|
+
- **Image placeholders**: use subtle gradient or brand-tint background, never gray boxes
|
|
673
|
+
- **Scroll indicators**: subtle shadow or blur at top/bottom edge when content is scrollable
|
|
674
|
+
- **Badge counts**: red dot (no number) for simple, numbered badge for specifics
|
|
675
|
+
- **Progressive disclosure**: show summary first, expand for details (not everything at once)
|
|
676
|
+
- **Thumb zone**: most important actions in bottom 2/3 of screen (reachable one-handed)
|
|
677
|
+
|
|
678
|
+
### Font Discovery & Selection
|
|
679
|
+
|
|
680
|
+
Use web search to find the right font:
|
|
681
|
+
|
|
682
|
+
```
|
|
683
|
+
jina_search_web("best modern sans-serif fonts for mobile app 2025")
|
|
684
|
+
jina_search_web("google fonts similar to SF Pro")
|
|
685
|
+
jina_search_images("[font name] font specimen")
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
**Safe modern font choices for Figma:**
|
|
689
|
+
|
|
690
|
+
- **Inter** — versatile, optimized for screens, free (best default choice)
|
|
691
|
+
- **SF Pro** — Apple system font (available on macOS)
|
|
692
|
+
- **Plus Jakarta Sans** — geometric, friendly, modern SaaS feel
|
|
693
|
+
- **Satoshi** — clean, contemporary, slightly geometric
|
|
694
|
+
- **Outfit** — geometric with warmth
|
|
695
|
+
- **Manrope** — semi-rounded, friendly
|
|
696
|
+
- **DM Sans** — geometric, works great for UI
|
|
697
|
+
|
|
698
|
+
Load fonts in figma_execute:
|
|
699
|
+
|
|
700
|
+
```javascript
|
|
701
|
+
await figma.loadFontAsync({ family: "Inter", style: "Regular" });
|
|
702
|
+
await figma.loadFontAsync({ family: "Inter", style: "Medium" });
|
|
703
|
+
await figma.loadFontAsync({ family: "Inter", style: "Semi Bold" });
|
|
704
|
+
await figma.loadFontAsync({ family: "Inter", style: "Bold" });
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### Image & Asset Sourcing
|
|
708
|
+
|
|
709
|
+
For placeholder photos, illustrations, and assets:
|
|
710
|
+
|
|
711
|
+
```
|
|
712
|
+
jina_search_images("fashion model wearing outfit studio photo") → find reference images
|
|
713
|
+
jina_capture_screenshot_url("https://unsplash.com/s/photos/...") → capture from Unsplash
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**Use `figma_set_image_fill` with downloaded images:**
|
|
717
|
+
|
|
718
|
+
```
|
|
719
|
+
1. jina_read_url or jina_capture_screenshot_url → get image
|
|
720
|
+
2. Save to /tmp/ if needed
|
|
721
|
+
3. figma_set_image_fill(nodeIds, imageData, scaleMode="FILL")
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### Design Review Checklist
|
|
725
|
+
|
|
726
|
+
After completing a screen, verify against this checklist:
|
|
727
|
+
|
|
728
|
+
1. **[ ] Visual hierarchy clear?** — Can you instantly tell what's most important?
|
|
729
|
+
2. **[ ] Spacing consistent?** — Does it follow the 8px grid?
|
|
730
|
+
3. **[ ] Touch targets adequate?** — All interactive elements ≥ 44px?
|
|
731
|
+
4. **[ ] Contrast passes WCAG?** — Run `figma_lint_design`
|
|
732
|
+
5. **[ ] No hardcoded colors?** — All colors from token system?
|
|
733
|
+
6. **[ ] Auto-layout used?** — No manual positioning?
|
|
734
|
+
7. **[ ] Component naming clear?** — No "Frame 1" or "Vector"?
|
|
735
|
+
8. **[ ] States covered?** — Empty, loading, error, success?
|
|
736
|
+
9. **[ ] Would this look good on Dribbble?** — If not, iterate.
|
|
737
|
+
10. **[ ] Compared to reference?** — Screenshot and compare with inspiration
|
|
738
|
+
|
|
739
|
+
---
|
|
740
|
+
|
|
741
|
+
## figma_execute Gotchas
|
|
742
|
+
|
|
743
|
+
1. **`figma.currentPage =` is BANNED** — Use `await figma.setCurrentPageAsync(page)` instead
|
|
744
|
+
2. **Font loading is required before text operations** — `await figma.loadFontAsync({ family, style })`
|
|
745
|
+
3. **Always `return` data** — The result is what you get back
|
|
746
|
+
4. **Timeout default is 5s, max 30s** — Set `timeout` for heavy operations
|
|
747
|
+
5. **Use `node.remove()` to clean up** failed artifacts
|
|
748
|
+
6. **`figma.createPage()` creates on document root** — no parent needed
|
|
749
|
+
7. **Auto-layout properties**: `layoutMode`, `primaryAxisAlignItems`, `counterAxisAlignItems`, `paddingTop/Right/Bottom/Left`, `itemSpacing`
|
|
750
|
+
|
|
751
|
+
---
|
|
752
|
+
|
|
753
|
+
## Design System Best Practices
|
|
754
|
+
|
|
755
|
+
### Color Token Naming
|
|
756
|
+
|
|
757
|
+
```
|
|
758
|
+
bg/primary → main background
|
|
759
|
+
bg/surface → card/container background
|
|
760
|
+
bg/surface-elevated → elevated surface
|
|
761
|
+
bg/brand → brand-colored backgrounds
|
|
762
|
+
text/primary → main text color
|
|
763
|
+
text/secondary → subdued text
|
|
764
|
+
text/tertiary → placeholder/hint text
|
|
765
|
+
text/on-brand → text on brand backgrounds
|
|
766
|
+
text/brand → brand-colored text
|
|
767
|
+
border/default → standard borders
|
|
768
|
+
border/subtle → light separators
|
|
769
|
+
accent/success → green for success states
|
|
770
|
+
accent/warning → yellow for warnings
|
|
771
|
+
accent/error → red for errors
|
|
772
|
+
brand/gradient-start → gradient endpoints
|
|
773
|
+
brand/gradient-end
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### Spacing Scale (4px base)
|
|
777
|
+
|
|
778
|
+
```
|
|
779
|
+
space/2 → 2px (micro)
|
|
780
|
+
space/4 → 4px (tight)
|
|
781
|
+
space/8 → 8px (small)
|
|
782
|
+
space/12 → 12px (compact)
|
|
783
|
+
space/16 → 16px (default)
|
|
784
|
+
space/20 → 20px (comfortable)
|
|
785
|
+
space/24 → 24px (spacious)
|
|
786
|
+
space/32 → 32px (section gap)
|
|
787
|
+
space/40 → 40px (large)
|
|
788
|
+
space/48 → 48px (hero)
|
|
789
|
+
space/64 → 64px (max)
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
### Typography Scale
|
|
793
|
+
|
|
794
|
+
```
|
|
795
|
+
Display → 36-48px Bold (hero text)
|
|
796
|
+
Heading/H1 → 28-32px Bold (page titles)
|
|
797
|
+
Heading/H2 → 22-24px Semibold (section titles)
|
|
798
|
+
Heading/H3 → 18-20px Semibold (subsections)
|
|
799
|
+
Body/Large → 16-18px Regular (primary body)
|
|
800
|
+
Body/Base → 14-16px Regular (standard body)
|
|
801
|
+
Body/Small → 12-14px Regular (captions)
|
|
802
|
+
Label → 12px Medium (UI labels, tabs)
|
|
803
|
+
Legal → 10-11px Regular (legal text, minimum readable)
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
### WCAG Compliance Checklist
|
|
807
|
+
|
|
808
|
+
- Normal text: minimum **4.5:1** contrast ratio
|
|
809
|
+
- Large text (18px+ or 14px+ bold): minimum **3:1**
|
|
810
|
+
- Minimum text size: **12px** (exceptions: legal at 10px)
|
|
811
|
+
- Line height: **1.5x** font size minimum
|
|
812
|
+
- Touch targets: **44x44px** minimum
|
|
813
|
+
|
|
814
|
+
---
|
|
815
|
+
|
|
816
|
+
## Performance Tips
|
|
817
|
+
|
|
818
|
+
- Response times are typically **1-3s** per tool call over WebSocket
|
|
819
|
+
- `figma_get_design_system_kit` is expensive — use once, cache mentally
|
|
820
|
+
- `figma_capture_screenshot` at scale=1 is faster than scale=2
|
|
821
|
+
- Batch variable operations with `figma_batch_create_variables` / `figma_batch_update_variables` (10-50x faster than individual calls)
|
|
822
|
+
- Use `figma_get_file_data` with `depth=1` and `verbosity="summary"` for initial exploration
|
|
823
|
+
|
|
824
|
+
---
|
|
825
|
+
|
|
826
|
+
## Example Workflow: Redesign a File
|
|
827
|
+
|
|
828
|
+
```
|
|
829
|
+
1. figma_get_status → verify connection
|
|
830
|
+
2. figma_get_file_data (depth=2) → understand existing structure
|
|
831
|
+
3. figma_lint_design (rules: ["all"]) → audit current state
|
|
832
|
+
4. figma_capture_screenshot (key screens) → visual reference
|
|
833
|
+
5. figma_execute → create new page → "Redesign" page
|
|
834
|
+
6. figma_setup_design_tokens × 3 → Colors, Spacing, Typography
|
|
835
|
+
7. figma_execute → build components → Button, Card, TabBar, etc.
|
|
836
|
+
8. figma_execute → compose screens → one screen at a time
|
|
837
|
+
9. figma_capture_screenshot → validate → check each screen
|
|
838
|
+
10. figma_lint_design → final audit → verify improvements
|
|
839
|
+
```
|