Perform automated visual design inspection using Playwright MCP...
This skill automates visual quality assurance for the blog using Playwright MCP. It ensures all UI changes maintain the terminal aesthetic, avoid generic AI-generated looks, and remain consistent across devices.
Use PROACTIVELY for ALL visual/design changes:
Do NOT wait for the user to ask. This skill should be your first step after implementing any UI change.
.claude.json (already set up for this project)localhost:4321 (pnpm dev)IMPORTANT: Track whether the server was already running before starting it. You will need this information at the end to know whether to stop the server.
Check if the dev server is already running on localhost:4321:
node .claude/skills/visual-inspection/scripts/visual-inspection.js check-server
Note the result:
SERVER_WAS_ALREADY_RUNNING = trueSERVER_WAS_ALREADY_RUNNING = false, then start it:node .claude/skills/visual-inspection/scripts/visual-inspection.js start-server
The start-server command will wait for the server to be ready before returning.
For each page you need to inspect (e.g., homepage /, blog index /blog/, individual posts /blog/post-slug/):
Desktop (1280px width):
Use browser_navigate to go to http://localhost:4321/path
Use browser_resize to set viewport width=1280, height=800
Use browser_take_screenshot with filename=".playwright-mcp/screenshots/desktop-pagename-YYYY-MM-DD.png"
Tablet (768px width):
Use browser_resize to set viewport width=768, height=1024
Use browser_take_screenshot with filename=".playwright-mcp/screenshots/tablet-pagename-YYYY-MM-DD.png"
Mobile (375px width):
Use browser_resize to set viewport width=375, height=667
Use browser_take_screenshot with filename=".playwright-mcp/screenshots/mobile-pagename-YYYY-MM-DD.png"
Important:
.playwright-mcp/screenshots/ directory by including it in the filename parameterfilename=".playwright-mcp/screenshots/desktop-homepage-2026-01-09.png"Interactive elements should have polished hover and focus states. Use Playwright to test these programmatically.
Common elements to test:
Workflow for testing hover states:
Use browser_snapshot to get the accessibility tree with element refs
Use browser_hover with element="Nav link" ref="e6"
Use browser_take_screenshot with filename=".playwright-mcp/screenshots/hover-nav-link-2026-01-09.png"
Use browser_press_key with key="Tab" to move focus
Use browser_take_screenshot with filename=".playwright-mcp/screenshots/focus-state-2026-01-09.png"
What to verify:
Example hover test sequence:
1. browser_navigate to http://localhost:4321
2. browser_snapshot (note the refs for nav links, social icons, etc.)
3. browser_hover element="Home nav link" ref="e6"
4. browser_take_screenshot filename=".playwright-mcp/screenshots/hover-nav-home.png"
5. browser_hover element="LinkedIn icon" ref="e10"
6. browser_take_screenshot filename=".playwright-mcp/screenshots/hover-social-linkedin.png"
7. browser_hover element="Theme toggle button" ref="e24"
8. browser_take_screenshot filename=".playwright-mcp/screenshots/hover-theme-toggle.png"
Tip: Compare hover screenshots against the design system to ensure accent colors and transition styles match expectations.
Use the Read tool to view each screenshot (Claude Code can read images). For each screenshot, check:
CRITICAL: Avoid Generic AI-Generated Looks
Terminal Aesthetic Compliance
Design Consistency
border border-border-default, all borders follow this patternLayout & Responsiveness
Accessibility
Provide a structured report:
## Visual Inspection Report
**Page:** [page name]
**Date:** [YYYY-MM-DD]
**Viewports Tested:** Desktop (1280px), Tablet (768px), Mobile (375px)
### ✅ Passed Checks
- [List what looks good]
### ⚠️ Issues Found
1. **[Issue category]**: [Description]
- Screenshot: `[filename].png` (in `.playwright-mcp/screenshots/`)
- Severity: Critical/High/Medium/Low
- Recommendation: [How to fix]
### 🎨 Design Consistency
- [Comment on consistency with existing components]
- [Comment on terminal aesthetic adherence]
### 📱 Responsive Behavior
- [Comment on layout shifts, breakpoints, mobile usability]
### 🖱️ Interactive States
- [Comment on hover effects - are they polished and consistent?]
- [Comment on focus indicators - are they visible for keyboard navigation?]
- [Comment on transitions - are they smooth or jarring?]
### ♿ Accessibility Notes
- [Comment on contrast, focus states, touch targets]
IMPORTANT: Only stop the dev server if YOU started it in Step 1.
Check your notes from Step 1:
SERVER_WAS_ALREADY_RUNNING = true: Do NOT stop the server. Leave it running for the user.SERVER_WAS_ALREADY_RUNNING = false: Stop the server:node .claude/skills/visual-inspection/scripts/visual-inspection.js stop-server
This ensures you don't leave background processes running that the user didn't ask for, while also not disrupting a server the user was already using.
Always cross-reference findings with .claude/context/design-system.md for:
A JavaScript helper script is available at scripts/visual-inspection.js with utilities for managing screenshots and the dev server.
Available commands:
# Check if dev server is running
node .claude/skills/visual-inspection/scripts/visual-inspection.js check-server
# Start the dev server
node .claude/skills/visual-inspection/scripts/visual-inspection.js start-server
# Stop the dev server (kills processes on port 4321)
node .claude/skills/visual-inspection/scripts/visual-inspection.js stop-server
# List all screenshots with metadata
node .claude/skills/visual-inspection/scripts/visual-inspection.js list
# Clean screenshots older than 7 days
node .claude/skills/visual-inspection/scripts/visual-inspection.js clean --days 7
# Validate a screenshot filename
node .claude/skills/visual-inspection/scripts/visual-inspection.js validate desktop-homepage-2026-01-09.png
All screenshots are saved to .playwright-mcp/screenshots/ (gitignored). This keeps visual artifacts out of version control while preserving them for review.
Note: When using browser_take_screenshot, include the full path with the screenshots subdirectory (e.g., filename=".playwright-mcp/screenshots/desktop-homepage-2026-01-09.png") to ensure proper organization.
browser_hover to verify hover effects on key elementsThis skill should be used:
User: "I've added a new blog post card component"
You should:
User: "Before I merge this PR, can you check the designs?"
You should:
.claude/context/design-system.md - Color palette, spacing, typography, component patternsCLAUDE.md - Design philosophy and quality standards.claude.json - Playwright MCP server configuration