design-from-mockup
Skill0 starsChanged 7 months agoMITView on GitHub
Takes any reference image, mockup, or screenshot and produces a pixel-close mobile UI inside an existing Expo project. Pipeline extracts assets one-at-a-time, removes backgrounds, applies them to the scaffold, then runs a screenshot-diff loop until the result matches. Use this skill whenever the user mentions designing like an existing app, matching a style, building from a screenshot or mockup, copying a layout, or producing a high-end UI from a reference image, even if they do not name the skill by name.
In this repository9 other files it gives its agents.
- app-store-submissionSkill
- hermes-vps-deploySkill
- higgsfield-mediaSkill
- mcp-to-mobileSkill
- mobile-app-scaffoldSkill
- mvp-design-frameworkSkill
- security-auditSkill
- supabase-bootstrapSkill
- three-tier-testSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
If the user passes an image path or URL, save it as design/reference.png.
- Very specific: line 37
If the user passes a text prompt, call the gemini-imagegen skill with four variations.
- Very specific: line 55
Write the tokens to lib/theme.ts in the project.
- Very specific: line 59
Place extracted assets at the project's assets/ folder.
- Distinctive: line 60
Update screen components to reference the new assets and the new theme.
- Distinctive: line 67
If the diff is below the tolerance threshold for the chosen match mode, stop.
- Distinctive: line 68
If above, generate a structured prompt naming the specific differences (spacing off by 8px, button radius too sharp, accent color …
- Distinctive: line 75
Never request multiple assets in a single Gemini call.
- Distinctive: line 76
Never proceed past stage 2 with assets that have non-transparent backgrounds.
- Very specific: line 77
Never overwrite the user's lib/theme.ts without first writing a backup.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
design-from-mockup
Purpose
Skip the slow manual translation of a mockup into RN components. Drive the asset pipeline and the screenshot diff loop until the running app matches the reference within a tolerable delta.
When to trigger
Trigger on these user phrases. Match loosely.
- "design like this"
- "match this style"
- "build from screenshot"
- "make it look like"
- "I want this design"
- "use this mockup"
- "copy this layout"
- "design my app to look like"
Inputs to collect
- Reference source: local image path, URL, or a text prompt for Gemini Imagegen.
- Target Expo project path (must exist, with running dev server reachable on http://localhost:8081 or a custom port).
- Color palette overrides (optional).
- Match tolerance: tight, moderate, or loose. Defaults to moderate.
Behavior
Stage 1: acquire the reference
- If the user passes an image path or URL, save it as
design/reference.png. - If the user passes a text prompt, call the
gemini-imagegenskill with four variations. The user picks one. Save asdesign/reference.png.
Stage 2: extract assets one at a time
Critical rule: do not request a grid of icons or illustrations from Gemini. Generate each asset in a separate call with the prompt template at assets/prompts/asset-extraction.txt.
- Identify discrete assets visible in the reference (icons, illustrations, backgrounds, buttons, logos).
- For each asset, send a separate Gemini call with: "transparent background, no padding, single subject, vector style matching reference."
- Save each asset under
assets/extracted/<name>.png. - Validate the asset has a transparent background and a clean edge. Reject if the background bleeds.
See references/asset-extraction.md for why grid generation fails.
Stage 3: detect design tokens
- Extract the dominant five-color palette from the reference.
- Identify primary font characteristics (rounded, geometric, serif, monospace).
- Identify spacing density (tight, balanced, generous).
- Write the tokens to
lib/theme.tsin the project. See references/design-tokens.md.
Stage 4: apply assets to the scaffold
- Place extracted assets at the project's
assets/folder. - Update screen components to reference the new assets and the new theme.
- Render the home screen.
Stage 5: screenshot diff loop
- Take a screenshot of the running app via Chrome DevTools MCP at the configured port.
- Compare to
design/reference.png. Compute a perceptual diff. - If the diff is below the tolerance threshold for the chosen match mode, stop.
- If above, generate a structured prompt naming the specific differences (spacing off by 8px, button radius too sharp, accent color saturation low, etc.) and apply changes.
- Loop. Max ten iterations or until the user accepts.
See references/screenshot-loop.md.
Hard constraints
- Never request multiple assets in a single Gemini call. One asset per call.
- Never proceed past stage 2 with assets that have non-transparent backgrounds.
- Never overwrite the user's
lib/theme.tswithout first writing a backup.
Composes with
- Runs after
mobile-app-scaffoldproduces the project tree. - Calls
gemini-imagegenfor mockup variations and asset generation. - Uses Chrome DevTools MCP for the screenshot diff loop.
References
- references/asset-extraction.md - the one-at-a-time generation rule and why.
- references/screenshot-loop.md - how to use Chrome DevTools MCP for visual verification.
- references/design-tokens.md - AiGNITE default palettes, fonts, and spacing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

