Agent skill

Managing Snapshot Tests

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Create and validate component snapshots for UI regression testing.

MITAuto-check passedTesting & QA

Install Managing Snapshot Tests

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-snapshot-tests -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace managing-snapshot-tests --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/managing-snapshot-tests .claude/skills/managing-snapshot-tests && rm -rf skills-src

Use ~/.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/

Facts

Skill name
managing-snapshot-tests
GitHub stars
2.8k
Token cost
~1.4k tokens
SKILL.md length
513 words
Files
4 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Create and validate component snapshots for UI regression testing.

  • Works in 7 steps: Identify components and data structures… → Write snapshot tests for each target → Organize snapshot files → …
  • Performing specialized testing
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Calls jest and vitest

What it does

Managing Snapshot Tests is an agent skill from jeremylongshore/tons-of-skills-marketplace. Create and validate component snapshots for UI regression testing. Use when performing specialized testing. Trigger with phrases like "update snapshots", "test UI snapshots", or "validate component snapshots".

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code

It sits in Testing & QA, covering QA and bug reports and Unit testing. It works with Jest and Vitest. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Performing specialized testing
  • With phrases like update snapshots
  • Test UI snapshots
  • Validate component snapshots

Example prompts

  • “update snapshots”
  • “test UI snapshots”
  • “validate component snapshots”
  • “/managing-snapshot-tests”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(test:snapshot-*)

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify components and data structures suitable for snapshot testing
  2. Write snapshot tests for each target
  3. Organize snapshot files
  4. Review and update snapshots when intentional changes occur
  5. Clean up obsolete snapshots
  6. Set up CI to fail on snapshot mismatches without auto-updating
  7. Consider property-based snapshot alternatives for large components

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(test:snapshot-*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • jest
    • vitest

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • jestjs.io
    • vitest.dev
    • testing-library.com
    • kentcdodds.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Managing Snapshot Tests loads about 1.4k tokens when it runs, and up to ~1.5k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 513 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.5k

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.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated 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); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 513 words, ~1,447 tokens.

Download SKILL.mdSave it as .claude/skills/managing-snapshot-tests/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
managing-snapshot-tests
description
Create and validate component snapshots for UI regression testing. Use when performing specialized testing. Trigger with phrases like "update snapshots", "test UI snapshots", or "validate component snapshots".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(test:snapshot-*)
compatibility
Designed for Claude Code
version
1.21.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
testing, snapshot-tests

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.
    • Periodically run snapshot cleanup to prevent stale data.
  6. Set up CI to fail on snapshot mismatches without auto-updating:
    • Use --ci flag which treats missing snapshots as failures.
    • Upload snapshot diff output as a CI artifact for review.
  7. Consider property-based snapshot alternatives for large components:
    • Use toMatchObject for partial structure matching.
    • Use custom serializers to exclude volatile fields.
Show full SKILL.md (188 more words)Show less

