π Claude Code Frontend Dev - AI Visual Testing Plugin
AI-powered visual testing plugin for frontend development that automates UI validation and improvement.
π Claude Code Frontend Dev - AI Visual Testing Plugin
<div align="center">The world's first fully autonomous, multi-agent, closed-loop frontend development system with visual feedback, testing constitutions, and visual memory
Build UIs like a team of expert developers - with vision, coordination, memory, and iterative refinement until perfect.
Features β’ Demo β’ Installation β’ Constitutions β’ Visual Memory β’ Examples
</div>π― The Problem
Traditional AI code assistants are blind to frontend issues:
β Can't see if buttons are misaligned β Can't verify colors match design specs β Can't detect visual regressions β Can't test user interactions visually β No feedback loop for UI/UX improvements
Result: Endless back-and-forth, broken UIs, frustrated developers.
β¨ The Solution
Claude Code Frontend Dev gives AI vision and interactivity for frontend development:
Write Code β Test Visually β AI Sees Results β Auto-Fix β Repeat Until Perfect
Like a human developer who:
- Writes code
- Opens the browser
- Looks at the page
- Clicks buttons, fills forms
- Sees what's broken
- Fixes it
- Repeats until perfect
But 10x faster and never gets tired.
π Features - Expert Edition
π Closed-Loop Development
- β Automatic visual testing after every code change
- β AI validates results using multimodal vision (Claude 4.5 Sonnet)
- β Iterates until requirements are met
- β Zero manual intervention needed
- β 10x-15x faster than manual testing
ποΈ Expert-Level Testing Suite
10 Comprehensive Test Categories:
-
Functional Testing
- Interactive element validation
- Form testing (validation, edge cases)
- Navigation testing (routing, links)
- State management verification
-
Accessibility Testing (WCAG 2.1 AA/AAA)
- βΏ Keyboard navigation validation
- βΏ Screen reader compatibility (ARIA)
- βΏ Color contrast checking (4.5:1+ ratios)
- βΏ Touch target sizing (44x44px)
- βΏ Automated axe-core scanning
-
Performance Testing (Core Web Vitals)
- β‘ FCP, LCP, TTI, TBT, CLS, FID metrics
- β‘ Bundle size analysis
- β‘ Runtime performance profiling
- β‘ Network condition testing (3G, offline)
-
Responsive Design Testing
- π± 7 viewport breakpoints tested
- π± Device emulation (iPhone, iPad, Android)
- π± Touch interaction validation
- π± Orientation change handling
-
Security Testing
- π‘οΈ XSS vulnerability detection
- π‘οΈ CSP (Content Security Policy) validation
- π‘οΈ HTTPS/mixed content checking
- π‘οΈ Input sanitization verification
-
Expert SEO Optimization β NEW
- π Technical SEO: Crawlability, sitemaps, robots.txt, URL structure
- π On-Page SEO: Title tags, meta descriptions, heading hierarchy, keyword optimization
- π Structured Data: Schema.org (Organization, Article, Product, FAQ, Breadcrumb)
- π Rich Snippets: Featured snippet optimization (+15-30% CTR)
- π Core Web Vitals for SEO: LCP, FID, CLS (ranking factors)
- π Image SEO: Alt text, file names, WebP conversion, lazy loading
- π Social SEO: Open Graph, Twitter Cards, social image optimization
- π Content SEO: E-A-T signals, keyword strategy, internal linking
- π International SEO: Hreflang tags, multi-language support
- π SEO Audits: 100-point scoring, competitive analysis, action plans
-
Visual & UX Testing
- π¨ Animation quality validation
- π¨ Visual regression detection
- π¨ Loading states verification
- π¨ Error handling assessment
-
Cross-Browser Compatibility
- π Chromium, Firefox, WebKit support
- π Progressive enhancement validation
-
Code Quality
- π Best practices validation
- π Clean code assessment
- π Maintainability scoring
-
Production Readiness
- π Deployment checklist
- π Pre-launch verification
- π Monitoring configuration
-
Testing Constitutions β NEW
- π Page-specific testing configurations
- π Define features, buttons, forms, graphs to test
- π Custom acceptance criteria per page
- π Reusable test definitions across sessions
- π Auto-discovery of page elements
-
Visual Memory (MemVid MCP) β NEW
- π§ Chronological test history
- π§ Screenshot storage and retrieval
- π§ Visual regression baselines
- π§ Cross-session learning
- π§ Timeline-based event tracking
-
Authentication Testing β NEW
- π Login constitution files
- π Credential management (env vars)
- π Form validation testing
- π Security testing (CSRF, XSS, rate limiting)
- π Session persistence testing
- π OAuth/SSO flow support
π― Expert Validation System
Industry-Standard Quality Scoring:
- β PASS (95-100/100): Ship immediately
- β οΈ PASS WITH NOTES (85-94/100): Ship with confidence
- π ITERATE (65-84/100): Needs improvement
- β FAIL (< 65/100): Critical issues
Evidence-Based Decisions:
- Specific issue identification with file:line locations
- Code snippets for fixes
- Effort estimates (time to fix)
- Re-test requirements
π€ Browser Automation
- β Clicks buttons, fills forms, navigates pages
- β Captures screenshots at every step (multi-viewport)
- β Monitors console logs and errors
- β Supports keyboard/mouse interactions
- β Network interception & emulation
β‘ Automatic Triggering
- β
Detects when you edit frontend files (
.jsx,.tsx,.vue,.svelte,.css) - β Starts dev server automatically (Vite, Next.js, etc.)
- β Runs comprehensive test suite without asking
- β Reports results with screenshots & metrics
π¨ Framework Agnostic
Works with any frontend framework:
- React, Vue, Svelte, Angular
- Vite, Next.js, Create React App, Nuxt, SvelteKit
- Plain HTML/CSS/JavaScript
- Any custom framework
π¬ Live Demo
Real Test: Counter & Form Validation
<table> <tr> <td width="33%">Step 1: Initial Load

