visual-regression
Skill355 starsChanged 13 months agoMITView on GitHub
Setup visual regression testing with Storybook stories, configuration, and CI/CD workflows. Supports Chromatic, Percy, BackstopJS. Auto-invoke when user says "set up visual regression", "add Chromatic tests", "add screenshot testing", or "set up Percy".
- Installs packages
7 other projects use a version of this.
Adopted by
Most recently taken up by
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- HsuanYuLee/polaristheir own version, first seen Nov 5, 2026
- ravidsrk/agent-skillstheir own version, first seen Nov 1, 2026
- ahilles107/gravitytheir own version, first seen Oct 2, 2026
- CaduS0uza/qa-supremetheir own version, first seen Sep 10, 2026
- mlopscommunity/Coding-Agents-Conference-skillstheir own version, first seen Mar 4, 2026
Other versions7 projects use a version of this.
Word for word · 1
- alekspetrov/navigator★ 355100% same
Edited · 0
None found.
Wrote their own version · 6
- mlopscommunity/Coding-Agents-Conference-skills★ 38same name
- ahilles107/gravity★ 22same name
- HsuanYuLee/polaris★ 5same name
- CaduS0uza/qa-supreme★ 1same name
- DnsQueen/orcinus-skills★ 1same name
- ravidsrk/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- backend-endpointSkill
- backend-testSkill
- database-migrationSkill
- frontend-componentSkill
- frontend-testSkill
- nav-briefSkill
- nav-compactSkill
- nav-deep-researchSkill
- nav-diagnoseSkill
- nav-featuresSkill
- nav-graphSkill
- nav-initSkill
- nav-loopSkill
- nav-markerSkill
- nav-onboardSkill
- nav-pilotSkill
- nav-profileSkill
- nav-releaseSkill
- nav-simplifySkill
- nav-skill-creatorSkill
- nav-sopSkill
- nav-startSkill
- nav-statsSkill
- nav-sync-claudeSkill
- nav-taskSkill
- nav-trizSkill
- nav-upgradeSkill
- nav-workflowSkill
- plugin-slash-commandSkill
- product-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 10 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 74
If Storybook not found: Ask user if they want to install Storybook first, provide setup instructions.
- Distinctive: line 76
If multiple VR tools found: Ask user which to use (Chromatic recommended).
- Distinctive: line 89
Add accessibility tests (@storybook/addon-a11y)
- Distinctive: line 90
Add interaction tests (if @storybook/test available)
- Very specific: line 265
For GitLab CI: Add job to .gitlab-ci.yml
- Very specific: line 266
For CircleCI: Add job to .circleci/config.yml
- Very specific: line 444
After product-design generates implementation plan, suggest visual regression:
- Distinctive: line 516
Start with key components: Don't test everything, focus on design system primitives
- Distinctive: line 518
Baseline on main: Always merge baselines to main branch
- Distinctive: line 519
Review changes: Don't auto-accept visual changes
- Distinctive: line 528
Read Storybook docs (20k)
- Distinctive: line 529
Read Chromatic docs (15k)
- Distinctive: line 530
Write stories manually (10k)
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Visual Regression Testing Setup Skill
Skill Purpose
Generate complete visual regression testing setup with Storybook stories, configuration files, and CI/CD workflows.
Supports: Chromatic, Percy, BackstopJS Frameworks: React, Vue, Svelte (TypeScript/JavaScript) CI/CD: GitHub Actions, GitLab CI, CircleCI
What This Skill Does
- Detects existing setup: Storybook version, VR tool, CI platform
- Validates component: Extract props, variants, states
- Generates stories: Complete
.stories.tsxwith all variants - Creates config files: Chromatic, Percy, or BackstopJS configuration
- Sets up CI/CD: Auto-generate workflow files
- Provides instructions: Next steps for API tokens, first baseline
Workflow
Step 1: Validate Project Setup
Execute: vr_setup_validator.py
Check:
- Framework (React/Vue/Svelte) from package.json
- Existing Storybook config (.storybook/ directory)
- Existing VR tool (chromatic, percy, backstopjs in dependencies)
- CI platform (.github/, .gitlab-ci.yml, .circleci/)
- Component file exists and is valid
Output:
{
"framework": "react",
"storybook_version": "7.6.0",
"vr_tool": "chromatic",
"ci_platform": "github",
"component": {
"path": "src/components/ProfileCard.tsx",
"name": "ProfileCard",
"props": [...],
"valid": true
},
"dependencies": {
"installed": ["@storybook/react", "@storybook/addon-essentials"],
"missing": ["chromatic", "@chromatic-com/storybook"]
}
}If Storybook not found: Ask user if they want to install Storybook first, provide setup instructions.
If multiple VR tools found: Ask user which to use (Chromatic recommended).
Step 2: Generate Storybook Stories
Execute: story_generator.py
Process:
- Parse component file (TypeScript/JSX/Vue SFC)
- Extract props, prop types, default values
- Identify variants (size, variant, disabled, etc.)
- Generate story file from template
- Add accessibility tests (@storybook/addon-a11y)
- Add interaction tests (if @storybook/test available)
Template: templates/story-template.tsx.j2
Example output (ProfileCard.stories.tsx):
import type { Meta, StoryObj } from '@storybook/react';
import { ProfileCard } from './ProfileCard';
const meta = {
title: 'Components/ProfileCard',
component: ProfileCard,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
size: { control: 'select', options: ['sm', 'md', 'lg'] },
variant: { control: 'select', options: ['default', 'compact'] },
},
} satisfies Meta<typeof ProfileCard>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
name: 'John Doe',
avatar: 'https://example.com/avatar.jpg',
bio: 'Software Engineer',
size: 'md',
variant: 'default',
},
};
export const Small: Story = {
args: {
...Default.args,
size: 'sm',
},
};
export const Large: Story = {
args: {
...Default.args,
size: 'lg',
},
};
export const Compact: Story = {
args: {
...Default.args,
variant: 'compact',
},
};
// Accessibility test
Default.parameters = {
a11y: {
config: {
rules: [
{ id: 'color-contrast', enabled: true },
{ id: 'label', enabled: true },
],
},
},
};Write to: {component_directory}/{ComponentName}.stories.tsx
Step 3: Generate Configuration Files
Execute: chromatic_config_generator.py (or percy/backstop equivalent)
For Chromatic:
Generate 3 files:
- chromatic.config.json:
{
"projectId": "<PROJECT_ID_PLACEHOLDER>",
"buildScriptName": "build-storybook",
"exitZeroOnChanges": true,
"exitOnceUploaded": true,
"onlyChanged": true,
"externals": ["public/**"],
"skip": "dependabot/**",
"ignoreLastBuildOnBranch": "main"
}- Update .storybook/main.js (add addon):
module.exports = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook', // ← Added
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
};- Update package.json (add scripts):
{
"scripts": {
"chromatic": "npx chromatic",
"chromatic:ci": "npx chromatic --exit-zero-on-changes"
}
}For Percy: Generate .percy.yml instead
For BackstopJS: Generate backstop.config.js instead
Step 4: Generate CI/CD Workflow
Execute: ci_workflow_generator.py
Detect CI platform from existing files:
.github/workflows/→ GitHub Actions.gitlab-ci.yml→ GitLab CI.circleci/config.yml→ CircleCI- None → Ask user, default to GitHub Actions
GitHub Actions Example:
Generate: .github/workflows/chromatic.yml
name: Visual Regression Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for Chromatic
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
onlyChanged: trueFor GitLab CI: Add job to .gitlab-ci.yml
For CircleCI: Add job to .circleci/config.yml
Step 5: Provide Setup Instructions
Output to user:
✅ Visual regression testing setup complete!
## Files Created/Modified
✅ {ComponentName}.stories.tsx (Storybook story with variants)
✅ chromatic.config.json (Chromatic configuration)
✅ .storybook/main.js (Added @chromatic-com/storybook addon)
✅ package.json (Added chromatic scripts)
✅ .github/workflows/chromatic.yml (CI workflow)
## Next Steps
### 1. Install Dependencies
```bash
npm install --save-dev chromatic @chromatic-com/storybook
```
### 2. Create Chromatic Project
1. Go to https://www.chromatic.com/start
2. Sign in with GitHub
3. Create new project
4. Copy project token
### 3. Add Secret to GitHub
1. Go to repository Settings → Secrets and variables → Actions
2. Create secret: `CHROMATIC_PROJECT_TOKEN`
3. Paste your project token
### 4. Update chromatic.config.json
Replace `<PROJECT_ID_PLACEHOLDER>` with your actual project ID from Chromatic dashboard.
### 5. Create Baseline
```bash
npm run chromatic
```
This captures the initial screenshots as your baseline.
### 6. Test Visual Regression
1. Make a visual change to ProfileCard
2. Commit and push
3. CI will run Chromatic automatically
4. Review changes in Chromatic dashboard
## Documentation
See `.agent/sops/testing/visual-regression-setup.md` for detailed workflow.
## Troubleshooting
**Storybook build fails**: Ensure all component dependencies are installed
**Chromatic upload fails**: Check project token in secrets
**No changes detected**: Chromatic only runs on changed stories (use `--force-rebuild` to test)Predefined Functions Reference
vr_setup_validator.py
def detect_storybook_config(project_root: str) -> dict
def detect_vr_tool(project_root: str) -> str
def validate_component_path(component_path: str) -> dict
def check_dependencies(project_root: str) -> dictReturns: Validation report with detected setup and missing dependencies
story_generator.py
def analyze_component(component_path: str, framework: str) -> dict
def generate_story(component_info: dict, template_path: str) -> str
def create_accessibility_tests(component_info: dict) -> str
def create_interaction_tests(component_info: dict) -> strReturns: Generated story file content
chromatic_config_generator.py
def generate_chromatic_config(project_info: dict) -> str
def generate_storybook_config(existing_config: dict) -> str
def generate_package_scripts(existing_scripts: dict) -> dict
def generate_percy_config(project_info: dict) -> str # Percy alternative
def generate_backstop_config(project_info: dict) -> str # BackstopJS alternativeReturns: Configuration file contents as strings
ci_workflow_generator.py
def detect_ci_platform(project_root: str) -> str
def generate_github_workflow(project_info: dict) -> str
def generate_gitlab_ci(project_info: dict) -> str
def generate_circleci_config(project_info: dict) -> strReturns: CI workflow file contents
Templates Reference
- story-template.tsx.j2: React/TypeScript story template
- story-template.vue.j2: Vue SFC story template
- chromatic-config.json.j2: Chromatic configuration
- percy-config.yml.j2: Percy configuration
- github-workflow.yml.j2: GitHub Actions workflow
- gitlab-ci.yml.j2: GitLab CI job
- storybook-main.js.j2: Storybook addon configuration
Examples
Example 1: Simple Component
User: "Set up visual regression for ProfileCard component"
→ Detects: React, existing Storybook, no VR tool
→ Generates: ProfileCard.stories.tsx with 4 variants
→ Creates: Chromatic config, GitHub workflow
→ Outputs: Setup instructionsSee: examples/simple-component-vr.md
Example 2: Full Design System
User: "Set up visual regression for entire design system"
→ Detects: React, Storybook, components in src/components/
→ Generates: Stories for all components (Button, Input, Card, etc.)
→ Creates: Chromatic config with design token validation
→ Outputs: Bulk setup instructionsSee: examples/design-system-vr.md
Example 3: Existing Storybook
User: "Add Chromatic to existing Storybook"
→ Detects: Storybook v7, existing stories
→ Adds: @chromatic-com/storybook addon
→ Creates: Chromatic config, CI workflow
→ Preserves: Existing stories and configurationSee: examples/existing-storybook-vr.md
Integration with product-design Skill
After product-design generates implementation plan, suggest visual regression:
"Implementation plan created! Consider setting up visual regression testing:
'Set up visual regression for {ComponentName}'
This ensures pixel-perfect implementation and prevents visual drift."Tool Comparison
Chromatic (Recommended)
- ✅ Purpose-built for Storybook
- ✅ Component-focused testing
- ✅ UI review workflow
- ✅ Free tier: 5,000 snapshots/month
- ❌ Requires cloud service
Percy
- ✅ Multi-framework support
- ✅ Responsive testing
- ✅ Visual reviews
- ❌ More expensive
- ❌ Less Storybook-specific
BackstopJS
- ✅ Open source, self-hosted
- ✅ No cloud dependency
- ✅ Free
- ❌ More manual setup
- ❌ Less automation
Default: Chromatic (best Storybook integration)
Error Handling
Component Not Found
Error: Component file not found at {path}
Please provide correct path:
"Set up visual regression for src/components/ProfileCard.tsx"Storybook Not Installed
Storybook not detected. Install first:
npm install --save-dev @storybook/react @storybook/addon-essentials
npx storybook init
Then retry: "Set up visual regression for ProfileCard"Multiple VR Tools Detected
Multiple VR tools found: chromatic, percy
Which should I use?
- "Use Chromatic for visual regression"
- "Use Percy for visual regression"Best Practices
- Start with key components: Don't test everything, focus on design system primitives
- Use interaction tests: Combine visual + functional testing
- Baseline on main: Always merge baselines to main branch
- Review changes: Don't auto-accept visual changes
- Test states: Capture hover, focus, error states
- Accessibility: Include a11y tests in all stories
Token Efficiency
Traditional approach (50k tokens):
- Read Storybook docs (20k)
- Read Chromatic docs (15k)
- Write stories manually (10k)
- Configure CI (5k)
With visual-regression skill (3k tokens):
- Skill auto-invokes (0 tokens)
- Instructions load (3k tokens)
- Functions execute (0 tokens)
Savings: 94% (47k tokens)
Version History
- v3.3.0: Initial release with Chromatic support
- Future: Percy, BackstopJS, Vue, Svelte support
Last Updated: 2025-10-21 Skill Type: Project-specific Generator: nav-skill-creator (self-improving)
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.

