amey-thakur/ai-skills/golden-master
Claude Code and agent skill by amey-thakur/ai-skills
- community
Checking that the SKILL.md file is still in the repository.
Capture the current output of untested legacy code as a recorded baseline so a refactor can prove it changed nothing. Use when about to restructure code whose behavior you must preserve but cannot yet specify.
Install
npx vskill@latest install amey-thakur/ai-skills/golden-masterSKILL.md
The same SKILL.md was published earlier as amey-thakur/ai-skills/golden-master.
Golden master testing
Legacy code with no tests but load-bearing behavior is the hardest thing to change safely: you cannot assert what it should do, only what it does today. A golden master, also called a characterization test, records the current output across a wide range of inputs and then fails the instant a refactor shifts any of it. It buys you a safety net before you touch the wiring.
Method
- Find a seam that captures observable output. Pick the widest boundary
whose result is deterministic: a function return, a rendered file, a serialized response. If output depends on the clock, database, or network, pin those first with fixed seeds and fakes.
- Generate a broad input corpus. Replay real production samples, sweep
parameter ranges, and add seeded random inputs. Aim for coverage of the branches you are about to disturb, not a tidy handful. Ten thousand cases is normal here, not excessive.
- Record the baseline once and commit it. Run the current code over the
corpus, write every output to a file, and commit it as the master. This snapshot is the specification you did not have, warts included.
- Diff every run against the committed master. The test recomputes
output over the same corpus and compares byte for byte. A tool like TextTest, ApprovalTests, or a plain diff in CI reports the first mismatch as a failure.
- Refactor in small steps and rerun after each. Extract a method, run
the master; rename a variable, run the master. A green diff after each step means the change was behavior-preserving. A red one localizes the mistake to the last edit.
- Investigate every diff before re-recording. A changed output is a
claim that behavior moved. Confirm the change is intended and correct, then regenerate the master deliberately. Blindly re-recording to get green throws away the entire safety net.
- Retire the master as real tests arrive. Once you understand a branch
well enough to write a named behavioral test, write it and shrink the corpus. The golden master is scaffolding, not the finished suite.
Checks
- Does the master fail if you invert a single condition in the code under
test? If not, the corpus does not exercise that path.
- Is every source of nondeterminism pinned, so two clean runs produce
identical output?
- Can a reviewer see exactly which inputs changed output when a diff appears?
Boundaries
Golden masters preserve behavior; they do not judge whether that behavior is correct. They lock in existing bugs on purpose. Once the code is understood, defer to unit-test-design and approval-testing for tests a human can read and reason about.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/testing/golden-master/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 2
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/amey-thakur/ai-skills/golden-master)