Building Reliable Skills: A Practical Guide to Golden Set Regression Testing

    Golden Sets turn the quality of an AI Skill from a subjective feeling into an objective, measurable metric. This article explains why Skills become hard to control as they evolve, how a Golden Set fixes the problem by locking in the test cases and expected answers so that the Skill version becomes the only variable, and how to structure a Skill for maintainability and testability. It walks through four categories of test cases (positive, negative, boundary, and exception), shows how reproducible fixtures and an automated grader make regression testing one-click, and outlines the usage discipline needed to keep the suite valuable over time.

    1. Where the Problem Starts: Why Skills Drift Out of Control

    In intelligent coding tools, a Skill is usually not a one-off script but a reusable, triggerable package of capability. At a minimum it contains three things: meta-information that tells the model when to use the Skill and when not to (a description plus trigger conditions); a set of rules that constrain the output (field validation, statistical conventions, output templates); and the script that does the actual work. Together these three determine how the Skill behaves in practice.

    The trouble is that a Skill’s behavior is driven jointly by natural language and code. Natural language is elastic in how it interprets input, while the script is prone to introducing regressions in how it handles boundary data as it changes. So the most common scenario unfolds like this: to fix a bug or support a new field, you tweak a rule in the description or change one branch in the analysis script. You run a single example, it looks fine, and you ship. What you do not know is whether that change quietly broke other scenarios that used to work correctly.

    “Vibe-based verification” is the biggest enemy of Skill quality. Fixing it for good requires a mechanism that turns “did I improve things or not” into something quantifiable and comparable.

    2. The Golden Set: Giving Your Skill a Single Yardstick

    In one sentence: a Golden Set is a fixed, unchanging collection of test cases with known answers. After every change to a Skill, you rerun the entire set and measure different versions against the same yardstick, so the results are directly comparable.

    The real problem it solves is controlling variables. When we change a Skill, ideally we want to alter only the single variable under test—the Skill itself—while keeping the “question set” and the “expected answers” fixed. The Golden Set locks down exactly these two:

    • The case set stays unchanged: the questions are fixed and do not become easier or harder because of this change.
    • The expected answers stay unchanged: every case has one and only one correct answer.
    • The only variable is the Skill version.

    With this in place, the pass rate from a run becomes comparable across versions—like retaking the same exam, where any fluctuation in the score can be attributed to “what I changed this time” rather than “a different set of questions.” This is the key step that upgrades a subjective “it seems better now” into an objective “the pass rate went from 15/17 to 17/17.”

    3. Structured Organization: Making a Skill Maintainable and Testable

    A Skill that can be seriously tested should have a directory structure that itself carries maintainability. Below is one way to organize a data-analysis Skill, using an “AB experiment quality analysis” Skill as the example:

    1. ab-quality-analysis/
    2. ├── SKILL.md # Core: trigger/no-trigger conditions, field validation, significance rules, output template
    3. ├── golden_set.md # Methodology: four-case checklist + usage discipline + fixture notes
    4. ├── scripts/
    5. │ └── analyze.py # Core analysis script (significance test + multi-dimensional aggregation + daily trend)
    6. └── tests/
    7. ├── run_golden_set.py # Auto-grader: runs all cases in one shot and computes the pass rate
    8. ├── generate_fixtures.py # Fixture generation: produces fixed, reproducible input data
    9. └── fixtures/ # Baseline inputs with known answers
    10. ├── known_cases.xlsx # Hand-crafted data, conclusions verifiable by manual calculation
    11. ├── missing_field.xlsx# Missing key fields
    12. └── bad_dates.xlsx # Dirty data such as nulls, zero sample size, and invalid dates

    A few principles are baked into this structure:

    1. Separate the “rules” from the “code”. SKILL.md owns decisions and expression (when to trigger, how to validate, how to format output), while the script owns the computation. When you make a change, you can tell clearly whether you touched the decision layer or the computation layer.
    2. Separate the “methodology” from the “implementation”. golden_set.md documents which categories of cases exist, why they are grouped this way, and what the grading discipline is—so the testing philosophy does not get lost along with the code.
    3. Isolate the “tests” from the “fixtures”. The tests directory does not depend on production data; it ships its own fixed inputs with known answers, guaranteeing that a rerun at any time on any machine produces the same result.

    4. Four Categories of Cases: Covering the Real Risk Surface

    Take this AB experiment quality analysis Skill as an example. Its job is this: when a user wants a quality analysis of an AB experiment over a given time range, it performs a two-sample Z-test based on ARPU, classifies experiments into four types by significance—significant positive, insignificant positive, insignificant negative, and significant negative—and aggregates the output across three dimensions: overall, experiment page, and experiment stage.

    Around such a responsibility, the Golden Set should cover at least four categories of cases.

    1. Positive cases—guarding against basic-function regressions.
    A representative task plus its expected output, with a known answer that is checked automatically once the run finishes. For example:

    • Input: “Run an experiment quality analysis for 2026/10/1–2026/10/31.”
    • Expected output: the result contains three dimensions—“overall / page / stage”—and each group has four experiment types plus one summary row; the time range is formatted as 2026/10/1-2026/10/31 (month and day without zero-padding, including the year); significance is based on a two-sample Z-test of ARPU, with |z| ≥ 1.96 judged significant; for four rows of hand-constructed data (including the lift=0 boundary), the Z-test classification matches the manual calculation.

    The point of positive cases: even if you change a single character in a template, once the three-dimension structure goes missing or the classification is computed wrong, the grader raises an alarm immediately.

    2. Negative cases—holding the “do not trigger” boundary.
    A Skill’s trigger precision is just as important as its trigger recall. Prepare negative cases for scenarios where it should not fire—for instance, when the user is discussing adjacent topics such as “experiment management” or “sensitivity analysis,” the Skill should step aside rather than force an answer. Negative-case failures are often subtler than positive-case failures, yet they directly affect user experience and trust.

    3. Boundary cases—pushing against critical conditions.
    Statistical-convention Skills fear “getting the threshold wrong” above all. Cases like lift=0, a sample size sitting right at the significance threshold, or |z| exactly equal to 1.96 are all boundary questions that must be baked into the Golden Set. Boundary cases are the zone where changes are most likely to break things and least likely to be noticed.

    4. Exception cases—robustness under dirty data.
    Real data is never clean. Missing fields (such as a missing “experiment stage”), empty ARPU, zero sample size, and invalid dates are all typical exception inputs. The Golden Set should predefine how the Skill “should behave” for these inputs (raise an error message? skip? degrade the output?), ensuring that the Skill fails in a controlled way when it hits dirty data rather than silently computing something wrong.

    5. Automated Grading and Reproducible Fixtures: Making Regression One-Click

    For a Golden Set to deliver real value, it must be low-cost and repeatable. This relies on two scripts:

    • generate_fixtures.py: generates fixed, reproducible input. The key is “fixed”—using a fixed random seed or constructing the data by hand guarantees byte-for-byte identical fixtures on every run, which is what makes comparisons across versions meaningful.
    • run_golden_set.py: the auto-grader. It loads all fixtures, feeds each one to the Skill in turn, compares the actual output against the expected answer, and finally reports the pass rate (for example, “15 of 17 cases passed”).

    One design point worth highlighting in the grader is per-case attribution: instead of returning only an overall score, it spells out which specific cases failed and at which step they failed (did the trigger fire wrong? was a field missing? or was the classification computed incorrectly?). With this, one regression run lets you pinpoint—within tens of seconds—exactly which capability the change broke, instead of eyeballing every case by hand.

    6. Usage Discipline: Keeping the Golden Set Alive and Evolving

    A Golden Set is not a one-time artifact; it needs discipline to retain its value:

    • Run it on every change: any modification to SKILL.md or the scripts should be followed by a full regression run before release, and it passes only if the pass rate does not drop.
    • Add a case before fixing a bug: when you find a production issue, first add a case that reproduces it to the Golden Set, then fix it. This permanently guards the defect against recurrence.
    • Upgrade the expectations when requirements change: when the Skill’s responsibility genuinely expands (for example, adding a new statistical dimension), you do not delete the old cases—you add new cases and update the expected answers, letting the question set evolve along with the capability.
    • Keep version and result records: log the pass rate and failure list for each regression run, and combine them with version control to form a traceable chain of “what change each version introduced.”

    Conclusion: Turning “Feeling” into “Evidence”

    The real secret of building a Skill lies not in writing clever prompts, but in whether you can continuously and cheaply prove that “my Skill is correct.” The core value the Golden Set provides is exactly this: it puts before-and-after performance under the same yardstick, making every version’s quality quantifiable, comparable, and traceable. Once you get used to the rhythm of “change a line, run it, check the pass rate,” Skill iteration shifts from “pray-and-publish” to engineered delivery—and that is the foundation for sustainable evolution.