Golden Set Regression Testing for Agent Skill Iterations
Agent skills often iterate faster than traditional code modules, and even a small change can silently break triggering, validation, or output formatting. This article explains how to use a Golden Set—a fixed, answer-known test suite—to build a regression baseline for skill iterations. It covers the key properties of an effective Golden Set, a practical directory structure, test case design with positive, negative, and boundary cases, an automated grader, and the discipline required to keep the baseline trustworthy across versions.
Golden Set Regression Testing for Agent Skill Iterations
Agent skills tend to iterate more frequently than traditional code modules. A single skill may consist of trigger instructions, field validation rules, analysis scripts, output templates, and presentation constraints—and a tweak to any one of them can change the final behavior: scenarios that previously triggered correctly stop triggering, missing fields no longer raise errors, statistical calculations drift, or output formats become unstable. Manually trying a few samples makes it nearly impossible to tell whether a new version has genuinely improved or has introduced a regression. The core question in skill development and maintenance is therefore not “can it run once,” but “after every change, can it still reliably complete the same batch of tasks correctly?”
The Golden Set is the baseline tool designed to solve this problem. Its value lies not in the number of test cases, but in controlling variables: the case set is fixed, the expected answers are fixed, and the only changing variable is the skill version. Re-running the same cases after every change makes pass rates directly comparable across versions. Fluctuations in results can then be attributed to the parts that were changed, rather than to shifting test data or inconsistent human judgment.
1. What a Golden Set Is and Its Key Properties
In one sentence: a Golden Set is a fixed set of test cases with known answers. Re-run it after every skill change to measure different versions against the same yardstick, making results directly comparable.
For a Golden Set to work effectively, it should have the following properties:
- Stability: Case inputs, fixture data, and expected answers remain fixed during version comparison. Do not casually adjust expected answers just because the new version fails—otherwise the baseline loses its meaning.
- Verifiable answers: Expected outputs must be specific to checkable dimensions—for example, which groups the output contains, whether classifications are complete, whether date formats meet requirements, whether significance determinations follow the rules, and whether error scenarios produce clear messages.
- Representativeness: Cases should cover core positive cases, boundary conditions, and typical negative cases. Positive cases guard against regressions in basic functionality; negative cases guard against degraded error handling.
- Reproducibility: Fixture data should be frozen, and random processes should use fixed seeds to avoid different inputs on each run.
- Version comparability: The grader outputs pass rates, lists of failing cases, and failure reasons, enabling side-by-side comparison across versions.
A Golden Set is not a performance or load test suite, nor a one-time acceptance checklist. It is closer to a behavioral contract and regression baseline for the skill: every change should leave an explainable result on it.
2. A Practical Directory Structure
Take an “experiment quality analysis skill” as an example. The skill directory can be organized into layers: documentation, methodology, core scripts, and tests with fixtures:
experiment-quality-analysis-skill/├── SKILL.md # Triggers/exclusions, field validation, significance rules, output template├── golden_set.md # Case list, usage discipline, fixture notes├── scripts/│ └── analyze.py # Core analysis script: statistical tests and dimension aggregation└── tests/├── run_golden_set.py # Automated grader: one command to compute the pass rate├── generate_fixtures.py # Fixture generator: fixed, reproducible data└── fixtures/├── manual_baseline.csv├── missing_fields.csv└── invalid_dates_and_empty_values.csv
Here, the skill documentation defines the skill’s boundaries: when to trigger, when not to trigger, which fields to validate, what the significance rules are, and which sections the output template includes. The methodology documentation explains the case classification and usage discipline for the Golden Set. The core script carries the actual analysis logic. The tests directory freezes both “inputs with known answers” and the automated grading logic, so regression validation no longer depends on personal memory.
3. Case Design: Positive, Negative, and Boundary Cases
The goal of positive cases is to prevent regressions in basic functionality. Representative tasks should include clear inputs and expected outputs. For example, given the input “run an experiment quality analysis for a given time range,” the expected output includes:
- Output containing three dimensions: overall / page / step;
- Each group covering four experiment types: significantly positive, non-significantly positive, non-significantly negative, and significantly negative, plus a summary row;
- Time range formats that follow the convention, such as months and days without zero-padding and including the year;
- Significance determined by a two-sample Z-test on ARPU, judged significant when the absolute value reaches the threshold;
- A small set of manually constructed data whose classification results can be verified against hand calculations, including the boundary case of a lift of 0.
Negative cases are equally important. When key fields are missing, the skill should return a clear validation message instead of silently generating an incomplete report; inputs such as empty ARPU, zero sample sizes, or invalid dates should trigger graceful degradation or errors; excluded scenarios should remain untriggered. Boundary cases should be small and precise—for example, significance falling exactly near the threshold, empty groups, or consistency between summary rows and detail rows. Every case should have a unique identifier, input fixtures, expected results, and assertion rules.
4. Basic Shape of an Automated Grader
For a Golden Set to become part of daily practice, manual grading costs must be minimized. The grader can be organized roughly like this pseudocode:
cases = load_cases("golden_set.md")for case in cases:output = invoke_skill(case.input)checks = [assert_dimensions(output, ["overall", "page", "step"]),assert_categories(output, expected_count=4),assert_date_format(output, case.expected_format),assert_significance_rule(output, case.expected_labels),assert_error_behavior(output, case.expected_error),]record(case.name, all(checks), checks)print("Pass rate:", passed / total)print("Failing cases:", failed_cases)
The grader should output the pass rate, failing cases, failure reasons, and the version number. For numerical results, set reasonable tolerances; for tabular output, sort deterministically before comparing; for error messages, avoid matching full copy verbatim—instead check the key error type and required fields. This catches regressions without generating frequent false alarms from irrelevant wording changes.
5. Discipline Matters More Than Tooling
The most common failure of a Golden Set is not an unbuildable grader, but lax discipline. Follow these rules:
- Establish the baseline before changing the skill: Run the suite before making changes and record the current pass rate.
- Run the full suite on every change: Do not run only the cases you assume are relevant.
- Attribute every failure: Determine whether it’s an outdated expected answer, a fixture problem, or a genuine skill regression.
- Review new cases: After fixing a real defect, add its minimal reproduction case to the Golden Set.
- Freeze fixtures and random seeds: Guarantee a fair, identical test every time.
- Track version trends: Pass rates, failure types, and fix timelines should all be recorded.
- Never change answers just because tests fail: Unless it’s confirmed—and reviewed—that the expected answer itself is wrong.
- Separate functional regression from effectiveness evaluation: The Golden Set mainly guards behavioral stability and does not replace effectiveness evaluation.
- Keep cases lean: Every case should have a clear protection goal; avoid redundancy.
- Regularly incorporate real defects: Let the Golden Set evolve with the skill while preserving version comparability.
6. Common Pitfalls and Takeaways
Common pitfalls include treating the Golden Set as a performance test; changing cases so often that versions are no longer comparable; leaving expected answers vague so grading depends on gut feeling; testing only positive cases and ignoring exceptions; focusing only on final output while ignoring trigger boundaries; embedding sensitive data in fixtures; and editing expected answers after failures. All of these weaken the value of the baseline.
The real lesson is this: control variables with fixed cases, reduce regression costs with automated grading, and keep the baseline trustworthy through discipline. Skill changes are inevitable, but as long as every change is re-run against the same batch of cases with known answers, and failures are localized through the failing-case list, teams can turn “modifying skills by feel” into an engineering practice that is comparable, attributable, and reviewable. A Golden Set doesn’t guarantee a skill is always correct—but it makes the cost and risk of every change visible and manageable.
