mobile-ai-agents 1.0.37 → 1.0.39
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 +10 -0
- package/CLAUDE.md +4 -0
- package/README.md +51 -5
- 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/network.js +19 -0
- package/cli/commands/router.js +4 -0
- package/cli/fixtures/network-demo.js +52 -0
- package/cli/index.js +22 -0
- package/cli/lib/network-capture.js +192 -0
- package/docs/figma-mcp.md +131 -0
- package/docs/website-api-discovery.md +111 -0
- package/docs/wiki.md +9 -0
- package/install.sh +2 -0
- package/package.json +7 -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/skills/cross-platform/web-network-to-mobile.md +139 -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
|
@@ -105,6 +105,10 @@ Use the agent at agents/android/code-reviewer/agent.md to review this file:
|
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
108
|
+
## Website API to Mobile Parity
|
|
109
|
+
|
|
110
|
+
Use `skills/cross-platform/web-network-to-mobile.md` when a deployed website is the reference for mobile API integration. Trace requests and responses per interaction, implement using the existing mobile stack (including Android, iOS, Flutter, React Native, and KMP), and verify actual mobile network and UI behavior. Browser observations alone do not prove mobile parity. This requires suitable browser capture and mobile verification tools; the skill does not bundle them.
|
|
111
|
+
|
|
108
112
|
## Mobile MCP QA
|
|
109
113
|
|
|
110
114
|
Use `skills/cross-platform/mobile-mcp-qa.md` and `workflows/mobile-mcp-qa.md` when a user wants device, emulator, or simulator QA through Mobile MCP. This belongs after implementation, during APPFORGE UI match review, full QA, launch readiness, or screenshot validation.
|
|
@@ -230,3 +234,9 @@ Short version:
|
|
|
230
234
|
## Questions / Discussion
|
|
231
235
|
|
|
232
236
|
Open a GitHub Discussion or Issue. PRs are always welcome.
|
|
237
|
+
|
|
238
|
+
## Figma Design Handoff
|
|
239
|
+
|
|
240
|
+
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.
|
|
241
|
+
|
|
242
|
+
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 · 57 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)
|
|
@@ -100,6 +100,43 @@ For focused work, use a specialist directly:
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
+
## Website API Discovery → Mobile Integration
|
|
104
|
+
|
|
105
|
+
**The website works. Which API calls does your mobile app need?**
|
|
106
|
+
|
|
107
|
+
Capture HTTP requests and response shapes for each website interaction: load a list, open a detail, validate a form, submit test data. Get a touchpoint report for your Android, iOS, Flutter, React Native or Kotlin Multiplatform coding agent.
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
Website flow → browser network capture → observed API shapes → mobile integration handoff
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Try the runnable demo from a checkout with optional Playwright browser tooling:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Install browser tooling in your project first; see the guide below.
|
|
117
|
+
node cli/fixtures/network-demo.js /tmp/mobile-api-flow.json
|
|
118
|
+
|
|
119
|
+
# In another terminal: this writes only to the owned local test server.
|
|
120
|
+
node cli/index.js network capture \
|
|
121
|
+
--url http://127.0.0.1:4173 \
|
|
122
|
+
--flow /tmp/mobile-api-flow.json \
|
|
123
|
+
--out /tmp/mobile-api-demo \
|
|
124
|
+
--allow-writes
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- Correlates zero, one or multiple requests with each interaction window.
|
|
128
|
+
- Records request/response schemas, status codes, failures and redirect links.
|
|
129
|
+
- Omits body values and redacts query/header values in exported JSON and Markdown.
|
|
130
|
+
- Blocks unlisted origins and write methods by default; keeps partial evidence when checks fail.
|
|
131
|
+
|
|
132
|
+
This delivers browser API evidence. Mobile code generation and verified app/API parity require the [web-network-to-mobile skill](skills/cross-platform/web-network-to-mobile.md), your target app and device/network tooling. It does not prove a native app works from a website capture alone.
|
|
133
|
+
|
|
134
|
+
[Website API discovery guide: setup, demo, privacy and mobile handoff](docs/website-api-discovery.md) · [Implementation issue #69](https://github.com/salmanashraf/mobile-ai-agents/issues/69)
|
|
135
|
+
|
|
136
|
+
Available in `mobile-ai-agents@1.0.39` and newer. Use `npx mobile-ai-agents@latest network capture --url URL --out NEW_DIRECTORY` for your own authorized site, with optional Playwright installed. Use a new output directory for every run.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
103
140
|
## Who It Helps
|
|
104
141
|
|
|
105
142
|
| Role | How Mobile AI Agents Helps |
|
|
@@ -217,11 +254,11 @@ Not sure where to begin? Pick your situation:
|
|
|
217
254
|
|---|---|---|
|
|
218
255
|
| Platform knowledge | Generic | Android · iOS · Flutter · React Native · Unity · Unreal |
|
|
219
256
|
| Agent personalities | None | 19 named specialists with opinions |
|
|
220
|
-
| Real workflows | No |
|
|
257
|
+
| Real workflows | No | 17 end-to-end processes |
|
|
221
258
|
| Real examples | Toy pseudocode | Production code input/output pairs |
|
|
222
259
|
| Installable | Copy-paste | `npx mobile-ai-agents install` |
|
|
223
260
|
| Severity levels | None | CRITICAL · WARNING · INFO |
|
|
224
|
-
| Slash commands | No |
|
|
261
|
+
| Slash commands | No | 57 composable skills |
|
|
225
262
|
|
|
226
263
|
---
|
|
227
264
|
|
|
@@ -260,7 +297,7 @@ Not sure where to begin? Pick your situation:
|
|
|
260
297
|
|
|
261
298
|
## Skills Library
|
|
262
299
|
|
|
263
|
-
|
|
300
|
+
57 focused prompt modules — use inline or compose with agents.
|
|
264
301
|
|
|
265
302
|
### Android
|
|
266
303
|
| Skill | What It Does |
|
|
@@ -308,6 +345,10 @@ Not sure where to begin? Pick your situation:
|
|
|
308
345
|
### Cross-Platform
|
|
309
346
|
| Skill | What It Does |
|
|
310
347
|
|---|---|
|
|
348
|
+
| `/web-network-to-mobile` | Website API touchpoints → observed contracts, mobile integration handoff and parity checks |
|
|
349
|
+
| `/figma-mcp-setup` | Connect official Figma MCP and verify frame access |
|
|
350
|
+
| `/figma-spec-harvest` | Figma → traceable requirements, tokens, component specs and references |
|
|
351
|
+
| `/figma-to-implementation` | Design contract → integrated UI in your existing platform |
|
|
311
352
|
| `/grill-mobile` | 20 questions before any mobile code is written |
|
|
312
353
|
| `/mobile-app-design` | Lovable/Stitch-style mobile UI generation, redesigns, and full app reskins |
|
|
313
354
|
| `/crash-triage` | Paste stacktrace → root cause → fix |
|
|
@@ -330,13 +371,14 @@ Not sure where to begin? Pick your situation:
|
|
|
330
371
|
|
|
331
372
|
## Workflows
|
|
332
373
|
|
|
333
|
-
|
|
374
|
+
17 end-to-end processes that chain agents and skills together.
|
|
334
375
|
|
|
335
376
|
| Workflow | What It Covers |
|
|
336
377
|
|---|---|
|
|
337
378
|
| `feature-ship` | Ticket → /grill-mobile → /feature-slice → implement → review → test → PR |
|
|
338
379
|
| `crash-to-fix` | Crash alert → CRASHER → fix → regression test → deploy |
|
|
339
380
|
| `app-launch` | Release build → SENTINEL → PERF → LAUNCHPAD → SCRIBE → /release-prep → store |
|
|
381
|
+
| `figma-to-code` | Figma MCP setup → spec harvest → native implementation → visual and behavior verification |
|
|
340
382
|
| `new-screen` | Figma spec → FIGMA → implement → review → performance check |
|
|
341
383
|
| `ci-setup` | PIPELINE → generate config → secrets → test → document |
|
|
342
384
|
| `release-cycle` | Feature freeze → CRASHER → SENTINEL → SCRIBE → /release-prep → staged rollout |
|
|
@@ -703,3 +745,7 @@ If Mobile AI Agents saved you time, a star helps others find it.
|
|
|
703
745
|
---
|
|
704
746
|
|
|
705
747
|
*Built for mobile engineers who ship real apps.*
|
|
748
|
+
|
|
749
|
+
## Figma MCP: from design to implementation
|
|
750
|
+
|
|
751
|
+
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 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs = require('node:fs');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { parseOptions } = require('../lib/options');
|
|
5
|
+
const { capture } = require('../lib/network-capture');
|
|
6
|
+
|
|
7
|
+
async function cmdNetwork(args) {
|
|
8
|
+
const opts = parseOptions(args);
|
|
9
|
+
if (opts._.join(' ') !== 'capture' || !opts.url || !opts.out || Object.keys(opts).some(key => !['_', 'url', 'out', 'flow', 'allow-origin', 'allow-writes', 'headed', 'channel'].includes(key))) {
|
|
10
|
+
throw new Error('Usage: mobile-ai-agents network capture --url URL --out NEW_DIRECTORY [--flow flow.json] [--allow-origin ORIGIN,ORIGIN] [--allow-writes] [--headed] [--channel chrome]');
|
|
11
|
+
}
|
|
12
|
+
for (const name of ['url', 'out', 'flow', 'allow-origin', 'channel']) if (opts[name] !== undefined && typeof opts[name] !== 'string') throw new Error(`--${name} needs a value.`);
|
|
13
|
+
for (const name of ['allow-writes', 'headed']) if (opts[name] !== undefined && opts[name] !== true) throw new Error(`--${name} is a flag without a value.`);
|
|
14
|
+
const report = await capture({ url: opts.url, output: path.resolve(opts.out), flow: opts.flow ? JSON.parse(fs.readFileSync(opts.flow, 'utf8')) : [], allowedOrigins: opts['allow-origin']?.split(',') || [], allowWrites: !!opts['allow-writes'], headless: !opts.headed, channel: opts.channel });
|
|
15
|
+
console.log(`${report.status}: ${report.touchpoints.length} touchpoints, ${report.requests.length} requests. ${path.resolve(opts.out)}`);
|
|
16
|
+
console.log('API shapes observed; mobile parity is unverified. Review capture.json and report.md.');
|
|
17
|
+
if (report.status !== 'captured') process.exitCode = 1;
|
|
18
|
+
}
|
|
19
|
+
module.exports = { cmdNetwork };
|
package/cli/commands/router.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const { cmdDoctor } = require('./doctor');
|
|
4
4
|
const { cmdHarness } = require('./harness');
|
|
5
5
|
const { cmdMcp } = require('./mcp');
|
|
6
|
+
const { cmdFigma } = require('./figma');
|
|
7
|
+
const { cmdNetwork } = require('./network');
|
|
6
8
|
|
|
7
9
|
function createCommandRouter(legacyHandlers) {
|
|
8
10
|
const routes = new Map([
|
|
@@ -14,6 +16,8 @@ function createCommandRouter(legacyHandlers) {
|
|
|
14
16
|
['doctor', cmdDoctor],
|
|
15
17
|
['harness', cmdHarness],
|
|
16
18
|
['mcp', cmdMcp],
|
|
19
|
+
['figma', cmdFigma],
|
|
20
|
+
['network', cmdNetwork],
|
|
17
21
|
['help', legacyHandlers.help],
|
|
18
22
|
['--help', legacyHandlers.help],
|
|
19
23
|
['-h', legacyHandlers.help],
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const http = require('node:http');
|
|
3
|
+
|
|
4
|
+
const flow = [
|
|
5
|
+
{ action: 'click', selector: '#load' },
|
|
6
|
+
{ action: 'click', selector: '#detail' },
|
|
7
|
+
{ action: 'click', selector: '#validate' },
|
|
8
|
+
{ action: 'fill', selector: '#title', value: 'Test listing' },
|
|
9
|
+
{ action: 'click', selector: '#save' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
function createDemo() {
|
|
13
|
+
const server = http.createServer(async (req, res) => {
|
|
14
|
+
const send = (status, data) => { res.writeHead(status, { 'content-type': 'application/json', 'x-test-secret': 'demo-secret' }); res.end(JSON.stringify(data)); };
|
|
15
|
+
if (req.url === '/api/items') return send(200, { items: [{ id: 1, title: 'Test listing', email: 'private@example.test' }] });
|
|
16
|
+
if (req.url === '/api/detail') return send(200, { id: 1, title: 'Test listing' });
|
|
17
|
+
if (req.url === '/api/options') return send(200, { categories: ['Books', 'Other'] });
|
|
18
|
+
if (req.url === '/api/save') {
|
|
19
|
+
let raw = ''; for await (const chunk of req) raw += chunk;
|
|
20
|
+
return send(201, { id: 2, saved: !!JSON.parse(raw).title });
|
|
21
|
+
}
|
|
22
|
+
if (req.url === '/api/error') return send(422, { errors: { title: 'Required' } });
|
|
23
|
+
if (req.url === '/api/fail') return req.socket.destroy();
|
|
24
|
+
if (req.url === '/favicon.ico') { res.writeHead(204); return res.end(); }
|
|
25
|
+
res.writeHead(200, { 'content-type': 'text/html' });
|
|
26
|
+
res.end(`<!doctype html><html lang="en"><meta charset="utf-8"><title>Website API discovery demo</title>
|
|
27
|
+
<h1>List → detail → form</h1><button id="load">Load listings</button><button id="detail">Open detail</button>
|
|
28
|
+
<label>Title <input id="title" required></label><button id="validate">Validate locally</button><button id="save">Save test listing</button>
|
|
29
|
+
<button id="error">Server error</button><button id="fail">Network failure</button><button id="external">External request</button>
|
|
30
|
+
<p id="state" role="status">Ready</p><script>
|
|
31
|
+
const show = text => document.querySelector('#state').textContent = text;
|
|
32
|
+
document.querySelector('#load').onclick = async () => { await fetch('/api/items'); show('Listings loaded'); };
|
|
33
|
+
document.querySelector('#detail').onclick = async () => { await Promise.all([fetch('/api/detail'),fetch('/api/options')]); show('Detail loaded'); };
|
|
34
|
+
document.querySelector('#validate').onclick = () => show(document.querySelector('#title').value ? 'Valid' : 'Title required');
|
|
35
|
+
document.querySelector('#save').onclick = async () => { await fetch('/api/save',{method:'POST',headers:{'Content-Type':'application/json','Authorization':'Bearer demo-secret'},body:JSON.stringify({title:document.querySelector('#title').value,password:'private-password'})}); show('Saved'); };
|
|
36
|
+
document.querySelector('#error').onclick = () => fetch('/api/error');
|
|
37
|
+
document.querySelector('#fail').onclick = () => fetch('/api/fail').catch(() => show('Failed'));
|
|
38
|
+
document.querySelector('#external').onclick = () => fetch('http://127.0.0.1:1/private?token=secret').catch(() => show('Blocked'));
|
|
39
|
+
</script></html>`);
|
|
40
|
+
});
|
|
41
|
+
return server;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (require.main === module) {
|
|
45
|
+
const fs = require('node:fs');
|
|
46
|
+
const path = require('node:path');
|
|
47
|
+
const directory = process.argv[2];
|
|
48
|
+
if (!directory) throw new Error('Usage: node cli/fixtures/network-demo.js NEW_FLOW_FILE');
|
|
49
|
+
fs.writeFileSync(path.resolve(directory), JSON.stringify(flow, null, 2), { flag: 'wx' });
|
|
50
|
+
createDemo().listen(4173, '127.0.0.1', () => console.log('Owned test site: http://127.0.0.1:4173. Stop with Ctrl+C.'));
|
|
51
|
+
}
|
|
52
|
+
module.exports = { createDemo, flow };
|
package/cli/index.js
CHANGED
|
@@ -65,6 +65,10 @@ const AGENTS = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const SKILLS = {
|
|
68
|
+
'web-network-to-mobile': { file: 'skills/cross-platform/web-network-to-mobile.md', platform: 'cross' },
|
|
69
|
+
'figma-mcp-setup': { file: 'skills/cross-platform/figma-mcp-setup.md', platform: 'cross' },
|
|
70
|
+
'figma-spec-harvest': { file: 'skills/cross-platform/figma-spec-harvest.md', platform: 'cross' },
|
|
71
|
+
'figma-to-implementation': { file: 'skills/cross-platform/figma-to-implementation.md', platform: 'cross' },
|
|
68
72
|
// Android
|
|
69
73
|
'anr-investigation': { file: 'skills/android/anr-investigation.md', platform: 'android' },
|
|
70
74
|
'android-tdd': { file: 'skills/android/android-tdd.md', platform: 'android' },
|
|
@@ -128,6 +132,7 @@ const SKILLS = {
|
|
|
128
132
|
};
|
|
129
133
|
|
|
130
134
|
const WORKFLOWS = {
|
|
135
|
+
'figma-to-code': { file: 'workflows/figma-to-code.md' },
|
|
131
136
|
'feature-ship': { file: 'workflows/feature-ship.md' },
|
|
132
137
|
'release-cycle': { file: 'workflows/release-cycle.md' },
|
|
133
138
|
'game-level': { file: 'workflows/game-level.md' },
|
|
@@ -194,8 +199,12 @@ const PLATFORM_AGENTS = {
|
|
|
194
199
|
],
|
|
195
200
|
};
|
|
196
201
|
|
|
202
|
+
const FIGMA_SKILLS = ['figma-mcp-setup', 'figma-spec-harvest', 'figma-to-implementation'];
|
|
203
|
+
|
|
197
204
|
const PLATFORM_SKILLS = {
|
|
198
205
|
android: [
|
|
206
|
+
...FIGMA_SKILLS,
|
|
207
|
+
'web-network-to-mobile',
|
|
199
208
|
'anr-investigation', 'android-tdd', 'code-review', 'compose-migration', 'compose-review',
|
|
200
209
|
'kotlin-modernize', 'memory-leak-investigation', 'proguard-rules',
|
|
201
210
|
// cross-platform bundled for android
|
|
@@ -205,6 +214,8 @@ const PLATFORM_SKILLS = {
|
|
|
205
214
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
206
215
|
],
|
|
207
216
|
ios: [
|
|
217
|
+
...FIGMA_SKILLS,
|
|
218
|
+
'web-network-to-mobile',
|
|
208
219
|
'data-persistence', 'ios-tdd', 'networking', 'ios-performance',
|
|
209
220
|
'swift-concurrency', 'swift-review', 'swiftui-review', 'swiftui-state',
|
|
210
221
|
'unit-testing', 'xcode-warnings',
|
|
@@ -215,6 +226,8 @@ const PLATFORM_SKILLS = {
|
|
|
215
226
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
216
227
|
],
|
|
217
228
|
flutter: [
|
|
229
|
+
...FIGMA_SKILLS,
|
|
230
|
+
'web-network-to-mobile',
|
|
218
231
|
'dart-modernize', 'flutter-review', 'flutter-tdd', 'widget-extract', 'widget-gen',
|
|
219
232
|
// cross-platform bundled for flutter
|
|
220
233
|
'accessibility-audit', 'api-versioning', 'clean-code-audit', 'crash-analysis', 'crash-triage',
|
|
@@ -223,6 +236,8 @@ const PLATFORM_SKILLS = {
|
|
|
223
236
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
224
237
|
],
|
|
225
238
|
rn: [
|
|
239
|
+
...FIGMA_SKILLS,
|
|
240
|
+
'web-network-to-mobile',
|
|
226
241
|
'bridge-audit', 'expo-optimize', 'new-arch-migrate', 'rn-performance',
|
|
227
242
|
'rn-review', 'rn-tdd',
|
|
228
243
|
// cross-platform bundled for rn
|
|
@@ -232,11 +247,15 @@ const PLATFORM_SKILLS = {
|
|
|
232
247
|
'release-prep', 'security-audit', 'security-scan', 'store-listing',
|
|
233
248
|
],
|
|
234
249
|
gaming: [
|
|
250
|
+
...FIGMA_SKILLS,
|
|
251
|
+
'web-network-to-mobile',
|
|
235
252
|
'blueprint-to-cpp', 'clean-code-audit', 'game-perf', 'mobile-app-design', 'mobile-mcp-qa',
|
|
236
253
|
'mobile-memory-graph', 'mobile-memory-search', 'mobile-memory-save', 'prd-verification', 'security-audit', 'shader-gen',
|
|
237
254
|
'unity-tdd', 'shader-review',
|
|
238
255
|
],
|
|
239
256
|
cross: [
|
|
257
|
+
...FIGMA_SKILLS,
|
|
258
|
+
'web-network-to-mobile',
|
|
240
259
|
'accessibility-audit', 'api-versioning', 'clean-code-audit', 'crash-analysis', 'crash-triage',
|
|
241
260
|
'deeplink-debug', 'feature-slice', 'grill-mobile', 'mobile-app-design', 'mobile-mcp-qa',
|
|
242
261
|
'mobile-memory-graph', 'mobile-memory-search', 'mobile-memory-save', 'perf-audit', 'prd-verification',
|
|
@@ -1208,6 +1227,7 @@ function cmdMemory(args) {
|
|
|
1208
1227
|
console.log(' --files Comma-separated related files');
|
|
1209
1228
|
console.log('');
|
|
1210
1229
|
console.log(' Examples:');
|
|
1230
|
+
console.log(dim(' npx mobile-ai-agents figma tools init'));
|
|
1211
1231
|
console.log(dim(' npx mobile-ai-agents memory init'));
|
|
1212
1232
|
console.log(dim(' npx mobile-ai-agents memory capture --type decision --title "Use Room" --text "Persist habits locally with Room."'));
|
|
1213
1233
|
console.log(dim(' git diff | npx mobile-ai-agents memory capture --type code-state --title "Current diff"'));
|
|
@@ -1397,6 +1417,7 @@ function cmdHelp() {
|
|
|
1397
1417
|
console.log(` ${bold('start')} Guided setup that creates PRD/design/tasks/roadmap`);
|
|
1398
1418
|
console.log(` ${bold('install')} Install agents, skills, and workflows`);
|
|
1399
1419
|
console.log(` ${bold('add')} agent|skill|workflow <name> Install a single item`);
|
|
1420
|
+
console.log(` ${bold('network capture')} --url URL --out DIR Capture website API touchpoints (optional Playwright)`);
|
|
1400
1421
|
console.log(` ${bold('memory')} init|capture|search|... Local Mobile Memory store`);
|
|
1401
1422
|
console.log(` ${bold('doctor')} --platform android Check SDK, adb, emulator, MCP, and project config`);
|
|
1402
1423
|
console.log(` ${bold('harness')} policy init|validate Configure governed Mobile Harness runs`);
|
|
@@ -1424,6 +1445,7 @@ function cmdHelp() {
|
|
|
1424
1445
|
console.log(' codex All agents/skills/workflows → AGENTS.md');
|
|
1425
1446
|
console.log('');
|
|
1426
1447
|
console.log(' Examples:');
|
|
1448
|
+
console.log(dim(' npx mobile-ai-agents figma tools init'));
|
|
1427
1449
|
console.log(dim(' npx mobile-ai-agents start'));
|
|
1428
1450
|
console.log(dim(' npx mobile-ai-agents start --platform flutter --idea "Habit tracker"'));
|
|
1429
1451
|
console.log(dim(' npx mobile-ai-agents install'));
|