Value bar for tests. Use when writing, changing, reviewing, or pruning tests: an authoring gate for new tests plus an audit workflow for low-value, implementation-coupled, or duplicative tests and the test-only production seams they keep alive.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Three modes, one value bar. Authoring mode gates every new or changed test at write time. Audit mode runs focused sweeps of tests that re-assert source, duplicate stronger proof, couple behavior to implementation, or keep test-only production seams alive. Continue broad audits as separate coherent follow-up PRs; optimize for confidence, not deletion count. Campaign mode prunes one whole subsystem's test surface (every test file a template or core area owns); before starting one, read references/campaign.md.
Where a test belongs and which CI lane runs it is owned by
adding-tests-and-ci; this skill owns whether the test should exist at all.
Before adding any test, answer four questions; a missing answer means do not add it yet:
Then check the test against every junk pattern; a match fails the gate unless the retention bar names the contract it independently guards. A test that would break under behavior-preserving refactoring is asserting implementation, not behavior; rewrite it at the owning boundary before landing it.
Bug regression tests must fail on the pre-fix code for the intended reason and pass after the owner-boundary repair. A regression test that never demonstrably failed proves the mock, not the fix. One regression at the owner boundary covers the bug; do not replay the same scenario at every layer it crosses.
The shared checklist for both modes: the authoring gate rejects a new test that matches one, and audits hunt for existing tests that do.
packages/core helpers;Tests justify their maintenance cost by protecting behavior, a credible regression, or an independently meaningful contract. In an audit, an existing test that must change for behavior-preserving source reorganization is suspect, not automatically deletable; the authoring gate still rejects new ones.
Before judging a candidate, read the complete test and production owner, its
entry point, callers, callees, sibling implementations, overlapping tests, CI
routing (scripts/ci-change-scope.ts, scripts/ci-test-lanes.ts), and
relevant history. Read root and scoped AGENTS.md files first. When the test
claims dependency-backed behavior, inspect the dependency source or types
directly.
Keep discovery read-only and report evidence before editing. For broad scope, run parallel read-only sub-agents, one per lane:
packages/);templates/);scripts/);Outside campaign mode, prefer a few high-confidence candidates over a large speculative inventory. Hunt for the junk patterns.
Keep a test when it independently enforces a public API, published package, protocol, config, migration, storage, security, access-scoping, platform, default, prompt-byte, SSR cache, release, or architecture contract. Also keep:
scripts/guard-*.test.ts) that prove a guard both passes
and fails, since a guard that cannot fail is the silent-coercion bug;Static or slow is not a deletion reason. A test that resembles implementation may still be the independent contract; prove otherwise before removing it.
Record every field below before editing. A missing field means the candidate is not ready for deletion:
Choose one coherent owner-boundary batch. Delete obsolete test-only exports, globals, wrappers, and dead production paths instead of preserving aliases. Move retained regressions to their canonical owners. Consolidate repeated package or dependency assertions into one generic contract.
Prefer net-negative production LOC. Do not add replacement tests that restate the same implementation, and do not convert uncertain candidates into cleanup to increase deletion counts.
Never edit source or tests while Vitest is running in the checkout; read
concurrent-agents first in a shared checkout.
pnpm --filter <package> exec vitest --run <path-or-filter>, or
tsx --test <file> for root scripts/*.test.ts.--coverage before and after and compare line and branch
totals.pnpm guard:<name>), or dry-run that owns the real contract.oxfmt on changed files, then git diff --check.pnpm test:fast for cross-cutting batches);
.db.test.ts, .integration.*, and .e2e.* files are excluded there, so
name and run any you touched.git diff --numstat; report production/tooling separately from
tests and test support.packages/core, packages/dispatch,
packages/scheduling, packages/pinpoint) need a .changeset/*.md;
test-only deletions do not.Commit, push, open a PR, or land only when authorized; use ship. Land one
coherent PR at a time; after landing, refresh from current main and rerun
read-only discovery for the next high-confidence batch.
Report:
adding-tests-and-ci — where a test lives and which lane runs it.verifying-changes — the proof required before reporting done.fix-at-the-boundary — finding the owner a regression belongs to.BuilderIO/agent-native
a0356c6
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.