← ClaudeAtlas

pytest-optimizer-00-scanlisted

Phase 1 of the pytest-optimizer pipeline. Profile the suite and emit hypotheses without editing any test. Detects pytest + plugin versions and gates capabilities, establishes a reproducible timing baseline with a measured noise band, ranks the slowest test bodies and the slowest fixture setup/teardown separately, and runs the static detectors (unused/mis-scoped/ duplicate fixtures, mark-on-fixture, typing and parametrize gaps). Writes baseline.json, capabilities.json, and hypotheses.json to the memory directory. Read-only on the test suite. Use when starting a pytest optimization pass or re-baselining after changes.
tony/ai-workflow-plugins · ★ 2 · Testing & QA · score 59
Install: claude install-skill tony/ai-workflow-plugins
# 00-scan Profile, detect, hypothesize. This phase **only reads** the suite and **only writes** JSON to the memory directory. No test is edited here. `$ARGUMENTS` may scope the run to a path or marker, set `--runs=N` (baseline sample count, default 5), `--force` to ignore the idempotency token, and `--memory-dir` to override the memory location. ## Step 1: Preflight Detect preferred tools (`rg`/`ag`/`fd`/`jq`/`uv`/`uvx`) and read the project's **own** test command from `AGENTS.md`, `CLAUDE.md`, `justfile`, `tox.ini`, or `pyproject.toml`. Do not hardcode a runner. Record the resolved command; every later phase reuses it. Substitute it wherever this file writes `pytest`. ## Step 2: Resolve memory and check idempotency Resolve the memory directory per `references/memory-schema.md` (repo-root `.pytest-optimizer/`, gitignored; XDG fallback). Compute the idempotency token (git HEAD + collection node-ids + pytest/plugin versions + environment fingerprint). If `state.json` shows `scan` completed with an unchanged token and `hypotheses.json` exists, report "already scanned" and stop — unless `--force`. ## Step 3: Detect capabilities Probe the installed pytest and plugins against `references/version-matrix.md`. Write `capabilities.json`. Use only available features below; fall back as the matrix directs (e.g. no `--durations-min` pre-6.1 → post-filter rows). ## Step 4: Establish the baseline and noise band Run the suite serially, cache disabled, `--runs` times, and record tot