mockup-parity
Skill81 starsChanged 43 days agoMITView on GitHub
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.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- acquia-sourceSkill
- canvas-contributionSkill
- claude-code-mcp-setupSkill
- design-reviewSkill
- drupal-api-endpointsSkill
- drupal-at-your-fingertipsSkill
- drupal-canvas-sdcSkill
- drupal-canvasSkill
- drupal-config-mgmtSkill
- drupal-config-reconcileSkill
- drupal-contrib-mgmtSkill
- drupal-ddevSkill
- drupal-deploy-safetySkill
- drupal-mailSkill
- drupal-performanceSkill
- drupal-search-apiSkill
- drupal-simple-oauthSkill
- drupal-testingSkill
- drupal-views-patternsSkill
- drupal-vite-themeSkill
- ivangrynenko-cursorrules-drupalSkill
- sentry-integrationSkill
- skill-developerSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Fix through primitives: If the delta is in a shared component (SDC), fix the primitive and enumerate ALL its call sites in your report.
- Distinctive: line 22
Tests: Add/update a Playwright spec per route (mandatory for any visually-verifiable change).
- Very specific: line 33
No baseline/snapshot updates to HIDE deltas — snapshots shrink because something was fixed, or grow only with an explicit decision citation …
≈ “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
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)
- 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.
- 🚦 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. - 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).
- 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.
- Verify. Run the
design-reviewskill'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. - 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.
- 🚦 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-reviewreport 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-toplevelbefore 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.
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.

