Storybook Testing
yonatangross/orchestkit
Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking…
Setup visual regression testing with Storybook stories, configuration, and CI/CD workflows.
$ npx skills add qf-studio/navigator --skill visual-regression -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install qf-studio/navigator visual-regression --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/visual-regression .claude/skills/visual-regression && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .claude/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/qf-studio/navigator/tree/main/skills/visual-regressionType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add qf-studio/navigator --skill visual-regression -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install qf-studio/navigator visual-regression --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/visual-regression .agents/skills/visual-regression && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .agents/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add qf-studio/navigator --skill visual-regression -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install qf-studio/navigator visual-regression --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/visual-regression .cursor/skills/visual-regression && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .cursor/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/qf-studio/navigator.git --path skills/visual-regression--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add qf-studio/navigator --skill visual-regression -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install qf-studio/navigator visual-regression --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/visual-regression .gemini/skills/visual-regression && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .gemini/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install qf-studio/navigator visual-regressionInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add qf-studio/navigator --skill visual-regression -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/visual-regression .github/skills/visual-regression && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .github/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add qf-studio/navigator --skill visual-regression -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install qf-studio/navigator visual-regression --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/visual-regression .opencode/skills/visual-regression && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "visual-regression" agent skill from https://github.com/qf-studio/navigator/tree/main/skills/visual-regression into .opencode/skills/visual-regression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "visual-regression", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
visual-regressionSetup visual regression testing with Storybook stories, configuration, and CI/CD workflows.
Visual Regression is an agent skill from qf-studio/navigator. 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".
Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files (for example `examples/design-system-vr.md`, `examples/existing-storybook-vr.md` and `examples/simple-component-vr.md`).
It sits in Testing & QA, covering Visual regression testing and CI/CD. It works with Storybook and Vue.js. The repository describes itself as: Finish What You Start — Context engineering for Claude Code. Sessions last 20+ exchanges instead of crashing at 7. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a6f3006. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteBashGlobFrom allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
Shell commands in SKILL.md call:
npmnpxFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
chromatic.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
CHROMATIC_PROJECT_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Visual Regression loads about 3.3k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 583 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Read, Write, Bash, GlobAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from qf-studio/navigator at commit a6f3006, republished under its MIT licence (© qf-studio). 583 words, ~3,280 tokens.
.claude/skills/visual-regression/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.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
.stories.tsx with all variantsExecute: vr_setup_validator.py
Check:
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).
Execute: story_generator.py
Process:
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
Execute: chromatic_config_generator.py (or percy/backstop equivalent)
Generate 3 files:
{
"projectId": "<PROJECT_ID_PLACEHOLDER>",
"buildScriptName": "build-storybook",
"exitZeroOnChanges": true,
"exitOnceUploaded": true,
"onlyChanged": true,
"externals": ["public/**"],
"skip": "dependabot/**",
"ignoreLastBuildOnBranch": "main"
}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: {},
},
};{
"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
Execute: ci_workflow_generator.py
Detect CI platform from existing files:
.github/workflows/ → GitHub Actions.gitlab-ci.yml → GitLab CI.circleci/config.yml → CircleCIGenerate: .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
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)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
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
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
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
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
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
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
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."Default: Chromatic (best Storybook integration)
Error: Component file not found at {path}
Please provide correct path:
"Set up visual regression for src/components/ProfileCard.tsx"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 found: chromatic, percy
Which should I use?
- "Use Chromatic for visual regression"
- "Use Percy for visual regression"Traditional approach (50k tokens):
With visual-regression skill (3k tokens):
Savings: 94% (47k tokens)
Last Updated: 2025-10-21 Skill Type: Project-specific Generator: nav-skill-creator (self-improving)
© qf-studio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 12 other files in skills/visual-regression of qf-studio/navigator.
Open the folder on GitHubat commit a6f3006
Visual Regression next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Visual Regression this skillqf-studio/navigator | 354 | — | ~3.3k | Automated safety check: Notes | MIT | |
| Storybook Testingyonatangross/orchestkit | 288 | — | ~2.3k | Automated safety check: Pass | MIT | |
| Economical Visual Testsigrlk/storybook-addon-test-codegen | 154 | 1 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Handsontable Visual Test Demoshandsontable/handsontable | 22k | — | ~1.3k | Automated safety check: Pass | Custom licence | |
| Computed Stylesbitovi/ai-enablement-prompts | 121 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Sanity Visual Regressionsanity-io/sanity | 6.4k | — | ~3.4k | Automated safety check: Pass | MIT |
yonatangross/orchestkit
Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking…
igrlk/storybook-addon-test-codegen
Author economical visual tests — full visual coverage in the fewest billable snapshots.
handsontable/handsontable
Explains how to add or change the demo pages that Handsontable's visual regression suite photographs, including per-feature routes in the js demo and the shared grid.
bitovi/ai-enablement-prompts
Extract and compare computed CSS styles between a baseline URL and a dev/Storybook URL using Playwright MCP evaluate calls.
sanity-io/sanity
Add, review, and maintain Chromatic visual regression coverage in the Sanity monorepo via dev/storybook stories, the vitest browser-mode suite, and Playwright e2e snapshots.
sickn33/agentic-awesome-skills
Generates SmartUI visual regression test configurations for screenshot comparison on TestMu AI cloud.
qf-studio/navigator
Create REST/GraphQL API endpoint with validation, error handling, and tests.
qf-studio/navigator
Load Navigator documentation navigator when starting development session, resuming work, or beginning new feature.
qf-studio/navigator
Generate backend tests (unit, integration, mocks) for existing code.
qf-studio/navigator
Create database migration with schema changes and rollback. An agent skill from qf-studio/navigator.
qf-studio/navigator
Create React/Vue component with TypeScript, tests, and styles.
qf-studio/navigator
Generate frontend component tests (React Testing Library, Vue Test Utils, snapshot) for existing components.
Categories
Setup visual regression testing with Storybook stories, configuration, and CI/CD workflows. Visual Regression is an agent skill from qf-studio/navigator. Setup visual regression testing with Storybook stories, configuration, and CI/CD workflows.
Visual Regression fits situations like: says set up visual regression; add Chromatic tests; add screenshot testing.
Run `npx skills add qf-studio/navigator --skill visual-regression -a claude-code`. Or copy the skill folder (skills/visual-regression in qf-studio/navigator) into .claude/skills/visual-regression in your project. Claude Code loads it when a task matches its description.
Run `npx skills add qf-studio/navigator --skill visual-regression -a codex`. Or copy the skill folder (skills/visual-regression in qf-studio/navigator) into .agents/skills/visual-regression in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add qf-studio/navigator --skill visual-regression -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/visual-regression, .gemini/skills/visual-regression, .github/skills/visual-regression and .opencode/skills/visual-regression in your project.
Going by SKILL.md and its folder, Visual Regression needs Python for the scripts in its folder, the command-line tools its instructions call (npm and npx) and credentials named CHROMATIC_PROJECT_TOKEN. Our summary lists: Python 3; Node.js; A credential in CHROMATIC_PROJECT_TOKEN. Its frontmatter pre-approves these tools: Read, Write, Bash, Glob.
SKILL.md names 1 domain. In commands or code: chromatic.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Visual Regression is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Visual Regression: Storybook Testing (yonatangross/orchestkit, 288 stars), Economical Visual Tests (igrlk/storybook-addon-test-codegen, 154 stars), Handsontable Visual Test Demos (handsontable/handsontable, 22k stars) and Computed Styles (bitovi/ai-enablement-prompts, 121 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
qf-studio (a GitHub organization) maintains it in qf-studio/navigator, which has 354 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 6, 2026.
Source: qf-studio/navigator on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.