Read Screenshot
Use this skill when screenshots are the design source of truth. Goal: reconstruct the component with strict mobile + desktop visual parity.
Mandatory Execution Rules
- •Read this file before acting.
- •Execute all workflow steps in exact order.
- •Execute all sub-bullets under each step.
- •Do not skip, combine, or reorder steps.
- •If blocked or input is missing, ask and wait.
- •When done, return to
build-component.
Trigger
Run this skill when build-component handles a screenshot-driven component request.
If both Figma and screenshots are provided, Figma values are canonical; screenshots are for visual validation.
Required Inputs
Collect before implementation:
- •Two screenshots:
- •one mobile,
- •one desktop.
- •Placement target:
- •
article.htmlinside<article>wrapped in<div class="article-component">, or - •
index.htmlinside<main>wrapped in<div class="frontpage-component">.
- •
- •Source theme when relevant:
- •
tv2Oj,tv2Nord,tv2Syd,tv2Fyn,tv2East, orkosmopol.
- •
- •Viewport assumptions (default, unless user says otherwise):
- •first screenshot is mobile viewport at
390pxwidth, - •second screenshot is desktop viewport at
1728pxwidth.
- •first screenshot is mobile viewport at
If any required input is missing, ask before implementation.
Viewport Calibration Rules (Non-Negotiable)
- •Assume screenshot order by default:
- •screenshot 1 = mobile (
390pxwide), - •screenshot 2 = desktop (
1728pxwide).
- •screenshot 1 = mobile (
- •Use these viewport widths to estimate element dimensions:
- •derive proportional widths, spacing, and typography scale from the screenshot-to-viewport ratio,
- •validate derived sizes across both mobile and desktop before finalizing CSS values.
- •Only deviate from these viewport defaults when the user explicitly provides different viewport sizes.
Extraction Rules (Non-Negotiable)
- •Capture all visible details from both screenshots:
- •layout, spacing, alignment, sizing, typography, colors, borders, radii, shadows, overlays, icons, and responsive behavior.
- •Scan screenshots for visible text content before implementation:
- •extract all readable copy (headlines, body, labels, quotes, captions, metadata, CTA text),
- •preserve original wording and punctuation when legible,
- •if text is partially unreadable, mark uncertain fragments explicitly as assumptions.
- •Convert extracted text into semantic HTML based on editorial meaning:
- •use tags that match intent (
h*,p,blockquote,figcaption,time,a,button, etc.), - •avoid generic wrappers (
div,span) when a semantic element fits, - •document ambiguous cases and why a semantic choice was made.
- •use tags that match intent (
- •No guesswork without disclosure:
- •if a value is uncertain, state the assumption and mark as potential delta.
- •Preserve semantic HTML.
- •Keep CSS fully scoped to the component.
- •Use existing tokens first.
- •Token mapping is required for screenshot builds:
- •colors: tokenized by default,
- •typography: tokenized family, size, weight, line-height by default via semantic typography tokens,
- •apply typography/color tokens that match the chosen semantic role (for example quote text -> quote tokens, metadata -> meta tokens),
- •typography must prefer semantic token usage (for example
font: var(--news-sys-typography-quote)) over legacy--font-*aliases in component CSS, - •when a semantic typography token is applied, do not override
font-size,font-weight, orline-heightunless absolutely required and documented as a delta, - •hardcoded fallback only when token coverage is missing, and document each exception.
Workflow (Execute In Order)
- •Inspect both screenshots and list observable primitives:
- •frame/grid, blocks, spacing rhythm, type scale, color palette, effects, edge treatments.
- •Run a text extraction pass:
- •list all detected text strings by region/role,
- •classify each string by semantic intent (headline, paragraph, quote, caption, metadata, control label, etc.).
- •Derive DOM plan:
- •map visible regions to semantic containers before CSS.
- •Implement HTML first using the semantic mapping from step 2.
- •Implement CSS in passes:
- •Pass 1: layout + geometry,
- •Pass 2: typography + spacing (semantic token-mapped first),
- •Pass 3: color + effects (token-mapped first),
- •Pass 4: responsive adjustments.
- •Run visual match pass:
- •compare mobile and desktop against screenshots,
- •iterate until mismatch is minimal.
- •Run self-review pass again:
- •re-check both screenshots after latest edits,
- •if mismatch remains, loop back to HTML/CSS refinements.
- •Report deltas:
- •only remaining, non-removable deltas with exact reason.
1:1 Acceptance Criteria
Accepted only when all are true:
- •Visual parity: geometry/layout match mobile and desktop.
- •Typographic parity: family, size, weight, line-height, spacing match.
- •Color/effect parity: backgrounds, text, borders, shadows, opacity/effects match.
- •Token compliance: colors + typography tokenized by default; any hardcoded exceptions documented.
- •Structural quality: semantic HTML + scoped CSS.
- •Transparent assumptions: all uncertain values documented.
Output Requirements
When reporting completion, include:
- •What was recreated from screenshots.
- •Files changed.
- •Assumptions made.
- •Remaining deltas and exact reason they cannot be removed.