bitovi/ai-enablement-prompts/pixel-perfect
Claude Code and agent skill by bitovi/ai-enablement-prompts
- community
Checking that the SKILL.md file is still in the repository.
Orchestrate a complete visual QA workflow to make a dev/Storybook page match a baseline URL pixel-for-pixel. Combines the visual-diff skill (screenshot comparison) with the computed-styles skill (CSS property extraction) in a loop until the pages match. Use when replicating a production page, matching a design reference, or achieving pixel perfection on a component.
Install
npx vskill@latest install bitovi/ai-enablement-prompts/pixel-perfectSKILL.md
Skill: Pixel-Perfect Orchestration
Drive a page or component to pixel-perfect fidelity with a baseline by orchestrating visual-diff (screenshot comparison) and computed-styles (CSS property extraction) in a converging loop.
When to Use
- Replicating a production page's look in the local codebase
- Matching a Storybook component to a live reference
- Any task where the user says "make it match" or "pixel perfect"
When NOT to Use
- Building new designs from scratch (no baseline exists)
- Content-only changes with no visual target
- Figma-based design work (use the Figma MCP skill instead)
Prerequisites
- All prerequisites from the
visual-diffandcomputed-stylesskills are met - The baseline URL and current URL are known
- The dev server or Storybook is running
Design System
All fixes must use the Bitovi design token system defined in src/styles/bitovi-theme.css. Prefer token-based Tailwind classes over arbitrary values. Only use [arbitrary] syntax when no matching token exists in the theme.
Workflow Overview
Detailed Steps
Step 1: Initial Visual Diff
Load the visual-diff skill and run the full workflow:
- Screenshot the baseline at desktop breakpoint (1280x720)
- Screenshot the current page at the same breakpoint
- Run
node scripts/visual-diff.mjsto produce the diff image and JSON stats - View the diff image through the HTTP server + Playwright vision
- Record the
diffPercentand identify which regions (top, middle, bottom) have red clusters
If `diffPercent` < 2%, the pages are effectively matching. Report success and stop.
If `diffPercent` >= 2%, proceed to Step 2.
Interpreting the Diff Image
Map red clusters to specific DOM regions:
| Red cluster location | Likely DOM region | Example | |
|---|---|---|---|
| Top band | Navigation bar | Height, padding, logo, nav items | |
| Below nav | Hero section | Font sizes, spacing, background | |
| Middle grid | Card layout | Card sizing, gaps, typography | |
| Bottom | Footer | Link colors, spacing, background | |
| Full-width bands | Container width | Max-width, padding differences | |
| Scattered dots only | Font rendering | Usually acceptable, not actionable |
Step 2: Computed Style Extraction
Load the computed-styles skill. Based on the regions identified in Step 1:
- Plan extraction targets: Map each red region to specific DOM elements and CSS properties
- Extract from baseline: Use
mcp_playwright_browser_evaluateon the baseline URL - Extract from current: Use
mcp_playwright_browser_evaluateon the current URL (remember the Storybook iframe pattern if applicable) - Build diff table: Compare every property, flag mismatches
- Fix mismatches: Apply Tailwind classes — always resolve computed values to design tokens from
src/styles/bitovi-theme.cssfirst (see the Design System section above). Only use[arbitrary]values when no token matches. - Verify each fix: Re-extract from current to confirm the computed value now matches
Prioritization
Fix differences in this order (highest visual impact first):
- Layout: width, height, maxWidth, padding, margin, display, flexDirection
- Typography: fontSize, fontWeight, fontFamily, lineHeight, letterSpacing
- Colors: color, backgroundColor, borderColor
- Decoration: borderRadius, boxShadow, opacity
- Fine-tuning: textTransform, gap, overflow
Step 3: Re-Diff
After fixing a batch of computed style differences:
- Re-screenshot only the current page (baseline hasn't changed)
- Re-run the pixel diff
- View the new diff image
Evaluate progress:
| New diffPercent | Action | |
|---|---|---|
| < 2% | Done. Report final stats. | |
| Decreased significantly | Good progress. If > 2%, identify remaining red regions and loop back to Step 2. | |
| Unchanged or increased | Something went wrong. Check that fixes actually applied (Tailwind theme overrides, specificity conflicts). Use computed-styles to verify. |
Step 4: Convergence
Continue the loop (Steps 2-3) until diffPercent < 2% or the remaining differences are confirmed to be not worth further pursuit.
Stop and flag for manual review — do NOT keep iterating on these:
- Sub-pixel font rendering (different OS/browser/font-smoothing)
- Anti-aliasing artifacts (icon edges, curved borders)
- Pixel-level positioning offsets (elements within 1–3px of correct position)
- Shadow or gradient rendering variance
- Third-party embedded content (reCAPTCHA, chat widgets, analytics overlays)
- Dynamic content (timestamps, user-specific data, live chat, cookie banners)
- Differences that require non-Tailwind workarounds or browser-specific hacks
When stopping for one of these reasons, clearly state:
- What the remaining diffPercent is
- Which specific element(s) are causing it
- Why it is not worth automating further
- What the user could do manually to address it
Using Subagents
For complex pages with many regions to fix, use subagents to parallelize investigation:
Investigation Subagent
Use the Explore agent to research element structures before extracting styles:
Extraction Pattern
When extracting styles, do both pages in sequence (not parallel, since Playwright MCP shares one browser):
- Navigate to baseline → extract → store results
- Navigate to current → extract → store results
- Compare in conversation context
Breakpoint Strategy
Always run the pixel-perfect loop at all three breakpoints:
| Breakpoint | Width | Height | Order | |
|---|---|---|---|---|
| Desktop | 1280 | 720 | 1st — fix base layout here first | |
| Tablet | 768 | 1024 | 2nd — fix responsive breakpoint issues | |
| Mobile | 375 | 667 | 3rd — fix mobile-specific issues |
Workflow:
- Run the full visual-diff + computed-styles loop at desktop until
diffPercent < 2% - Then run at tablet — resize viewport, re-screenshot both sides, diff, fix, re-diff
- Then run at mobile — same process
Fix desktop first so you're not chasing responsive issues against a broken base layout. Each breakpoint has its own screenshot files (e.g. temp/vdiff-baseline-tablet.png, temp/vdiff-current-tablet.png, temp/vdiff-diff-tablet.png).
Component-scoped comparison at smaller breakpoints: Re-measure the component height at each breakpoint (it will change) and resize the viewport accordingly before screenshotting.
Session Notes
Keep a running log of what was fixed and verified. This helps avoid re-checking properties and provides a summary at the end.
Use session memory (/memories/session/) to store:
- The diff table with baseline vs current values
- Which properties have been fixed and verified
- Current diffPercent after each round
Success Criteria
| Level | diffPercent | Description | |
|---|---|---|---|
| Pixel perfect | < 1% | Only sub-pixel rendering differences remain | |
| Excellent match | 1–2% | Minor font rendering, anti-aliasing, or shadow differences — stop here | |
| Good match | 2-5% | Small spacing or color differences worth fixing | |
| Needs work | > 5% | Significant visual differences still present |
The default target is < 2%. Stop and report as soon as this threshold is met — do not keep iterating to squeeze from 1% to 0% unless the user explicitly asks. Flag remaining issues that fall into the "hard to align" bucket (font rendering, sub-pixel spacing, third-party overlays) and let the user decide whether to fix them manually.
Example Session
Cleanup
After the session:
All computed style data lives in conversation context and session memory only.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/playwright/skills/pixel-perfect/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 4 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bitovi/ai-enablement-prompts/pixel-perfect)