LLM Skill Development in Practice: Quality Evaluation with a Golden Set
When developing applications powered by large language models, a common challenge is evaluating whether changes—prompt tweaks, business logic updates, or model upgrades—have negatively impacted existing functionality. This article introduces the Golden Set approach: a fixed set of test cases with known expected results that serves as a regression testing baseline for LLM-based Skills. Using a data analysis Skill as a working example, it covers a standardized Skill directory structure, intent boundary definitions in SKILL.md, test fixture design, and an automated grading pipeline that integrates with CI/CD to form a complete quality closed loop.
When building applications on large language models (LLMs), developers often face a thorny problem: after adjusting a prompt, updating business logic, or upgrading the underlying model, how do you accurately assess whether these changes have negatively affected existing functionality? Traditional unit tests struggle with the non-deterministic output of LLMs, while manual evaluation is time-consuming, labor-intensive, and hard to keep consistent. To address this pain point, an engineering-grade quality evaluation mechanism is essential. This article uses the development of a data analysis Skill as a backdrop to explore how to build a reliable regression testing system with a “Golden Set” mechanism.
1. What Is a Golden Set?
In one sentence: a Golden Set is a fixed, immutable collection of test cases with known expected results.
In traditional software development, we rely on unit and integration tests to guarantee code quality. In the development of AI Agents or Skills, the Golden Set plays a similar role. Its core idea is: every time the Skill changes, re-run this fixed set of cases and measure all versions with the same ruler, making test results directly comparable.
LLM output is inherently stochastic, but by enforcing strict output formats, business rules, and statistical methods (such as the two-sample Z-test), certain business scenarios can be turned into deterministic problems. The Golden Set is built on exactly this foundation: it requires fixed input data and clear expected results, providing an objective yardstick for continuous Skill iteration.
2. Standardized Skill Structure Design
An engineering-grade, maintainable Skill should not be just a prompt—it should be a complete project containing documentation, scripts, and tests. Here is a typical directory structure for a data analysis Skill:
ab-quality-analysis/├── SKILL.md # Core configuration: trigger rules, field validation, business rules, output template├── golden_set.md # Test methodology doc: case list, usage discipline, fixture description├── scripts/│ └── analyze.py # Core business script: data processing, statistical testing, multi-dimensional aggregation, trend calculation└── tests/├── run_golden_set.py # Automated grader: run all cases in one command and compute the pass rate├── generate_fixtures.py # Fixture generator: ensure test data is fixed and reproducible└── fixtures/ # Test fixture directory: baseline input data├── known_cases.xlsx # Basic positive cases, results can be verified by hand├── missing_field.xlsx # Exception scenario: missing required field└── bad_dates.xlsx # Edge cases: null values, zero samples, invalid dates
This structure fully decouples business logic, configuration rules, and test data, improving readability and laying a solid foundation for automated testing.
3. Core Configuration and Intent Boundaries
SKILL.md is the soul of the entire Skill—it directly determines when the LLM gets involved and how it executes. The most critical part of this file is the precise definition of intent boundaries.
Taking an “A/B experiment quality analysis” Skill as an example, its description should cover both positive triggers and negative exclusions. Positive trigger scenarios should explicitly list the ways users might express the need, such as “experiment quality,” “experiment revenue,” “experiment significance summary,” and “experiment effect overview.” Negative exclusions draw red lines—for example, the Skill should not trigger on broader or adjacent scenarios like “experiment management,” “A/B analysis,” or “sensitivity analysis,” to avoid misfiring and causing logic conflicts.
In addition, SKILL.md should define clear business constraints. For example: determine significance using a two-sample Z-test based on ARPU, and require output of summary tables across three dimensions—overall, experiment page, and experiment step. These constraints later serve as validation criteria for automated grading.
4. Building Test Fixtures and Coverage Strategy
The quality of test data directly determines the effectiveness of the Golden Set. When building fixtures, follow three principles: comprehensive coverage, fixed data, and hand-verifiable results.
- Basic positive-case data: e.g.,
known_cases.xlsx, containing a small amount of hand-crafted data. This data should be simple enough that a human can compute the Z-test results with a calculator, verifying the correctness of the core algorithm script. - Exception scenario coverage: real-world data is rarely perfect. Fixtures should include cases with missing required fields (e.g., a missing “experiment step” field) to test whether the Skill degrades gracefully or returns a clear error.
- Edge-case testing: e.g.,
bad_dates.xlsx, covering null ARPU values, zero sample counts, invalid dates, and other extremes. These scenarios are where crashes and LLM hallucinations most often occur, so testing them is essential to ensure system robustness.
Generating or freezing this data with the generate_fixtures.py script ensures that every regression test uses identical inputs, eliminating result deviations caused by data changes.
5. Automated Grading and the Quality Loop
With fixed input data in place, you still need an automated “grading” mechanism. run_golden_set.py fills this role: it loads all test fixtures, invokes the core script analyze.py, and compares the outputs against the expected Golden Set answers.
When implementing automated grading, you can combine JSON Schema validation for output structure with business-rule scripts for numerical accuracy—for example, checking whether the classification into significantly positive, non-significantly positive, non-significantly negative, and significantly negative matches expectations. Finally, the system should output the pass rate for the current version in one command (e.g., 100% if all 17 cases pass).
This mechanism plugs easily into CI/CD pipelines. Every time a developer commits a Skill change, the system automatically runs the Golden Set; if the pass rate drops, the release is blocked—forming a quality closed loop from development to testing.
6. Conclusion
AI application development should not be an exercise in stacking prompts; it should return to the rigor of software engineering. By adopting the Golden Set mechanism, together with a standardized Skill directory structure, strict intent boundaries, and multi-dimensional test fixtures, developers can move beyond blind, trial-and-error iteration. Measuring every commit with the same yardstick not only greatly improves the stability of AI applications but also gives teams the confidence to keep evolving in the face of complex business requirements.
