This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
PixelBreak is a pre-commit hook + CLI tool that automatically catches responsive layout failures and visual regressions before they land in your repo — without any manual steps, subscriptions, or cloud services.
Every time you git commit, PixelBreak:
- Scans your running app at every configured viewport width (375px → 1920px) using a real Chromium browser
- Detects horizontal overflow and element clipping with deterministic pixel measurements
- Compares screenshots against the previous committed version automatically — no manual baseline setup
- Blocks the commit if anything breaks and opens a localhost dashboard showing exactly what changed
Who gets to be lazier: frontend developers who used to manually resize their browser at 5+ widths after every CSS change, or pay for Percy/Chromatic subscriptions. With PixelBreak, you just commit. The tool does the rest.
Demo

PixelBreak Dashboard — 6 findings blocked across 375px, 768px, 1024px, 1280px, 1440px, 1920px

Visual regression finding — Baseline (before), Current (after your change), Diff (changed pixels highlighted)
Since PixelBreak is a local-first tool, here's what a real terminal run looks like:
# Developer changes a CSS variable and tries to commit
git commit -m "style: update primary color"
# PixelBreak fires automatically
🔍 [PixelBreak] Running pre-commit checks...
🚀 Starting scan for project 'my-app'...
Base URL: http://localhost:4173
Profile: responsive
Widths: [375, 768, 1024, 1280, 1440, 1920]px
Git baseline: 1 staged file(s) detected — comparing against HEAD automatically.
📊 Scan Complete: 6 viewports, 8 findings
🚨 BLOCKED [HIGH] horizontal-overflow @ 375px
Element: #metrics-card overflows viewport by 857px
🚨 BLOCKED [HIGH] horizontal-overflow @ 768px
Element: #metrics-card overflows viewport by 464px
🚨 BLOCKED [MODERATE] visual-regression @ 1024px
0.09% pixel diff — 787 pixels changed
❌ Commit Gate: BLOCKED
Dashboard: http://localhost:3847
Clone and try it yourself:
git clone https://github.com/praveen-pravi6B/pixelbreak
cd pixelbreak && pnpm install && pnpm build
pnpm demo
node apps/runner/dist/cli.js init
node apps/runner/dist/cli.js baseline update
# Change fixtures/broken-demo/src/style.css and commit
Code
praveen-pravi6B
/
pixelbreak
Local-first frontend regression testing — responsive breakpoint detection, visual diffs, and local AI explanations. Blocks bad commits before they ship.
PixelBreak
Local-first responsive breakpoint detection and visual regression testing — no cloud, no account, no drama.
PixelBreak checks your frontend before every Git commit. It tests only the viewport widths you configure, detects layout failures and visual regressions, shows evidence in a localhost dashboard, and uses a local LLM to explain issues and suggest CSS fixes — without sending your source code or screenshots to any cloud service.
Why PixelBreak?
- Find where it breaks. Deterministic horizontal-overflow and layout-clipping detection at exactly the breakpoints your app supports.
- See what changed. Pixel-level screenshot diffs with bounding-box evidence and diff overlays.
- Understand the cause. A local LLM explains findings and proposes CSS patches — all on your machine.
- Block bad commits. A severity-gated pre-commit hook stops high and critical regressions before they land.
- Stay private. Zero telemetry. Zero cloud calls. No API key required.
Core Modules
Module
What it does
Breakpoint Detective
Configured
How I Built It
Open-source AI: llama.cpp running Qwen2.5-Coder-Instruct (GGUF, Q4_K_M quantization) locally on port 8080. No API key, no cloud, no bundled weights.
The AI is the explanation layer — not the detection layer. Detection is fully deterministic:
Detection (no AI involved):
-
@pixelbreak/layout-analyzer— injects JavaScript into Playwright pages to measurescrollWidth > clientWidthand element clipping geometry -
@pixelbreak/visual-diff— usespixelmatchto compare screenshots pixel-by-pixel and generate diff PNGs
AI layer (llama.cpp + Qwen2.5-Coder):
- After deterministic detection blocks a commit, the AI receives: finding summary, measured pixel geometry, relevant computed CSS
- Returns structured JSON: summary, likely cause, supporting evidence, and a CSS patch proposal
- All responses are validated with a Zod schema — malformed output is rejected, never silently accepted
- The model cannot change severity, waive findings, or apply patches.
severity: finding.severityis copied from the finding object, never from the AI response.
Git-aware automatic baselines:
The most important UX decision: instead of requiring pixelbreak baseline update before every scan, PixelBreak uses git show HEAD:<file> to automatically get the previous version of staged files as the baseline. You just commit — no manual setup.
Stack:
- pnpm workspaces monorepo (TypeScript, ESM throughout)
- Playwright for Chromium automation
- pixelmatch for pixel comparison
- Zod for all schema validation
- Commander.js for CLI
- React + Vite for the localhost dashboard
- Node.js built-in
httpfor the dashboard server (no Express)
Why Does Open Innovation Matter?
I could have built this on Percy, Chromatic, or the Applitools API. But every hosted visual regression tool:
- Sends your screenshots to their servers — a non-starter for internal dashboards, confidential UIs, or enterprise apps
- Requires a subscription — free tiers run out, pricing changes, vendor disappears
- Locks you into their severity rules — you file a ticket if you disagree
- Breaks when you're offline or behind a corporate firewall
Open innovation made this possible in four concrete ways:
1. The AI runs on your hardware. Qwen2.5-Coder-Instruct via llama.cpp — download once, run forever, cost $0. No API key. No data leaving your machine. A team building a hospital admin panel can use PixelBreak without worrying about screenshots of patient data touching a third-party server.
2. You own the severity rules. The policy engine is a configurable YAML file. If your team disagrees with how a 0.08% pixel diff is classified, you change .pixelbreak.yml. No support ticket.
3. You can audit everything. When a security review found 9 vulnerabilities in my own code (command injection, path traversal, prototype pollution via YAML), I could read the exact lines, understand the attack vectors, fix them, and write tests that prove they're fixed. That's not possible with a black-box SaaS.
4. No lock-in by design. The AI adapter speaks the OpenAI-compatible /v1/chat/completions API. Swap llama.cpp for Ollama, LM Studio, or any future local inference server — zero code changes.
My Agent Session
Built with Claude Code across two sessions — foundation phases on a personal machine, AI engine + dashboard + security hardening in this session:
The Lazy Payoff
Before PixelBreak, a developer changing a CSS file would need to:
- Open browser dev tools → resize to 375px → does it look right? (memory-based)
- Resize to 768px → check again
- Resize to 1024px → check again
- Resize to 1280px, 1440px, 1920px → check, check, check
- Compare visually against "what it looked like before" → impossible from memory
Time per CSS change: 5–10 minutes if done properly. Realistically: skipped 90% of the time.
With PixelBreak: 0 extra minutes. The commit either goes through or it doesn't.
During this week's build, PixelBreak caught:
- A
min-width: 1200pxon a flex container that caused 857px overflow at 375px — completely broken on mobile, would have shipped - A color variable change creating 787 changed pixels at 1024px — would have passed code review unnoticed
- A table that overflowed at 375px when the metrics container was fixed — a bug introduced by fixing another bug, caught automatically
Community Wisdom: Visual regression testing for modern web apps by Rizwan Saleem — the hosted tool landscape that shaped the decision to go local-first.
Top comments (0)