test-audit
/test-audit
Ustala próg wartości testów: bramkę dla nowych testów i audyt testów mało wartościowych, sprzężonych z implementacją lub zduplikowanych.
- Autor
- builderio ↗
- Repozytorium
- agent-native ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Ustala próg wartości testów: bramkę dla nowych testów i audyt testów mało wartościowych, sprzężonych z implementacją lub zduplikowanych.
Oryginalny opis (EN)
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.
Jak działa
- Authoring gate
- Junk patterns
- Value bar
- Discovery
- Retention bar
- Candidate evidence
- Edit shape
- Validation
- Landing and continuation
- Handoff
Podgląd SKILL.md
--- name: test-audit description: >- 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. scope: dev metadata: internal: true --- # Test Audit 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](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. ## Authoring gate Before adding any test, answer four questions; a missing answer means do not add it yet: 1. What observable behavior, invariant, or independent contract does it protect? 2. What credible regression makes it fail? 3. Why does existing coverage not already catch that failure? Each contract has one primary test owner at the strongest boundary; another layer needs its own distinct risk, such as a transport or lifecycle failure the owner cannot reach. Prefer extending a table-driven case or shared fixture over a near-duplicate test; consolidate duplicated setup in the same change. 4. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, move the test to the real boundary instead. Then check the test against every [junk pattern](#junk-patterns); a match fails the gate unless the [retention bar](#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. ## Junk patterns The shared checklist for both modes: the authoring gate rejects a new test that matches one, and audits hunt for existing tests that do. - assertion-free coverage probes; - self-comparisons and identity copiers; - copied fixtures, inventories, manifests, or export lists; - exact source, import, or string greps; - private predicate or call-shape tests duplicated at real boundaries; - duplicate invocations of the same contract; - template-local replays of shared `packages/core` helpers; - tests whose only purpose is preserving test-only exports, globals, or wrappers; - dead production code whose only callers are tests; - expected values produced by the helper or renderer under test; - mocks that implement the asserted behavior, or one identical mock standing in for different APIs; - fixtures that supply the receipt, admission, or callback ordering the owner should produce, or persistence asserted against a store the path never writes; - capability tests that restate declared flags instead of exercising the delivery or acknowledgement the flag promises; - negative controls that pass for an unrelated reason, such as a denial from a different guard or a rejection the production path never reaches; - names or fixtures that promise more than the input exercises, such as a "retires the window" test asserting the window was not cleared. ## Value bar 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. ## Discovery Keep discovery read-only and report evidence before editing. For broad scope, run parallel read-only sub-agents, one per lane: - core and shared packages (`packages/`); - templates (`templates/`); - root scripts, guards, and tooling (`scripts/`); - a cross-cutting pattern sweep. Outside campaign mode, prefer a few high-confidence candidates over a large speculative inventory. Hunt for the [junk patterns](#junk-patterns). ## Retention bar 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: - call ordering when order is observable behavior; - regressions with a credible failure mode; - guard self-tests (`scripts/guard-*.test.ts`) that prove a guard both passes and fails, since a guard that cannot fail is the silent-coercion bug; - source inspection when it is the cheapest independent guard: it fails when the contract changes (the user-facing key, byte, or path) and survives an identifier-only refactor; - a retained test that fails on the baseline: treat it as a possible product bug, reproduce it, and repair the owner rather than deleting it. Static or slow is not a deletion reason. A test that resembles implementation may still be the independent contract; prove otherwise before removing it. ## Candidate evidence Record every field below before editing. A missing field means the candidate is not ready for deletion: - exact test name and location; - what failure it can actually detect; - non-test callers of the covered production or support seam; - stronger remaining owner-boundary proof, or why no proof is needed; - relevant history and the reason the test or seam exists; - production or test-support deletion unlocked; - risk and the focused validation command. ## Edit shape 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. ## Validation Never edit source or tests while Vitest is running in the checkout; read `concurrent-agents` first in a shared checkout. 1. Run the smallest owner and sibling tests with `pnpm --filter <package> exec vitest --run <path-or-filter>`, or `tsx --test <file>` for root `scripts/*.test.ts`. 2. When a deletion claims coverage is preserved, measure it: run the owning package with `--coverage` before and after and compare line and branch totals. 3. For removed source greps or plan assertions, run the executable script, guard (`pnpm guard:<name>`), or dry-run that owns the real contract. 4. Run `oxfmt` on changed files, then `git diff --check`. 5. Run the package's fast lane (`pnpm test:fast` for cross-cutting batches); `.db.test.ts`, `.integration.*`, and `.e2e.*` files are excluded there, so name and run any you touched. 6. Inspect `git diff --numstat`; report production/tooling separately from tests and test support. 7. Publishable package source changes (`packages/core`, `packages/dispatch`, `packages/scheduling`, `packages/pinpoint`) need a `.changeset/*.md`; test-only deletions do not. ## Landing and continuation 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. ## Handoff Report: - root cause and removed low-value categories; - production owner simplifications; - retained false positives and why they remain valuable; - focused and full proof actually run, with before/after coverage when measured; - production versus test LOC; - PR and merge state; - named follow-ups. ## Related Skills - `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.
Pliki w paczce (2)
- SKILL.md 9 KB
- references/campaign.md 5 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · builderio/agent-native | 100 | MIT |
| ensodynamics/enso-method | 100 | MIT |
| every-app/open-seo | 100 | MIT |
| vercel/eve | 100 | Apache-2.0 |
| simstudioai/sim | 100 | Apache-2.0 |
| iliaal/ai-skills | 100 | MIT |
| avivsinai/yoetz | 100 | MIT |
| nikhilsitaram/claude-caliper | 100 | MIT |
| million-views/skills | 100 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki 9af1e782ad93 (skrót SHA-256 całej paczki)
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100tdd
Prowadzi TDD i bramkę wartości testów: wykrywa i odchudza testy niskiej wartości, zduplikowane lub zależne od implementacji. - 100pm-test-audit
Audytuje testy pm-cli pod kątem wartości regresyjnej, zdublowanego pokrycia i sprzężenia z implementacją, zachowując kontrakty SDK i izolację piaskownicy. - 100audit-tests
Ocenia, czy testy zasługują na koszt utrzymania i który zestaw odpowiada za dany kontrakt, przy przycinaniu redundantnych testów i wykrywaniu sprzężeń z implementacją. - 100behavioral-testing
Stosuje metodykę testów behawioralnych: testuje to, czego doświadcza użytkownik, a nie strukturę kodu, przy pisaniu testów, ich przeglądzie i planowaniu strategii testów nowych funkcji. - 100test-quality-analysis
Analizuje jakość kodu testów, wykrywa testy wyłącznie podbijające pokrycie, test smells i asercje o niskiej wartości, ocenia testy w skali 1-5 i tworzy raport priorytetów poprawek. - 90dte-test-auditor
Audytuje zestaw testów pod kątem realnej wartości: luki w pokryciu, słabe asercje, nadmierne mockowanie i testy mutacyjne.