/victorhahn-skills:test-coverage-quality-auditfrom victorhahn-skills
Audit a codebase for test coverage *quality* — not just line %. Detects tautological assertions, business logic leaks into controllers, snapshot abuse, fake-timer/store leaks, over-mocking of internals, missing tests, and framework-specific anti-patterns in JS/TS (Jest, Vitest, Testing Library, MSW, Playwright) and Go. Use whenever the user says "audit our tests", "check test quality", "are our tests meaningful", "find coverage gaps", "test smell review", "review the tests for this feature", "are these tests any good", "what's wrong with our test suite", or pastes a repo path / PR diff and asks about testing rigor. Produces a severity-tagged diagnostic report with file:line citations — does not run tests or modify code. Strongly prefer this skill over generic code review for any question that touches test integrity, assertion strength, mock strategy, or coverage adequacy.
Ships in victorhahn-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A diagnostic skill. Reads source + test files, produces a severity-tagged report. Never runs tests, installs deps, or mutates code.
Line coverage is a noise metric past ~70%. The real questions:
Heuristics in references/detectors.md are tuned for statically detectable signal. Dynamic things (mutation scores, order-dependency, actual coverage %) are accepted as optional user-provided inputs, never inferred.
The user can invoke this skill three ways. Identify which before reading any code:
| Intent | Signal | Behavior |
|---|---|---|
| Whole-repo exhaustive | "audit our tests", "review the test suite", points at repo root | Full sweep, all detector categories, sample large directories |
| Targeted slice | Names a directory, feature, PR diff, or set of files | Restrict scope. Skip co-location/structural detectors if scope is just a few files |
| Topic slant | "find business logic in controllers", "check for over-mocking", "are our async tests safe" | Run only the relevant detector categories. Skip the rest. |
If ambiguous, ask one short question before proceeding.
Read these to determine framework + runner — needed to load the right detectors:
package.json → look for jest, vitest, @testing-library/*, playwright, cypress, msw, framework (react, vue, next, express, fastify)tsconfig.json → strict mode? noImplicitAny?go.mod → Go project?**/*.{test,spec}.{ts,tsx,js,jsx} and **/*_test.goReport what you found in the audit Summary section. If the repo is a monorepo, audit each package separately (or ask the user to scope).
Before applying H7 (business logic in controllers) or N1 (mocked req/res), spend 60 seconds checking what the codebase calls "controllers" and what they actually are. The detector catalog assumes the user's naming reflects the code's shape, which is often false.
Quick checks:
src/controllers/ (or equivalent). Do they import Request/Response from Express? Do they read req.body / write res.json? If no, they're a service layer, not HTTP handlers — and H7 may not apply. Look further up at src/routes/ or src/handlers/ for the actual HTTP boundary.controller.create(payload, user)), that's already the extracted architecture H7 would recommend. Don't flag H7; instead audit whether the service layer is itself too fat (validation + persistence + audit + cache + rollback in one function — see H10).src/controllers/ are a service layer, not Express handlers." Then audit what's actually there. This is more useful than silently applying detectors against the wrong abstraction.Before flagging H1 (manual fetch/axios mocking) or N3 (missing MSW), check whether the repo runs an explicit mock-server container/process. Look for:
mock-services/ or __mocks__/server/ directory containing an Express appdocker-compose.test.yml that brings up a service exposing mocked endpointsconfig/test.js (or equivalent) that points outbound HTTP at http://localhost:<port> or http://mocks:<port>If any of these exist, the codebase has a deliberate mock-server architecture that legitimately substitutes for MSW. Note it in the report as a sound design choice and do not flag absent MSW. The H1 detector still applies for additional in-test fetch stubs (those would bypass the mock server).
Ask the user (or accept if already provided) whether they have:
coverage/coverage-summary.json, coverage/lcov.info, or text output). If yes, use it for the Coverage Gaps section.reports/mutation/mutation.json). If yes, use it for the Surviving Mutants section.If neither is provided, say so explicitly in the report. Do not silently skip.
Read references/detectors.md — the full pattern catalog with grep templates, AST hints, severity, and one-line principle citations. This is the core of the skill.
For framework-specific patterns (React act/RTL, Vue Pinia/composables, Node Express/MSW, Go t.Parallel), load references/frameworks.md and apply only the sections matching the detected stack.
Use Grep and Read aggressively. For each detector category:
Sampling rule for large codebases: If a detector returns >50 matches in one category, sample diversely (different directories/files) for the top 20 and mention the total count. Do not paginate through hundreds of identical findings.
| Severity | Definition | Examples |
|---|---|---|
| 🔴 Critical | Test cannot fail, hides real bugs, or asserts nothing meaningful | Empty test body, tautological assertion, missing await before async assertion, test inside if |
| 🟠 High | Real quality problem that will allow regressions or cause flakes | Manual global.fetch mock, fake timer leak, store not reset, business logic buried in controller |
| 🟡 Medium | Worth fixing, but not actively broken | Snapshot-heavy component test, missing test file for non-trivial module, over-mocked internals |
| 🟢 Low | Style/consistency observations — only include if user asked for thorough audit | Naming inconsistency, missing describe blocks, AAA pattern violations |
Bias toward fewer, higher-confidence findings. A finding the user dismisses as a false positive damages trust in the whole report. When unsure, downgrade severity or omit.
Severity elevation rule — concentration in highest-logic files. When a Medium finding (missing tests, weak assertions) is concentrated in the largest / most branchy / highest-business-value files in the codebase, elevate it to High or Critical. Example: M2 ("missing co-located test") for ten 50-LOC utility files is Medium. M2 for the 848-LOC rollback orchestrator that no other test covers is Critical. The severity reflects impact, not pattern occurrence count.
When you elevate, say so in the finding: **Severity rationale:** elevated from Medium to Critical because the missing tests are concentrated on the highest-logic files in the directory.
Follow references/report-template.md exactly. Output to stdout (do not write a file unless the user asks).
End the report with Recommended next 3 actions — pick the highest-leverage fixes, not just the highest-severity. "Extract processSubscription business logic from routes/billing.ts" beats "10 snapshot tests are too verbose" even if both are flagged.
Do not include in v1:
--fix mode (diagnostic only — user asked for this explicitly)If the user asks for something that this skill is designed to avoid, push back briefly:
references/detectors.md — full pattern catalog (load first, in step 4). Severity-prefixed IDs: C1-C5 critical, H1-H10 high (incl. H6b — mocking the dependency the unit exists to wrap), M1-M5 medium, L1-L3 low, S1 suite-wide quantitative ratios.references/frameworks.md — framework-specific detectors (load on-demand based on stack)references/report-template.md — exact output format (load before writing the report)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (victorhahn/skills) — no native marketplace selected
npx claudepluginhub p/victorhahn-victorhahn-skills18 skills in this plugin
/ai-engineering-digestFetch a weekly briefing of what's trending and being discussed in the AI engineering landscape — HN, Reddit, GitHub — and synthesize it into a structured digest covering technical signal, notable projects, and the professional/cultural discourse around AI. Use when the user says "/ai-engineering-digest", "run the digest", "what's the ai meta this week", "weekly ai pulse", "what's trending in ai dev", or wants a broad briefing on the current state of AI engineering. Accepts an optional topic arg for on-demand narrower queries ("/ai-engineering-digest mcp")./aws-solutions-architectExpert AWS solutions architect with deep knowledge of AWS services, architecture patterns, best practices, cost optimization strategies, and Terraform AWS provider implementation. Use this skill whenever the user asks about AWS architecture, AWS service selection, infrastructure design, cost optimization, rightsizing, savings plans, Reserved Instances, AWS debugging, CloudWatch, IAM, networking (VPCs, subnets, security groups, Transit Gateway), ECS/EKS, Lambda, DynamoDB, RDS, S3, SQS/SNS, API Gateway, or any AWS service question. Also trigger for Terraform AWS provider questions, terraform-aws module usage, writing or reviewing .tf files that use AWS resources, and any question that starts with "what's the best way to..." in an AWS or infrastructure context. When in doubt about whether this is an AWS question, use this skill — it's better to over-apply than miss a relevant question.