ui-mockup-fidelity
UI Mockup Fidelity
Implement mockups with fidelity-first execution and explicit reporting of intentional adaptations.
Quick Start
- Read the mockup and list every visible section, component, and state.
- Identify repeated UI patterns before coding and choose stack-appropriate extraction points (component, partial, include, slot, variant, or primitive).
- Apply the layout and token contract from references/layout-token-contract.md.
- Implement in four passes: structure, extraction, styling, review.
- Run a manual coverage pass using references/mockup-coverage-checklist.md.
- Report exact matches, extracted components, intentional deviations, and unresolved ambiguities.
Rule Tiers
Apply these tiers in order.
Tier 1: Hard constraints
- Use
grid grid-cols-12 gap-(--grid-gap)for layout grids by default. - Preserve section hierarchy and component order from the mockup.
- Keep all major layout blocks present; do not drop sections silently.
- Use explicit background treatment for root and major sections.
- Extract repeated UI into reusable front-end components instead of duplicating large HTML and Tailwind blocks.
- When a pattern appears more than once, default to a shared component or variant API unless the repetition is truly incidental.
Tier 2: Default constraints
- Use project color tokens/classes instead of ad hoc values.
- Match spacing rhythm, alignment, and proportions as closely as possible.
- Match responsive behavior implied by the mockup.
- Match typography hierarchy (size, weight, emphasis, cadence).
- Keep component APIs narrow and composable; prefer props/slots/variants over copy-pasted markup forks.
Tier 3: Flexible constraints
- Adapt micro-spacing or decorative detail when implementation context requires it.
- Preserve visual intent when exact values are unavailable.
- Leave markup inline only when it is genuinely one-off and unlikely to repeat.
Component Extraction Protocol
Before styling repeated UI, decide what should become a reusable unit.
- Extract when the same structure, class cluster, or interaction pattern appears in multiple places.
- Extract when a mockup implies a family of elements such as cards, stats, buttons, feature rows, nav items, badges, or section headers.
- Prefer project-native abstractions: React/Vue/Svelte components, Blade partials/components, template includes, or equivalent primitives.
- Avoid "shared" components that merely wrap a single use site; keep unique compositions local.
- If duplication remains, treat it as a deviation and explain why extraction would have been worse.
Deviation Protocol
Never deviate silently from Tier 1 or Tier 2.
When a deviation is necessary, document it as:
Intentional deviation: what changedReason: why strict adherence was not appropriateReplacement: what was implemented instead
Only deviate when the mockup clearly demands a different approach or when project constraints conflict.
Four-Pass Implementation
- Structure pass:
- Build layout skeleton, section wrappers, and grid placement.
- Confirm 12-column baseline usage unless intentionally deviating.
- Extraction pass:
- Convert repeated patterns into reusable components before finishing markup.
- Define the smallest API that covers current usage without speculative abstraction.
- Styling pass:
- Apply tokens, backgrounds, typography, spacing, borders, and shadows.
- Match stateful elements (hover/active/focus/disabled) when shown.
- Fidelity pass:
- Compare implemented UI against the mockup section by section.
- Check that repeated patterns are centralized rather than duplicated inline.
- Complete the coverage checklist before finalizing.
Output Requirements
Before returning final output, provide:
What matches exactlyWhat components were extractedWhat was adapted(with intentional deviation entries)What needs clarification
If details are ambiguous and materially affect fidelity, ask for clarification instead of guessing.
More from sebkay/skills
generate-agent-instructions
Generate or update AGENTS.md for AI coding agents by extracting project-specific architecture, workflows, conventions, and integration details from the repository. Use when the user asks to create, refresh, or improve AGENTS.md or agent instructions for a codebase.
23add-plan-todos
Create and maintain granular todos in the active execution plan to reduce omissions, sequencing errors, and misunderstandings. Use when drafting a plan, updating scope, starting implementation, or recovering from uncertainty/blockers.
12audit-errors
Audit code for error-handling inconsistencies, anti-patterns, and silent failures such as empty catch blocks, ignored promise rejections, log-and-continue paths, fallback values that hide faults, broad catch clauses, and inconsistent error translation across layers. Use when reviewing controllers, services, jobs, API handlers, async workflows, UI actions, or any change where errors may be swallowed, downgraded, or surfaced unreliably.
9finalise-plan
Stress-test implementation, execution, rollout, migration, or task plans for missing steps, bad sequencing, weak assumptions, hidden dependencies, vague acceptance criteria, and inadequate validation. Use when a plan has just been drafted or revised, when inheriting someone else's plan, before starting implementation, or when a plan needs one last quality pass before execution.
9generate-laravel-agent-instructions
Generate or update `.ai/guidelines/project.md` for Laravel codebases by extracting architecture, domain logic, jobs, workflows, and integration details from repository evidence. Use when the user asks to create, refresh, or improve Laravel-specific agent instructions or project overview guidance.
7update-laravel-project-overview
Update the project overview file with anything not covered.
3