Output

  • Snapshot test files (*.test.ts or *.test.tsx) with toMatchSnapshot() assertions
  • Snapshot data files (__snapshots__/*.snap)
  • Snapshot update report listing changed, added, and removed snapshots
  • CI configuration preventing accidental snapshot updates in automated runs
  • Custom serializer modules for filtering dynamic content

Error Handling

ErrorCauseSolution
Snapshot mismatch on unrelated changeComponent depends on a shared style or context providerIsolate components with wrapper providers; mock global styles
Snapshot file is enormous (>1000 lines)Entire page DOM serialized instead of target componentNarrow the snapshot scope to the specific component subtree; use container.querySelector
Obsolete snapshot warningTest was renamed or deleted but .snap file remainsRun jest --updateSnapshot to remove orphaned entries; delete unused .snap files
Snapshot differs between local and CIDifferent Node.js version or OS renders slightly different outputPin Node.js version in CI; use toMatchInlineSnapshot for exact control
Non-deterministic snapshotComponent includes random keys, timestamps, or Math.random()Mock Date.now() and Math.random(); use expect.any(String) for volatile fields

Examples

React component snapshot test (Jest):

tsx
import { render } from '@testing-library/react';
import { Alert } from './Alert';

describe('Alert', () => {
  it('renders success variant', () => {
    const { container } = render(
      <Alert variant="success" message="Operation completed" />
    );
    expect(container.firstChild).toMatchSnapshot();
  });

  it('renders error with inline snapshot', () => {
    const { container } = render(
      <Alert variant="error" message="Something failed" />
    );
    expect(container.firstChild).toMatchInlineSnapshot(`
      <div class="alert alert-error" role="alert">
        <span>Something failed</span>
      </div>
    `);
  });
});

Custom serializer to exclude dynamic IDs:

typescript
// jest.config.ts
export default {
  snapshotSerializers: ['./test/serializers/strip-ids.ts'],
};

// test/serializers/strip-ids.ts
export const serialize = (val: string) =>
  val.replace(/id="[a-z0-9-]+"/g, 'id="[dynamic]"');
export const test = (val: unknown) => typeof val === 'string' && val.includes('id=');

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references, assets) in skills/.curated/managing-snapshot-tests of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • references/README.md
  • scripts/README.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Managing Snapshot Tests 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.

Managing Snapshot Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Managing Snapshot Tests this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: PassMIT
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Vitestpixel-point/animate-text1492 repos~1.3kAutomated safety check: PassNone
Designing TestsCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Playwright Testingchongdashu/vibejam-starter-pack149—~2.1kAutomated safety check: PassNone

Similar skills

  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Vitest

    pixel-point/animate-text

    Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest).

    149 GitHub starsUsed in 2 repos~1.3k tokens
    Testing & QAAuto-check passed
  • Designing Tests

    CloudAI-X/claude-workflow-v2

    Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.1k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.2k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Managing Snapshot Tests

What does Managing Snapshot Tests do?

Create and validate component snapshots for UI regression testing. Managing Snapshot Tests is an agent skill from jeremylongshore/tons-of-skills-marketplace. Create and validate component snapshots for UI regression testing.

When should I use Managing Snapshot Tests?

Managing Snapshot Tests fits situations like: performing specialized testing; with phrases like update snapshots; test UI snapshots; validate component snapshots.

How do I install Managing Snapshot Tests in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-snapshot-tests -a claude-code`. Or copy the skill folder (skills/.curated/managing-snapshot-tests in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/managing-snapshot-tests in your project. Claude Code loads it when a task matches its description.

How do I install Managing Snapshot Tests in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-snapshot-tests -a codex`. Or copy the skill folder (skills/.curated/managing-snapshot-tests in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/managing-snapshot-tests in your project. Codex loads it when a task matches its description.

Can I use Managing Snapshot Tests in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-snapshot-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/managing-snapshot-tests, .gemini/skills/managing-snapshot-tests, .github/skills/managing-snapshot-tests and .opencode/skills/managing-snapshot-tests in your project.

What does Managing Snapshot Tests need to run?

Going by SKILL.md and its folder, Managing Snapshot Tests needs the command-line tools its instructions call (jest and vitest). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(test:snapshot-*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Managing Snapshot Tests access the network?

SKILL.md names 4 domains. As links in the text: jestjs.io, vitest.dev, testing-library.com and kentcdodds.com. This is read from the text; nothing was executed.

Is Managing Snapshot Tests safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Managing Snapshot Tests use?

Managing Snapshot Tests is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Managing Snapshot Tests use?

About 1.4k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16 tokens, read only when the agent opens those files.

What are the alternatives to Managing Snapshot Tests?

Skills that share tags, products or a category with Managing Snapshot Tests: Vitest (supabase/supabase, 111k stars), Test Guard (amElnagdy/guard-skills, 1.3k stars), Vitest (pixel-point/animate-text, 149 stars) and Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Managing Snapshot Tests?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.