The prompt
Generate code for a web page that looks exactly like the provided screenshot(s).
{selected_stack}
{design_system_block}
## Replication instructions
- Make sure the web page looks exactly like the screenshot.
- Use the exact text from the screenshot.
- Since our goal is to make the web page look as close to the screenshot as possible, we need to extract the exact image assets where possible and generate images for the assets that are not extractable.
- Extracting assets can be done with the extract_assets tool. After extracting assets, make sure to inspect the extracted image closely to ensure that it is what we want.
- When available, use edit_images for asset edits such as removing unwanted elements, batching independent edits into one call.
- If an extracted or supplied asset is visibly low-resolution or pixelated and must render larger, upscale it with edit_images—not CSS stretching or generate_images.
- If an asset in the original screenshot is not extractable (for example, occluded by other objects or is the background), when available, use generate_images to create image URLs from prompts (you may pass multiple prompts).
- {image_policy}
## Multiple screenshots
If multiple screenshots are provided, organize them meaningfully:
- If they appear to be different pages in a website, make them distinct pages and link them.
- If they look like different tabs or views in an app, connect them with appropriate navigation.
- If they appear unrelated, create a scaffold that separates them into "Screenshot 1", "Screenshot 2", "Screenshot 3", etc. so it is easy to navigate.
- For mobile screenshots, do not include the device frame or browser chrome; focus only on the actual UI mockups. What it is
The user message that asks a vision model to build a web page that looks exactly like the given screenshots, with rules for exact text, asset extraction and what to do with several screenshots. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the screenshot-to-code repository (MIT licence, Copyright (c) 2023 Abi Raja). Licence: https://github.com/abi/screenshot-to-code/blob/main/LICENSE. Original author: Abi Raja (abi/screenshot-to-code). Changes by FoxaMind: Python string quotes removed and the code indentation removed; placeholders keep the source syntax.
Who it's for
- Front-end developers
- Designers turning mockups into code
رسالة المستخدم التي تطلب من نموذج رؤية بناء صفحة ويب تطابق لقطات الشاشة المرفقة تمامًا، مع قواعد للنصوص والصور ولحالة عدة لقطات.
Tips
- The source builds this text in code: {selected_stack}, {design_system_block} and {image_policy} are filled in by the app, and any extra user text is appended after "Additional instructions:".
- In the source the screenshots are sent as high-detail images in the same message.
- The asset rules mention tools (extract_assets, edit_images, generate_images); adapt or delete those lines if your setup has no such tools.
- It is meant to be used with the front-end agent system prompt from the same repository.