Communitygithub.com

mockup-sheet

>- Turn a product idea plus reference websites into a full UI design sheet: a DESIGN.md, one shared CSS file, and a screens.html that renders every page of the website and/or app as working mock-ups in phone and desktop frames, with day/night themes, a playable motion lab, and headless-browser checks. Use this whenever someone wants mock-ups, a design sheet, a style guide or design system drawn from sites they like ("decompose these sites into a style", "make it look like X", "render each page as an example", "a site and an app that share one style"), wants to explore or iterate on screens before building, or asks to test animations and interactions in a mock-up, even if they never say "design sheet".

O que é mockup-sheet?

mockup-sheet is a Claude Code agent skill that >- Turn a product idea plus reference websites into a full UI design sheet: a DESIGN.md, one shared CSS file, and a screens.html that renders every page of the website and/or app as working mock-ups in phone and desktop frames, with day/night themes, a playable motion lab, and headless-browser checks. Use this whenever someone wants mock-ups, a design sheet, a style guide or design system drawn from sites they like ("decompose these sites into a style", "make it look like X", "render each page as an example", "a site and an app that share one style"), wants to explore or iterate on screens before building, or asks to test animations and interactions in a mock-up, even if they never say "design sheet".

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Zeos-ctrl/mockup-sheet-skill/tree/HEAD/mockup-sheet

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Mock-up sheet

Builds a design sheet the user can open from the file system and react to: every screen drawn as a real HTML mock-up, each with a short note on why it looks that way. The sheet is the conversation; expect many rounds of "change this", and make each round cheap.

Deliverables, in a design/ folder (or wherever the user keeps design work — look for an existing sheet first and match its format):

FileWhat it is
DESIGN.mdThe concept, what was taken from each reference, tokens, type, layout, components, states, motion, open questions
<name>.cssOne stylesheet for every surface (site and app), with tokens for light and dark
screens.htmlEvery screen as a frame, grouped, with a note under each title; a top bar to jump and switch theme
check-*.sh / .mjsScripts that prove the non-trivial bits work (interactions, generated graphics)

Start from assets/screens-template.html. It already has the frame system (each page as a 1920×1080 desktop frame with its phone version beside it), theme switch, jump menu, actual-size toggle and the motion-lab bench system. Copy it and assets/app-template.css into the project and rename. Paths to scripts/ and assets/ in this file are relative to this skill's own folder; scripts need Python 3 with Pillow, Node 22+, and Chromium or Chrome.

Read references/house-style.md first. It is the user's standing style: palette, radius, charts, page layout, motion, wording and phone navigation. Apply it by default; the references and the user's requests for this project win where they differ, and anything new they settle goes back into that file.

1. Understand the idea before the look

Work out what the product is saying before choosing fonts. A design sheet is strongest when the visual system carries the concept: in the project this skill came from (a shop selling commute poems as a critique of work), the design became "two voices" (mono uppercase for the shop, serif for the person), a receipt as the product image, prices computed from words, and receipts that age. Ask only what you can't infer; otherwise state your reading of the concept in a sentence and build.

If the user has an earlier design sheet in another folder, read it first and copy its structure and conventions: consistency across their projects matters more than your preferences.

2. Decompose the references from their real code

Summaries of a page (WebFetch and similar) lose exactly what you need: fonts, colour values, sizes, grids. Fetch the raw HTML and CSS instead:

python3 scripts/extract_style.py https://example.com https://other.example

It prints, per site: title, fonts (font-family and @font-face), colours by frequency, font sizes, letter-spacing, text-transform, grid templates, CSS custom properties, and visible text. Read the markup of a key component (a product tile, the nav) for structure. For image references (a photo whose backdrop or texture the user likes), download the image, look at it, and sample it:

python3 scripts/sample_image.py ref.jpg            # mean colour and noise per region, plus a zoomed crop

Write down, per reference: type, colour, layout and grid, components, motion, and tone of copy. Then decide what to take from each and say why. A table "idea → where it shows up" in DESIGN.md keeps the concept honest.

3. Build the system

  • Tokens first, on :root, redefined for dark under @media (prefers-color-scheme: dark) guarded by :root:not([data-theme="light"]) and again under :root[data-theme="dark"], so the sheet's theme switch works.
  • One root class (e.g. .soul) that sets font, colour and background for a frame, so frames don't inherit sheet styles.
  • Reset buttons with :where() (.root :where(button,input){…}) — a plain .root button reset outranks .btn and silently makes every styled button invisible.
  • Components sized in em where one component appears at many sizes (a thumbnail and a hero): set font-size on the component and everything scales.
  • Free fonts that match the references (Google Fonts) in the sheet; note any paid original and suggest self-hosting for production (privacy and image export both need it).

