mobile-ai-agents 1.0.37 → 1.0.38
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/AGENTS.md +6 -0
- package/CLAUDE.md +4 -0
- package/README.md +12 -4
- package/agents/cross-platform/appforge/agent.md +4 -2
- package/agents/cross-platform/figma/agent.md +65 -47
- package/agents/cross-platform/mobile-harness/agent.md +1 -1
- package/cli/commands/figma.js +42 -0
- package/cli/commands/router.js +2 -0
- package/cli/index.js +14 -0
- package/docs/figma-mcp.md +131 -0
- package/docs/wiki.md +4 -0
- package/package.json +3 -2
- package/skills/cross-platform/figma-mcp-setup.md +60 -0
- package/skills/cross-platform/figma-spec-harvest.md +103 -0
- package/skills/cross-platform/figma-to-implementation.md +90 -0
- package/skills/cross-platform/prd-verification.md +7 -0
- package/tools/figma-spec/README.md +86 -0
- package/tools/figma-spec/compare_screens.py +111 -0
- package/tools/figma-spec/crosscheck.py +112 -0
- package/tools/figma-spec/dump_to_yaml.py +132 -0
- package/tools/figma-spec/node_dump.js +237 -0
- package/tools/figma-spec/page_index.js +44 -0
- package/tools/figma-spec/requirements.txt +3 -0
- package/tools/figma-spec/text_dump.js +68 -0
- package/tools/figma-spec/validate_spec.py +153 -0
- package/tools/figma-spec/yaml_io.py +22 -0
- package/workflows/figma-to-code.md +26 -0
- package/workflows/new-screen.md +2 -2
package/AGENTS.md
CHANGED
|
@@ -230,3 +230,9 @@ Short version:
|
|
|
230
230
|
## Questions / Discussion
|
|
231
231
|
|
|
232
232
|
Open a GitHub Discussion or Issue. PRs are always welcome.
|
|
233
|
+
|
|
234
|
+
## Figma Design Handoff
|
|
235
|
+
|
|
236
|
+
Use `skills/cross-platform/figma-mcp-setup.md` for connection setup, `skills/cross-platform/figma-spec-harvest.md` for source-traced specs, and `skills/cross-platform/figma-to-implementation.md` for native integration. Follow `workflows/figma-to-code.md` for the full pipeline. Setup examples are in `docs/figma-mcp.md`. Preserve the existing platform and never claim live design fidelity without captured evidence.
|
|
237
|
+
|
|
238
|
+
Portable Figma helpers: `npx mobile-ai-agents figma tools init`. Read `tools/figma-spec/README.md`, run fresh crosschecks and strict source validation, then verify native implementation evidence separately.
|
package/CLAUDE.md
CHANGED
|
@@ -234,3 +234,7 @@ See `CONTRIBUTING.md` for the full guide.
|
|
|
234
234
|
## Release Process
|
|
235
235
|
|
|
236
236
|
For npm releases, follow `docs/release-process.md`. Do not run `npm publish` manually. Update `package.json`, commit, create a local `vX.Y.Z` tag, push `main`, then push the tag so GitHub Actions publishes npm.
|
|
237
|
+
|
|
238
|
+
## Figma specs and implementation
|
|
239
|
+
|
|
240
|
+
Use `/figma-mcp-setup` to connect official Figma MCP, `/figma-spec-harvest` to extract source-traced specs, and `/figma-to-implementation` to build in the existing native platform. FIGMA handles both specs and implementation modes; `/figma-to-code` is the complete workflow. Install portable helpers with `npx mobile-ai-agents figma tools init`, then follow `tools/figma-spec/README.md`. Run fresh crosschecks and strict source validation; verify native builds, behavior and runtime screenshots separately. See `docs/figma-mcp.md`.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**The complete AI dev team for mobile engineers.**
|
|
4
4
|
|
|
5
|
-
19 personality-driven agents ·
|
|
5
|
+
19 personality-driven agents · 56 composable skills · 17 end-to-end workflows
|
|
6
6
|
Android · iOS · Flutter · React Native · Kotlin Multiplatform · Unity · Unreal
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/mobile-ai-agents)
|
|
@@ -217,11 +217,11 @@ Not sure where to begin? Pick your situation:
|
|
|
217
217
|
|---|---|---|
|
|
218
218
|
| Platform knowledge | Generic | Android · iOS · Flutter · React Native · Unity · Unreal |
|
|
219
219
|
| Agent personalities | None | 19 named specialists with opinions |
|
|
220
|
-
| Real workflows | No |
|
|
220
|
+
| Real workflows | No | 17 end-to-end processes |
|
|
221
221
|
| Real examples | Toy pseudocode | Production code input/output pairs |
|
|
222
222
|
| Installable | Copy-paste | `npx mobile-ai-agents install` |
|
|
223
223
|
| Severity levels | None | CRITICAL · WARNING · INFO |
|
|
224
|
-
| Slash commands | No |
|
|
224
|
+
| Slash commands | No | 56 composable skills |
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
|
|
@@ -308,6 +308,9 @@ Not sure where to begin? Pick your situation:
|
|
|
308
308
|
### Cross-Platform
|
|
309
309
|
| Skill | What It Does |
|
|
310
310
|
|---|---|
|
|
311
|
+
| `/figma-mcp-setup` | Connect official Figma MCP and verify frame access |
|
|
312
|
+
| `/figma-spec-harvest` | Figma → traceable requirements, tokens, component specs and references |
|
|
313
|
+
| `/figma-to-implementation` | Design contract → integrated UI in your existing platform |
|
|
311
314
|
| `/grill-mobile` | 20 questions before any mobile code is written |
|
|
312
315
|
| `/mobile-app-design` | Lovable/Stitch-style mobile UI generation, redesigns, and full app reskins |
|
|
313
316
|
| `/crash-triage` | Paste stacktrace → root cause → fix |
|
|
@@ -330,13 +333,14 @@ Not sure where to begin? Pick your situation:
|
|
|
330
333
|
|
|
331
334
|
## Workflows
|
|
332
335
|
|
|
333
|
-
|
|
336
|
+
17 end-to-end processes that chain agents and skills together.
|
|
334
337
|
|
|
335
338
|
| Workflow | What It Covers |
|
|
336
339
|
|---|---|
|
|
337
340
|
| `feature-ship` | Ticket → /grill-mobile → /feature-slice → implement → review → test → PR |
|
|
338
341
|
| `crash-to-fix` | Crash alert → CRASHER → fix → regression test → deploy |
|
|
339
342
|
| `app-launch` | Release build → SENTINEL → PERF → LAUNCHPAD → SCRIBE → /release-prep → store |
|
|
343
|
+
| `figma-to-code` | Figma MCP setup → spec harvest → native implementation → visual and behavior verification |
|
|
340
344
|
| `new-screen` | Figma spec → FIGMA → implement → review → performance check |
|
|
341
345
|
| `ci-setup` | PIPELINE → generate config → secrets → test → document |
|
|
342
346
|
| `release-cycle` | Feature freeze → CRASHER → SENTINEL → SCRIBE → /release-prep → staged rollout |
|
|
@@ -703,3 +707,7 @@ If Mobile AI Agents saved you time, a star helps others find it.
|
|
|
703
707
|
---
|
|
704
708
|
|
|
705
709
|
*Built for mobile engineers who ship real apps.*
|
|
710
|
+
|
|
711
|
+
## Figma MCP: from design to implementation
|
|
712
|
+
|
|
713
|
+
Start with the [Figma setup and usage guide](docs/figma-mcp.md). Install the toolkit, connect your assistant to Figma, then use `/figma-spec-harvest` for specs or `/figma-to-code` for the complete workflow. Works with Android, iOS, Flutter, React Native, KMP, Unity, Unreal, and other explicitly selected repository stacks. Build and screenshot verification require the corresponding local tools. Install portable harvest/crosscheck/image helpers in your project with `npx mobile-ai-agents figma tools init`; existing files are preserved.
|
|
@@ -90,6 +90,8 @@ Create `PRD.md` with product overview, target audience, personas, core features,
|
|
|
90
90
|
|
|
91
91
|
Create a low-cost design plan using Pencil Project, Figma free plan, Penpot, Excalidraw, Canva free, or hand-drawn wireframes.
|
|
92
92
|
|
|
93
|
+
When Figma is supplied, use `/figma-spec-harvest` before design planning. Carry source node IDs, AC IDs, open questions, token/component gaps and reference screenshots into DESIGN.md. Connect MCP with `/figma-mcp-setup` if needed; record disconnected reads as unverified. Preserve existing stage approval rules.
|
|
94
|
+
|
|
93
95
|
Output includes screen list, wireframe descriptions, design system, colors, typography, component list, states, and screenshot plan.
|
|
94
96
|
|
|
95
97
|
Before creating the design plan, confirm or infer the design direction:
|
|
@@ -114,7 +116,7 @@ Create:
|
|
|
114
116
|
- `DEPENDENCIES.md`
|
|
115
117
|
- `ROADMAP.md`
|
|
116
118
|
|
|
117
|
-
Each task includes title, goal, dependencies, likely files, acceptance criteria, QA checklist, complexity, and implementation notes.
|
|
119
|
+
Each task includes title, goal, dependencies, likely files, acceptance criteria, QA checklist, complexity, and implementation notes. For harvested Figma scope, include component spec paths, node/AC IDs and verification methods. Do not treat proposed criteria as approved or lose unresolved questions during task breakdown.
|
|
118
120
|
|
|
119
121
|
### Stage 5 — Implementation Loop
|
|
120
122
|
|
|
@@ -138,7 +140,7 @@ For every subtask:
|
|
|
138
140
|
|
|
139
141
|
After each feature implementation, compare UI against design for layout, spacing, typography, colors, components, responsiveness, empty states, loading states, error states, and accessibility.
|
|
140
142
|
|
|
141
|
-
Output
|
|
143
|
+
Output differences, fixes, priority and captured evidence. If reporting a numerical match, include method, threshold/tolerance and matched viewport/state/theme; an unmeasured percentage remains unverified.
|
|
142
144
|
|
|
143
145
|
### Stage 7 — Full QA
|
|
144
146
|
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
# FIGMA — Design-to-Code Translator
|
|
2
2
|
|
|
3
|
-
**Platform:** Cross-Platform (
|
|
4
|
-
**Personality:**
|
|
3
|
+
**Platform:** Cross-Platform (Android / iOS / Flutter / React Native / KMP / Unity / Unreal / other selected stacks)
|
|
4
|
+
**Personality:** Precise about design evidence, honest about verification.
|
|
5
5
|
**Category:** UI / Design Handoff
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Extracts source-traced Figma specifications and translates them into native UI in the target repository. Supports connected MCP reads and supplied descriptions/exports, with explicit coverage and verification limits.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
## Input Format
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
|
|
18
|
+
MODE: <specs | implementation; default implementation>
|
|
19
|
+
PLATFORM: <repository stack or explicit target>
|
|
20
|
+
FIGMA_URL: <optional frame link including node-id>
|
|
21
|
+
SPEC_PATH: <optional harvested contract folder>
|
|
22
|
+
SCOPE: <optional page/node scope; default linked subtree>
|
|
19
23
|
DESIGN_DESCRIPTION:
|
|
20
|
-
<
|
|
24
|
+
<Supply this when no accessible URL or harvested contract is available:>
|
|
21
25
|
- Component name and purpose
|
|
22
26
|
- Layout: dimensions, padding, spacing (in dp/pt)
|
|
23
27
|
- Typography: font, weight, size, color (hex or design token)
|
|
@@ -35,12 +39,29 @@ EXISTING_COMPONENTS: <optional: list reusable components already in your codebas
|
|
|
35
39
|
|
|
36
40
|
## Output Format
|
|
37
41
|
|
|
42
|
+
For `MODE: specs` return this schema (use zero counts and explicit unverified checks when disconnected):
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
FIGMA SPECS
|
|
46
|
+
===========
|
|
47
|
+
Source: <URL or supplied input>
|
|
48
|
+
Scope: <requested; inspected; skipped; unreadable>
|
|
49
|
+
Contract: <folder or inline supplied spec>
|
|
50
|
+
Counts: pages=<n>; components=<n>; criteria=<n>; references=<n>
|
|
51
|
+
Verification: <crosscheck pass|fail|unverified; evidence>
|
|
52
|
+
Questions: <blocking questions or none>
|
|
53
|
+
Tasks: <node/component; AC IDs; target; reference>
|
|
54
|
+
Verdict: <READY|PARTIAL|BLOCKED>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For `MODE: implementation` use the format below:
|
|
58
|
+
|
|
38
59
|
```
|
|
39
60
|
FIGMA TRANSLATION
|
|
40
61
|
=================
|
|
41
62
|
Component: <name>
|
|
42
63
|
Platform: <platform>
|
|
43
|
-
Accessibility: <
|
|
64
|
+
Accessibility: <target A | AA | AAA; verified or unverified>
|
|
44
65
|
|
|
45
66
|
COMPONENT CODE
|
|
46
67
|
--------------
|
|
@@ -64,11 +85,11 @@ ACCESSIBILITY CHECKLIST
|
|
|
64
85
|
☑/☐ Touch target ≥ 44×44pt / 48×48dp
|
|
65
86
|
☑/☐ Color contrast ≥ 4.5:1 (AA)
|
|
66
87
|
☑/☐ Focus order correct
|
|
67
|
-
☑/☐ Screen reader tested (
|
|
88
|
+
☑/☐ Screen reader tested (actual evidence or unverified)
|
|
68
89
|
|
|
69
90
|
NOTES
|
|
70
91
|
-----
|
|
71
|
-
<
|
|
92
|
+
<Deviations, node/AC-to-file mapping, actual checks/evidence, open gaps; verdict VERIFIED|IMPLEMENTED_UNVERIFIED|BLOCKED>
|
|
72
93
|
```
|
|
73
94
|
|
|
74
95
|
---
|
|
@@ -76,42 +97,36 @@ NOTES
|
|
|
76
97
|
## System Prompt
|
|
77
98
|
|
|
78
99
|
```
|
|
79
|
-
You are FIGMA
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- Add accessibilityLabel and accessibilityRole to interactive elements.
|
|
110
|
-
- Touch targets: minHeight: 44, minWidth: 44 (iOS) / 48, 48 (Android).
|
|
111
|
-
- Use Animated.Value or Reanimated 2 for interactions.
|
|
112
|
-
|
|
113
|
-
Always implement ALL states described. Flag any design property that is not achievable on
|
|
114
|
-
the target platform and suggest the closest native equivalent.
|
|
100
|
+
You are FIGMA, a design handoff and native UI engineer. Detect the repository's
|
|
101
|
+
framework, architecture, tokens, components and state management. Never switch
|
|
102
|
+
platforms because MCP returns React/Tailwind code.
|
|
103
|
+
|
|
104
|
+
Discover Figma tools and load vendor prerequisites. Read the linked subtree or
|
|
105
|
+
explicit scope in bounded batches: variants, nested requirements/copy, variables
|
|
106
|
+
and screenshots. Keep Figma read-only. Record unknown values and unreadable scope.
|
|
107
|
+
Separate observed values, derived criteria and proposed behavior; retain source
|
|
108
|
+
node IDs/text. Screenshots cannot establish hidden behavior or exact tokens.
|
|
109
|
+
|
|
110
|
+
In specs mode follow figma-spec-harvest guidance when available. Save a contract,
|
|
111
|
+
cross-check against fresh reads, and report coverage, questions and tasks using
|
|
112
|
+
the SPECS format. Supplied descriptions remain supplied evidence, not live reads.
|
|
113
|
+
|
|
114
|
+
In implementation mode follow figma-to-implementation guidance when available.
|
|
115
|
+
Reuse native components and semantic tokens; trace nodes/criteria to changed files.
|
|
116
|
+
Preserve API contracts and resolve blockers before dependent edits. Translate Auto
|
|
117
|
+
Layout into responsive native constraints and logical units. Preserve safe areas,
|
|
118
|
+
text scaling, keyboard/focus behavior, accessibility, variants and actions.
|
|
119
|
+
Android/iOS use existing Compose/XML or SwiftUI/UIKit. Flutter requires bounded
|
|
120
|
+
flex/scroll/Stack layouts. React Native preserves navigation and virtualization.
|
|
121
|
+
KMP respects shared/native ownership. Unity/Unreal preserve UI systems, anchors,
|
|
122
|
+
DPI scaling and controller focus. Other targets follow their actual stack.
|
|
123
|
+
Record unavailable fonts/assets and necessary deviations without silent substitution.
|
|
124
|
+
|
|
125
|
+
Run relevant checks and compare captured runtime UI with design references at
|
|
126
|
+
matched viewport, theme and state. Report commands, actual evidence and gaps.
|
|
127
|
+
Never claim build, contrast, visual or screen-reader checks passed without evidence;
|
|
128
|
+
unrun checks remain unverified. Accessibility is a target, not certification.
|
|
129
|
+
Use the selected mode's exact output; code may be returned or linked to edited files.
|
|
115
130
|
|
|
116
131
|
Output MUST follow the exact format specified. Do not add extra sections or omit any section.
|
|
117
132
|
```
|
|
@@ -228,14 +243,16 @@ ACCESSIBILITY CHECKLIST
|
|
|
228
243
|
☑ Touch target ≥ 48×48dp (height is 56dp, fills width)
|
|
229
244
|
☑ Color contrast ≥ 4.5:1 (white on #1A73E8 = 4.62:1 — passes AA)
|
|
230
245
|
☑ Focus order correct (default focus traversal)
|
|
231
|
-
|
|
246
|
+
☐ Screen reader: unverified; native Button semantics alone do not prove runtime testing
|
|
232
247
|
|
|
233
248
|
NOTES
|
|
234
249
|
-----
|
|
235
250
|
- The #1557B0 pressed state is delivered via Material3's built-in ripple indication on
|
|
236
251
|
top of the base color. If you need the exact hex, override indication with a custom
|
|
237
252
|
PressedColor in ButtonDefaults.
|
|
238
|
-
-
|
|
253
|
+
- Source is a supplied description; no live Figma node/AC mapping is available.
|
|
254
|
+
- Build, visual match and runtime accessibility checks: unverified.
|
|
255
|
+
- Verdict: IMPLEMENTED_UNVERIFIED.
|
|
239
256
|
```
|
|
240
257
|
|
|
241
258
|
---
|
|
@@ -244,4 +261,5 @@ NOTES
|
|
|
244
261
|
|
|
245
262
|
- The more precise your design description (exact px/dp, font weights, hex values), the more accurate the output.
|
|
246
263
|
- For design system integration, provide your existing token names — FIGMA will use them instead of raw values.
|
|
247
|
-
-
|
|
264
|
+
- Original component prompt tested with: Claude Sonnet 4.6. Revised MCP/specs workflow reviewed in Codex; live Figma and platform runtime checks not performed.
|
|
265
|
+
- Full setup and pipeline: [Figma MCP guide](../../../docs/figma-mcp.md), [Figma to code workflow](../../../workflows/figma-to-code.md).
|
|
@@ -299,7 +299,7 @@ For high or regulated risk, define rollback before implementation: trigger, owne
|
|
|
299
299
|
- Use the platform reviewer after code changes: AXIOM, SWIFT, DART, or BRIDGE.
|
|
300
300
|
- Run the configured build, lint/static-analysis, and test checks after every task. If commands are missing, discover safe platform defaults; mark unavailable checks explicitly instead of silently skipping them.
|
|
301
301
|
- Run `/prd-verification` to verify behavior against `PRD.md`, `DESIGN.md`, `TASKS.md`, tests, screenshots, and QA reports.
|
|
302
|
-
- Verify UI against the design artifact, not memory.
|
|
302
|
+
- Verify UI against the design artifact, not memory. For Figma, use `/figma-spec-harvest` before implementation and carry contract paths/node/AC IDs into tasks and `/prd-verification`. Require complete scoped source checks and native runtime evidence separately; partial or missing component results remain pending.
|
|
303
303
|
- Use Mobile MCP for device, emulator, or simulator evidence when available.
|
|
304
304
|
- Capture screenshots, element lists, and failures in the report.
|
|
305
305
|
- Record evidence by artifact ID in `evidence.json`; narrative statements alone are not proof.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs = require('node:fs');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { parseOptions } = require('../lib/options');
|
|
5
|
+
const SOURCE = path.resolve(__dirname, '../../tools/figma-spec');
|
|
6
|
+
const FILES = ['README.md', 'requirements.txt', 'page_index.js', 'text_dump.js', 'node_dump.js',
|
|
7
|
+
'yaml_io.py', 'dump_to_yaml.py', 'crosscheck.py', 'compare_screens.py', 'validate_spec.py'];
|
|
8
|
+
|
|
9
|
+
function initFigmaTools(cwd = process.cwd()) {
|
|
10
|
+
const realRoot = fs.realpathSync(cwd);
|
|
11
|
+
const destination = path.join(realRoot, 'tools/figma-spec');
|
|
12
|
+
// Check existing ancestors before creating anything; never follow redirected paths.
|
|
13
|
+
for (const relative of ['tools', 'tools/figma-spec']) {
|
|
14
|
+
const candidate = path.join(realRoot, relative);
|
|
15
|
+
if (fs.existsSync(candidate) || (() => { try { return fs.lstatSync(candidate).isSymbolicLink(); } catch { return false; } })()) {
|
|
16
|
+
if (fs.lstatSync(candidate).isSymbolicLink()) throw new Error('Tools directory must be inside the project without symlink redirects');
|
|
17
|
+
if (!fs.statSync(candidate).isDirectory()) throw new Error(`Expected directory: ${candidate}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
21
|
+
return FILES.map(name => {
|
|
22
|
+
const target = path.join(destination, name);
|
|
23
|
+
try {
|
|
24
|
+
fs.copyFileSync(path.join(SOURCE, name), target, fs.constants.COPYFILE_EXCL);
|
|
25
|
+
return { name, status: 'created' };
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error.code === 'EEXIST') return { name, status: 'preserved' };
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function cmdFigma(args) {
|
|
34
|
+
const options = parseOptions(args);
|
|
35
|
+
if (options._.join(' ') !== 'tools init' || Object.keys(options).some(key => key !== '_')) {
|
|
36
|
+
throw new Error('Usage: mobile-ai-agents figma tools init (run in the target project)');
|
|
37
|
+
}
|
|
38
|
+
const results = initFigmaTools();
|
|
39
|
+
for (const { name, status } of results) console.log(`${status}: tools/figma-spec/${name}`);
|
|
40
|
+
console.log('Helpers installed. Connect/authenticate Figma separately; see tools/figma-spec/README.md.');
|
|
41
|
+
}
|
|
42
|
+
module.exports = { initFigmaTools, cmdFigma };
|
package/cli/commands/router.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const { cmdDoctor } = require('./doctor');
|
|
4
4
|
const { cmdHarness } = require('./harness');
|
|
5
5
|
const { cmdMcp } = require('./mcp');
|
|
6
|
+
const { cmdFigma } = require('./figma');
|
|
6
7
|
|
|
7
8
|
function createCommandRouter(legacyHandlers) {
|
|
8
9
|
const routes = new Map([
|
|
@@ -14,6 +15,7 @@ function createCommandRouter(legacyHandlers) {
|
|
|
14
15
|
['doctor', cmdDoctor],
|
|
15
16
|
['harness', cmdHarness],
|
|
16
17
|
['mcp', cmdMcp],
|
|
18
|
+
['figma', cmdFigma],
|
|
17
19
|
['help', legacyHandlers.help],
|
|
18
20
|
['--help', legacyHandlers.help],
|
|
19
21
|
['-h', legacyHandlers.help],
|
package/cli/index.js
CHANGED
|
@@ -65,6 +65,9 @@ const AGENTS = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const SKILLS = {
|
|
68
|
+
'figma-mcp-setup': { file: 'skills/cross-platform/figma-mcp-setup.md', platform: 'cross' },
|
|
69
|
+
'figma-spec-harvest': { file: 'skills/cross-platform/figma-spec-harvest.md', platform: 'cross' },
|
|
70
|
+
'figma-to-implementation': { file: 'skills/cross-platform/figma-to-implementation.md', platform: 'cross' },
|
|
68
71
|
// Android
|
|
69
72
|
'anr-investigation': { file: 'skills/android/anr-investigation.md', platform: 'android' },
|
|
70
73
|
'android-tdd': { file: 'skills/android/android-tdd.md', platform: 'android' },
|
|
@@ -128,6 +131,7 @@ const SKILLS = {
|
|
|
128
131
|
};
|
|
129
132
|
|
|
130
133
|
const WORKFLOWS = {
|
|
134
|
+
'figma-to-code': { file: 'workflows/figma-to-code.md' },
|
|
131
135
|
'feature-ship': { file: 'workflows/feature-ship.md' },
|
|
132
136
|
'release-cycle': { file: 'workflows/release-cycle.md' },
|
|
133
137
|
'game-level': { file: 'workflows/game-level.md' },
|
|
@@ -194,8 +198,11 @@ const PLATFORM_AGENTS = {
|
|
|
194
198
|
],
|
|
195
199
|
};
|
|
196
200
|
|
|
201
|
+
const FIGMA_SKILLS = ['figma-mcp-setup', 'figma-spec-harvest', 'figma-to-implementation'];
|
|
202
|
+
|
|
197
203
|
const PLATFORM_SKILLS = {
|
|
198
204
|
android: [
|
|
205
|
+
...FIGMA_SKILLS,
|
|
199
206
|
'anr-investigation', 'android-tdd', 'code-review', 'compose-migration', 'compose-review',
|
|
200
207
|
'kotlin-modernize', 'memory-leak-investigation', 'proguard-rules',
|
|
201
208
|
// cross-platform bundled for android
|
|
@@ -205,6 +212,7 @@ const PLATFORM_SKILLS = {
|
|
|
205
212
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
206
213
|
],
|
|
207
214
|
ios: [
|
|
215
|
+
...FIGMA_SKILLS,
|
|
208
216
|
'data-persistence', 'ios-tdd', 'networking', 'ios-performance',
|
|
209
217
|
'swift-concurrency', 'swift-review', 'swiftui-review', 'swiftui-state',
|
|
210
218
|
'unit-testing', 'xcode-warnings',
|
|
@@ -215,6 +223,7 @@ const PLATFORM_SKILLS = {
|
|
|
215
223
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
216
224
|
],
|
|
217
225
|
flutter: [
|
|
226
|
+
...FIGMA_SKILLS,
|
|
218
227
|
'dart-modernize', 'flutter-review', 'flutter-tdd', 'widget-extract', 'widget-gen',
|
|
219
228
|
// cross-platform bundled for flutter
|
|
220
229
|
'accessibility-audit', 'api-versioning', 'clean-code-audit', 'crash-analysis', 'crash-triage',
|
|
@@ -223,6 +232,7 @@ const PLATFORM_SKILLS = {
|
|
|
223
232
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
224
233
|
],
|
|
225
234
|
rn: [
|
|
235
|
+
...FIGMA_SKILLS,
|
|
226
236
|
'bridge-audit', 'expo-optimize', 'new-arch-migrate', 'rn-performance',
|
|
227
237
|
'rn-review', 'rn-tdd',
|
|
228
238
|
// cross-platform bundled for rn
|
|
@@ -232,11 +242,13 @@ const PLATFORM_SKILLS = {
|
|
|
232
242
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
233
243
|
],
|
|
234
244
|
gaming: [
|
|
245
|
+
...FIGMA_SKILLS,
|
|
235
246
|
'blueprint-to-cpp', 'clean-code-audit', 'game-perf', 'mobile-app-design', 'mobile-mcp-qa',
|
|
236
247
|
'mobile-memory-graph', 'mobile-memory-search', 'mobile-memory-save', 'prd-verification', 'security-audit', 'shader-gen',
|
|
237
248
|
'unity-tdd', 'shader-review',
|
|
238
249
|
],
|
|
239
250
|
cross: [
|
|
251
|
+
...FIGMA_SKILLS,
|
|
240
252
|
'accessibility-audit', 'api-versioning', 'clean-code-audit', 'crash-analysis', 'crash-triage',
|
|
241
253
|
'deeplink-debug', 'feature-slice', 'grill-mobile', 'mobile-app-design', 'mobile-mcp-qa',
|
|
242
254
|
'mobile-memory-graph', 'mobile-memory-search', 'mobile-memory-save', 'perf-audit', 'prd-verification',
|
|
@@ -1208,6 +1220,7 @@ function cmdMemory(args) {
|
|
|
1208
1220
|
console.log(' --files Comma-separated related files');
|
|
1209
1221
|
console.log('');
|
|
1210
1222
|
console.log(' Examples:');
|
|
1223
|
+
console.log(dim(' npx mobile-ai-agents figma tools init'));
|
|
1211
1224
|
console.log(dim(' npx mobile-ai-agents memory init'));
|
|
1212
1225
|
console.log(dim(' npx mobile-ai-agents memory capture --type decision --title "Use Room" --text "Persist habits locally with Room."'));
|
|
1213
1226
|
console.log(dim(' git diff | npx mobile-ai-agents memory capture --type code-state --title "Current diff"'));
|
|
@@ -1424,6 +1437,7 @@ function cmdHelp() {
|
|
|
1424
1437
|
console.log(' codex All agents/skills/workflows → AGENTS.md');
|
|
1425
1438
|
console.log('');
|
|
1426
1439
|
console.log(' Examples:');
|
|
1440
|
+
console.log(dim(' npx mobile-ai-agents figma tools init'));
|
|
1427
1441
|
console.log(dim(' npx mobile-ai-agents start'));
|
|
1428
1442
|
console.log(dim(' npx mobile-ai-agents start --platform flutter --idea "Habit tracker"'));
|
|
1429
1443
|
console.log(dim(' npx mobile-ai-agents install'));
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Figma MCP: setup, specs, and implementation
|
|
2
|
+
|
|
3
|
+
Connect your coding assistant once, extract a design contract, then implement it in your project's own framework. Installing this toolkit installs prompts; it does **not** connect your Figma account or grant access to files.
|
|
4
|
+
|
|
5
|
+
## 1. Connect Figma
|
|
6
|
+
|
|
7
|
+
Use the official remote endpoint `https://mcp.figma.com/mcp` and complete Figma OAuth. No personal access token is needed for this route. Choose one setup below; preserve your existing MCP servers when adding configuration.
|
|
8
|
+
|
|
9
|
+
### Codex
|
|
10
|
+
|
|
11
|
+
In the Codex app, open Plugins, find Figma, install it, and complete authentication. Alternatively, with Codex CLI installed:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
codex mcp add figma --url https://mcp.figma.com/mcp
|
|
15
|
+
codex mcp login figma
|
|
16
|
+
codex mcp list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Claude Code
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
claude mcp add --transport http figma https://mcp.figma.com/mcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Start a new session, run `/mcp`, select Figma, and authenticate. Use `--scope user` on the add command if you want it across projects.
|
|
26
|
+
|
|
27
|
+
### Cursor
|
|
28
|
+
|
|
29
|
+
Use `/add-plugin figma` in agent chat and authenticate, or follow Figma's manual Cursor installation guide linked below.
|
|
30
|
+
|
|
31
|
+
### VS Code
|
|
32
|
+
|
|
33
|
+
Run **MCP: Open Workspace Folder MCP Configuration** (or **MCP: Open User Configuration** for global setup). Merge this entry into the `servers` object:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"servers": {
|
|
38
|
+
"figma": {
|
|
39
|
+
"type": "http",
|
|
40
|
+
"url": "https://mcp.figma.com/mcp"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Start the server and complete authentication. This `servers` shape belongs to VS Code; do not paste it into clients expecting `mcpServers` or TOML.
|
|
47
|
+
|
|
48
|
+
### Desktop alternative
|
|
49
|
+
|
|
50
|
+
Open the file in Figma desktop, switch to Dev Mode, and enable the desktop MCP server in the inspect panel. Configure your supported client with Streamable HTTP URL `http://127.0.0.1:3845/mcp`. Keep Figma desktop running on the same machine as the MCP client. Desktop access depends on your seat/plan; consult current Figma documentation. Selection-based prompts are available here; use explicit frame links for reproducible handoffs.
|
|
51
|
+
|
|
52
|
+
### Check the connection
|
|
53
|
+
|
|
54
|
+
Copy a frame's link, including `node-id`, from a file your authenticated account can access. Ask:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Use Figma MCP to read this frame's metadata and capture a reference screenshot.
|
|
58
|
+
Report the file key, node ID, tools available, and any access failures.
|
|
59
|
+
Do not change the Figma file or app code.
|
|
60
|
+
URL: paste your frame link here
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Success means a real node read and screenshot, not just a configured server. Tool names and capabilities vary by client and server. Load the Figma plugin's prerequisite skills when supplied, especially before `get_design_context` or `use_figma`. `use_figma` is optional; do not require it for basic design-to-code.
|
|
64
|
+
|
|
65
|
+
## 2. Load the toolkit workflows
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npx mobile-ai-agents install
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Select your coding tool and platform. Install the portable extraction and verification helpers inside your target project:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npx mobile-ai-agents figma tools init
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This preserves existing helper files. Read `tools/figma-spec/README.md` for Python prerequisites, raw-dump conversion, strict validation and screenshot comparison. In a checkout of this toolkit, you can also run `node /absolute/path/to/mobile-dev-skills/cli/index.js figma tools init` from the target project. Available starting with v1.0.38.
|
|
78
|
+
|
|
79
|
+
The three Figma skills are included for every platform. In tools supporting the installed slash commands:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
/figma-mcp-setup
|
|
83
|
+
Help me connect Figma MCP and verify a read of my frame.
|
|
84
|
+
|
|
85
|
+
/figma-spec-harvest
|
|
86
|
+
URL: paste your frame link here
|
|
87
|
+
FEATURE: checkout
|
|
88
|
+
SCOPE: this frame and its variants
|
|
89
|
+
Extract written requirements, exact available values, assets, and reference screenshots.
|
|
90
|
+
|
|
91
|
+
/figma-to-implementation
|
|
92
|
+
SPEC: docs/design-spec/checkout
|
|
93
|
+
PLATFORM: detect from this repository
|
|
94
|
+
Implement the verified scope and report requirement and screenshot evidence.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For tools without those commands, ask the assistant to read the corresponding `skills/cross-platform/figma-*.md` files. Use `/figma-to-code` for the combined workflow; `/figma` remains the component translation agent. There is no automatic Figma authentication during toolkit installation. The existing `mobile-ai-agents mcp setup` command configures **Mobile MCP device QA**, not Figma.
|
|
98
|
+
|
|
99
|
+
## 3. Platform mapping
|
|
100
|
+
|
|
101
|
+
| Target | Native implementation | Verification |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| Android | Compose or existing XML Views; semantic theme tokens | Gradle checks and emulator/device captures |
|
|
104
|
+
| iOS | SwiftUI or existing UIKit; dynamic type and safe areas | Xcode build/tests and simulator/device captures |
|
|
105
|
+
| Flutter | Existing Dart state management, bounded flex/scroll layout | Analyze, widget tests, golden/device captures |
|
|
106
|
+
| React Native | Existing JS/TS components and navigation | Project checks and iOS/Android captures |
|
|
107
|
+
| Kotlin Multiplatform | Existing shared UI or separate native UIs | Checks/captures per rendered target |
|
|
108
|
+
| Unity | Existing UI Toolkit or uGUI; canvas scaling and anchors | Editor/player checks and target resolution captures |
|
|
109
|
+
| Unreal | Existing UMG/Slate; anchors and DPI scaling | Compile/automation and viewport captures |
|
|
110
|
+
| Web or other framework | User-selected repository stack | Native build/tests and browser/runtime captures |
|
|
111
|
+
|
|
112
|
+
Figma pixels describe the reference canvas. Record how they map to logical dp/pt/framework units and responsive constraints; do not use device pixel ratio as a universal conversion. A generated React/Tailwind snippet is evidence about the design, not a reason to change the project's platform.
|
|
113
|
+
|
|
114
|
+
## Troubleshooting
|
|
115
|
+
|
|
116
|
+
- **No tools:** restart the client/session, confirm the server is enabled, and check client support. If both remote and desktop are configured, confirm which server is selected.
|
|
117
|
+
- **Access denied:** authenticate the account that can open the design; a shared URL does not guarantee API access.
|
|
118
|
+
- **Rate limit:** record incomplete scope, retry within server guidance, and resume from saved evidence. Do not report a partial harvest as complete.
|
|
119
|
+
- **Missing exact values or written notes:** request the missing export/data or use read-only file inspection if available. Record unknowns; screenshots cannot prove exact token values or hidden behavior.
|
|
120
|
+
- **Missing assets/fonts:** list the gap and resolve licensing/availability before substituting. Respect the client's media-download rules.
|
|
121
|
+
- **Only web code returned:** specify the target framework, reuse repository components, and select the matching Code Connect label when available.
|
|
122
|
+
|
|
123
|
+
## Sources and validation
|
|
124
|
+
|
|
125
|
+
Setup checked against official documentation on 2026-10-08:
|
|
126
|
+
- [Figma remote setup](https://developers.figma.com/docs/figma-mcp-server/remote-server-installation/)
|
|
127
|
+
- [Figma desktop setup](https://developers.figma.com/docs/figma-mcp-server/local-server-installation/)
|
|
128
|
+
- [Figma tools and prompts](https://developers.figma.com/docs/figma-mcp-server/tools-and-prompts/)
|
|
129
|
+
- [OpenAI Codex MCP configuration](https://developers.openai.com/codex/mcp/)
|
|
130
|
+
|
|
131
|
+
Adapted from the seller-app's `figma-spec-harvest`, `figma-spec-harvester`, `figma-to-flutter`, `figma-to-implementation`, and `design-sync` workflows. No seller-app file IDs, business copy, or package paths are included. Live Figma extraction and per-platform compilation must be validated in users' connected projects; they were not run when authoring this guide.
|
package/docs/wiki.md
CHANGED
|
@@ -768,3 +768,7 @@ A: Yes. The repo is MIT licensed — free to use, modify, and incorporate into c
|
|
|
768
768
|
---
|
|
769
769
|
|
|
770
770
|
*Last updated: v1.0.25 — August 2026*
|
|
771
|
+
|
|
772
|
+
## Figma MCP and Design Handoff
|
|
773
|
+
|
|
774
|
+
Connect your coding assistant using the [Figma MCP guide](figma-mcp.md). Use `/figma-spec-harvest` for source-traced specs and `/figma-to-implementation` to build in the existing platform. `/figma-to-code` chains setup, harvest, implementation and evidence checks. Install portable helpers with `npx mobile-ai-agents figma tools init`; this preserves existing files and does not authenticate Figma. APPFORGE, Mobile Harness and `/prd-verification` carry node/AC traceability into planning and verification.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile-ai-agents",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "AI agents, skills, and Loop Engineering workflows for building, testing, auditing, and releasing mobile apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mobile-ai-agents": "cli/index.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"mobile-karpathy.md",
|
|
20
20
|
"skills/",
|
|
21
21
|
"templates/",
|
|
22
|
-
"workflows/"
|
|
22
|
+
"workflows/",
|
|
23
|
+
"tools/figma-spec/"
|
|
23
24
|
],
|
|
24
25
|
"keywords": [
|
|
25
26
|
"mobile",
|