tests-improve

tests-improve is a skill for Claude Code, Codex from deephaven/deephaven-mcp. It costs 63 tokens per session (1,033 once invoked), scanned A, original, Apache-2.0.

A testing guide for improving unit tests, which are checks that verify individual parts of a program. It targets complete coverage for each source file and checks package entry files too.

In plain words
What is it for?
Use it to create missing test files, add tests for uncovered code, remove redundant tests, and verify package exports such as public names and re-exports.
Why use it?
It helps find missing tests, unnecessary tests, and poorly organized test files. This reduces the chance that code changes break behavior without being noticed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/deephaven/deephaven-mcp/tests-improve
Any agent
npx skills add deephaven/deephaven-mcp --skill tests-improve
Clone the repo
git clone --depth 1 https://github.com/deephaven/deephaven-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tests-improve

README.md
[![agentmods](https://agentmods.dev/badge/skills/deephaven/deephaven-mcp/tests-improve.svg)](https://agentmods.dev/skills/deephaven/deephaven-mcp/tests-improve)
Your own site
<a href="https://agentmods.dev/skills/deephaven/deephaven-mcp/tests-improve"><img src="https://agentmods.dev/badge/skills/deephaven/deephaven-mcp/tests-improve.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,033 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00063 $0.01033
Opus 5 $0.00032 $0.00517
Sonnet 5 $0.00013 $0.00207
Haiku 4.5 $0.00006 $0.00103

Measured 4d ago against content hash 0eca2a434ba2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tests-improve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/tests-improve/SKILL.md · 30 lines

How it starts

The opening of the file, as written. The whole thing — 30 lines — stays where its author put it; the contents beside it link to each section on GitHub.

For every file in src/deephaven_mcp except _version.py:

  1. Make sure that there is a test file.
    • __init__.py files count. Every __init__.py — even one that only declares __all__ or re-exports from siblings — gets its own test_init.py. The package surface is part of the API contract; an untested __init__.py is a silent-refactor hazard.
    • What the test_init.py must pin: the exact set of names in __all__, that each re-export is the same object as the internal definition, and that no _-prefixed names leak into the public surface.
    • Canonical implementations: tests/config/schema/test_init.py, tests/config/test_init.py, tests/auth/middleware/test_init.py.
    • Exception — a test directory kept deliberately non-package cannot host a test_init.py. tests/mcp_systems_server/_tools/ has no __init__.py because its modules import fixtures by bare name (from conftest import MockContext); adding one breaks collection there. Without __init__.py, a test_init.py in that directory resolves to the same module name as tests/test_init.py and pytest fails with "import file mismatch". That package's surface is pinned by tests/mcp_systems_server/_tools/test_tool_module_inventory.py instead. Do not create a test_init.py there.
  2. Make sure the test file is in the correct directory with a name that meets project standards.
    • Unit tests: test_<file>.py. Integration tests: test_<file>_integration.py. Both live in tests/<package>/ mirroring the source (see ref-python-coding-practices rule 5).
    • For __init__.py the test file is test_init.py (single underscore between test and init, matching tests/auth/middleware/test_init.py).
    • A test whose subject is broader than one source file is out of scope for this step. Guardrail/contract tests and package-scope integration tests are named for their invariant, not for a module, and rule 5's broader than one source file clause governs them. Do not rename one to fit test_<file>.py, and do not create a source-mirroring stub for one — tests/test_field_docs_contract.py tests an invariant across every schema in the package, not a source module of the same stem, and no such module exists.
  3. Analyze the test file and flag tests that are dead, redundant, test implementation detail rather than observable behavior, or are overly fragile (assert on incidental output, internal call order, or private state). List the flagged tests before changing anything.
    • Also flag any threshold the author invented — a byte cap, a maximum entry count, a size budget with no source in the code or a documented requirement (ref-python-coding-practices rule 21). Ask what defect it stands in for and assert that directly; if the property resists a test, delete the test rather than keep an arbitrary number that will fail someone else's legitimate work.
  4. Add tests for every uncovered branch and error path (coverage rises toward 100%); testing private functions is appropriate for simpler, more targeted tests.
  5. Remove the tests flagged dead or redundant in step 3; confirm coverage holds after removal.
  6. Restructure the tests flagged fragile in step 3 (those asserting on incidental output, call order, or private state) to assert on observable behavior instead.
  7. Run the individual test file. Test files must be run one-by-one to accurately assess per-file coverage.
  8. Target 100% coverage. If coverage is below 100%, add tests until it reaches 100%.

pytest is pre-configured for coverage — no extra flags needed. To run a single file: uv run pytest <file>. Do not add --cov= or --cov-report=; these are already configured.

Per-file runs are required because running the full suite together does not show whether a source file's own test file covers it completely. See the tests-run-file skill for the per-file invocation rules.

After per-file runs pass, run the tests-run skill to verify the full suite. For integration tests (test_<file>_integration.py), use the integration-tests-run skill — they have separate invocation rules (-m integration -s).

Read the full file on GitHub · 30 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 30 lines · 63 tokens per session scan A 0eca2a434ba2

Subscribe to this mod's changes

tests-improve is a skill published in the GitHub repository deephaven/deephaven-mcp (5 stars, last pushed today), licensed Apache-2.0. It adds 63 tokens to every session and 1,033 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens