Golden Set Evaluation for AI Coding Skills: A Practical Guide

    This article explains how to use a Golden Set to evaluate AI coding Skills reliably. It covers why Skill iteration needs a fixed benchmark, how to organize evaluation assets inside a Skill directory, and the four test categories: positive, boundary, exception, and non-trigger cases. It also details fixture generation, automated grading, comparison strategies, usage discipline, common pitfalls, and a minimal starter set for getting a quality loop running.

    1. Why Skill Iteration Needs a Single Yardstick

    In practice with AI coding tools, a Skill is essentially a structured capability contract. It uses natural language and constraint clauses to tell the model when to trigger, which fields to validate, which rules to apply for calculations, and which template to use for output. Unlike a traditional function, a Skill has fuzzy behavioral boundaries: a single wording change or one added constraint can cause previously stable output to drift.

    The most common challenge engineers face is not that a Skill is hard to change, but that after changing it, they cannot tell whether anything broke. Manually running a few samples only covers obvious paths and cannot answer the systemic question of whether overall capability has regressed. Answering that question requires controlled variables: fixed inputs, fixed expected answers, and the Skill version as the only variable. This is exactly the value of a Golden Set.

    In one sentence: a Golden Set is a fixed collection of test cases with known answers. After every Skill change, you rerun it and measure different versions against the same standard, so results are naturally comparable.

    2. Sample Structure: Persisting Evaluation Inside the Skill Directory

    Evaluation should not be a temporary script. It should exist as a first-class citizen of the Skill over the long term. A typical directory layout looks like this:

    1. quality-analysis-skill/
    2. ├── SKILL.md # Trigger and non-trigger rules, field validation, significance rules, output template
    3. ├── golden_set.md # Methodology doc: four case categories + usage discipline + fixture notes
    4. ├── scripts/
    5. │ └── analyze.py # Core analysis logic (hypothesis testing + multi-dimensional aggregation + trend output)
    6. └── tests/
    7. ├── run_golden_set.py # Automated grader: batch execution and pass-rate statistics
    8. ├── generate_fixtures.py # Fixture generation: ensures fixed, reproducible data
    9. └── fixtures/ # Baseline inputs with known answers
    10. ├── known_cases.xlsx # Small hand-built dataset, results verifiable by hand
    11. ├── missing_field.xlsx # Missing key fields
    12. └── bad_values.xlsx # Null values / zero sample size / invalid dates

    The metadata in SKILL.md should clearly state the capability description and boundaries. For example, it should trigger when a user mentions intents such as experiment quality, revenue analysis, or significance summaries, and it should not trigger in scenarios such as experiment management or sensitivity analysis. It should also specify the dimensions the output must cover, the classification enum for each group, the time range format, and the significance threshold (for example, a two-sample Z-test based on ARPU, where |z| ≥ 1.96 is considered significant). Only when these constraints are fixed does the grader have a clear comparison target.

    3. Four Case Categories: Regression, Boundaries, and Defense

    3.1 Positive Cases: Preventing Basic Functional Regression

    Select the most representative tasks with fully known expected output. For example, the input “run a quality analysis for a given time range” should produce output covering three dimensions: overall, page, and stage. Each group should have four result categories plus one summary row. The time range format is fixed as “year/month/day-year/month/day” (month and day without leading zeros, including the year). For a small hand-built dataset (including the boundary case of zero effect size), the test classification must match hand calculations. Positive cases are the regression defense line: any single failure means the core pipeline is damaged.

    3.2 Boundary Cases: Verifying Thresholds and Format Details

    Design cases around values on both sides of the decision threshold, extremely small sample sizes, an effect size of exactly zero, and dates that cross months or years. The value of boundary cases is catching problems that “look right but are wrong in detail,” such as zero-padded months, missing years, or a missing summary row.

    3.3 Exception Cases: Verifying Field Validation and Fault Tolerance

    Provide fixtures with missing key fields, empty key metrics, zero sample size, and invalid dates. The Skill is expected to raise a clear error or give an understandable fallback message rather than silently producing a wrong conclusion. Exception cases ensure the Skill “dares to fail” in the face of dirty data and avoids misleading output.

    3.4 Non-Trigger Cases: Verifying Scenario Isolation

    Provide requests that should be handled by other capabilities, and expect the Skill not to trigger. Scenario isolation prevents capabilities from competing with each other. It is easily overlooked in complex Skill systems but is extremely critical.

    4. Fixtures and Automated Grading: Reproducible and Comparable Results

    Fixtures must be fixed and reproducible. It is recommended to produce them with a generation script rather than preparing them manually on the fly, and to document the random seed, data scale, and field structure. The grader executes cases one by one according to the case list, parses the output structurally, compares it with the expected result, and finally reports the pass rate and failure details:

    1. cases = load_cases("golden_set.md")
    2. passed, details = 0, []
    3. for c in cases:
    4. out = run_skill(c.input)
    5. ok = compare(out, c.expected) # dimensions complete, classifications correct, format compliant
    6. passed += int(ok)
    7. details.append((c.id, ok, diff(out, c.expected)))
    8. print(f"pass rate: {passed}/{len(cases)}")

    There are three key grading points. First, compare structured fields rather than entire text blocks to avoid false judgments caused by wording differences. Second, validate format rules separately. Third, keep diff snapshots so you can quickly locate whether the issue is in the prompt or the script.

    5. Usage Discipline and Common Pitfalls

    • Once finalized, the case set must not be modified arbitrarily. Changes require review and a recorded reason; otherwise, versions are no longer comparable.
    • Run the full set after every Skill change, not just the failed items, to prevent fixing one issue while breaking another.
    • Read the pass rate together with failure types. A cluster of the same failure type usually points to the same constraint.
    • Put fixtures and the grader under version control and commit them together with the Skill.
    • Common pitfalls include: too few cases leading to insufficient coverage, incorrect expected values, comparing only text, ignoring non-trigger scenarios, and fixtures depending on external dynamic data.

    6. Implementation Recommendations

    Start with a minimal viable set in an environment such as Baidu AI Cloud: three positive cases, two boundary cases, two exception cases, and one non-trigger case. Once the loop runs end to end, expand it gradually. Integrate the grader into pre-commit checks or a pipeline to automate the quality gate. When the pass rate drops, use the failure details to quickly attribute the issue to a specific constraint clause. Over time, Skill iteration shifts from “going by feel” to “looking at data,” improving both stability and maintainability.