Agent skill · operations · jeremylongshore
managing-snapshot-tests
Create and validate component snapshots for UI regression testing.
Why this skill is useful
Provides specific patterns and commands for managing snapshot tests that the AI wouldn't reliably generate on its own.
What it needs
Requires jest, pytest, vitest installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Snapshot Test Manager Overview Create, update, and maintain snapshot tests for UI components and data structures using Jest, Vitest, or pytest snapshot plugins. Manages serialized output snapshots (HTML, JSON, component trees) to detect unexpected changes in rendered output. Prerequisites Jest or Vitest with built-in snapshot support, or pytest-snapshot/syrupy for Python React Testing Library, Vue Test Utils, or equivalent for component rendering Snapshot files committed to version control (.snap files or snapshots/ directory) Component library with stable prop interfaces Code review process that includes snapshot diff review Instructions 1. Identify components and data structures suitable for snapshot testing: UI components with complex rendered output (navigation bars, forms, cards). API response transformers producing structured JSON. Configuration generators outputting YAML or TOML. Avoid snapshots for highly dynamic content (timestamps, random IDs). 2. Write snapshot tests for each target: Render the component with representative props. Call expect(result).toMatchSnapshot() or toMatchInlineSnapshot(). Create separate snapshots for each meaningful prop combination. Use inline snapshots for small outputs (under 20 lines) for better readability. 3. Organize snapshot files: Group snapshots by component in snapshots/ComponentName.test.ts.snap. Name each snapshot descriptively: "renders with error state", "displays loading skeleton". Keep snapshot files in the same directory as the test file. 4. Review and update snapshots when intentional changes occur: Run jest --updateSnapshot or vitest --update after verifying changes are correct. Review every line of the snapshot diff in pull requests -- do not blindly update. Add a comment in the PR explaining why snapshots changed. 5. Clean up obsolete snapshots: Run jest --ci to detect obsolete snapshots that no longer match any test. Delete orphaned .snap files for removed components. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/managing-snapshot-tests--02607a