AgentStack
SKILL verified MIT Self-run

Vibe Golden File Testing

skill-ash1794-vibe-engineering-golden-file-testing · by ash1794

Implements snapshot/golden file tests with temporal normalization so tests don't break daily. Use when implementing tests that compare output against expected snapshots.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-ash1794-vibe-engineering-golden-file-testing

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Vibe Golden File Testing? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

vibe-golden-file-testing

Golden file tests are powerful but brittle. This skill makes them robust.

When to Use This Skill

  • Implementing tests that compare output against saved expected output
  • Tests that currently break because dates, timestamps, or IDs change
  • API response testing with dynamic fields
  • CLI output testing

When NOT to Use This Skill

  • Simple unit tests with static assertions
  • Tests where the exact output IS the requirement (byte-for-byte)
  • Performance benchmarks

The Problem

Golden tests break when they contain:

  • Dates/timestamps (2026-02-28 → different tomorrow)
  • UUIDs/IDs (random each run)
  • Hostnames/ports (different per environment)
  • File paths (absolute paths differ per machine)
  • Durations (took 1.23s → varies by machine)

Steps

  1. Identify dynamic fields in the output being tested
  1. Create normalizer function:

`` func normalizeOutput(s string) string { // Dates: 2026-02-28 → REDACTED_DATE s = dateRegex.ReplaceAll(s, "REDACTED_DATE") // UUIDs: 550e8400-... → REDACTED_UUID s = uuidRegex.ReplaceAll(s, "REDACTED_UUID") // Timestamps: 1709136000 → REDACTED_TS s = tsRegex.ReplaceAll(s, "REDACTED_TS") // Durations: 1.23s → REDACTED_DURATION s = durationRegex.ReplaceAll(s, "REDACTED_DURATION") return s } ``

  1. Apply normalization to BOTH:
  • The actual output (at test time)
  • The golden file (at generation time)
  1. Generate golden file with update flag:

`` if os.Getenv("UPDATE_GOLDEN") == "1" { os.WriteFile(goldenPath, normalized, 0644) } ``

  1. Document update command:

`` # To update golden files: UPDATE_GOLDEN=1 go test ./... ``

Common Normalizations

| Pattern | Regex | Replacement | |---------|-------|-------------| | ISO Date | \d{4}-\d{2}-\d{2} | REDACTEDDATE | | ISO DateTime | \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2} | REDACTEDDATETIME | | UUID | [0-9a-f]{8}-[0-9a-f]{4}-... | REDACTEDUUID | | Unix timestamp | \b1[6-9]\d{8}\b | REDACTEDTS | | Duration | \d+\.?\d*[µnm]?s | REDACTEDDURATION | | Absolute path | /home/\w+/ or C:\\Users\\ | REDACTEDPATH | | Port | :\d{4,5}\b | :REDACTED_PORT |

Output Format

Golden File Setup: [Test Name]

Dynamic fields found: X Normalizations applied: Y Golden file: [path] Update command: UPDATE_GOLDEN=1 [test command]

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.