mockup-parity

GitHub

将静态HTML原型转换为Drupal Twig/SDC主题路由的标准化流程,通过差异分类与双门控审查确保视觉一致性与功能完整性。

skills/mockup-parity/SKILL.md grasmash/drupal-claude-skills

Trigger Scenarios

将静态HTML原型移植到Drupal路由 调整现有路由以匹配设计稿 执行界面重绘或一致性校验任务

Install

npx skills add grasmash/drupal-claude-skills --skill mockup-parity -g -y
More Options

Use without installing

npx skills use grasmash/drupal-claude-skills@mockup-parity

指定 Agent (Claude Code)

npx skills add grasmash/drupal-claude-skills --skill mockup-parity -a claude-code -g -y

安装 repo 全部 skill

npx skills add grasmash/drupal-claude-skills --all -g -y

预览 repo 内 skill

npx skills add grasmash/drupal-claude-skills --list

SKILL.md

Frontmatter
{
    "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."
}

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.

Version History

  • 19514f4 Current 2026-10-19 07:29

Same Skill Collection

skills/acquia-source/SKILL.md
skills/canvas-contribution/SKILL.md
skills/claude-code-mcp-setup/SKILL.md
skills/design-review/SKILL.md
skills/drupal-api-endpoints/SKILL.md
skills/drupal-config-reconcile/SKILL.md
skills/drupal-ddev/SKILL.md
skills/drupal-mail/SKILL.md
skills/drupal-search-api/SKILL.md
skills/sentry-integration/SKILL.md
skills/skill-developer/SKILL.md
skills/drupal-at-your-fingertips/SKILL.md
skills/drupal-canvas-sdc/SKILL.md
skills/drupal-canvas/SKILL.md
skills/drupal-config-mgmt/SKILL.md
skills/drupal-contrib-mgmt/SKILL.md
skills/drupal-deploy-safety/SKILL.md
skills/drupal-performance/SKILL.md
skills/drupal-simple-oauth/SKILL.md
skills/drupal-testing/SKILL.md
skills/drupal-views-patterns/SKILL.md
skills/drupal-vite-theme/SKILL.md
skills/ivangrynenko-cursorrules-drupal/SKILL.md

Metadata

Files
0
Version
19514f4
Hash
b8911421
Indexed
2026-10-19 07:29

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-01 11:53
浙ICP备14020137号-1