4. Build the sheet

In screens.html, each screen is one call:

add(group, id, title, note, html, kind)   // kind: 'win' (desktop + phone, default) | 'ph' (phone only) | 'long' (phone, full height) | 'raw' (no frame)

Frames are drawn at real size and scaled. A win page is laid out at 1920×1080 (a full HD screen) and scaled down to fit the sheet, so what the user sees is what a real screen gets, and building the UI is just dropping the scale. The phone version sits beside it at the same height: an iPhone-sized 393×852 screen with the status bar either side of the Dynamic Island, a home indicator, and a bezel. On a narrow window the phone drops below. The top bar's actual size button shows frames 1:1. fitFrames() sets --fw, --s and --ps; don't hard-code frame sizes elsewhere.

  • The phone is the same markup with phone rules, scoped under .m in the app stylesheet: one column, stat tiles two across, tables trimmed to their key columns, charts redrawn at phone width, desktop-only extras hidden. One add() gives both, so they never drift apart. Use ph only for screens that exist only on the phone.

  • Safe areas: nothing in the top 59px (status bar and island) or the bottom 34px (home indicator). Floating controls sit above the home indicator, and scrolling pages get bottom padding so nothing hides under them.

  • Fill the frame. At 1920×1080 short pages look empty; give them a summary column or analysis rather than leaving the bottom blank (see the house style). Measure it: share of each page body below the lowest content.

  • Write screens as small JS template functions (nav(), card(), receipt()…) over realistic sample data, so a change to a component updates every frame.

  • The note matters as much as the frame. One short paragraph: what the screen is for, the decision it shows, and why. Plain English, no jargon; bold the one idea to notice.

  • Groups in order: System (palette, type, the key component at several sizes, state strips), Motion lab, then each surface's pages (each one a desktop + phone pair), then phone-only screens (navigation, sheets).

  • Draw states, not just happy paths: empty, loading, error, full, offline, first run, 404, coming soon.

  • Write real copy. Instructions on screen are plain English sentences ("Press and hold the button. It takes about 30 seconds. Let go to pause.") — users notice and object to jargon.

  • Don't publish the user's private details in mock data (exact commute times, stations, real names).

Motion lab

Every animation gets a playable bench (bench(name, title, stage, controls, note) in the template) with its own RESET, so the user can feel timing instead of reading about it. Wire each in WIRE[name](benchEl); reset re-renders and re-wires. Real interactions (hold, drag, drop) are built for real with pointer events here — the bench becomes the reference implementation for production. Offer test speeds (1×/4×) for anything slow.

5. Verify by looking, every round

Render and look at the frames you changed before reporting. Don't trust the code to look right.

# screenshot specific frames (selectors, theme, optional press-and-hold first)
sh scripts/run-chromium.sh design/screens.html node scripts/shot.mjs \
  '[{"sel":"#home .fit","out":"/tmp/home.png"},{"sel":"#home .phone","out":"/tmp/home-phone.png","theme":"dark"},{"sel":"#home .pair","out":"/tmp/both.png"}]'

BROWSER=/path/to/chrome picks the browser (Playwright's chrome-headless-shell works well). Screenshots wait SHOT_WAIT ms (default 1500) after scrolling, so load motion has finished, then measure again before capturing. The launcher exits with the check's own status. Desktop and phone share markup, so checks that walk every frame should scope to .fit .win (desktop) or .phone .win (phone) explicitly.

Then read the PNGs. For interactions, copy scripts/cdp.mjs next to the sheet and write a check script on it (start from scripts/check-template.mjs): real mouse events, then assertions on the DOM, printing PASS/FAIL. Keep it in the project and rerun it after every change to that area.

For non-visual outputs, verify with the real consumer (e.g. decode a generated barcode with zbarimg).

6. Each round with the user

  1. Make the change in the CSS / template functions, not per frame.
  2. Render and look; fix what's off.
  3. Update DESIGN.md (tokens, component table, notes) so it never disagrees with the sheet.
  4. Report briefly: what changed, what you checked, anything you couldn't check, and any decision you made on their behalf (with how to reverse it).

When something the user asks for has a catch (an accessibility loss, a privacy leak, a scannability limit), build it and say so in one line, with the fallback you kept (e.g. keep a THROW AWAY button when adding drag-to-bin).

Pitfalls seen in practice

Read references/pitfalls.md when something renders blank, half-animated, or invisible — it lists the specific browser and headless-capture traps (data-URI quoting inside style="", mask clipping drop-shadow, rAF loops freezing --virtual-time-budget, viewport vs page coordinates in CDP clips, clip-path morph vertex counts, and more).

Habilidades Relacionadas