visual-responsive-regression-testing
Skill4 starsChanged 2 months agoMITView on GitHub
Detect visual regressions and missing responsive transformations across breakpoints. Use when visual regression, screenshot comparison, layout broke on mobile, element overflowing, or component not transforming correctly.
In this repository46 other files it gives its agents.
- accessibility-reviewSkill
- accessibility-runtime-auditSkill
- adaptive-component-behaviorSkill
- ai-feature-ux-patternsSkill
- behavioral-pricing-psychologySkill
- business-model-readingSkill
- business-model-thinkingSkill
- cognitive-load-heatmap-predictionSkill
- component-style-guideSkill
- cross-functional-reviewSkill
- dark-mode-theming-systemSkill
- dashboard-layout-patternsSkill
- dashboard-scaffolding-contractSkill
- design-drift-detectorSkill
- design-system-builderSkill
- design-to-code-handoffSkill
- design-tokensSkill
- error-boundary-resilience-designSkill
- flow-based-functional-testingSkill
- growth-impact-reviewSkill
- i18n-localization-strategySkill
- information-architectureSkill
- interactive-element-auditSkill
- kinematic-motion-choreographySkill
- micro-interaction-motion-designSkill
- module-registry-syncSkill
- mvp-scopingSkill
- perceived-performance-loadingSkill
- prd-traceability-matrixSkill
- product-discoverySkill
- product-strategySkill
- project-health-diagnosticsSkill
- qa-feedback-loop-orchestratorSkill
- responsive-breakpoint-strategySkill
- responsive-qa-auditSkill
- route-integrity-checkerSkill
- security-privacy-reviewSkill
- stakeholder-requirement-mappingSkill
- touch-gesture-interactionSkill
- typography-systemSkill
- usability-heuristics-checkSkill
- user-flow-mappingSkill
- user-research-synthesisSkill
- ux-chaos-monkeySkill
- visual-hierarchy-reviewSkill
- visual-style-extractorSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
After any code change, run the visual regression suite.
- Distinctive: line 38
Not all visual differences are bugs:
- Distinctive: line 63
All regressions classified (intentional vs bug vs noise)
- Distinctive: line 75
Only testing at one or two breakpoints
- Distinctive: line 76
Not updating baselines after intentional design changes (leads to permanent failures)
- Distinctive: line 78
Not running regression tests after every deploy (defeats the purpose of automated regression)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
A visual regression is a change nobody intended. Catch it by comparing screenshots automatically — not by manually checking every screen after every change.
1. Define the screenshot inventory
List every unique screen/view that needs visual regression coverage. For each view:
- Route/URL
- Authentication state required
- Data state (empty, populated, error state)
- Breakpoints to capture: all breakpoints from responsive-breakpoint-strategy
Priority: cover critical path screens first, then secondary screens.
2. Capture baseline screenshots
For the first run, capture baseline screenshots at every defined breakpoint for every screen. Store these as the "approved" reference images. These are the ground truth.
3. Generate Playwright visual regression scaffolds
Generate test files using Playwright's screenshot comparison:
// Run: npx playwright test visual-regression/
// First run: npx playwright test --update-snapshots (captures baseline)
test('Homepage at mobile breakpoint', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/');
await expect(page).toHaveScreenshot('homepage-mobile.png', {
maxDiffPixels: 100 // allow minor anti-aliasing differences
});
});4. Run comparison against baseline
After any code change, run the visual regression suite. The tool compares current screenshots pixel-by-pixel against the baseline. Flag any difference above the threshold.
5. Classify differences
Not all visual differences are bugs:
- Intentional change: design was updated intentionally → update baseline with
--update-snapshots - Regression: unintentional change that broke existing behavior → must be fixed
- Environment noise: font rendering differences, anti-aliasing → adjust threshold or ignore
For each flagged difference, classify it before acting.
6. Audit responsive transformations
Beyond pixel comparison, verify the transformation table from adaptive-component-behavior:
- At
bp-sm(mobile): is the sidebar a bottom-nav? Is the table a card-list? Is the modal fullscreen? - At
bp-md(tablet): are intermediate transformations correct?
This cannot be done by pixel comparison alone — it requires semantic assertions (check that the element with role navigation has the correct structure at each breakpoint).
7. Report and escalate
For each regression:
- Screenshot before and after (diff highlighted)
- Breakpoint affected
- Route/component affected
- PRD requirement ID if the regression violates a specified behavior
- Recommended fix
Completion Criteria
- Baseline screenshots captured for all critical screens at all breakpoints
- Visual regression suite runs in CI (or on-demand) after every change
- All regressions classified (intentional vs bug vs noise)
- Responsive transformation audit passed at each breakpoint
- Zero unresolved regressions at ship time
Output
- Playwright visual regression test files (
visual-regression/*.spec.js) - Baseline screenshot library
- Regression report (diff images + classification + PRD reference)
Anti-patterns
- Setting the diff threshold to 0 (every font-rendering difference becomes a false positive)
- Setting the threshold too high (real regressions get masked)
- Only testing at one or two breakpoints
- Not updating baselines after intentional design changes (leads to permanent failures)
- Relying only on pixel diff — missing the semantic transformation validation entirely
- Not running regression tests after every deploy (defeats the purpose of automated regression)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

