better-test

Writes, audits, and prunes tests using value gates and KEEP/REWRITE/DELETE verdicts.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/Suge8/skills --skill better-test-suge8
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: better-test
Source: https://github.com/Suge8/skills/tree/main/development/better-test
Command: npx skills add https://github.com/Suge8/skills --skill better-test-suge8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Test suites accumulate tautological, brittle, and duplicated tests that cost maintenance effort without catching real regressions. This Skill enforces a six-condition value gate so every persistent test must prove a real behavior, and provides a structured verdict process for auditing or cleaning existing suites. ## Core Features & Use Cases - Value Gate for New Tests: Six mandatory conditions (traceable source, meaningful failure, independent expectations, stable seams, refactor resistance, single owner) decide whether a test should be written at all, including a mandatory see-it-fail-red step. - Audit and Cleanup Verdicts: Per-test KEEP / REWRITE / DELETE / undecided judgments with required evidence, plus removal of test-only production seams, dead fixtures, and orphaned snapshots. - Anti-Pattern Catalog and Mock Boundaries: Reference guides covering tautologies, change detectors, appearance-as-behavior, and mocking only at system boundaries via dependency injection. - Use Case: When asked to slim down a bloated test directory, the Skill reads each test alongside its production owner and callers, issues evidence-backed verdicts, deletes failing-value-gate tests with their exclusive seams, and reports line-count changes separately for production and test code. ## Quick Start Ask the agent to audit the tests in a specific module using the better-test value gate and report which tests should be kept, rewritten, or deleted.

Frequently Asked Questions about better-test

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

FAQPage Schema
How do I decide whether a test is worth keeping?▼

Apply the six-condition value gate: the test needs a traceable source, a meaningful failure mode, independent expected values, a stable observation seam, resistance to refactoring, and a single owner. Tests failing any condition are rewritten or deleted with documented evidence.

How to clean up a bloated test suite safely?▼

Judge tests individually rather than by file, reading each test with its production owner, callers, and git history. Issue KEEP, REWRITE, or DELETE verdicts with evidence, remove test-only production seams and dead fixtures, then run the narrowest affected verification.

When should I use mocks in unit tests?▼

Mock only at system boundaries such as external APIs, databases, time, and randomness. Never mock your own classes or internal collaborators. Design mockable boundaries with dependency injection and SDK-style interfaces where each function is independently mockable.

What are common test anti-patterns to avoid?▼

Key anti-patterns include tautological tests that recompute expectations like the implementation, change detectors asserting call counts or snapshots, duplicated scenarios across layers, hollow tests without assertions, and treating appearance like layout classes as behavior.

Why should a new test fail before it passes?▼

Seeing a test fail red proves it actually exercises the intended behavior rather than only validating mocks. For tests added to existing behavior, temporarily break the implementation, confirm the failure, then restore precisely and verify green.

What to do when a behavior cannot be tested automatically?▼

Use manual evidence gathering in order of closeness to real user paths: browser inspection, curl or CLI calls, asserted logging, or desktop automation. Only record test debt for gaps that pass the value gate and deserve long-term protection.