Turn your AI Coding Agent into a Senior Frontend Staff Engineer.
Autonomous design perception, semantic token extraction, and closed-loop browser verification for pixel-perfect production interfaces.
English • 简体中文 • Agent Skill • Documentation • Examples • CLI Reference
Most "screenshot-to-code" tools stop after a single blind text-generation pass, leaving behind broken grids, arbitrary pixel hacks, and illegible contrast.
PixelForge AI closes the loop in real browsers. It inspects its own work, computes perceptual pixel diffs, diagnoses semantic layout drift, and iterates until visual convergence:
🎯 97.2% Perceptual Similarity • 🚫 Zero CSS Hacks • ♿ WCAG 2.1 AA Contrast • 📱 Responsive 4px/8px Cadence
| Dimension | Naive "Screenshot-to-Code" | ⚡ PixelForge AI |
|---|---|---|
| Architecture | Single-file spaghetti with inline CSS hacks | Clean modular components (Atoms / Molecules / Organisms) |
| Design System | Hardcoded magic numbers (mt-[37px], w-[312px]) |
Semantic tokens (spacing-4, color-primary, tracking-tight) |
| Verification | Zero. Assumes LLM output is correct | Real browser execution + anti-aliased pixel diffing |
| Refinement | Manual human debugging and manual edits | Autonomous feedback loop converging to >= 95% fidelity |
| Multi-Framework | Rigid static output | React 19, Next.js 14+ App Router, Vue 3, and Standalone HTML5 |
| Browser Runtime | Requires heavy setup or headless dependencies | Tier 1: Host Agent Browser (instant) ➔ Tier 2: Playwright fallback |
PixelForge AI follows the Universal Agent Skill Standard, instantly compatible with all modern AI engineering platforms:
Claude Code • OpenCode • Cursor • Windsurf • OpenAI Codex
mkdir -p ~/.config/opencode/skills/pixelforge-ai
cp -r skills/pixelforge-ai/SKILL.md ~/.config/opencode/skills/pixelforge-ai/mkdir -p ~/.claude/skills/pixelforge-ai
cp -r skills/pixelforge-ai/SKILL.md ~/.claude/skills/pixelforge-ai/Add skills/pixelforge-ai/SKILL.md to your .cursorrules or project instructions.
Simply prompt your agent naturally with a screenshot, mockup, or URL:
User: "Recreate this cloud telemetry dashboard from @screenshot.png using Next.js and Tailwind."
Agent (Powered by PixelForge):
1. Analyzes spatial cadence, color palette, and WCAG contrast.
2. Exports design-tokens.json and builds modular components.
3. Renders preview in host browser (OpenCode / Browser MCP).
4. Runs perceptual pixel diff against reference image.
5. Diagnosed 88.2% similarity (header padding + card radius drift).
6. Autonomously patches classes -> Re-checks at 96.8% similarity.
7. Delivers production-ready, verified code.
Run PixelForge directly in your terminal or automation pipeline:
# 1. Clone & install
git clone https://github.com/pixelforge-ai/pixelforge-ai.git
cd pixelforge-ai
npm install && npm run build
# 2. Run visual validation loop against your implementation
npm run cli:validate -- \
--ref ./examples/screenshot-to-page/input.png \
--target ./examples/screenshot-to-page/output/index.html \
--out-dir ./.pixelforge/runsBefore generating code, PixelForge extracts design rules into structured JSON, CSS Custom Properties (:root), and tailwind.config.ts:
- Color Scales: Primary, secondary, semantic accents, surfaces, and dark-mode tokens.
- Typography Matrix: Fluid typographic scale (
clamp()), font weights, and line-height cadence. - Spatial Rhythm: Automatic detection of 4px/8px layout grids and elevation shadows.
Generates production-quality frontend code adhering to strict engineering standards:
- React 19 & Next.js 14+: Server/Client components with App Router architecture and TypeScript definitions.
- Vue 3 SFCs: Composition API
<script setup lang="ts">with scoped Tailwind styling. - Zero-Dependency HTML5 Previews: Instant browser previews configured with Tailwind Play CDN for immediate rendering without
npm install.
Seamlessly switches execution backends depending on where it runs:
- Priority 1 — Built-in Agent Browser: Utilizes host browser tools (OpenCode
openchamber_web, Claude Code MCP browser) with zero subprocess overhead. - Priority 2 — Playwright Fallback: Automatically spins up headless Chromium in terminal and CI environments.
- Compares rendered screenshots against design mockups using anti-aliasing aware
pixelmatch. - Groups pixel discrepancies into semantic clusters (spatial layout drift, typography mismatch, color shift).
- Applies targeted CSS patches until the interface reaches >= 95% similarity.
Explore end-to-end verified examples in the repository:
| Example | Output Code | Verification Report | Key Highlight |
|---|---|---|---|
| Screenshot to App (Textify) | TextifyApp.tsx + Modular UI |
96.63% Similarity (Gemini 3.8 Flash High) |
Full SaaS web app, extracted design-tokens.json, 5 viewports verified |
| Landing Page Generation | LandingPage.tsx |
97.1% Similarity |
High-converting SaaS layout, responsive nav |
| Dashboard Generation | DashboardView.tsx |
95.8% Similarity |
Data-dense KPI widgets, workload tables |
| UI Refinement Workflow | CandidateIter2.html |
97.2% Similarity |
Autonomous 2-pass feedback loop demonstration |
Detailed technical guides and architectural specifications have been organized into the docs/ directory:
- 🏛️ System Architecture — Monorepo package design, module boundaries, and data flow.
- 🔄 Engineering Workflow — The 6-phase engineering lifecycle from perception to delivery.
- 🌐 Visual Validation & Browser Runtime — Multi-tier browser routing and diff mechanics.
- 🛠️ CLI Reference & CI Integration — Command flags, automation scripts, and GitHub Actions recipes.
- 🎨 Design Principles & UX Standards — Token contracts, accessibility rules, and layout hierarchy.
- Universal Agent Skill specification (
skills/pixelforge-ai/SKILL.md) - Design Analyzer token extractor (JSON, CSS variables, Tailwind theme)
- Multi-tier Browser Provider (Built-in Agent browser + Playwright fallback)
- Perceptual pixel diff engine (
pixelmatch+pngjs) with semantic diagnosis - Multi-framework synthesizers (React 19, Next.js App Router, Vue 3, HTML5)
- Figma REST API direct token synchronization
- Multi-viewport simultaneous diff matrix (Mobile, Tablet, Desktop grid)
- Vision-model assisted semantic diff evaluation
- Storybook & component catalog automatic synthesis
Contributions make the open-source community an incredible place to learn, inspire, and create. Any contribution is greatly appreciated!
- Check out CONTRIBUTING.md for local development setup and pull request guidelines.
- Review our Code of Conduct and Security Policy.
PixelForge AI is open-source software licensed under the MIT License.