Skip to content

Guide · Agent skill

How to use the Audit a pytest suite agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Audit a pytest suite skill (agentic-test-audit) lets an AI agent measure how good a Python project's pytest tests are. It checks whether the tests would notice deliberately broken code, which tests are slow, flaky or order-dependent, and whether any tests look removable. This guide explains what agent skills are, how to install this one, how to ask for an audit in plain language, and how to read the results safely.

Audit a pytest suitesickn33/agentic-awesome-skills · MIT

Quick start

  1. 1Download and unzip. Download the ZIP from this page and unzip it into ~/.claude/skills/ or into the project's .claude/skills/ folder.
  2. 2Or upload in the Claude apps. In the Claude apps, open Settings, then Capabilities, then Skills, and upload the ZIP.
  3. 3Prepare the project. Confirm it is a pytest project with Python 3.12 or newer, pytest-cov, and pytest-randomly if you want order checks. Have uv and network access to GitHub available.
  4. 4Ask for an audit. Request a quick or deep audit in plain language. The agent will state the time budget before it starts.
  5. 5Read report.md. Review the three summary headings, the labels, and the reproduction command for any mutant finding.
  6. 6Check any removal set. If a deep audit proposes removals, have the agent run prune-check with the run directory and read the verdict.
  7. 7Decide on follow-ups. Choose whether to replay a survivor, draft a test, remove a not-refuted set in its own commit, or run a deeper audit. The agent makes no changes on its own.

What is an agent skill, and what does this one do?

An agent skill is a folder of instructions and optional scripts that an AI agent such as Claude can load when a task matches it. This skill is defined in a single file, SKILL.md, and is marked with the category testing and the tags pytest, mutation-testing and flaky-tests.

When installed, the agent runs a pinned measurement tool against your pytest suite. It asks whether the suite would notice broken code (mutants), which tests cost time without adding detection, and which tests are flaky or order-dependent. It then writes a report and explains the findings.

The skill is report-only. The agent does not edit, delete, skip or quarantine tests, and does not change source code unless you ask for a specific change after reading the report.

Install the agentic-test-audit skill

Option 1: download the ZIP from this page and unzip it into your personal skills folder, ~/.claude/skills/, so it is available in all your projects.

Option 2: unzip it into a project's .claude/skills/ folder so it applies only to that repository. This is a good choice when you want teammates to get the same skill through the repo.

Option 3: in the Claude apps, open Settings, go to Capabilities, then Skills, and upload the ZIP there.

  • Personal: ~/.claude/skills/
  • Per project: .claude/skills/ inside the repository
  • Claude apps: Settings → Capabilities → Skills

Check your project before the first run

The skill only applies to Python projects that use pytest. Confirm that the project has a working test environment. The runner needs Python 3.12 or newer, pytest-cov in the project's environment, and pytest-randomly if you want order checks. It also needs uv, because the runner is started with uvx, and network access to GitHub to fetch the pinned runner.

If the runner cannot find your test setup, you can add a test-suite-audit.toml file. The agent will ask you before writing one. Its keys are python, source, tests, pytest_args, env, workers and protected. The protected key lists test node ID prefixes or marker names that must never be proposed for removal.

If pytest-cov is missing, the agent will say that coverage is not assessed and offer the install command. It will not install anything without asking.

  • Python 3.12 or newer
  • pytest and pytest-cov in the project environment
  • pytest-randomly for order-dependent test checks
  • uv, to run the pinned runner with uvx
  • Network access to GitHub

Ask for an audit in plain language

You do not need a special command. Ask the agent to audit, review, speed up, prune or strengthen your pytest tests, or ask which tests are useful, flaky or slow. The skill will then pick a mode.

The default mode is quick, which takes about 5 minutes: one baseline run, timings, coverage and overlap, with no mutants. The deep mode runs for 30 minutes by default and adds file-order and random-order runs, coverage, every deletion mutant and a seeded sample of classical mutants. The agent states the budget before running.

To check a single change instead of the whole suite, use the related agentic-verify skill.

  • Audit my pytest tests and tell me which ones are flaky.
  • Run a quick audit of this Python project.
  • Do a deep audit of the test suite with a 30-minute budget.
  • Which of my tests are slow and add nothing to detection?

Read the report and check removal candidates

The agent reads report.json for full evidence and report.md for the summary. The findings are grouped under three headings: whether the suite catches broken code, whether an agent can run it on every change, and whether it is bloated. Each finding carries a label and a next validation step.

If a deep audit proposes removal candidates, the agent treats them as an upper bound and runs prune-check on them using held-out mutants. The verdict is either refuted, with the kills or lines lost, or not refuted. A not refuted result is not the same as safe, and the skill never presents a refuted set as removable.

A surviving mutant is a candidate gap, not proof of a bug. Equivalent mutants need human review.

  • Refuted: the tests named are sole killers and must be kept.
  • Not refuted: the set survived the check, but this is not proof that removal is safe.
  • The runner writes its output to .test-suite-audit/ in your project. Consider adding that folder to .gitignore.

Example commands the runner uses

The agent runs the pinned runner through uvx. The three entry points are quick or deep audits, prune-check for a removal set, and replay for a single mutant. The runner works in a disposable copy and writes only to .test-suite-audit/. The last line of its output is JSON with the report paths.

A deep audit followed by a removal check looks like the second example below. The first example is a 5-minute quick audit.

AV='uvx --from git+https://github.com/timini/agentic-verification@07608b3b9e4e359bc0b93b3eca94bb78d67e369e#subdirectory=runner agentic-verification' $AV quick . --budget-minutes 5

What people use it for

  • Finding surviving mutants that show which logic your tests never check.
  • Locating slow tests and setup-heavy fixtures to speed up CI without losing detection.
  • Investigating intermittent failures by checking for flaky and order-dependent tests.
  • Reviewing a long-established suite for tests that cost time but add no detection, then checking any removal set on held-out mutants.

Frequently asked questions

How do I install the agentic-test-audit skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder to share it with a repository. In the Claude apps you can instead upload the ZIP under Settings, then Capabilities, then Skills.

What does the agentic-test-audit skill require?

It needs Python 3.12 or newer, pytest and pytest-cov in the project environment, and pytest-randomly for order checks. It also needs uv to run the pinned runner with uvx, and network access to GitHub to fetch that runner.

Is the agentic-test-audit skill free to use?

The skill is published under the MIT licence, as stated in its source. Check the licence file linked from the source for the full terms.

Will the skill delete or rewrite my tests?

No. The skill is report-only. It does not edit, delete, skip or quarantine tests, and it does not change source code unless you ask for a specific change after reading the report.

Does this skill work with languages other than Python?

No. It targets pytest specifically, so it only applies to Python projects that use pytest.

What should I do if the audit runs out of time?

Very large repositories may need a budget above the 30-minute default for a full deep audit. If a run is partial, the agent says so first and explains which steps are missing.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits Python developers and teams who want evidence about whether their pytest suite catches bugs, and who want to find slow, flaky or order-dependent tests without the agent changing anything. It is not suited to non-Python projects, to anyone who wants automatic test rewriting or deletion, or to very large repositories that may exceed the default time budget.

Download the skill