Agentic test audit

From sickn33/agentic-awesome-skills · View interactive version

Agentic test audit is an AI agent skill from the GitHub repository sickn33/agentic-awesome-skills. Audit a pytest suite: surviving mutants and untested code, flaky, order-dependent and slow tests, and removal candidates checked on held-out mutants. Report-only.

How to use this skill

Skill file

Audit a test suite

Overview

This skill measures whether a Python test suite is a good check. It asks whether the suite would

notice broken code, whether it is fast and stable enough to run on every change, and which tests

cost time without adding detection. A pinned runner does the measuring; the skill reports and

does not change tests. Upstream source:

timini/agentic-verification.

When to Use This Skill

How It Works

Arguments: $ARGUMENTS. The first word is the mode: quick (default) or deep. Anything

else goes to the runner. To check a single change rather than the whole suite, use the

agentic-verify skill instead.

An agent can only be trusted as far as the checks it runs. This skill measures whether a test

suite is a good check: whether it would notice broken code, whether it is fast and stable enough

to run on every change, and which tests cost time without adding detection.

Runner

AV='uvx --from git+https://github.com/timini/agentic-verification@07608b3b9e4e359bc0b93b3eca94bb78d67e369e#subdirectory=runner agentic-verification'
$AV quick|deep <path> [--budget-minutes N]
$AV prune-check <path> --tests-file <file> --from-run <run-dir>
$AV replay --run <run-dir> --mutant <id>

The runner works in a disposable copy and writes only to .test-suite-audit/ in the project;

suggest adding that to .gitignore. It needs Python 3.12+ and pytest-cov in the project's

environment, and pytest-randomly for order checks. Use a Bash timeout of the budget plus 2

minutes. The last stdout line is JSON with the report paths.

Rules

never upgrade a label (an inferred finding stays inferred).

user asks for a specific change after reading the report.

are not redundant together. Only a removal set that prune-check did not refute may be

presented as removable, and even then as "not refuted", not "safe".

equivalent yourself; say it needs human review.

the study evidence instead of just declining.

Steps

  1. Check the target. Confirm it is a pytest project. Look for test-suite-audit.toml; if

absent, the runner discovers source packages, test directories and the interpreter

(.venv/bin/python, then python3). If discovery looks wrong (for example a monorepo),

write a test-suite-audit.toml only after asking. Keys: python, source, tests,

pytest_args, env, workers, protected (node ID prefixes or marker names of tests that

must never be proposed for removal). If pytest-cov is missing, say coverage will be "not

assessed" and offer the install command; do not install anything without asking.

  1. State the budget before running. Quick is 5 minutes: one baseline run, timings, coverage,

overlap, no mutants. Deep is 30 minutes by default: three file-order and three random-order

runs, coverage, every deletion mutant, then a seeded sample of classical mutants until the

budget ends. In our benchmark, 12 to 14 minutes completed deep audits of projects up to about

3,300 executable lines; dateutil (about 3,600) and click (about 5,000) needed more.

  1. Run the audit and read report.json (full evidence) and report.md. See

reading the report for statuses, labels and the detection rate.

  1. If the deep audit proposed removal candidates, treat them as an upper bound: in our

study such sets covered about 80% of each suite and every one lost kills on held-out mutants.

Run prune-check on them with

--from-run <run-dir>, so the check uses mutants the set was not chosen from. Give it at

least 10 minutes. Report its verdict: refuted (with the kills or lines lost) or not refuted

(with the number of killed mutants checked and the upper bound it gives).

If it is refuted, keep the tests it names as sole killers, and say the rest is still

unproven. Never present a refuted set as removable.

  1. Summarise under three headings, findings in the report's order, each with its label,

evidence and next validation step:

weak tests, uncovered code, and whether property-based tests exist.

slowest and setup-heavy tests, intermittent and order-dependent tests.

Overlap pairs are listed only as things to look at.

Give the reproduction command for at least one mutant finding. List what was not assessed.

Link report.md.

  1. Offer follow-ups, not changes: replaying a survivor; drafting a test that passes on the

original and fails on a confirmed mutant (the agentic-verify skill does this for changed code);

removing a not-refuted set in its own commit; or a deeper run with a larger budget.

If the run is partial (budget or interruption), say so first and explain which steps are missing.

Examples

Example 1: Quick audit

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

Example 2: Deep audit, then check a removal set on held-out mutants

$AV deep . --budget-minutes 30
$AV prune-check . --tests-file removal.txt --from-run .test-suite-audit/<run-dir>

Limitations

Security & Safety Notes

Related Skills

A temporary copy is not a security sandbox: pytest, fixtures, plugins, conftest and dependency hooks execute code and may access network, credentials and external services. Inspect the pinned runner and target test setup first; use a low-privilege isolated environment with no production credentials and controlled network access. Scope secrets and environment inheritance before running mutation/replay commands. A pin identifies code, not a completed safety review.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.