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 agentmods add skills/tony/skills/pytest-optimizernpx 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.svg" alt="Measured on agentmods" 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 | $0.00027 | $0.02427 |
| Opus 5 | $0.00014 | $0.01213 |
| Sonnet 5 | $0.00005 | $0.00485 |
| Haiku 4.5 | $0.00003 | $0.00243 |
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 4d 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 — 194 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 one as its own verified commit — through a resumable, idempotent four-phase loop.
The core discipline: measure before you mutate, and prove a speedup against the project's own timing noise before you trust it. A theoretically great change whose measured delta falls inside the noise band is worth nothing and is never committed.
$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, and --memory-dir to
override where durable state is written.
The loop
00-scan -> 01-benchmark -> 02-plan -> 03-execute -> (re-scan)
Each phase is a separate command that reads and writes durable JSON under the
resolved memory directory. Re-running the whole skill resumes at the first
incomplete phase. After 03-execute, re-scanning measures the new baseline and
the loop can continue until no candidate clears the rubric.
| Phase | Command | Reads | Writes |
|---|---|---|---|
| 1 | the pytest-optimizer-00-scan skill |
AGENTS.md/CLAUDE.md, prior state.json |
baseline.json, capabilities.json, hypotheses.json |
| 2 | the pytest-optimizer-01-benchmark skill |
baseline.json, hypotheses.json |
benchmarks.json |
| 3 | the pytest-optimizer-02-plan skill |
benchmarks.json, baseline.json |
plan.json |
| 4 | the pytest-optimizer-03-execute skill |
plan.json, baseline.json |
execution-log.json + commits |
Step 1: Detect preferred tools and the project test command
Check for the user's preferred search tools, then read the project's own test and
quality-check commands. Never hardcode the runner — pytest, uv run, tox,
nox, and hatch are all valid and the project declares which it uses.
for tool in rg ag fd jq uv uvx; do command -v "$tool" >/dev/null 2>&1 && echo "$tool:available" || echo "$tool:missing"; done
Read AGENTS.md, CLAUDE.md, justfile, tox.ini, and pyproject.toml to
discover the canonical commands for running the suite, the formatter, the linter,
and the type checker. Record the test command verbatim; every phase reuses it.
What ships with it
12 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.
- references/durations-parsing.md 4.1 KB
- references/fixture-analysis.md 5.9 KB
- references/heuristic-catalog.md 15 KB
- references/memory-schema.md 6.6 KB
- references/output-contract.md 2.7 KB
- references/parametrize-convention.md 3.7 KB
- references/safety-gates.md 3.8 KB
- references/scoring-rubric.md 4.4 KB
- references/version-matrix.md 5.3 KB
- templates/conftest_cache_snippet.py 4.1 KB runs code
- templates/pytest_optimizer_plugin.py 3.0 KB runs code
- templates/state.schema.json 6.1 KB
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.
- 4d ago First seen · 194 lines · 27 tokens per session scan A 99e2e280f64b
pytest-optimizer is a skill published in the GitHub repository tony/skills (2 stars, last pushed 6d ago), licensed MIT. It adds 27 tokens to every session and 2,427 once invoked, about $0.0001 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.
Other skills, from other repositories
specify-factory
Decompose a multi-feature or multi-component specification into factory-consumable artifacts. Use this for high-complexity work — multiple features, three or more components, or parallel-eligible workstreams.
debug
Systematically diagnose and resolve bugs through conversational investigation and root cause analysis.
specify-incremental
Decompose a single-feature specification into a linear, phase-by-phase implementation plan. Use this for medium-complexity work — single feature, one or two components — where transparent human-in-the-loop phase review is preferred over factory automation.
validate
Validate in any of six modes — spec quality, single-file review, spec-to-implementation drift, constitution rule enforcement, comparison between two artifacts, or sanity-checking your understanding. Use when checking a spec by ID, validating a file by path, detecting drift, enforcing constitution rules, comparing two…
pattern-detection
Identify existing codebase patterns (naming conventions, architectural patterns, testing patterns) to maintain consistency. Use when generating code, reviewing changes, or understanding established practices.
requirements-elicitation
Requirement gathering techniques, stakeholder analysis, user story patterns, and specification validation. Use when clarifying vague requirements, resolving conflicting needs, documenting specifications, or validating requirements with stakeholders.