By shmulc8
Scan TypeScript and Python test suites for assertions that can never fail — type-checker redundancies, tautologies, mock echoes, dead assertions, and duplicates — then delete them automatically.
Modifies files
Hook triggers on file write and edit operations
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
AI agents write tests that can never fail. This skill deletes them.
Every AI-generated test suite has them:
assert isinstance(add(1, 2), int) # the function is typed `-> int`. mypy knew.
expect(true).toBe(true); // bold claim
Tests like these can't catch a regression — they re-assert what the compiler already proved, or assert nothing at all. They burn CI minutes and inflate coverage into false confidence. Empirical studies find test smells in 38–100% of LLM-generated test suites.
Detection is fully deterministic — no LLM in the loop, one script invocation per repo. Instead of asking an AI "is this test useful?", it asks the tools that already know:
typeof result === 'number' is a fact of the
type, the assertion is not a test. Plain-JS test files (.test.js etc.) get
the syntactic categories; type-guaranteed needs TypeScript (or stays off
without checkJs).mypy reveal_type probes (one mypy run for the whole
repo) answer the same for isinstance(...) and is not None.return, assertions swallowed by empty catch/except: pass, duplicate
bodies, len(x) >= 0.Every finding is one of two tiers, and each tier is handled by whoever can actually decide it:
--fix, no LLM
involved. The scripts guard every known way types lie: any/unknown,
as casts, non-null !, index signatures, unchecked index access, structural
instanceof (only nominal classes are provable), cast()/type: ignore.instanceof, mock-echo variants, pytest.raises(Exception), unawaited async
assertions, rotten-green conditional asserts). The script writes down exactly
why it's uncertain, and the coding agent running the skill adjudicates each
one against the surrounding code — delete, keep, or rewrite — then
proposes the calls for your approval before touching anything.It also knows what not to flag: toBeDefined() on .find() results
(T | undefined — a real check), enum contract locks, custom assertion
helpers, deliberate determinism tests, and "must not raise" contract tests.
.rejects.toThrow(...) never awaited, so it
silently never ran.The honest headline isn't a line count — it's that --fix only removes what it
can prove, so whatever it deletes could never have caught a regression. Clone
it and run it on your own repo.
npx skills add shmulc8/captain-obvious@captain-obvious
Also ships a .claude-plugin/plugin.json manifest, or copy
skills/captain-obvious/ into ~/.claude/skills/. Then ask your agent to
"clean up the useless tests" — or run the scanners directly:
# report-only (add --json out.json to save)
node skills/captain-obvious/scripts/captain_obvious_ts.mjs --project <repo>
python3 skills/captain-obvious/scripts/captain_obvious_py.py --path <repo> --mypy "uv run mypy"
# delete proven findings (needs a clean git tree — review the diff after)
node ... --fix
# confirm rotten-green asserts against real coverage (lcov / istanbul / coverage.py)
node ... --coverage coverage/lcov.info
python3 ... --coverage coverage.json
With --coverage, a conditional-assert whose line never executed is promoted
to proven rotten; one that did execute is a confirmed false positive and is
dropped — the dynamic half of the ICSE'19 analysis, using coverage your runner
already emits.
Trust boundary: the scan runs the project's own toolchain — mypy (with whatever plugins the repo's config loads),
uv/poetryenvironments, the repo's owntypescriptpackage. Treat scanning like running the repo's type checker: only do it on code you trust.
Requires Python ≥ 3.9 for the Python scanner and hook; the TS scanner uses the target repo's own typescript and requires ≥ 4.0.
npx claudepluginhub shmulc8/captain-obviousAgent skill and plugin that helps developers and AI coding agents write, scaffold, audit, and manage native lifecycle hooks across 10+ AI coding agents.
Turn a packaged Codex pet (pet.json + spritesheet.webp) into a playable, customizable side-scrolling platformer that ships as a self-contained static site, with themed art generation and one-command Netlify deploy.
Interactive coaching workflow to craft and polish winning talk proposals (CFPs) for developer conferences.
Detect test smells, overmocking, flaky tests, and coverage issues. Analyze test effectiveness, maintainability, and reliability. Use when reviewing tests or improving test quality.
Use this agent when code changes have been made and you need to write new tests, run existing tests, analyze failures, and fix them while maintaining test integrity. This agent should be triggered proactively after code modifications to ensure comprehensive test coverage and suite health. Examples:\n\n<example>\nContext: The user has just implemented a new feature or modified existing code.\nuser: "I've updated the user authentication logic to support OAuth"\nassistant: "I've successfully updated the authentication logic. Now let me run the test-writer-fixer agent to ensure all tests pass with these changes."\n<commentary>\nSince code changes were made, use the Task tool to launch the test-writer-fixer agent to run relevant tests and fix any failures.\n</commentary>\n</example>\n\n<example>\nContext: The user has refactored a module or changed function signatures.\nuser: "Please refactor this payment processing module to use async/await"\nassistant: "I've completed the refactoring to use async/await throughout the payment module."\n<function call omitted for brevity>\nassistant: "Now I'll use the test-writer-fixer agent to run the tests and fix any issues caused by the refactoring."\n<commentary>\nAfter refactoring code, proactively use the test-writer-fixer agent to ensure tests still pass.\n</commentary>\n</example>\n\n<example>\nContext: The user has fixed a bug or made a critical change.\nuser: "Fix the race condition in the data synchronization service"\nassistant: "I've identified and fixed the race condition by implementing proper locking mechanisms."\n<function call omitted for brevity>\nassistant: "Let me run the test-writer-fixer agent to verify the fix doesn't break existing functionality."\n<commentary>\nAfter bug fixes, use the test-writer-fixer agent to ensure the fix works and doesn't introduce regressions.\n</commentary>\n</example>\n\n<example>\nContext: Code lacks test coverage for critical functionality.\nuser: "Our payment processing module has no tests"\nassistant: "That's a critical gap. Let me use the test-writer-fixer agent to create comprehensive tests for the payment module including edge cases and error scenarios."\n<commentary>\nCritical modules without tests are high-risk areas that need immediate test coverage.\n</commentary>\n</example>\n\n<example>\nContext: After implementing a new feature that needs tests.\nuser: "I've added the social sharing functionality"\nassistant: "Great! The social sharing is implemented. Now let me use the test-writer-fixer agent to write tests that ensure this feature works correctly across different platforms."\n<commentary>\nNew features should always include comprehensive test coverage from the start.\n</commentary>\n</example>
Test framework detection, convention-aware test generation, and changed-file test execution.
Test execution, TDD workflow, testing strategies, and quality analysis
Testing workflow skill for high-value test discovery, strategy selection, focused implementation, realistic workload generation, strict review, and suite health diagnostics.
Analyze test failures, identify patterns, and suggest targeted fixes