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.
npx skills add tony/skills --skill pytest-optimizergit clone --depth 1 https://github.com/tony/skillsWrote 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.
[](https://agentmods.dev/skills/tony/skills/pytest-optimizer)<a href="https://agentmods.dev/skills/tony/skills/pytest-optimizer"><img src="https://agentmods.dev/badge/skills/tony/skills/pytest-optimizer/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.
<a href="https://agentmods.dev/skills/tony/skills/pytest-optimizer"><img src="https://agentmods.dev/badge/skills/tony/skills/pytest-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00030 | $0.02131 |
| Opus 5.5 | $0.00012 | $0.00852 |
| Sonnet 5.5 | $0.00006 | $0.00426 |
| Haiku 4.5 | $0.00003 | $0.00213 |
Grade A, and why
pytest-optimizer 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.
How it starts
The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pytest-optimizer
Profile a pytest suite, find safe speedups, and apply each as its own verified commit on a new branch, through a resumable, idempotent four-phase loop.
Measure before you mutate, and prove a speedup against the project's own timing noise before you trust it. A change whose measured saving falls inside the noise band, whose run exits non-zero, or whose collected tests change is never committed, except a deselection the user approved with its test count, which is reported as a smaller default run, not a faster suite.
$ARGUMENTS may name a test path or marker to scope the run, a --phase to jump
to, --force to ignore idempotency tokens and re-run, --hygiene to add the opt-in typing
and parametrize detectors, and --memory-dir to
override where durable state is written.
Paths under ../../scripts/ resolve from this skill's directory: print the absolute path once and write it literally in each command, since shell variables do not persist between Bash calls.
When python3 is missing or older than 3.14, follow references/python.md.
The loop
00-scan -> 01-benchmark -> 02-plan -> 03-execute -> (re-scan)
Each phase reads and writes durable JSON under the resolved memory directory;
re-running resumes at the first phase whose completed flag is false, which
measure.py state resume reports. After 03-execute, re-scan and loop until no
candidate clears the rubric.
The phase skills set disable-model-invocation, so this skill cannot invoke
them. To run a phase, read its file and follow it:
- the
pytest-optimizer-00-scanskill readsAGENTS.md/CLAUDE.mdand priorstate.json; writesbaseline.json,capabilities.json,collection.txt,hypotheses.json. - the
pytest-optimizer-01-benchmarkskill readsbaseline.json,hypotheses.json; writesbenchmarks.json,control.jsonand one hash-bound patch per candidate. - the
pytest-optimizer-02-planskill readsbenchmarks.json,baseline.json; writesplan.json. - the
pytest-optimizer-03-executeskill readsplan.json,baseline.json,control.json; writesexecution-log.jsonand commits on a new branch in a scratch worktree, leaving the user's checkout, index and branches untouched.
What ships with it
16 files 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.
- agents/openai.yaml 255 B
- references/durations-parsing.md 5.7 KB
- references/fixture-analysis.md 6.3 KB
- references/heuristic-catalog.md 15 KB
- references/isolate.py 24 KB runs code
- references/measure.py 64 KB runs code
- references/memory-schema.md 14 KB
- references/output-contract.md 8.1 KB
- references/parametrize-convention.md 3.6 KB
- references/prose-rules.md 4.5 KB
- references/python.md 1.9 KB
- references/safety-gates.md 4.6 KB
- references/scoring-rubric.md 4.5 KB
- references/version-matrix.md 7.1 KB
- templates/conftest_cache_snippet.py 2.8 KB runs code
- templates/pytest_optimizer_plugin.py 3.3 KB runs code
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.
- 2d ago Changed · +2 lines 3fbb4e369ac7
- 1mo ago Changed · -19 lines 1f762b082e93
- 1mo ago Changed · +2 lines · +3 tokens per session daeb57514b79
- 3mo ago First seen · 194 lines · 27 tokens per session scan A 99e2e280f64b
pytest-optimizer is a skill published in the GitHub repository tony/skills (0 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 2,131 once invoked, about $0.0001 per session on Opus 5.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.
pytest-optimizer compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pytest-optimizertony/skills | Skill | 0 | today | MIT | A | 30 | Claude Code, Codex |
| test-masterJeffallan/claude-skills | Skill | 13k | today | MIT | A | 104 | Claude Code |
| migrate-xunit-to-xunit-v3dotnet/skills | Skill | 6.4k | today | MIT | A | 149 | Claude Code |
| go-testingGentleman-Programming/gentle-ai | Skill | 9.7k | yesterday | MIT | A | 26 | Claude Code, Codex |
| dart-testdartsim/dart | Skill | 1.2k | today | BSD-2-Clause | A | 18 | Claude Code, Codex |
| test-generatorrshankras/claude-code-apple-skills | Skill | 915 | 21d ago | MIT | A | 33 | Claude Code |
| nw-fp-clojurenWave-ai/nWave | Skill | 636 | 11d ago | MIT | A | 25 | Claude Code |