
prune-tests
Skill that prunes tests guarding no behavior, removing dead checks from a test suite.
- GitHub stars
- 1.4K
What it does
- Adds a
prune-testsskill that identifies tests which assert nothing about observable behavior - Covers removing tests that only restate implementation details or duplicate other assertions
- Designed for codebases where a large test suite has grown noisy and slow to maintain
Prune tests that guard no behavior.
Add marketplace
/plugin marketplace add caldoai/skillsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install prune-tests@caldo-skillsRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourcePrune every test that guards no behavior.
1. Find what each test depends on
Keep a test only if it depends on the intended behavior: it should change only when that behavior changes, and fail only when it regresses.
If another test already guards the same behavior, prune the copy.
Prune tests that depend on:
The past: it asserts that removed code stays gone. Bringing it back would be a decision, not a regression.
For example:
- A feature was removed, and tests assert it's gone.
- A module was moved, and a test asserts it's absent from its old path.
Nothing: no change to the code can make it fail, so it has no reason of its own to change.
For example:
- It tests the browser: a
<button>renders, or a click event fires. The browser is already tested. - It mocks the unit under test, then asserts what the mock returns.
- It asserts what the type system already guarantees.
The implementation: it changes whenever the code does, even when behavior didn't.
For example:
- The expected value is derived from the same logic as the code, so a wrong result still passes.
- It asserts private state, internal call order, or which helper was invoked.
2. Prune
- Delete every test that isn't anchored to intended behavior.
- Where one also covers behavior something relies on, rewrite it against that behavior instead.
- Delete production code that only existed for the tests you removed.
What done looks like
- Every test left is anchored to intended behavior.
- Each one would fail on a regression, and only on a regression.
- No test asserts code that no longer exists.
- No two tests guard the same behavior.
- No production code exists only for tests.
Example
--- a/pricing.test.ts
+++ b/pricing.test.ts
@@ rewritten: the expected value repeated the code's logic @@
test("applies the discount", () => {
- const price = 100;
- expect(applyDiscount(price, 0.2)).toBe(price - price * 0.2);
+ expect(applyDiscount(100, 0.2)).toBe(80);
});
--- a/cart.test.ts
+++ b/cart.test.ts
@@ rewritten against what callers see: it asserted private state @@
test("adds an item to the cart", () => {
const cart = new Cart();
cart.add(book);
- expect(cart._items.length).toBe(1);
+ expect(cart.total()).toBe(book.price);
});
@@ deleted: checkout.test.ts already guards the same total @@
-test("total includes tax", () => {
- expect(cartTotal([book], { tax: 0.1 })).toBe(11);
-});
--- a/export.test.ts
+++ b/export.test.ts
@@ deleted: it guards code that no longer exists @@
-test("legacy exporter is gone", () => {
- expect(existsSync("src/export/legacy.ts")).toBe(false);
-});
--- a/session.test.ts
+++ b/session.test.ts
@@ deleted, with the production code that only existed for it @@
-test("clears the cache", () => {
- _resetCacheForTests();
- expect(_getCacheSize()).toBe(0);
-});
--- a/session.ts
+++ b/session.ts
@@ @@
-export function _resetCacheForTests() { cache.clear(); }
-export function _getCacheSize() { return cache.size; }
From the caldoai/skills README
Caldo Skills
Install
Install with the skills CLI, which works with Claude Code, Cursor, Codex and other agents:
npx skills add caldoai/skills
To install a single skill:
npx skills add caldoai/skills --skill untangle-codebase
Or, in Claude Code, add this repo as a plugin marketplace:
/plugin marketplace add caldoai/skills
Then install a skill with the command in its row of the table below.
To install by hand instead, copy a skill's folder into ~/.claude/skills/.
Skills
| Skill | Description | Install |
|---|---|---|
| untangle-codebase | Untangle a codebase for agents. | /plugin install untangle-codebase@caldo-skills |
| prune-tests | Prune tests that guard no behavior. | /plugin install prune-tests@caldo-skills |
Adding a skill
- Create
skills/<name>/SKILL.md. - Add an entry for it to
pluginsin .claude-plugin/marketplace.json. - Add a row to the table above.
License
Details
- Marketplace
- caldoai/skills
- Category
- Community
More from caldoai/skills
All 2Similar to prune-tests
More Development Tools
reamorluto/rea466.8K starsReverse engineer anything with agents, from app behavior down to native binaries.
superpowersobra/superpowers319.5K starsCore skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques
claude-apianthropics/skills196.9K starsClaude API and SDK documentation skill for building LLM-powered applications
prompts.chatf/prompts.chat178.2K starsAccess thousands of AI prompts and skills directly in your AI coding assistant. Search prompts, discover skills, save your own, and improve prompts with AI.
agent-sdk-devanthropics/claude-code156.1K starsDevelopment kit for working with the Claude Agent SDK
ui-ux-pro-maxnextlevelbuilder/ui-ux-pro-max-skill152.6K starsProfessional UI/UX design intelligence for AI coding assistants. Includes searchable databases of styles, colors, typography, charts, and UX guidelines for Reac