Test Cleaner

Analyzes and optimizes test suites through multi-phase adversarial review workflows.

1|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/htxryan/claude-code-config-profiles --skill test-cleaner-htxryan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Test Cleaner
Source: https://github.com/htxryan/claude-code-config-profiles/tree/main/.agents/skills/compound/test-cleaner
Command: npx skills add https://github.com/htxryan/claude-code-config-profiles --skill test-cleaner-htxryan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites accumulate fake tests, redundant coverage, order-dependent tests, and untested code paths over time, making them slow and unreliable. This Skill systematically detects and removes these problems while guaranteeing coverage is not degraded. ## Core Features & Use Cases - Parallel Analysis Subagents: Detects cargo-cult tests, redundant coverage, order dependencies, and untested code paths using five specialized analyzers. - Adversarial Review Gate: Two independent reviewer subagents (Opus and Sonnet) must unanimously approve the optimization plan before any changes are applied. - Machine-Readable Output: Emits findings as ERROR [file:line] type: description with remediation suggestions, and verifies results with before/after metrics. - Use Case: A team with a slow, flaky test suite runs this Skill to identify mocked business logic and duplicate tests, then safely removes them after adversarial review confirms coverage is preserved. ## Quick Start Analyze my project's test suite, remove fake and redundant tests, and verify coverage is not degraded.

Frequently Asked Questions about Test Cleaner

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

FAQPage Schema
How do I remove redundant tests from my test suite?▼

Run a redundancy analysis that maps which invariants each test verifies and identifies overlapping coverage. Tests can be safely deleted only after confirming the same code paths and invariants remain covered by other tests.

How to detect fake or cargo-cult tests in a codebase?▼

Fake tests are detected by looking for mocked business logic, trivial assertions, and tests that never exercise real code paths. A dedicated analysis pass flags these so they can be replaced with meaningful tests or removed.

Can I run only a subset of tests for faster feedback?▼

Yes, use module isolation by passing a path filter to your test runner, such as pnpm test with a specific module path. Run the full suite only for final validation after targeted changes pass.

Why do my tests fail depending on execution order?▼

Order-dependent failures happen when tests share mutable state or rely on side effects from earlier tests. An independence checker identifies these by verifying each test passes in isolation and in randomized order.

What are the risks of deleting tests to speed up a suite?▼

Deleting tests without verifying coverage elsewhere can silently drop protection for critical invariants. Always compare before/after coverage metrics and require independent review approval before removing any test.