oracle-past-output

Applies snapshot, approval, and characterization testing techniques that use past outputs as test oracles.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-past-output-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oracle-past-output
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/oracle-past-output
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-past-output-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When expected values cannot be written by hand one at a time, this Skill provides oracle techniques that pin correctness against past outputs, covering golden/snapshot tests, approval testing, and characterization testing for legacy code. ## Core Features & Use Cases - Golden/Snapshot Testing: Fix rendered output, formatted strings, or generated code as a baseline and judge pass/fail by diff, with normalization of nondeterministic values like timestamps and random IDs. - Approval Testing: Manage received/approved file pairs with a human review workflow that records who approved what and why. - Characterization Testing: Record the current behavior of legacy code as a safety net before refactoring, separating "current behavior" from "needs review" entries so bugs are not frozen in as spec. - Use Case: You inherit an untested discount calculation module. Record its actual outputs as characterization tests, flag suspicious results like NaN for review, then refactor safely under the green safety net. ## Quick Start Use the oracle-past-output skill to set up snapshot and characterization tests for my legacy report generation module.

Frequently Asked Questions about oracle-past-output

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write snapshot tests in TypeScript with vitest?

Call expect(output).toMatchSnapshot() inside a vitest test to save the first output as a golden baseline. Later runs compare against it, and any diff must be reviewed by a human before updating the baseline.

What is the difference between snapshot testing and approval testing?

Approval testing is the general form of snapshot testing. It works with any artifact such as text, images, or PDFs, and requires a human to review received versus approved files in a viewer and record who approved the change and why.

How do I add tests to legacy code that has no specification?

Use characterization testing: enumerate real call patterns from logs or callers, record the actual outputs as test expectations, and mark suspicious behavior as needing review. This creates a safety net before refactoring without assuming current behavior is correct.

Why do my snapshot tests fail on every run?

Nondeterministic values like timestamps, random IDs, UUIDs, or unordered output cause constant diffs. Normalize or mask these elements before capturing the snapshot, and verify stability by running the same input twice.

When should I not use snapshot or approval testing?

Avoid them when the specification is clear and expected values can be written directly as assertions, which is faster. Also avoid them for nondeterministic output that has no normalization layer, since the tests will break every run.