---
name: mockup-parity
description: "Workflow for porting static HTML mockups into themed Drupal Twig/SDC routes without dropping working capabilities: a two-gate reconciliation process, per-delta classification (style, structural, or conflict with a prior decision), fixing through shared components, and a Playwright-verified visual diff ledger. Use when porting a mockup screen into a route, conforming an existing route to its mockup, or executing any parity or reskin work item. Load alongside design-review."
title: mockup-parity
canonical_url: https://skilld.dev/gh/grasmash/drupal-claude-skills/mockup-parity
last_updated: 2026-10-02T12:03:00.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install grasmash/drupal-claude-skills/mockup-parity`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/mockup-parity`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/grasmash/drupal-claude-skills/mockup-parity) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/mockup-parity`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/mockup-parity --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/mockup-parity --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Mockup Parity (Twig/SDC)

The reskin goal: build a themed route that is as true to the approved static mockup as possible, without dropping any working capability. Judgment is required — the mockup is binding canon for *visuals*, not license to remove functionality it happens not to show.

This skill assumes a canon of static HTML mockups plus a single CSS token source (e.g. Tailwind `@theme` tokens emitted by the mockup generator), with Playwright as the verification tool. The two-gate discipline below is a lightweight process, not tooling.

## Order of operations (per screen)

1. **Read the canon.** The route/screen inventory → the screen's mockup HTML (BOTH themes, via the class-toggle strategy the mockups use) → the mockups' CSS token source for exact values (hex, px, radius, weight) — read it for numbers, don't eyeball a screenshot.
2. **🚦 GATE 1 — reconciliation sheet.** Before implementing, write a discrepancy sheet: one row per difference between the mockup and the current themed route (if one already exists) or per element to build (if new). For each, a call (`match mockup` / `keep existing` / `hybrid`) + reason. Do a **visual-element inventory, not just a capability inventory** — walk the mockup HTML and the current route top-to-bottom and list every visible element; for each, diff **presence** (in both / extra / missing), **size** (read exact px from the token source), **surface fill** (background/border colors — token names, not raw hex), **icon** (glyph family + name), and **position**. This is what catches missing empty-state icons, wrong logo scale, and missing surface fills that a holistic glance misses. Present the sheet; get the operator's approval before implementing (queue it through your project's async decision channel if the operator isn't available synchronously). Surface any app-wide design-system decisions (font, palette) separately — they set rules for all screens, not just this one.
3. **Classify every delta before fixing:**
   - **style** (font/color/spacing/radius) → conform to the mockup, via design tokens and existing shared components ONLY. A mockup value with no matching token is a decision (raise it), not a license for a raw literal — an asset guard should catch bypassed tokens.
   - **structural/capability** (element on one side only) → NEVER delete a working capability to match a mockup. Mockup-missing elements are mockup-update candidates (flag for the mockup, not the app); app-missing elements need explicit approval before adding (no speculative affordances — the mockup is canon for what a screen currently must show).
   - **conflict with a prior decision** (a documented plan/ADR ruling) → HOLD, list it, don't average the two. Mockups usually win — but not against an explicit prior decision (check decision history before "fixing" something a prior ruling made deliberate).
4. **Fix through primitives.** If the delta is in a shared component (SDC), fix the primitive and enumerate ALL its call sites in your report. Never fork a local one-off lookalike.
5. **Verify.** Run the `design-review` skill's Phase 1-7 pass for anything user-visible beyond a pure token swap: browser screenshots at the project's binding breakpoints (e.g. 1280 and 390), both themes. Build a **visual diff ledger**, not a glance: go element-by-element top-to-bottom and note, for each, screenshot-vs-mockup on **presence, size, surface fill, icon, position, shadow, and spacing** — pull the COMPLETE style set from the token source for each element, not just the headline property. Only "match / acceptable delta / FIX" per row. **Measure the visual gap in the screenshot vs. the mockup** — don't assume a token value reproduces the mock's look by inspection alone; some HTML elements have intrinsic spacing that makes a nominally-correct token render differently than expected. Scroll the full screen.
6. **Tests.** Add/update a Playwright spec per route (mandatory for any visually-verifiable change). Dark mode toggled in-spec via the class strategy. Empty/error state specs assert headings/CTAs render.
7. **🚦 GATE 2 — review packet.** Before declaring the screen done, present: before/after screenshots per theme, the reconciliation recap from Gate 1, any capability/behavior-change flags, Playwright status, and **recommendations (a11y / performance / UX)** noticed but NOT silently applied — the operator accepts or defers them explicitly. This is the `design-review` report structure, reused as the Gate 2 packet.

## Test rule (behavior-preserving → characterization)

When a change is meant to be purely visual (a reskin, not a feature change), the proof no capability was dropped is a test that passes BEFORE and AFTER the change — not a new test that only goes green after (that's evidence you changed behavior, not preserved it). Write/confirm the test passes on current code before starting; re-run it after. An intentional behavior change approved at Gate 1 uses normal red → green TDD instead and gets marked intentional in the commit.

## Hard rules

- Both themes, always, every step.
- Worktree discipline: never write outside the current worktree; confirm `git rev-parse --show-toplevel` before mutating if working across multiple worktrees in one session.
- No baseline/snapshot updates to HIDE deltas — snapshots shrink because something was fixed, or grow only with an explicit decision citation (see `design-review`'s screenshot-baseline convention).
- Cross-breakpoint: match at the binding widths (e.g. 1280 and 390); don't chase pixel equality at other widths — flex/relative elsewhere.
- Report format: delta table before/after per theme + held-conflict list + shared-component call-sites-swept list + Playwright results. Machine numbers, not adjectives.
