AI-powered frontend visual regression testing for web teams β detect, understand, and fix visual bugs before they ship to production.
Frontguard gives frontend teams a local, inspectable screenshot comparison loop without requiring a hosted account.
multi-browser Β· optional AI vision analysis Β· local-first Β· MIT
Current test, source, version, and bundle metrics are derived by
scripts/stats.ts. Seescripts/stats.jsonfor the canonical snapshot.

π½οΈ Demo: frontguard init β doctor β run β AI classification.
Published packages are listed in CHANGELOG.md. The first validation run is documented in
validation/results-v0.2.md: 39 of 43 route rechecks completed across 2 of 5 fixture repositories on one macOS host, with AI disabled. It is not an AI-accuracy or cross-OS benchmark.
The MIT-licensed repository contains the CLI, optional AI pipeline, cloud API source, integrations, MCP server, and Docker renderer source. The local CLI is the supported product path. Hosted, MCP, GitHub App, and Docker Compose onboarding remain pre-release; see the launch audit for the unresolved acceptance work.
AI is optional; without it, the CLI performs local pixel comparison and writes local reports. Cloud source and the self-host guide are available for evaluation, not as a verified production quick start.
- π§ Optional model-assisted analysis β When configured, sends screenshot evidence to your selected OpenAI or Anthropic account and returns a classification, confidence, and explanation for review.
- π― Configurable consensus β Opt into multiple renders per route when a project needs protection from transient screenshot variation.
- π€ Pre-release MCP interface β
@frontguard/mcpcan query a verified API deployment; there is no live hosted default, and cloud approval does not yet promote screenshots. - π³ Pinned renderer source β The renderer is currently repository-source-only and must be built with the documented npm tarball preparation. Cross-host byte equivalence has not yet been validated and no registry image is published.
- π Open-source CLI β CLI-first, free forever. No per-screenshot pricing cliff, no dashboard lock-in, BYO AI key. Cloud components are available in the repository but their hosted and Docker quick starts are still pre-release.
Developer runs Frontguard β Pages render β Pixels compare to reviewed baselines β
Console, JSON, and HTML evidence are written β Optional AI assists with changed screenshots
- Detect β Pixel comparison finds changes above the configured threshold
- Understand β Optional AI returns a confidence-scored explanation for human review
- Fix β Experimental CSS suggestions and sandbox verification are separate opt-ins
Prerequisites: Node.js 20+ and npm 9+
# Frontguard terminal: install, initialize, and check the environment
npm install @frontguard/cli
npx -p @frontguard/cli frontguard init --ci
npx -p @frontguard/cli frontguard doctorApp terminal (leave this running): use your project's dev-server command (for example, the command below) and wait for the baseUrl generated in frontguard.config.ts to respond.
npm run devFrontguard terminal: review the running app, then capture baselines and compare using the generated config.
npx -p @frontguard/cli frontguard update-baselines
git push origin frontguard-baselines
npx -p @frontguard/cli frontguard runFull documentation: frontguard.dev/docs Β· internal notes in
docs/
- Zero-config route discovery β Auto-crawls your app to find all pages
- Multi-browser β Chromium, Firefox, WebKit via Playwright
- AI-powered analysis β BYOK (OpenAI/Anthropic) classifies regressions vs intentional changes
- Smart rendering β Dependency graph renders only pages affected by your changes
- Preview deployments β Auto-detects Vercel/Netlify preview URLs
- Git-native baselines β Stored in orphan branch, zero main branch bloat
- Framework detection β Next.js, Remix, SvelteKit, Nuxt, Astro out of the box
- Security hardened β Shell injection prevention, path traversal guards, API key redaction
- Memory managed β Streaming buffers, temp file cleanup, bounded concurrency
- Visual evidence β Baseline/current/diff images are retained in the HTML report; remote thumbnails require an explicit image-upload backend
- Per-route thresholds β Strict on
/checkout, relaxed on/blogβ all in one config
| Frontguard | Percy | Chromatic | BackstopJS | Lost Pixel | Argos | |
|---|---|---|---|---|---|---|
| Open source | β MIT | β | β | β | β (read-only) | β MIT |
| CLI-first | β | β | β | β | β | β |
| AI change classification | β optional | β | β | β | β | β |
| AI fix verification | β experimental | β | β | β | β | β |
| Multi-render consensus | β configurable | β | β | β | β | β |
| Runs without a hosted service | β | β | β | β | β | β |
| Free tier | Forever (CLI) | 5k screenshots/mo | 5k snapshots/mo | Free | Sunset | 5k screenshots/mo |
| Hosted entry | Waitlist | $199/mo | $179/mo | n/a | n/a | $100/mo |
| Project status | Active | Active | Active | Low activity observed | Sunset; team joined Figma | Active |
Migrating? See the BackstopJS, Lost Pixel, and Argos guides. Comparisons: Percy Β· Chromatic Β· Argos.
Illustrative output only; the published validation run did not measure model accuracy.
β /dashboard @ 375px β 2.34% changed
π΄ AI Analysis β Regression (94% confidence)
"The sidebar overlaps the main content on mobile. Review the responsive
layout rules affecting the sidebar and content container."
Suggested fix (unverified): restore column stacking at the mobile breakpoint.
β /pricing @ 1440px β 0.8% changed
π’ AI Analysis β Intentional (91% confidence)
"New 'Enterprise' pricing tier added. Layout intact, content expanded."
// frontguard.config.ts
export default {
version: 1,
baseUrl: 'http://localhost:3000',
// Auto-discover routes (zero config)
discover: {
startUrl: '/',
maxDepth: 3,
exclude: ['/admin/*', '/api/*'],
},
// Or explicit routes
// routes: ['/', '/pricing', '/checkout'],
viewports: [375, 768, 1440],
browsers: ['chromium'],
threshold: 0.1, // changed-pixel ratio: 0.1 = 10%
// AI analysis (optional, BYOK)
ai: {
provider: 'openai',
model: 'gpt-4o',
},
// Ignore dynamic content
ignore: [
{ selector: '.dynamic-timestamp' },
],
};ROUTE DISCOVERY β PLAYWRIGHT RENDER β PIXEL COMPARISON β CONSOLE / JSON / HTML
ββββββββ OPTIONAL BYOK AI ANALYSIS
frontguard
π Discovering routes... found 47 routes
π 12/47 routes affected by changed files
π₯ Rendering 12 routes Γ 3 viewports
βββββββββββββββββββββββββββββββββββββββββββ
RESULTS 12 routes
βββββββββββββββββββββββββββββββββββββββββββ
β / 375 768 1440 PASS
β /pricing 375 768 1440 PASS
β /checkout 375 768 1440 WARNING
β /dashboard 375 768 1440 REGRESSION
β
/settings 375 768 1440 NEW
βββββββββββββββββββββββββββββββββββββββββββ
β /dashboard @ 375px
AI: "At 375px, the current screenshot shows the sidebar overlapping
the main content; the baseline keeps both regions separate."
Guidance: Review responsive stacking for this viewport.
Severity: π΄ Critical (confidence: 94%)
1 regression Β· 1 warning Β· 9 passed Β· 1 new
Frontguard ships with a plugin architecture (9 lifecycle hooks) and 5 built-in plugins:
| Plugin | Description | Key Features |
|---|---|---|
Figma (packages/cli/src/plugins/figma.ts) |
Design-to-code comparison | Figma API integration, design token extraction, component mapping |
Performance Budgets (packages/cli/src/plugins/perf-budgets.ts) |
Web Vitals & budgets | LCP/CLS/TTFB thresholds, violations correlated with the visual diff |
Accessibility (packages/cli/src/plugins/accessibility.ts) |
axe-core audits | WCAG checks (contrast, alt text, target size, focus, headings) in the same render pass |
Third-Party Scripts (packages/cli/src/plugins/third-party-scripts.ts) |
Script drift detection | Flags ad/analytics/widget origins that appear or disappear between runs |
Monitor (packages/cli/src/plugins/monitor.ts) |
Production visual monitoring (CLI + optional cloud scheduler) | Live-URL checks, threshold alerting, history tracking |
Plugin lifecycle hooks: setup, beforeDiscover, afterDiscover, beforeRender, afterRender, afterCompare, afterRun, onError, teardown
// frontguard.config.ts
import { createFigmaPlugin } from '@frontguard/cli/plugins';
export default {
// ...base config
plugins: [
createFigmaPlugin({ fileKey: 'your-figma-file-key' }),
],
};packages/
βββ cli/src/ # @frontguard/cli β discover β render β diff β report
β βββ cli/ # Commander entry
β βββ core/ # Pipeline orchestrator, types, config, plugin system
β βββ discovery/ # Route discovery (crawler + filesystem)
β βββ render/ # Playwright rendering engine
β βββ diff/ # Pixel diff + AI vision analysis
β βββ storage/ # Git orphan branch baselines
β βββ report/ # Console, JSON, HTML, GitHub PR reporters
β βββ plugins/ # Figma, perf budgets, a11y, third-party, monitor
β βββ utils/ # Redaction, logging, retry
βββ playwright/ # @frontguard/playwright
βββ mcp/ # @frontguard/mcp
βββ cloud-api/ # Cloudflare Workers + D1 + R2
βββ create-frontguard-plugin/
apps/
βββ web/ # docs site
βββ demo/
integrations/
βββ github-app/
βββ vercel/
βββ netlify/
βββ slack-app/
Pipeline: discover β filter β render β diff β analyze β report
Each stage is independent with error boundaries β one page failing doesn't kill the run.
See docs/ for:
- Product deep-dive β Architecture decisions and design rationale
- Launch readiness (v0.2.0) β Go/no-go for the 2026-06-17 release, 20-PR punch list, residual risks
- Adversarial review β The audit we held v0.2.0 to
- Product-completion plan β The frozen IN / ROADMAP / FIX boundary
- Research β Mid-2026 competitive landscape (16 competitors fetched live)
- Validation results β Real harness run, real numbers
See ROADMAP.md for the full milestone history and upcoming plans.
The release flow is documented and reproducible β no hidden steps.
- Tag a version:
git tag -a v0.X.Y -m "..."andgit push origin v0.X.Y. .github/workflows/release.ymlruns on the tag push:scripts/release.sh --dry-runfirst as a sanity check, then real publish withNPM_TOKENfrom repo secrets (provenance signing in CI). Marketplace submissions emit as a workflow summary.scripts/release.shis the single source of truth. Run it locally with--dry-runfor any audit βnpm pack --dry-runper package, manifest checks, no state mutated.
Idempotent: already-published versions are skipped automatically. Scoped packages are forced public after publish so org defaults can't silently restrict them.
# AI Analysis (optional, BYOK β bring your own key, pick one)
FRONTGUARD_OPENAI_KEY=sk-...
FRONTGUARD_ANTHROPIC_KEY=...
Note: AI keys are optional. Frontguard works without them using local pixel comparison. AI analysis activates only when you configure a provider and sends screenshot evidence directly to that provider.
Contributions welcome! See CONTRIBUTING.md for guidelines, development setup, and how to submit PRs.
MIT