pytest-quality

pytest-quality is a skill for Claude Code, Codex from kaisa-kucherenko/claude-code-flow. It costs 82 tokens per session (2,932 once invoked), scanned C, original, MIT.

A set of rules for writing pytest unit tests that catch specific, realistic bugs. It covers project conventions, test inputs, expected results, fixtures, and mocks.

In plain words
What is it for?
It is for adding or reviewing Python unit tests with pytest, including tests for branches, validation, side effects, boundaries, and default values.
Why use it?
It helps avoid tests that pass even when the code is wrong, or that merely increase test counts and coverage numbers. Each test must have a clear failure it would detect.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for adding or reviewing Python unit tests with pytest, including tests for branches, validation, side effects, boundaries, and default values.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kaisa-kucherenko/claude-code-flow/pytest-quality
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.

Any agent
npx skills add kaisa-kucherenko/claude-code-flow --skill pytest-quality
Clone the repo
git clone --depth 1 https://github.com/kaisa-kucherenko/claude-code-flow

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kaisa-kucherenko/claude-code-flow/pytest-quality/github.svg)](https://agentmods.dev/skills/kaisa-kucherenko/claude-code-flow/pytest-quality)
Your own site
<a href="https://agentmods.dev/skills/kaisa-kucherenko/claude-code-flow/pytest-quality"><img src="https://agentmods.dev/badge/skills/kaisa-kucherenko/claude-code-flow/pytest-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pytest-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/kaisa-kucherenko/claude-code-flow/pytest-quality"><img src="https://agentmods.dev/badge/skills/kaisa-kucherenko/claude-code-flow/pytest-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,932 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00082 $0.02932
Opus 5.5 $0.00033 $0.01173
Sonnet 5.5 $0.00016 $0.00586
Haiku 4.5 $0.00008 $0.00293

Measured 11d ago against content hash 9f7b1a433f0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

pytest-quality scanned grade C 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 11d 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 deletehighDestructive command

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

find "${TMPDIR:-/tmp}" -maxdepth 1 -name 'pytest-mutation.*' -mmin +120 -exec rm -rf {} +
skills/pytest-quality/SKILL.md · 209 lines

How it starts

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

pytest quality bar

A test earns its place by failing on a plausible bug. Count and line coverage are not goals: a suite of ten tests that each catch a distinct break beats fifty that pass whatever the code does, and every extra test is maintenance forever.

0. Project context comes first

Before anything else, read .claude/testing.md in the project root if it exists — run command, asyncio mode, mock edge, conventions, gitignored files the tests need, traps. If it does not exist, derive the same from pyproject.toml ([tool.pytest.ini_options]), the conftest.py nearest the target, and two or three adjacent test files, and say in the report that the project file is missing. Project conventions override style preferences here; they never override sections 1–5.

Existing tests are not automatically the standard. A pattern this skill rejects (bare assert_called(), is not None as the only check) stays rejected even if half the suite does it.

1. The gate — before writing a test body

  1. Name the break. State the production change that makes this test fail: wrong branch, wrong constant or argument, missing side effect, skipped validation, wrong boundary, empty/default return. Cannot name one → do not write the test.
  2. Bug or decision? If only intentional decisions fail it (a constant's value, exact message wording, private structure), it is a change detector: it fires on redesign and sleeps through bugs. Test the behavior that depends on the decision instead.
  3. Independent expected value. Literals and hand-checked fixtures. Never computed with the code under test, its helpers, or its constants — an oracle that shares the logic shares the bug. Never pasted from a run of the current code: that confirms the code matches itself. Characterization (pinning current behavior of legacy code) is allowed only when asked for, labeled as such in the test name or docstring, and each pinned value cross-checked against the raw input.
  4. Discriminating values. Distinct, non-default inputs so a dropped, defaulted or swapped argument fails. When a value can come from several sources (default / config / explicit argument), give each a different value, or picking the wrong source still passes. 0, "", None, empty and equal values are still covered when they are boundaries.

Read the full file on GitHub · 209 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. 11d ago First seen · 209 lines · 82 tokens per session scan C 9f7b1a433f0b

Subscribe to this mod's changes

pytest-quality is a skill published in the GitHub repository kaisa-kucherenko/claude-code-flow (23 stars, last pushed 4d ago), licensed MIT. It adds 82 tokens to every session and 2,932 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-08.