test-audit

Gates new tests and audits existing suites for low-value, duplicated, or implementation-coupled coverage.

2.4k|538|Updated Nov 19, 2020
Ready to run
npx skills add https://github.com/supabase/cli --skill test-audit-supabase
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: test-audit
Source: https://github.com/supabase/cli/tree/main/.agents/skills/test-audit
Command: npx skills add https://github.com/supabase/cli --skill test-audit-supabase

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites often accumulate junk: tests that replay the same contract at multiple tiers, mock implementations instead of real collaborators, or depend on test-only production seams. This Skill prevents low-value tests from entering the codebase and identifies candidates for consolidation or deletion across unit, integration, e2e, and live test tiers. ## Core Features & Use Cases - Authoring Gate: Answer four screening questions before adding any test to catch tests that protect nothing, duplicate existing coverage, or require test-only production seams. - Audit Mode: Record evidence for each candidate (what it detects, stronger proof that remains, test-only seams to free) and mark with R/F/C/D verdicts before making edits. - Junk Pattern Detection: Flags replayed contracts across tiers, mock-based assertions, expected values from helpers, negative controls with unrelated guards, and real-time waits on production timeouts. - Use Case: Before merging a PR that adds five new integration tests, use this Skill to verify each test answers all four screening questions and does not duplicate unit-tier coverage already exercised. ## Quick Start Review the test you are about to write or the test suite you are auditing against the junk patterns and retention bar to determine if it deserves to remain in the codebase.

Frequently Asked Questions about test-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What four questions must a new test answer before being added?▼

First, what behavior does it protect? Second, what credible regression makes it fail? Third, why doesn't existing coverage already catch that failure? Fourth, does it need a test-only production seam? If any answer is missing, do not add the test yet.

How many tests should protect the same contract at different tiers?▼

Each contract gets one primary test at the strongest boundary that can reach it: unit for pure logic, integration for handlers and effects, e2e for subprocess boundaries, live only when reaching the real platform. A second-tier test needs a distinct risk the first cannot catch, not the same contract replayed.

What junk patterns should I flag during audit?▼

Reject tests that replay contracts across multiple tiers, implement behavior instead of standing in for collaborators, use expected values produced by the helper under test, pass for unrelated reasons, or promise more than they exercise. Also flag real-time waits on production timeouts instead of controlled clocks.

What does the R/F/C/D ledger mean in audit mode?▼

R (retain) names the contract and regression it catches; F (fix) keeps the contract but repairs weak assertions; C (consolidate) names the sibling or stronger boundary suite absorbing it; D (delete) names the proof that remains or confirms no contract exists.

When should a regression test be deleted?▼

Only delete a regression test if stronger proof remains at a higher boundary or if no contract exists. Being slow or static is never a deletion reason. A test that never demonstrably failed on pre-fix code proves only the mock, not the fix, and should be marked for deletion or repair.

How do I know if a test-only production seam is needed?▼

If the test requires exporting internals, injecting flags, or adding wrappers to reach the code path, move the test to the real boundary where that contract is exposed. Controlled clocks, injected budgets, or production config values are acceptable; test-only exports are not.