vitest-evals
Skill342 starsChanged 52 days agoApache-2.0View on GitHub
Use when authoring, reviewing, or debugging harness-backed vitest-evals suites, custom Harness adapters, first-party ai-sdk or pi-ai harness integrations, judges, replay, reporter-facing normalized run data, or examples and docs for these APIs.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use the harness-backed API as the only authoring model.
- Distinctive: line 12
Read the package, app, or eval file being changed.
- Very specific: line 14
Keep suites close to Vitest: one harness per describeEval(...), explicit run(...) inside each test, ordinary expect(...) assertions over …
- Very specific: line 31
Import describeEval(...), judges, and helpers from vitest-evals.
- Very specific: line 33
Call run(input) where the test should execute the system.
- Very specific: line 35
Use toolCalls(result) and message helpers for normalized session assertions.
- Very specific: line 36
Use spans(result), spansByKind(result, kind), and failedSpans(result) for span assertions.
- Very specific: line 37
Keep HarnessRun, NormalizedSession, usage, artifacts, and tool records JSON-serializable.
- Very specific: line 40
Keep rubric text and parsing in the judge.
- Distinctive: line 42
Put scenario-owned criteria on the input value.
- Distinctive: line 49
Prefer the smallest command that covers the edited files:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
vitest-evals
Use the harness-backed API as the only authoring model.
First Steps
- Read the package, app, or eval file being changed.
- Identify the runtime target, then open only the needed reference.
- Keep suites close to Vitest: one harness per
describeEval(...), explicitrun(...)inside each test, ordinaryexpect(...)assertions over the returned result.
Reference Router
| Need | Open |
| Write or review a normal eval suite | references/suite-authoring.md |
Build a custom app Harness without a first-party adapter | references/custom-harness.md |
Integrate AI SDK generateText, generateObject, tools, or an AI SDK-style agent | references/harness-ai-sdk.md |
| Integrate a Pi AI or Pi Mono-style agent | references/harness-pi-ai.md |
Add custom judges, suite judges, built-in judges, or toSatisfyJudge(...) assertions | references/judges-and-assertions.md |
| Assert on message, tool-call, or span history | references/utilities.md |
| Configure tool recording or replay | references/tool-replay.md |
| Diagnose failures, missing traces, odd output, or choose verification commands | references/troubleshooting.md |
Runtime Defaults
- Import
describeEval(...), judges, and helpers fromvitest-evals. - Bind exactly one
harnessto a suite. - Call
run(input)where the test should execute the system. - Assert on
result.outputfor app-facing behavior. - Use
toolCalls(result)and message helpers for normalized session assertions. - Use
spans(result),spansByKind(result, kind), andfailedSpans(result)for span assertions. - Keep
HarnessRun,NormalizedSession, usage, artifacts, and tool records JSON-serializable. - Report known tokens and USD cost in
run.usage. OmitcostUsdwhen unknown; use0only when the run is known to be free. - Keep rubric text and parsing in the judge. Put provider calls in a
judgeHarness, then call them throughctx.runJudge(...)so usage is recorded. - Put scenario-owned criteria on the input value. Put direct-check expected values in Vitest case rows. Pass per-case judge criteria through explicit matcher options, and suite-wide criteria through judge config.
- Custom judges should use
createJudge(...)for stable reporter labels.
Verification
Prefer the smallest command that covers the edited files:
| Task | Command |
| Lint file | pnpm exec biome lint path/to/file.ts |
| Format file | pnpm exec biome format --write path/to/file.ts |
| Test file | pnpm exec vitest run path/to/file.test.ts -c vitest.config.ts |
| Eval file | pnpm exec vitest run path/to/file.eval.ts -c vitest.config.ts --reporter=./packages/vitest-evals/src/reporter.ts |
| Type surface | pnpm typecheck |
| Package build | pnpm build |
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- packages/docs/public/llms.txtllms.txt
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

