> Agent-ready spec from Diff of the Day (2026-11-29, playbook 1). Based on Uber's skill evaluation system, as described by Andrew Mager, Jason Varbedian and Uday Kiran Medisetty. Give this file to your coding agent and review its plan before it changes anything.

# Spec: Evals for a small team's agent skills

## Problem Statement
Teams now keep dozens of agent skills (SKILL.md files) but have no way to know whether a skill helps, hurts or has become unnecessary after a model update. Uber, whose skills marketplace grew to more than 5,000 skills and over 1 million invocations in one month, tests skills with a mix of golden cases, real prompts graded on trajectory and author-judged cases, and replays prompts with and without a skill. A team of one or two can copy the core of this in a repo.

## Goals
- Every skill in the repo has at least 10 test prompts, split roughly 5% golden, 80% real and 15% author-judged as Uber suggests (round up to at least one golden case).
- A with-or-without replay shows, per skill, how often a blind judge prefers the run with the skill.
- A CI job runs the suite on every change to a skill and on a model change.
- Usage counts per skill come from agent hooks without recording prompt text.

## Non-Goals
- A marketplace or tiers: one repo is enough for a small team.
- Supporting every agent: start with the one you use.
- A web app: Markdown reports are enough.

## User Stories
- As a skill author, I want a test file next to each SKILL.md so that changes are checked like code.
- As a developer, I want to know if a skill still beats no skill after a model update so that I can retire it.
- As a team lead, I want weekly usage counts per skill so that I know which ones matter.
- Edge case: as an author, I want flaky judge results flagged when repeated runs disagree, so that I don't trust a coin flip.

## Requirements
### P0 (must have)
1. **Test files**: skills/NAME/tests.yaml with golden cases (fixed input, expected tool calls), real prompts with an expected trajectory, and author-judged prompts.
   - [ ] A skill without tests fails CI with a clear message.
2. **Trajectory grader**: check that the agent used the expected skills and tools in the expected order.
   - [ ] Given a recorded session, when graded, then each expected step is marked hit or missed.
3. **Ablation replay**: run each real prompt with and without the skill and let a judge model pick the better result blind.
   - [ ] The report shows the preference rate and how many runs disagreed.
4. **CI job** that runs the suite on changes under skills/ and writes report.md.

### P1 (nice to have)
- Usage telemetry from agent hooks: skill name, version, chosen by agent or user, no prompt text.
- Papercut file: the agent writes a short structured report when a skill step fails.

### P2 (future)
- Recompile a skill per model family from a spec file.

## Success Metrics
- Leading: every skill has tests and the suite runs in CI.
- Lagging: at least one skill is fixed or retired because of an ablation result within a month.

## Open Questions
- Which judge model, and how many repeats per prompt? (you)
- Where do real prompts come from without storing sensitive text? (you)

## Timeline
Two days: day one test format, grader and CI; day two ablation replay and report.

## Agent Instructions
- **Suggested stack**: Python 3.12 or TypeScript on Node 22, YAML test files, the agent's own CLI in headless mode, GitHub Actions.
- **Build order**: test file schema and validator → trajectory grader with recorded fixtures → ablation replay → CI job → telemetry hook.
- **Safety**: strip prompt text and file contents from telemetry; keep API keys in CI secrets; run agents in throwaway workspaces.
- **Done when**: CI posts a report with trajectory scores and ablation preference rates for every skill.

## Sources
- How Uber Evals 1 Million Agent Skill Invocations a Month: https://www.uber.com/us/en/blog/optimizing-ubers-agent-skills/
- Agent Skills specification: https://agentskills.io/specification
