handbook: Skill for Claude Code

.claude/skills/test-quality/SKILL.md

test-quality is a skill for Claude Code from nicograef/handbook. It costs 44 tokens per session (861 once invoked), scanned A, original, MIT.

A review process for an existing automated test suite. It labels each test to keep, improve, remove, or combine.

In plain words
What is it for?
Use it to inventory tests, inspect their helpers and shared setup, and produce a file-by-file cleanup report. It helps reduce noisy tests and improve their clarity and stability.
Why use it?
Older test suites often contain repetitive tests or tests tied too closely to implementation details, making them hard to read and easy to break. This process gives each test a clear reason for its fate before code is changed.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is nicograef/handbook's own configuration. It tells Claude Code how to work on handbook itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything handbook configures →

Part of the handbook plugin — 23 skills, 1 agent, 1 hook shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to nicograef/handbook. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nicograef/handbook/main/.claude/skills/test-quality/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nicograef/handbook

Made for: Claude Code.

Or install handbook, the plugin that ships this one along with the rest of its 23 skills, 1 agent, 1 hook.

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 test-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicograef/handbook/test-quality.svg)](https://agentmods.dev/skills/nicograef/handbook/test-quality)
Your own site
<a href="https://agentmods.dev/skills/nicograef/handbook/test-quality"><img src="https://agentmods.dev/badge/skills/nicograef/handbook/test-quality.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 861 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00044 $0.00861
Opus 5 $0.00022 $0.00430
Sonnet 5 $0.00009 $0.00172
Haiku 4.5 $0.00004 $0.00086

Measured 2d ago against content hash f0acbbcc6ed9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test-quality 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 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.

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.

.claude/skills/test-quality/SKILL.md · 93 lines

How it starts

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

Test Quality Review

Workflow

Step 1 — Discover

  • List the test files in a compact inventory table: file → test count → framework.
  • Note any test helpers, fixtures, or shared setup files.
  • Ask the user whether to limit scope to specific packages or files, before proceeding.

Step 2 — Audit

  • Evaluate every test file.
  • Assign each test exactly one tag: Keep, Refactor, Delete, or Merge.
  • Apply the decision rules and anti-pattern catalog in anti-patterns.md.
  • Group findings by file.
  • Do not make changes yet.

Step 3 — Report

Present the summary to the user before touching any code.

  • Group the tags by file, in this shape:
File: src/checkout/checkout.test.ts  (12 tests)
  Keep     4  — [list test names]
  Refactor 5  — [list test names + 1-line reason]
  Delete   2  — [list test names + 1-line reason]
  Merge    1  — [list test names + target]

File: src/cart/cart.test.ts  (8 tests)
  ...

Total: 20 tests → 17 tests after changes
  • Fields — Keep and Merge list test names; Merge adds the target.
  • Fields — Refactor and Delete add a one-line reason per test.
  • Delete and Merge tags follow the report shape rules.
  • Explain the biggest quality wins after the report.
  • Ask for explicit confirmation before proceeding.
  • Update any tag the user disagrees with, before proceeding.
  • Gate — do not start Step 4 until the user confirms.

Step 4 — Refactor

Work through changes one file at a time.

  • Apply Merge first (reduces total test count, simplifies subsequent work)
  • Apply Refactor next (rewrite tests to use public interface only)
  • Apply Delete last (already confirmed in the Step 3 report)
  • Remove dead test helpers and fixtures that are no longer referenced
  • Clean up imports left orphaned by deleted tests
  • Preserve mocks at true system boundaries (HTTP, email, time, randomness). Prefer a real test DB, mocking the driver only when none is available.

Read the full file on GitHub · 93 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · -5 lines f0acbbcc6ed9
  2. 6d ago First seen · 98 lines · 44 tokens per session scan A 4d3e30f5c2c9

Subscribe to this mod's changes

test-quality is a skill published in the GitHub repository nicograef/handbook (2 stars, last pushed 3d ago), licensed MIT. It adds 44 tokens to every session and 861 once invoked, about $0.0002 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

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

emdash-cms/emdash · 71 tokens

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

semgrep-rule-variant-creator

Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.

waybarrios/opencode-power-pack · 50 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

include-test-files-that-assert-on-behavior-being-changed-in-decl

When delegating a task affected by this skill, include.

ZaxbyHub/opencode-swarm · 29 tokens

qa-frontend

Internal PostHog developer frontend/browser QA skill. Use only when a PostHog developer explicitly asks to run frontend QA, browser-test a PR, verify a UI flow against the local PostHog stack, use qa-frontend, or QA current frontend changes with browser/runtime evidence. Do not use for generic code review, PR review…

PostHog/posthog · 142 tokens