← ClaudeAtlas

pytest-optimizerlisted

Use when a pytest suite or its fixtures are slow and need measured, safety-gated optimization across the full pipeline.
tony/skills · ★ 2 · Testing & QA · score 71
Install: claude install-skill tony/skills
# 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`, `baselin