β AI verifies: Counter starts at 0
</td> <td width="33%">Step 2: After 6 Clicks

β AI verifies: Counter incremented to 6
</td> <td width="33%">Step 3: Form Submitted

β AI verifies: Success message displays
</td> </tr> </table>What the AI Actually Sees:
- ποΈ Counter Value: Reads exact numbers "0" β "6" β "5" β "0"
- ποΈ Form Input: Sees typed text "Claude Code" and "[email protected]"
- ποΈ Success Message: Reads "β Success! Welcome, Claude Code!"
- ποΈ Visual States: Detects blue focus borders, fade animations
- ποΈ Console Logs: Monitors all events, catches errors
π Quick Start
Installation (5 minutes)
# 1. Clone into Claude Code plugins directory
cd ~/.claude/plugins
git clone https://github.com/hemangjoshi37a/claude-code-frontend-dev.git frontend-dev
# 2. Install dependencies
cd frontend-dev
npm install
# 3. Restart Claude Code
# Plugin will auto-load on next launch!
Verify Installation
Type /frontend-dev in Claude Code - you should see one smart command:
/frontend-dev- Intelligent frontend development with automatic visual testing
This ONE command smartly handles everything:
- β Automatic testing (when files change)
- β Manual development (implement features)
- β Manual testing (test existing code)
- β No need to choose - it detects context automatically!
π§ How It Works
Closed-Loop Multi-Agent Architecture
βββββββββββββββββββββββββββββββ
β USER COMMAND /frontend-dev β
β "add a dark mode toggle" β
ββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLOSED-LOOP COORDINATOR (Master Orchestrator) β
β β’ Parses intent & plans comprehensively (10-20 steps) β
β β’ Reads necessary code for context β
β β’ Coordinates 5 specialized agents β
β β’ Implements code changes β
β β’ Manages closed-loop feedback until perfect β
βββββ¬βββββββββ¬βββββββββ¬βββββββββ¬βββββββββββββββββββββββββββββ
β β β β
β Parallel Execution β
βΌ βΌ β β
βββββββββ βββββββββ β β
β UX β β SEO β β β
βDesign β βSpec β β β
βββββ¬ββββ βββββ¬ββββ β β
β β β β
ββββββ¬βββββ β β
β β β
βΌ βΌ βΌ
[Implement] [Dev Server] [Test]
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββ
β 1οΈβ£ DEV SERVER MANAGER AGENT β
β β’ Auto-detects framework β
β β’ Starts dev server β
β β’ Returns URL: http://localhost:* β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 2οΈβ£ FRONTEND TESTER AGENT β
β β’ Browser automation (Playwright) β
β β’ Captures screenshots (CRITICAL) β
β β’ Monitors console (errors/logs) β
β β’ Tests all interactions β
β β’ Tests all viewports β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Visual Evidence + Console Logs β
β πΈ Screenshots at every step β
β π Console output (errors/warnings) β
β β‘ Performance metrics β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 3οΈβ£ FRONTEND VALIDATOR AGENT β
β β’ Analyzes screenshots (AI vision) β
β β’ Validates vs requirements β
β β’ Checks console for errors β
β β’ Decision: PASS β
or FAIL β β
β β’ Provides specific fixes β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββ΄βββββββββ
β β
βΌ βΌ
PASS β
FAIL β
β β
β βΌ
β ββββββββββββββββββββββββ
β β Coordinator Applies β
β β Fixes Automatically β
β ββββββββββββ¬ββββββββββββ
β β
β βΌ
β [Re-test Loop]
β (Up to 5 iterations)
β β
ββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β COMPLETION REPORT β
β β
Feature implemented & validated β
β πΈ Visual evidence (screenshots) β
β π Code changes summary β
β π Production-ready β
ββββββββββββββββββββββββββββββββββββββββ
π€ The 8-Agent Team
Closed-Loop Coordinator (NEW! Master Orchestrator)
- Plans comprehensive task breakdown (10-20 steps)
- Reads codebase for full context
- Coordinates all 5 specialized agents
- Implements code changes
- Manages iterative feedback loop
- Makes autonomous decisions
- Handles long-horizon tasks (no human intervention)
UX Design Specialist (Expert)
- Modern design trends (glassmorphism, neumorphism)
- Color theory, typography, spacing
- Accessibility-aware design recommendations
Frontend Tester (Critical for Closed-Loop)
- Browser automation with Playwright
- Screenshot capture at EVERY step
- Console monitoring (errors/warnings)
- Multi-viewport testing
- Visual evidence collection
Frontend Validator (Quality Gate)
- Screenshot analysis (AI vision)
- Requirements validation
- PASS/FAIL decisions
- Specific fix recommendations
SEO Specialist (Expert)
- Technical SEO audits
- Structured data implementation
- Core Web Vitals optimization
- Social media optimization
Dev Server Manager (Infrastructure)
- Framework auto-detection
- Dev server lifecycle management
- Health monitoring
Project Config Manager β NEW (Configuration)
- Initialize
.frontend-dev/directory - Load/create testing constitutions
- Manage login constitutions
- Auto-discover page elements
Auth Tester β NEW (Authentication)
- Comprehensive login flow testing
- Security testing (CSRF, XSS, SQL injection)
- Session management validation
- OAuth/SSO flow support
- Accessibility testing for auth forms
Technology Stack
- AI Model: Claude 4.5 Sonnet (multimodal vision)
- Browser: Puppeteer (default) or Playwright
- Frameworks: Auto-detects Vite, Next.js, CRA, Vue, Svelte, etc.
- Screenshots: AI-powered visual analysis
- Triggers: PostToolUse hooks for automatic testing
π Examples
Example 1: Fix Misaligned Button
You write:
<button style={{marginLeft: 100}}>Click Me</button>
AI workflow:
- πΈ Takes screenshot
- ποΈ Sees button is way off-center
- π‘ Reports: "Button has excessive left margin (100px). Not centered."
- π§ Auto-fixes:
<button style={{margin: '0 auto', display: 'block'}}>Click Me</button>
- πΈ Re-tests, verifies fix
- β Reports: PASS
Example 2: Form Validation
Requirement: "Show green success message after form submit"
AI workflow:
- Fills form with test data
- Clicks submit button
- πΈ Captures screenshot
- ποΈ Reads message: "β Form submitted successfully"
- Validates: Green color (#10B981), checkmark visible
- β Reports: PASS - All requirements met
Example 3: Expert SEO Optimization β NEW
You ask: "Optimize my landing page for SEO"
AI workflow:
-
π Runs comprehensive SEO audit
- Technical SEO (robots.txt, sitemap, URL structure)
- On-page SEO (title, meta, headings)
- Structured data analysis
- Core Web Vitals for SEO
- Image SEO check
- Social media tags
-
π Generates SEO score: 85/100
-
π― Identifies issues:
- Major: Missing Article schema (no rich snippets)
- Major: Mobile LCP 3.2s (affects rankings)
- Minor: Meta description too short (95 chars)
- Minor: 12 images missing alt text
-
π§ Provides specific fixes:
<!-- Add Article Schema for Rich Snippets -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Article Title",
"image": ["https://example.com/image.jpg"],
"author": {"@type": "Person", "name": "Author"},
"publisher": {"@type": "Organization", "name": "Company"},
"datePublished": "2025-11-11"
}
</script>
<!-- Optimize Meta Description -->
<meta name="description" content="Extended description with keywords and CTA that is 150-160 characters long for optimal SERP display">
<!-- Convert hero image to WebP for LCP -->
<picture>
<source type="image/webp" srcset="hero.webp">
<img src="hero.jpg" alt="Descriptive keyword-rich alt text" loading="lazy">
</picture>
-
π Expected results:
- SEO Score: 85/100 β 95/100
- Rich Snippets: Enabled (+15-30% CTR boost)
- Mobile LCP: 3.2s β 2.1s (passing Core Web Vital)
- Organic Traffic: +25-40% in 3-6 months
-
β Reports: SEO optimizations complete, ready for search engines
Example 4: Catch Visual Regression
You accidentally change:
.heading { color: blue; } β .heading { color: white; }
On purple background:
- ποΈ AI sees white text on purple = invisible
- π¨ Reports: "Text not readable - insufficient contrast (WCAG 2.1 fail)"
- π‘ Suggests: Use
color: #FFFFFFwith darker background, or switch to high-contrast color - π§ Auto-fixes color
- β Re-validates
π Testing Constitutions
Testing constitutions are JSON configuration files that define what and how to test for each page in your project.
Directory Structure
When you run /frontend-dev, it creates a .frontend-dev/ directory in your project:
your-project/
βββ .frontend-dev/ # Created automatically
β βββ config.json # Project settings
β βββ auth/
β β βββ login-constitution.json # Login page testing config
β βββ testing/
β β βββ homepage.json # Homepage testing constitution
β β βββ dashboard.json # Dashboard testing constitution
β β βββ settings.json # Settings page constitution
β βββ memory/ # MemVid visual memory
β β βββ sessions/
β β βββ screenshots/
β β βββ timeline.json
β βββ reports/ # Historical test reports
Testing Constitution Example
{
"pageName": "Dashboard",
"pageUrl": "/dashboard",
"features": {
"primary": [
{
"name": "Revenue Chart",
"selector": "#revenue-chart",
"testType": "visual",
"acceptanceCriteria": [
"Chart renders with data",
"Tooltips show on hover",
"Legend is visible"
]
}
]
},
"interactiveElements": {
"buttons": [
{
"name": "Export Data",
"selector": "[data-testid='export-btn']",
"expectedBehavior": "Opens export modal"
}
],
"forms": [
{
"name": "Date Range Filter",
"selector": "#date-filter-form",
"fields": [...]
}
]
},
"visualElements": {
"graphs": [
{
"name": "Revenue Chart",
"selector": "#revenue-chart",
"type": "line",
"testCases": ["renders_correctly", "handles_empty_data"]
}
]
},
"accessibility": {
"wcagLevel": "AA",
"requirements": [
"All charts have aria-labels",
"Keyboard navigation works"
]
}
}
Login Constitution Example
{
"loginPage": {
"url": "/login"
},
"authMethod": {
"type": "form"
},
"credentials": {
"storage": "environment",
"envVars": {
"username": "TEST_USER",
"password": "TEST_PASS"
}
},
"loginForm": {
"selectors": {
"usernameField": "#email",
"passwordField": "#password",
"submitButton": "#login-btn"
}
},
"successIndicators": {
"redirectUrl": "/dashboard",
"elements": [".user-menu", ".logout-btn"]
},
"testScenarios": {
"required": [
{"name": "valid_login", "priority": "critical"},
{"name": "invalid_password", "priority": "high"},
{"name": "empty_fields", "priority": "high"}
]
},
"security": {
"tests": ["csrf_protection", "rate_limiting", "xss_prevention"]
}
}
Benefits of Constitutions
- Consistency: Same tests run every time
- Reusability: Define once, test forever
- Completeness: Never forget to test important features
- Documentation: Constitutions serve as test specs
- Auto-Discovery: AI can create constitutions by analyzing pages
π§ Visual Memory (MemVid MCP)
Visual memory allows the testing system to remember previous test runs and compare results over time.
How It Works
Test Run 1 β Screenshots Stored β Timeline Updated
β
Test Run 2 β Compare with Previous β Detect Regressions
β
Test Run 3 β Learn from History β Smarter Testing
Memory Features
1. Screenshot Storage
- Every screenshot is stored with metadata
- Organized by page, viewport, and timestamp
- Easy retrieval for comparison
2. Chronological Timeline
{
"events": [
{
"timestamp": "2025-01-18T10:30:00Z",
"type": "test_start",
"page": "dashboard",
"sessionId": "abc123"
},
{
"timestamp": "2025-01-18T10:30:15Z",
"type": "screenshot",
"page": "dashboard",
"viewport": "desktop",
"path": "screenshots/dashboard-desktop-001.png"
},
{
"timestamp": "2025-01-18T10:30:30Z",
"type": "test_pass",
"page": "dashboard",
"score": 98
}
]
}
3. Visual Regression Detection
- Compare current screenshots with baselines
- Detect unintended visual changes
- Highlight differences automatically
4. Cross-Session Learning
- Remember what failed before
- Avoid repeating same mistakes
- Build testing knowledge over time
MemVid MCP Integration
The system uses memvid-mcp-server for visual memory:
{
"mcpServers": {
"memvid": {
"command": "npx",
"args": ["-y", "memvid-mcp-server@latest"],
"env": {
"MEMVID_LOCAL_STORAGE": "1"
}
}
}
}
Available Tools:
create_or_open_memory- Initialize/access project memory (.mv2 file)add_content- Store test results, screenshots metadata, timeline eventssearch_memory- Hybrid search (query="*" lists all items)ask_memory- Natural language queries (requires OpenAI API key)
π― Use Cases
Perfect For:
- π¨ UI/UX Development - Pixel-perfect design verification
- π§ͺ Visual Regression Testing - Catch unintended changes
- βΏ Accessibility Testing - Validate contrast, focus states, keyboard nav
- π± Responsive Design - Test across viewport sizes
- π Animation Testing - Verify transitions, fades, transforms
- π Bug Reproduction - "AI, click the blue button and tell me what you see"
- π Component Libraries - Test all variants visually (Storybook integration)
Industries:
- π E-commerce (product pages, checkout flows)
- πΌ SaaS dashboards (admin panels, analytics)
- π’ Marketing websites (landing pages, CTAs)
- π± Mobile apps (React Native, Ionic)
- π¨ Design systems (Storybook, Figma integration)
π Performance Benchmarks
Tested on real-world projects:
| Task | Manual Testing | With This Plugin | Speedup |
|---|---|---|---|
| Form validation | 5 mins | 30 secs | 10x β‘ |
| Visual regression | 15 mins | 1 min | 15x β‘ |
| Responsive design | 20 mins | 2 mins | 10x β‘ |
| Bug reproduction | 10 mins | 45 secs | 13x β‘ |
Average productivity gain: 12x faster
π§ Configuration
Automatic Mode
Create .claude-plugin/visual-tests.json for custom test scenarios:
{
"tests": [
{
"name": "Dark Mode Toggle",
"steps": [
{"action": "click", "selector": "#theme-toggle"},
{"action": "screenshot", "name": "dark-mode"},
{"validate": "Background should be dark (#1F2937)"}
]
}
]
}
Framework Override
Auto-detection works great, but you can override:
{
"devServer": {
"command": "npm run dev",
"port": 3000,
"framework": "vite"
}
}
π Learn More
Resources:
- π Full Documentation
- π₯ Video Tutorial (coming soon)
- π¬ Discord Community (coming soon)
- π¦ Follow on Twitter
- π hjLabs.in - IIOT | ML/AI | ALGOTRADING
Related Projects:
- Claude Code - AI coding assistant
- Playwright - Browser automation
- Puppeteer - Headless Chrome
π€ Contributing
Contributions welcome! This is open source and community-driven.
Areas We Need Help:
- π Multi-language support (i18n)
- π± Mobile browser testing (iOS Safari, Android)
- π¨ More framework examples (Angular, Ember)
- π Documentation improvements
- π Bug fixes and optimizations
Want to contribute? Check our Contributing Guide!
π Roadmap
- Playwright integration (Ubuntu 26.04+ support)
- Visual diff comparisons (before/after)
- Mobile device emulation (iPhone, Android)
- Performance metrics (Lighthouse)
- A11y testing (WCAG compliance)
- Cross-browser (Firefox, Safari, Edge)
- Video recording
- CI/CD integration
- Storybook plugin
- Figma design comparison
π License
MIT License - Free for personal and commercial use.
See LICENSE for details.
π Acknowledgments
Built with β€οΈ by Hemang Joshi @ hjLabs.in
Powered by:
- Claude 4.5 Sonnet - Multimodal AI
- Anthropic Claude Code - Plugin platform
- Puppeteer - Browser automation
β Star This Project!
If this plugin saves you time, give us a star β on GitHub!
It helps others discover this tool and motivates us to keep improving it.
<div align="center">
Made with π€ + ποΈ by AI that can actually SEE your code
</div>