image-to-frontend
Skill11 starsChanged 10 days agoMITView on GitHub
Turn a product brief, screenshot or reference image into a working frontend page: generate 4 visual variants with the askcodex image CLI, let the user pick one, extract a detailed build spec, build React/Next.js or plain HTML with the chosen image kept in context, and iterate to pixel-close. Also produces matching logos, hero illustrations, product shots and desktop + mobile mockup pairs for many ideas. Trigger on "image to frontend", "build this UI from this image", "make me a landing page", "design and ship this site", "turn this screenshot into code", "generate a mockup", "hazme una landing", "diseña y monta esta página", "convierte este screenshot en código", "genera mockups para esta idea", "maqueta desktop y mobile". Not for a standalone image with no page to build (use askcodex), not for videos (use motion-design), and not for auditing existing UI code against design guidelines.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- motion-designSkill
- compound-knowledgeSkill
- file-todosSkill
- agent-sdk-wizardSkill
- askcodexSkill
- managed-agents-wizardSkill
- metapromptSkill
- goal-loopSkill
- insistirSkill
- remote-agentsSkill
- second-opinionSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Use the prompt template in examples/variant-prompt.md as the quoted prompt: askcodex image create "<prompt>" -o mockups/v1.png.
- Distinctive: line 57
Read the spec; add anything the image omits but the page needs (footer, legal links, secondary CTAs, mobile nav, 404, loading states).
- Distinctive: line 71
Run the dev server and view the page in a browser.
- Very specific: line 72
If a browser annotation tool is available (e.g.
- Distinctive: line 81
One call = one image: Never ask for "4 variants in one call".
- Distinctive: line 84
Errors, quota, auth, reference-file limits: follow the askcodex skill.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Image → Frontend (images via askcodex)
End-to-end workflow: brief → 4 visual variants → chosen variant → detailed build spec → real frontend code → iterate to pixel-close.
Images come from the askcodex CLI. Before the first image call, call the Skill tool with askcodex: it owns install, auth, flags, output handling and error rules. This skill only uses two command shapes: askcodex image create "<prompt>" -o <file>.png and askcodex image edit "<prompt>" -i <ref>.png -o <file>.png.
The image model is strong at photorealistic web/mobile app screenshots, accurate text rendering, world knowledge, and identity preservation across edits. But ~3 in 4 attempts fail to closely replicate a complex reference without strategy. Follow the steps; do not shortcut.
Step 1 — Brief
Collect from the user (or draft and confirm):
- Business / product name and one-line pitch
- Audience and tone (expert + grounded? playful? minimal?)
- Primary CTAs (book a call, sign up, try demo)
- Aesthetic preferences, palette, vibe references
- Type (SaaS dashboard, marketplace landing, personal site, mobile app, infographic)
- Existing brand assets, icons, color tokens (paths)
Ambiguity is fine in step 2 — it surfaces options. Explicit direction massively improves variant quality.
Step 2 — Generate 4 stylistic variants
Fire 4 askcodex image create calls in parallel (background Bash calls in one message), each with a distinct visual direction (e.g. editorial-serif, bento grid, glass-morphism, brutalist-mono). Same brief, different style. Save to mockups/v1.png … mockups/v4.png.
Use the prompt template in examples/variant-prompt.md as the quoted prompt: askcodex image create "<prompt>" -o mockups/v1.png. Verify outputs with file mockups/v*.png. Read each PNG with the Read tool to view, then show the variants to the user.
Step 3 — Image → detailed build spec
Once the user picks a variant, do not jump straight to "build it." Generate a meticulous build spec from the chosen image. Pass the PNG to a strong code/vision model and ask it to enumerate:
- Layout regions and grid structure
- Spacing scale (px values for gaps, padding, max-widths)
- Font family (display + body), weights, approximate sizes
- Color stops, gradients (with hex), accent uses
- Container widths, border radii, shadows
- Icon set / icon style
- Hover/active/focus states (inferred)
- Responsive breakpoints — what reflows at <1024 / <720 / <480
- Copy snippets exactly as rendered
Read the spec; add anything the image omits but the page needs (footer, legal links, secondary CTAs, mobile nav, 404, loading states).
Step 4 — Build, with the image fed back into context
Pass BOTH the spec AND the original PNG into the implementation step. Instruct:
Build the frontend exactly as outlined. While building, regularly refer back to the original image to check the work. Loop: build → diff against image → fix discrepancies → repeat. Carefully match spacing, font, icons, logos, layout, and text. Execution over speed. Accuracy over efficiency. Make sure it works on mobile.
The image-in-context is the load-bearing part — without it, output drifts.
Step 5 — Annotate & iterate
The first build will not be pixel-perfect. Expect ~5–10 follow-ups for spacing, font, SVGs, copy fit. Best practice:
- Run the dev server and view the page in a browser.
- If a browser annotation tool is available (e.g. the
agent-browserskill), highlight specific elements and batch all fixes into one prompt rather than trickling them. - Each round should be visibly closer; if not, prompts are ambiguous — be more concrete (px values, hex codes, exact copy).
Step 6 — Personalize and extend
Once the visual style locks, the same image model also generates: logos, hero illustrations, product shots, supporting imagery, infographics, slide artifacts — separate askcodex image create / askcodex image edit calls. Keep style consistent by passing the chosen v{N}.png as a reference (askcodex image edit "..." -i mockups/v{N}.png -o out.png) and saying "use the same style/palette/typography as the input image." For motion, hand stills off to an image-to-video tool.
Hard rules for this flow
- One call = one image. Never ask for "4 variants in one call"; fire 4 calls in parallel. Put composition (landscape desktop viewport, mobile portrait framing) in the prompt wording, not in flags. Exact size and transparency are not guaranteed; see
references/sizing.md. - Parallelize: 6–8 concurrent
askcodex image createprocesses have worked in practice. - Always pass an explicit
-opath inside the project (mockups/…). Verify withfile path.png. - Errors, quota, auth, reference-file limits: follow the askcodex skill. Do not loop on a failing call.
- Read PNGs early with the Read tool — catch style drift at variant #1, not at image #28.
Additional Resources
Reference Files
references/prompt-engineering.md— phrasing rules across structure, text rendering, photorealism, composition, constraints/preserve-lists, multi-image inputs, and iteration.references/sizing.md— composition wording per artifact, and how to hit exact pixel sizes with a local crop/resize.references/use-cases.md— secondary use case (batch desktop+mobile mockup pairs across many ideas) plus tertiary use cases: logos, ads, edits/try-on, style transfer, character consistency, in-image translation, product mockups on plain backgrounds.
Examples
examples/variant-prompt.md— Step 2 per-variant prompt template (4 parallel calls).examples/batch-pair-prompt.md— desktop + mobile pair template for the secondary batch case.examples/mvp-handoff-prompt.md— inline prompt to hand off a single idea's clean-MVP frontend implementation (mockup PNGs + brief → one deployable page). Built for the batch case where many ideas each need their own MVP page.
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.

