visual-regression-storybook-review
Reviews Storybook visual-testing setup -- test-runner wiring, Chromatic integration, and the a11y addon's axe-core gating -- to ensure visually-critical components have deterministic pixel-diff and accessibility coverage before merge, grounded in current Storybook docs.
Install
npx skills add https://github.com/VincentChuWaiChow/vanguard-frontier-agentic/tree/master/skills/frontend/visual-regression-storybook-review
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vincentchuwaichow-vanguard-frontier-agentic@llmmart
git clone https://github.com/VincentChuWaiChow/vanguard-frontier-agentic.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole vincentchuwaichow/vanguard-frontier-agentic collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Visual Regression (Storybook) Review
Purpose
Storybook can run three different kinds of automated checks -- the generic test-runner, hosted Chromatic visual/interaction diffing, and the a11y addon's axe-core accessibility checks -- and teams frequently conflate them or wire only one when they need two. This skill reviews which checks are actually wired, whether they gate merge or are advisory-only, and whether visually-critical components and all theme variants are in scope, grounded in current, version-specific Storybook API behavior rather than remembered config shapes that may be stale across majors.
When to use
Use this skill when the user asks to:
- review or configure Storybook's
test-runner, Chromatic, ora11yaddon setup, - diagnose why a visual or accessibility regression shipped despite Storybook tests passing,
- decide whether a check should run locally, in the test-runner, or via Chromatic,
- audit whether dark mode/RTL/reduced-motion story variants have visual and a11y coverage.
Context7 Documentation Protocol
Storybook's addon config shape (preVisit/postVisit hooks, parameters.a11y.*, chromatic.config.json fields) has changed across Storybook 8/9/10 and is documented, not folklore -- never assert a hook signature, parameter name, or default value from memory.
- Call
ToolSearchwith query"context7"(or"select:mcp__Context7__resolve-library-id,mcp__Context7__query-docs") to load the Context7 tools if not already loaded in this session. - Call
mcp__Context7__resolve-library-idwith library nameStorybookto obtain the current Context7-compatible ID (/storybookjs/storybook); prefer the resolved ID over guessing. - Call
mcp__Context7__query-docsfor the specific claim in question -- e.g. "test-runner preVisit postVisit hooks configuration", "a11y addon parameters.a11y.test values", "Chromatic config.json fields and CI wiring" -- before stating it as fact. Do this per review, not once from a prior session's memory. - Prefer the official docs URLs in
official_docsfor primary normative statements (exact parameter names, exact config shape); use Context7 to ground and cross-check the claim before writing it into a finding. - If Context7 is unavailable or returns no relevant match, fall back to the
official_docsURLs and mark the claimdocumentation-based (Context7 unavailable)rather than presenting it as freshly verified. - Never invent a config key, addon parameter, hook name, or axe-core rule ID that no queried source confirms.
Lean operating rules
- Distinguish the three tools explicitly:
test-runner(generic CI test harness, runs locally or in CI via Playwright-drivenpreVisit/postVisithooks), Chromatic (hosted visual + interaction diffing with a reviewer UI and git-provider sync), and thea11yaddon (axe-core checks configured throughparameters.a11y.*) -- do not treat them as interchangeable or assume one subsumes the others. - Confirm whether
parameters.a11y.testis set to'error'(fails the build on violations) rather than left unset or at'todo'(warns only) before crediting a project with enforced accessibility gating;'off'disables the check entirely except for manual panel review. - Require that visually-critical stories include dark mode, RTL, and
prefers-reduced-motionvariants in the checked set, not just the default light theme -- a diff/a11y suite that only ever renders the default theme systematically misses regressions in every other supported mode. - Verify the exact addon/config API shape (e.g.,
preVisit/postVisithook signatures,injectAxe/configureAxe/checkA11yfromaxe-playwright, orparameters.a11y.context/config/options) against the installed Storybook major version before recommending a.storybook/test-runner.tsorpreview.tsdiff, since these shapes have changed across Storybook 8/9/10. - Recommend masking or mocking non-deterministic content (timestamps, animations, randomized data, live network responses) before recommending a looser pixel-diff tolerance -- widening tolerance first hides the actual source of visual noise rather than fixing it.
- Treat the test-runner and Chromatic as complementary, not redundant: the test-runner can run custom assertions locally and in any CI, while Chromatic adds hosted visual/interaction diffing with reviewer approval and git sync; a project that has only one may still have a real coverage gap depending on what it needs.
- Load the design-token-governance skill instead of this one when the root cause is a token/contrast issue rather than a Storybook wiring gap; load
wcag-22-accessibility-auditwhen the question is about accessibility compliance strategy broader than what thea11yaddon checks.
References
Load these only when needed:
- Test-runner and Chromatic wiring -- use when reviewing or configuring the
test-runner'spreVisit/postVisithooks, CI invocation, or Chromatic project setup and the distinction between the two. - Accessibility addon gating -- use when reviewing or configuring the
a11yaddon'sparameters.a11y.testgating behavior, axe-core rule configuration, or diagnosing why violations aren't failing CI. - Theme and variant coverage -- use when auditing whether dark mode, RTL, and reduced-motion story variants have visual/a11y coverage, or when non-deterministic content needs masking before diffing.
Response minimum
Return, at minimum:
- which of the three tools (test-runner/Chromatic/a11y addon) is in scope and whether it currently gates merge,
- theme/variant coverage gap (dark mode, RTL, reduced-motion) if any,
- evidence level and the Storybook major version the guidance targets,
- proposed config diff (not applied),
- security caveat on any Chromatic/Percy token or PII-bearing baseline reviewed.
Files (vanguard-frontier-agentic)
-
references
-
accessibility-addon-gating.md 6.9 KB
# Accessibility Addon (a11y) Gating Use this reference when reviewing or configuring the `a11y` addon's `parameters.a11y.test` gating behavior, axe-core rule configuration, or diagnosing why accessibility violations aren't failing CI despite the addon being installed. For test-runner/Chromatic wiring, see `test-runner-and-chromatic-wiring.md`. For dark mode/RTL/reduced-motion coverage of the stories being checked, see `theme-and-variant-coverage.md`. > Version note: `parameters.a11y.test` and the `initialGlobals`/`globals.a11y.manual` flag are current documented shapes; the addon's config surface has changed across Storybook majors (notably the move to `parameters.a11y.test` gating via the Vitest addon or test-runner). Verify the exact parameter names against the installed Storybook version via Context7 (`/storybookjs/storybook`) or the official docs before writing a config diff. ## What people get wrong The common bad assumption is: > The `a11y` addon is installed, so accessibility violations block merge. That is false by default. The addon being installed only means violations are visible in the Storybook UI's a11y panel during manual browsing. Whether a violation actually fails a build depends entirely on the `parameters.a11y.test` value, which is `undefined` (no enforced test behavior) unless explicitly set. ## Officially grounded shape The accessibility addon is built on `axe-core`; its configuration options largely map to axe-core's own API surface: | Property | Default | Description | |---|---|---| | `parameters.a11y.context` | `'body'` | Context passed to `axe.run` -- which elements checks run against. | | `parameters.a11y.config` | (empty) | Configuration passed to `axe.configure()` -- most commonly used to enable/disable individual rules. | | `parameters.a11y.options` | `{}` | Options passed to `axe.run` -- can adjust which rulesets are checked. | | `parameters.a11y.test` | `undefined` | Determines test behavior when run with the Vitest addon or the test-runner. | | `globals.a11y.manual` | `undefined` | Set `true` to prevent a story from being automatically analyzed when visited. | `parameters.a11y.test` accepts exactly three documented values: - `'off'` -- do not run accessibility tests automatically (manual panel review is still possible). - `'todo'` -- run accessibility tests; violations surface as a **warning** in the Storybook UI, not a failing test. - `'error'` -- run accessibility tests; violations surface as a **failing test** in the Storybook UI and CLI/CI. This parameter can be set at the project level (`.storybook/preview.ts`), the component level (a story file's meta/default export), or an individual story level -- so a project can have global `'error'` gating with a deliberate `'todo'` or `'off'` override on a specific known-noisy story, or the reverse (global `'todo'` with `'error'` only on a few critical components). Either shape is valid; the review's job is to confirm which shape actually exists and whether it matches intent. For test-runner-based enforcement (as opposed to the Vitest addon), the documented pattern injects and configures axe via the `axe-playwright` package inside the `preVisit`/`postVisit` hooks: ```typescript import type { TestRunnerConfig } from '@storybook/test-runner'; import { getStoryContext } from '@storybook/test-runner'; import { injectAxe, checkA11y, configureAxe } from 'axe-playwright'; const config: TestRunnerConfig = { async preVisit(page) { await injectAxe(page); }, async postVisit(page, context) { const storyContext = await getStoryContext(page, context); await configureAxe(page, { rules: storyContext.parameters?.a11y?.config?.rules, }); const element = storyContext.parameters?.a11y?.element ?? 'body'; await checkA11y(page, element, { detailedReport: true, detailedReportOptions: { html: true }, }); }, }; export default config; ``` Note this is a distinct enforcement path from `parameters.a11y.test` (which governs the addon's own Vitest-addon/test-runner-integrated behavior) -- a project wiring axe manually through `axe-playwright` in `preVisit`/`postVisit` is not automatically respecting `parameters.a11y.test`, and the two should not be assumed to be reading the same configuration unless the `postVisit` hook explicitly reads `storyContext.parameters?.a11y?.config`. ## Non-negotiable design rules 1. **Never credit "a11y addon is installed" as accessibility gating without confirming `parameters.a11y.test` is `'error'`** (or that a manual `axe-playwright` wiring in `postVisit` calls `checkA11y` in a way that actually fails the test runner process, not just logs a report). `'todo'` and the addon's default unset state are advisory only. 2. **Confirm which enforcement path is in use** -- `parameters.a11y.test` via the Vitest addon/test-runner integration, or a manually wired `axe-playwright` `preVisit`/`postVisit` pair -- before writing a config diff; they are configured differently and a fix aimed at the wrong path silently does nothing. 3. **Do not recommend disabling a rule globally via `parameters.a11y.config.rules` to silence a violation** without first confirming the violation is a false positive for the actual DOM/ARIA semantics in question, not a real defect the team wants to suppress. 4. **Respect `globals.a11y.manual: true` as an intentional opt-out signal**, not dead config -- confirm with the team whether a story marked `manual` is deliberately excluded (e.g., because it renders non-deterministic third-party content) before treating its absence from automated coverage as a gap to fix by removing the flag. 5. **Scope `parameters.a11y.context` deliberately** when a story wraps content the team doesn't own (e.g., a third-party embed) -- running the full-page `axe.run` against unowned markup produces violations the team cannot fix and trains reviewers to ignore the panel. ## Safe verification targets - `.storybook/preview.ts` -- confirm the project-level `parameters.a11y.test` value and any `initialGlobals.a11y.manual` default. - Individual story files -- confirm component/story-level `parameters.a11y` overrides match documented intent (not accidental inheritance). - `.storybook/test-runner.ts` -- if `axe-playwright` is used, confirm `preVisit` calls `injectAxe` and `postVisit` calls `checkA11y` with a real failure path (not a report-only call whose result is discarded). - CI logs from a Storybook build with a known-injected violation -- the most reliable evidence that gating is real is a CI run that actually failed on a deliberate violation, not just config inspection. ## When to push back Push back if the user asks for: - treating `'todo'` as sufficient gating because "it shows up in the UI," - disabling a specific axe rule project-wide to unblock a single component's merge, as a permanent fix rather than a scoped, justified exception, - adding the `a11y` addon without setting `parameters.a11y.test` anywhere, and calling that "accessibility testing is now covered." Visibility in a panel is not the same as a merge-blocking test. -
test-runner-and-chromatic-wiring.md 5.7 KB
# Test-Runner and Chromatic Wiring Use this reference when reviewing or configuring the Storybook `test-runner`'s `preVisit`/`postVisit` hooks, its CI invocation, Chromatic project setup, or when a user is unclear on the difference between the two. For axe-core/a11y gating specifics, see `accessibility-addon-gating.md`. For theme/variant coverage, see `theme-and-variant-coverage.md`. > Version note: hook signatures and helper exports (`getStoryContext`, `waitForPageReady`) live in `@storybook/test-runner` and have evolved across Storybook majors. Verify exact exports and signatures against the installed version via Context7 (`/storybookjs/storybook`) or the official docs before citing one as available. ## What people get wrong The common bad assumption is: > "We have Storybook tests" means visual regressions are covered. That is not necessarily true. A project can have: - a `test-runner` that only asserts `expect(canvas).toBeInTheDocument()`-style smoke checks, with no image snapshot step at all, - Chromatic connected but running in "notify only" mode with no branch protection requiring the check, - both tools installed, but neither one covering the components the team actually considers visually critical. "Storybook tests exist" and "visual regressions are gated" are different claims. Confirm which one is actually true before crediting a project with coverage. ## Officially grounded shape Per Storybook's own documentation, the `test-runner` and Chromatic are described as complementary, not redundant: - **The `test-runner`** is a generic testing tool, built on Playwright, that can run locally or in CI and be configured or extended to run "all kinds of tests." It exposes a `preVisit`/`postVisit` hook API in `.storybook/test-runner.ts`: - `setup()` runs once before the test runner starts. - `preVisit(page, context)` runs before a story is rendered; `page` is Playwright's page object, `context` carries the story's id/title/name. - `postVisit(page, context)` runs after a story is fully rendered; this is where image-snapshot assertions and `getStoryContext(page, context)` (to read the story's full parameters/args/argTypes) typically go. - `waitForPageReady(page)` is a documented helper for image-snapshot testing that waits for the page -- including async items like images and fonts -- to finish loading before a screenshot is taken; skipping it is a common source of flaky screenshot diffs on slow-loading assets. - **Chromatic** is a cloud-based service that runs visual and interaction tests without the team having to set up the test-runner itself. It syncs with the git provider and manages access control for private projects. Storybook's own docs describe using the test-runner locally and Chromatic in CI as a valid pairing: use Chromatic for visual and component tests, and the test-runner for other custom tests. - Chromatic project configuration lives in `chromatic.config.json` (fields such as `projectId`, `buildScriptName`, `zip`, `debug`) rather than being hardcoded into CI invocation flags. ## Non-negotiable design rules 1. **Do not credit "Storybook tests pass" as visual coverage without confirming a diffing step exists.** A `test-runner` config with no image-snapshot assertion in `postVisit`, and no Chromatic connection, has zero visual-regression coverage regardless of how many stories exist. 2. **Confirm the check is required, not advisory.** A connected Chromatic project that is not set as a required status check on the default branch's protection rules can be bypassed by any merge; "connected" and "gating" are different claims and must be verified separately (repo evidence: branch protection config, not just Chromatic dashboard presence). 3. **Use `waitForPageReady` (or an equivalent explicit wait) before any screenshot assertion in `postVisit`.** Taking a screenshot before fonts/images finish loading produces non-deterministic diffs that erode trust in the whole suite and lead teams to loosen thresholds instead of fixing the real timing bug. 4. **Do not run the test-runner without `preVisit`/`postVisit` review when adding a11y or visual checks.** These hooks are the only place axe injection and screenshot assertions can run per-story with access to `getStoryContext`; bolting checks on outside this API produces inconsistent coverage across stories. 5. **When both the test-runner and Chromatic exist, confirm they aren't duplicating the same check with different tolerances.** Two visual-diff mechanisms with different pixel-diff thresholds on the same components is a maintenance and false-confidence problem, not defense in depth. ## Safe verification targets - `.storybook/test-runner.ts` (or `.js`) -- confirm `preVisit`/`postVisit` hooks exist and what they assert. - `chromatic.config.json` and the CI workflow step invoking `chromatic` -- confirm `projectId` is present and the step is wired into a required CI job, not an optional/manual trigger. - Branch protection rules (repo settings, not just CI YAML) -- confirm the Chromatic and/or test-runner CI check is marked required before merge. - `package.json` `test-storybook` script and its CI invocation flags (e.g. `--ci`, coverage flags) -- confirm it's actually called in CI, not just defined locally. ## When to push back Push back if the user asks for: - widening a `test-runner` image-snapshot diff threshold as the first response to flaky screenshots, before confirming `waitForPageReady` or explicit content masking is in place, - connecting Chromatic without also making it a required CI check, calling that "visual regression coverage," - removing the test-runner because "Chromatic covers it," without confirming Chromatic's scope actually includes the custom assertions the test-runner was running. Those are shortcuts that produce the appearance of coverage without the substance. -
theme-and-variant-coverage.md 5.5 KB
# Theme and Variant Coverage Use this reference when auditing whether dark mode, RTL, and `prefers-reduced-motion` story variants have visual and accessibility coverage, or when non-deterministic content needs masking/mocking before a pixel diff is trustworthy. For the mechanics of the test-runner and Chromatic themselves, see `test-runner-and-chromatic-wiring.md`. For axe-core gating specifics, see `accessibility-addon-gating.md`. ## What people get wrong The common bad assumption is: > If the default-theme story passes visual and a11y checks, the component is covered. That is incomplete. A component's rendered DOM, computed contrast ratios, and layout can all differ meaningfully across: - **color scheme** (light vs. dark, or any custom theme the design system supports) -- contrast ratios computed by axe-core in a light-theme snapshot say nothing about the dark-theme token pairing, which is a distinct set of color values, - **text direction** (LTR vs. RTL) -- logical layout bugs (icon placement, padding asymmetry, text truncation direction) frequently only appear in RTL and are invisible in an LTR-only snapshot, - **motion preference** (`prefers-reduced-motion: reduce`) -- a component that only has an animated entrance story has no coverage confirming the reduced-motion fallback renders correctly, not just "does not animate." A visual-regression suite that only ever renders the default light/LTR/motion-enabled variant of each component has verified one of potentially four-plus meaningfully different rendered states, and will not catch a regression introduced in any of the others. ## Officially grounded shape Storybook does not automatically render every theme/direction/motion-preference permutation of a story -- coverage of these dimensions is a function of how many story variants exist and whether decorators or globals feed them into each render. Confirm, as repo evidence rather than assumption, whether: - a dark-mode (or multi-theme) decorator/global exists and is exercised by dedicated stories, not just toggle-able in the manual Storybook UI, - RTL stories exist using the project's actual RTL mechanism (e.g. a `dir="rtl"` wrapper decorator), not just documented as "supported" in a design doc, - a `prefers-reduced-motion` variant exists, typically via a decorator that sets the media feature for the story's iframe, or via a dedicated reduced-motion story. `parameters.a11y.context` (see `accessibility-addon-gating.md`) determines what markup axe-core inspects per story -- confirm it is not silently scoped in a way that excludes the very wrapper (e.g. an RTL `dir` wrapper) whose correctness is under test. ## Non-negotiable design rules 1. **Do not count a single default-theme story as coverage for "the component supports dark mode."** Supporting a capability in code and having a regression-tested story for it are different claims; only the latter catches a regression. 2. **Mask or mock non-deterministic content before adding any new theme/variant story to a visual diff, rather than after a flaky failure appears.** Timestamps, live avatars, randomized placeholder data, and animated content are common sources of false-positive diffs; the fix is explicit masking (e.g. a `mask` option, disabled animations, or seeded fixture data) applied at story-authoring time, not a loosened global threshold applied later. 3. **Treat RTL coverage as a layout-logic concern, not a translation concern.** An RTL story does not need translated text to be useful -- it needs the same content rendered with `dir="rtl"` to catch physical-vs-logical CSS property bugs (e.g. `margin-left` instead of `margin-inline-start`). 4. **Treat `prefers-reduced-motion` coverage as a distinct assertion from "does it animate," not a subset of it.** A story confirming the *entrance* animation looks right says nothing about whether the reduced-motion fallback (often a hard cut or fade) is also correct; test both if the component is animated. 5. **Prioritize theme/variant coverage by actual usage risk, not exhaustive permutation.** A component used only in an admin-only, LTR-only internal tool does not need RTL coverage; a design-system primitive used across public, internationalized surfaces does. Recommend coverage proportional to blast radius, not maximal coverage for its own sake. ## Safe verification targets - Story files for visually-critical components -- confirm the presence (or absence) of theme/direction/motion story variants, not just the default export. - `.storybook/preview.ts` decorators and globals -- confirm a theme-switching or `dir`-setting decorator exists and is actually wired into the stories claimed to cover it. - The test-runner's `postVisit` hook or Chromatic's captured snapshot list -- confirm the theme/variant stories are actually included in the set of stories being diffed, not excluded by a `tags` filter or story-level skip. ## When to push back Push back if the user asks for: - claiming "dark mode is covered" based on a single manually-toggled preview in local dev, with no corresponding story or CI snapshot, - adding an RTL story with translated placeholder text but no `dir="rtl"` wrapper, which tests translation rendering but not the actual logical-CSS layout bug class RTL coverage exists to catch, - deferring reduced-motion coverage indefinitely on an animation-heavy component while treating it as low priority, without characterizing the actual user population affected (motion-sensitivity accommodations are an accessibility requirement, not a nice-to-have). Partial coverage presented as complete coverage is worse than an honestly documented gap.
-
-
metadata.json 1.3 KB
{ "id": "visual-regression-storybook-review", "name": "Visual Regression (Storybook) Review", "type": "skill", "provider": "frontend", "harnesses": [ "claude-code", "cursor", "codex", "gemini", "kiro", "other" ], "summary": "Reviews Storybook-based visual regression and accessibility gating (test-runner, a11y addon, Chromatic integration) to ensure visually-critical components have deterministic pixel-diff and axe-core coverage before merge.", "source_type": "original", "official_docs": [ "https://storybook.js.org/docs/writing-tests/visual-testing", "https://storybook.js.org/docs/writing-tests/integrations/test-runner", "https://storybook.js.org/docs/writing-tests/accessibility-testing", "https://www.w3.org/TR/WCAG21/#contrast-minimum" ], "security_notes": "Chromatic/Percy project tokens used in CI must be scoped per-project secrets, not account-wide credentials, and never committed to `chromatic.config.json` or `.storybook/main.js`. Screenshot baselines must not capture real user PII from a staging environment seeded with production-like data.", "last_verified": "2026-07-02", "path": "skills/frontend/visual-regression-storybook-review", "author": "github: VincentChuWaiChow", "version": "0.1.0" } -
SKILL.md 6.3 KB
--- name: visual-regression-storybook-review description: Reviews Storybook visual-testing setup -- test-runner wiring, Chromatic integration, and the a11y addon's axe-core gating -- to ensure visually-critical components have deterministic pixel-diff and accessibility coverage before merge, grounded in current Storybook docs. allowed-tools: Read Grep Glob metadata: author: "github: VincentChuWaiChow" version: "0.1.0" updated: "2026-07-02" category: delivery --- # Visual Regression (Storybook) Review ## Purpose Storybook can run three different kinds of automated checks -- the generic `test-runner`, hosted Chromatic visual/interaction diffing, and the `a11y` addon's axe-core accessibility checks -- and teams frequently conflate them or wire only one when they need two. This skill reviews which checks are actually wired, whether they gate merge or are advisory-only, and whether visually-critical components and all theme variants are in scope, grounded in current, version-specific Storybook API behavior rather than remembered config shapes that may be stale across majors. ## When to use Use this skill when the user asks to: - review or configure Storybook's `test-runner`, Chromatic, or `a11y` addon setup, - diagnose why a visual or accessibility regression shipped despite Storybook tests passing, - decide whether a check should run locally, in the test-runner, or via Chromatic, - audit whether dark mode/RTL/reduced-motion story variants have visual and a11y coverage. ## Context7 Documentation Protocol Storybook's addon config shape (`preVisit`/`postVisit` hooks, `parameters.a11y.*`, `chromatic.config.json` fields) has changed across Storybook 8/9/10 and is documented, not folklore -- never assert a hook signature, parameter name, or default value from memory. 1. Call `ToolSearch` with query `"context7"` (or `"select:mcp__Context7__resolve-library-id,mcp__Context7__query-docs"`) to load the Context7 tools if not already loaded in this session. 2. Call `mcp__Context7__resolve-library-id` with library name `Storybook` to obtain the current Context7-compatible ID (`/storybookjs/storybook`); prefer the resolved ID over guessing. 3. Call `mcp__Context7__query-docs` for the specific claim in question -- e.g. "test-runner preVisit postVisit hooks configuration", "a11y addon parameters.a11y.test values", "Chromatic config.json fields and CI wiring" -- before stating it as fact. Do this per review, not once from a prior session's memory. 4. Prefer the official docs URLs in `official_docs` for primary normative statements (exact parameter names, exact config shape); use Context7 to ground and cross-check the claim before writing it into a finding. 5. If Context7 is unavailable or returns no relevant match, fall back to the `official_docs` URLs and mark the claim `documentation-based (Context7 unavailable)` rather than presenting it as freshly verified. 6. Never invent a config key, addon parameter, hook name, or axe-core rule ID that no queried source confirms. ## Lean operating rules - Distinguish the three tools explicitly: `test-runner` (generic CI test harness, runs locally or in CI via Playwright-driven `preVisit`/`postVisit` hooks), Chromatic (hosted visual + interaction diffing with a reviewer UI and git-provider sync), and the `a11y` addon (axe-core checks configured through `parameters.a11y.*`) -- do not treat them as interchangeable or assume one subsumes the others. - Confirm whether `parameters.a11y.test` is set to `'error'` (fails the build on violations) rather than left unset or at `'todo'` (warns only) before crediting a project with enforced accessibility gating; `'off'` disables the check entirely except for manual panel review. - Require that visually-critical stories include dark mode, RTL, and `prefers-reduced-motion` variants in the checked set, not just the default light theme -- a diff/a11y suite that only ever renders the default theme systematically misses regressions in every other supported mode. - Verify the exact addon/config API shape (e.g., `preVisit`/`postVisit` hook signatures, `injectAxe`/`configureAxe`/`checkA11y` from `axe-playwright`, or `parameters.a11y.context`/`config`/`options`) against the installed Storybook major version before recommending a `.storybook/test-runner.ts` or `preview.ts` diff, since these shapes have changed across Storybook 8/9/10. - Recommend masking or mocking non-deterministic content (timestamps, animations, randomized data, live network responses) before recommending a looser pixel-diff tolerance -- widening tolerance first hides the actual source of visual noise rather than fixing it. - Treat the test-runner and Chromatic as complementary, not redundant: the test-runner can run custom assertions locally and in any CI, while Chromatic adds hosted visual/interaction diffing with reviewer approval and git sync; a project that has only one may still have a real coverage gap depending on what it needs. - Load the design-token-governance skill instead of this one when the root cause is a token/contrast issue rather than a Storybook wiring gap; load `wcag-22-accessibility-audit` when the question is about accessibility compliance strategy broader than what the `a11y` addon checks. ## References Load these only when needed: - [Test-runner and Chromatic wiring](references/test-runner-and-chromatic-wiring.md) -- use when reviewing or configuring the `test-runner`'s `preVisit`/`postVisit` hooks, CI invocation, or Chromatic project setup and the distinction between the two. - [Accessibility addon gating](references/accessibility-addon-gating.md) -- use when reviewing or configuring the `a11y` addon's `parameters.a11y.test` gating behavior, axe-core rule configuration, or diagnosing why violations aren't failing CI. - [Theme and variant coverage](references/theme-and-variant-coverage.md) -- use when auditing whether dark mode, RTL, and reduced-motion story variants have visual/a11y coverage, or when non-deterministic content needs masking before diffing. ## Response minimum Return, at minimum: - which of the three tools (test-runner/Chromatic/a11y addon) is in scope and whether it currently gates merge, - theme/variant coverage gap (dark mode, RTL, reduced-motion) if any, - evidence level and the Storybook major version the guidance targets, - proposed config diff (not applied), - security caveat on any Chromatic/Percy token or PII-bearing baseline reviewed.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.