Agent skill
update-test-snapshots
Regenerate test snapshot files after intentional markdown output changes. Use after modifying templates or rendering logic.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/update-test-snapshots
SKILL.md
Update Test Snapshots
Purpose
Regenerate all test snapshot (golden file) baselines when intentional changes are made to markdown output. This updates the expected outputs that snapshot tests compare against.
Hard Rules
Must
- Use the stable wrapper script:
scripts/update-test-snapshots.sh - Script will handle deleting old snapshots, running tests, and verification automatically
- Always allow this script — it only modifies test snapshot files, no production code
- Review the git diff of snapshot changes before committing
Must Not
- Manually copy files to update snapshots
- Update snapshots without understanding why they changed
- Run without first verifying the new output is correct
- Skip reviewing snapshot diffs before committing
Actions
Regenerate All Snapshots
scripts/update-test-snapshots.sh
This single command:
- Deletes all existing snapshot files in
tests/Oocx.TfPlan2Md.Tests/TestData/Snapshots/ - Runs snapshot tests (which will fail but create new snapshots)
- Counts generated snapshots to verify success
- Runs snapshot tests again to verify they pass with new baselines
- Reports success with instructions to review changes
Expected Output
[INFO] Deleting existing snapshot files...
[INFO] ✓ Deleted 6 snapshot files
[INFO] Running snapshot tests to regenerate files...
[INFO] (Tests will fail on first run, but will create new snapshots)
[INFO] ✓ Generated 6 new snapshot files
[INFO] Running snapshot tests again to verify...
[INFO] ✅ All snapshot tests pass!
Snapshots updated successfully. Review changes with:
git diff tests/Oocx.TfPlan2Md.Tests/TestData/Snapshots
When to Use
- After intentionally modifying template files (
.scribantemplates) - After changing markdown rendering logic
- After updating formatting rules (value escaping, table formatting, etc.)
- After adding new snapshot tests
- When snapshot tests fail due to expected changes
What Gets Updated
Snapshot files in tests/Oocx.TfPlan2Md.Tests/TestData/Snapshots/:
comprehensive-demo.md- Full comprehensive demo outputsummary-template.md- Summary template outputbreaking-plan.md- Edge cases with escapingrole-assignments.md- Role assignment renderingfirewall-rules.md- Firewall rule semantic diffmulti-module.md- Multi-module plan output
After Running
Always review the changes:
git diff tests/Oocx.TfPlan2Md.Tests/TestData/Snapshots/
Verify the changes match your expectations, then stage and commit:
git add tests/Oocx.TfPlan2Md.Tests/TestData/Snapshots/
git commit -m "test: update snapshots after [describe change]"
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?