Catch Visual Regressions Before Every PR
A repo skill that makes Devin screenshot every affected page and flag layout breakage before opening a PR.The problem: CSS bugs slip past unit tests
Your test suite passes, CI is green, and the PR gets merged — but the settings page now has overlapping text on mobile, and the checkout button disappeared behind a footer. Unit tests and linters don’t catch visual breakage, so it ships to production and a customer reports it.A repository skill solves this. Skills are markdown files you commit to
.agents/skills/<your-skill>/ in any of your repos. Devin sees all skills across all connected repositories — you can trigger them manually or Devin can choose to trigger them automatically when it detects a relevant situation. This skill tells Devin exactly how to boot your app, navigate the pages affected by the diff, and screenshot them at multiple viewport widths — every time, before every PR.Add the visual-regression skill to your repo
Commit a file at This file ships with your code. Once committed, Devin sees it as an available skill — whenever a session touches UI files in this repo, Devin can trigger the visual regression checks automatically, or you can invoke them manually at any point.
.agents/skills/visual-regression/visual-regression.md that encodes your team’s manual QA checklist as steps Devin can follow:Make the checks specific to your pages
Generic instructions like “check the page looks right” produce vague results. The highest-value part of this skill is telling Devin what correct looks like for each area of your app.Add route-specific sections to your skill:Devin reads the diff, identifies which routes were touched, and follows the matching section — so checks are focused rather than generic.
See it catch a real regression
Suppose an engineer changes the CSS grid on the dashboard from
grid-template-columns: repeat(3, 1fr) to repeat(auto-fit, minmax(200px, 1fr)) to make the layout responsive. The unit tests pass — no logic changed. But on mobile, the cards now overflow the viewport.When Devin finishes the code change, it follows the skill automatically:- Boots the app — installs dependencies, starts Docker, runs migrations, seeds data, starts the dev server
- Reads the diff — sees that
src/components/Dashboard.tsxchanged, maps it to the/dashboardroute - Screenshots at 1280px — the 3-column grid renders correctly
- Screenshots at 375px — spots horizontal overflow: the cards don’t fit in the viewport
- Flags the issue — reports “Horizontal scroll detected on /dashboard at 375px width — metric cards overflow the viewport”
- Fixes the CSS — adds
overflow-x: hiddenand adjusts theminmaxminimum to150px - Re-screenshots — confirms the fix at both widths
- Opens the PR — includes before/after screenshots and the fix in the description
