Tooluck logoTooluck
SKILL.md

snapshot-testing

Agent skill fromAaronontheweb/dotnet-skills

Use Verify for snapshot testing in .NET. Approve API surfaces, HTTP responses, rendered emails, and serialized outputs. Detect unintended changes through human-reviewed baseline files.

How to install snapshot-testing

install snapshot-testing
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills

# or add only this skill to Claude Code: copy the folder

skills/snapshot-testing/

# into

~/.claude/skills/snapshot-testing/ (all projects)

.claude/skills/snapshot-testing/ (one project)

skills/snapshot-testing/SKILL.md

MITFull file
1# Snapshot Testing with Verify
2
3## When to Use This Skill
4
5Use snapshot testing when:
6- Verifying rendered output (HTML emails, reports, generated code)
7- Approving public API surfaces for breaking change detection
8- Testing HTTP response bodies and headers
9- Validating serialization output
10- Catching unintended changes in complex objects
11
12---
13
14## What is Snapshot Testing?
15
16Snapshot testing captures output and compares it against a human-approved baseline:
17
181. **First run**: Test generates a `.received.` file with actual output
192. **Human review**: Developer approves it, creating a `.verified.` file
203. **Subsequent runs**: Test compares output against `.verified.` file
214. **Changes detected**: Test fails, diff tool shows differences for review
22
23This catches **unintended changes** while allowing **intentional changes** through explicit approval.
24
25---
26
27## Installation
28
29### Add Verify Package
30
31```bash
32dotnet add package Verify.Xunit
33# or for other test frameworks:
34dotnet add package Verify.NUnit
35dotnet add package Verify.MSTest
36```
37
38### Configure ModuleInitializer
39
40Create a `ModuleInitializer.cs` in your test project:
41
42```csharp
43using System.Runtime.CompilerServices;
44
45public static class ModuleInitializer
46{
47 [ModuleInitializer]
48 public static void Init()
49 {
50 // Use source-file-relative paths for verified files
51 VerifyBase.UseProjectRelativeDirectory("Snapshots");
52
53 // Configure diff tool (optional - auto-detected)
54…

Excerpt shown under the repository's MIT license.

More skills in dotnet-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates