test-health

A test-suite audit that checks for unreliable tests, unused or trivial tests, missing coverage, weak assertions, and structural problems. A test suite is the collection of automated checks for a codebase.

In plain words
What is it for?
Use it to produce a health report, repeat tests to detect flakiness, inspect coverage gaps, or run a quicker audit that skips repeated runs.
Why use it?
It reveals whether tests can be trusted and where important code lacks meaningful checks.

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/optave/ops-codegraph-tool/test-health
Any agent
npx skills add optave/ops-codegraph-tool --skill test-health
Clone the repo
git clone --depth 1 https://github.com/optave/ops-codegraph-tool

Made for: Claude Code, Codex.

Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,458 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00029 $0.02458
Opus 5 $0.00015 $0.01229
Sonnet 5 $0.00006 $0.00492
Haiku 4.5 $0.00003 $0.00246

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

Security

Grade B, and why

test-health scanned grade B with 1 finding 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 2d 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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$RUN_DIR"

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/skills/test-health/SKILL.md · 270 lines

How it starts

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

/test-health — Test Suite Health Audit

Audit the test suite for flaky tests, dead/trivial tests, coverage gaps on recent changes, missing assertions, and structural issues. Produce a health report with prioritized recommendations.

Arguments

  • $ARGUMENTS may contain:
    • --flaky-runs N — number of times to run the suite for flaky detection (default: 5)
    • --coverage — only run the coverage gap analysis (skip flaky/dead detection)
    • --quick — skip flaky detection (most time-consuming), run everything else
    • No arguments — full audit

Phase 0 — Pre-flight

  1. Confirm we're in the codegraph repo root
  2. Verify vitest is available: npx vitest --version
  3. Parse $ARGUMENTS:
    • FLAKY_RUNS=N from --flaky-runs N (default: 5)
    • COVERAGE_ONLY=true if --coverage
    • QUICK=true if --quick
  4. Discover all test files:
    find tests/ \( -name '*.test.js' -o -name '*.test.ts' \) | sort
    
  5. Count total test files and categorize by directory (integration, parsers, graph, search, unit)

Phase 1 — Flaky Test Detection

Skip if COVERAGE_ONLY or QUICK is set.

Run the full test suite FLAKY_RUNS times and track per-test pass/fail:

RUN_DIR=$(mktemp -d /tmp/test-health-XXXXXX)
for i in $(seq 1 $FLAKY_RUNS); do
  timeout 180 npx vitest run --reporter=json > "$RUN_DIR/run-$i.json" 2>"$RUN_DIR/run-$i.err"
  exit_code=$?
  if [ $exit_code -eq 124 ]; then
    echo '{"timeout":true}' > "$RUN_DIR/run-$i.json"
  elif [ $exit_code -ne 0 ] && [ $exit_code -ne 1 ]; then
    # Use jq to safely JSON-escape stderr content (may contain quotes, newlines, backslashes)
    stderr_content=$(cat "$RUN_DIR/run-$i.err")
    jq -n --argjson code "$exit_code" --arg stderr "$stderr_content" \
      '{"error":true,"exit_code":$code,"stderr":$stderr}' > "$RUN_DIR/run-$i.json"
  fi
done

For each run, parse the JSON reporter output from $RUN_DIR/run-$i.json to get per-test results.

After all runs are parsed and analysis is complete, clean up the temporary directory:

rm -rf "$RUN_DIR"

Read the full file on GitHub · 270 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. 2d ago First seen · 270 lines · 29 tokens per session scan B 6f433b2eb124

Subscribe to this mod's changes

test-health is a skill published in the GitHub repository optave/ops-codegraph-tool (92 stars, last pushed yesterday), licensed Apache-2.0. It adds 29 tokens to every session and 2,458 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

codespaces

Build and query architecture-aware code search, dependency graphs, call flows, impact analysis, and belief maps for Python, TypeScript, TSX, Rust, C#, Java, Go, Ruby, and Ruby on Rails repositories. Use before non-trivial code changes to find module boundaries, blast radius, architecture violations, and the minimal…

diskd-ai/codespaces · 74 tokens

security-triage

Turn a large codebase into a short, ranked reading list of security-relevant code paths worth a human researcher's time, using the flyto-indexer MCP tools. Use when asked to find, prioritize, or triage potential vulnerabilities / taint flows / attack surface in a repository indexed (or indexable) by flyto-indexer …

flytohub/flyto-indexer · 105 tokens

devlens

Understand a codebase with the DevLens MCP — TypeScript, JavaScript, Python, Go, Rust, or Java (incl. React/Next.js/Node, FastAPI/Flask/Django, Spring Boot, Gin/Echo/chi/net-http, axum/actix/rocket). Query a precomputed graph of nodes (components, hooks, functions, classes, methods, structs, traits, routes) and typed…

devlensio/devlensOSS · 0 tokens

archon

Multi-language dependency impact analysis for Java, JS/TS, and Python codebases. Answers "if I change this, what breaks?" Run /archon diff before refactoring, /archon analyze for full dependency maps.

Schr0d/Archon · 48 tokens

codebase-intelligence

Query the codebase-intelligence CLI to understand TypeScript architecture, dependencies, blast radius, and risk before reading files. Use for any "how is this structured", "what breaks if I change X", "where is the complexity" question.

bntvllnt/codebase-intelligence · 54 tokens

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens