routine-useless-test-pruner

Detects and deletes tests that cannot fail by sabotaging covered behavior and verifying they stay green.

275|32|Updated Oct 2, 2020
One-click install
npx skills add https://github.com/bex-co/beancount-io --skill routine-useless-test-pruner-bex-co
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routine-useless-test-pruner
Source: https://github.com/bex-co/beancount-io/tree/main/.agents/skills/routine-useless-test-pruner
Command: npx skills add https://github.com/bex-co/beancount-io --skill routine-useless-test-pruner-bex-co

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites accumulate worthless tests — tautologies, mock-everything tests, and assertion-free checks — that pass no matter what the code does, inflating coverage numbers while providing zero protection against regressions. ## Core Features & Use Cases - Mechanical proof of uselessness: Temporarily breaks the behavior a test claims to cover, runs the test, and confirms it stays green before deleting it. - Pattern detection: Finds tests with no meaningful assertions, tautological mock assertions, fully mocked units under test, and near-duplicate tests. - Safe, reviewable shipping: Deletes one finding per /ship, verifies all sabotage is reverted via git diff, and keeps the owning package's full gate green. - Use Case: A developer suspects the Jest suite in mobile/src/__tests__/ contains dead tests; invoking this routine identifies candidates, proves each one cannot fail, and removes them one at a time. ## Quick Start Invoke /routine-useless-test-pruner with an optional package or path to find, prove, and delete tests that cannot fail.

Frequently Asked Questions about routine-useless-test-pruner

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

FAQPage Schema
How do I find and delete useless tests in my test suite?

Invoke the routine with an optional package or path scope. It reads test files for shapes that cannot fail, proves each candidate by breaking the covered behavior and watching the test stay green, then deletes it and ships the change.

What kinds of tests are considered useless or worthless?

Tests with no meaningful assertion, tautologies asserting a mock returns what it was told to return, mock-everything tests where the unit under test is itself mocked away, and exact or near-exact duplicates of neighboring tests.

How does the routine prove a test cannot fail?

It temporarily sabotages the behavior the test claims to cover, such as inverting a condition or corrupting a return value, then runs the test. If the test stays green, it is proven useless; if it goes red, it is a real test and is left alone.

When should I not prune a test that looks useless?

Never delete a test that went red under sabotage, tests that fail intermittently (handled by routine-flaky-test-fixer), tests of code being deleted by another routine, or tests that are merely slow but valid.

How does the routine ensure sabotage changes are not shipped?

Before staging, it verifies with git diff that only test deletions remain and every sabotage is fully reverted. This check is part of each finding, and shipping a sabotage is treated as the worst possible outcome.