[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E8D6ADR3AQ760YC1PZDN3B":3,"skill-same:01M7E8D6ADR3AQ760YC1PZDN3B":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":14,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":53},"01M7E8D6ADR3AQ760YC1PZDN3B","00-scan",null,"Use when starting or re-baselining a pytest optimization pass by profiling tests and fixtures without editing the suite.","tony\u002Fskills","tony","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F26336?v=4","01M72E5RNJ7SQV8F9KBM5RKRMN","Tony Narlock","01M7E7MBN5C6YZ4JJJ5Y82KBJG",0,"MIT","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fpytest-optimizer\u002Fskills\u002F00-scan\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: 00-scan\ndescription: \"Use when starting or re-baselining a pytest optimization pass by profiling tests and fixtures without editing the suite.\"\nallowed-tools: [\"Bash\", \"Read\", \"Grep\", \"Glob\", \"Write\", \"AskUserQuestion\"]\nargument-hint: \"[test-path-or-marker] [--force] [--runs=N] [--hygiene] [--memory-dir=\u003Cpath>]\"\ndisable-model-invocation: true\n---\n\n# 00-scan\n\nProfile, detect, hypothesize. This phase never edits the suite and never\ninstalls anything into the user's environment without asking. It writes JSON and\none collection listing to the memory directory, run files under the git\ndirectory (or the memory directory when that is unwritable), and one line in the\nlocal git exclude file when it creates an in-tree memory directory. It does run\nthe project's tests, which can write files. A project runner can also update the\nproject environment first (`uv run` creates it or brings it up to date, per the\n[uv project layout](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fconcepts\u002Fprojects\u002Flayout\u002F) docs):\nStep 4 reports any change in the working tree.\n\n`$ARGUMENTS` may scope the run to a path or marker, set `--runs=N` (baseline\nsample count, default 5), `--force` to ignore the idempotency token,\n`--hygiene` to run the typing and parametrize detectors, and\n`--memory-dir` to override the memory location. Those detectors rewrite test\nsignatures and case ids to one house convention, so they stay off unless asked.\n\nArithmetic goes through `..\u002F..\u002Fscripts\u002Fmeasure.py` and the working-tree digest\nthrough `..\u002F..\u002Fscripts\u002Fisolate.py` (Python 3 standard library). Both paths\nresolve from this skill's own directory, not the project's working directory:\nresolve this file's directory, join each path, print the absolute paths once,\nand write those literal paths in each command below where `\u003Cmeasure.py>` and\n`\u003Cisolate.py>` appear.\n\n## Step 1: Preflight\n\nRead the project's own test command from `AGENTS.md`, `CLAUDE.md`,\n`justfile`, `tox.ini`, or `pyproject.toml`. Append the scope from `$ARGUMENTS`\n(a path or `-m \u003Cmarker>`) to it, record the result as `test_command`, and\nsubstitute it wherever this file writes `pytest`. Every later phase reuses\n`test_command` unchanged, so baseline and candidates measure the same tests.\n\nThe measurement flags and how they attach to a wrapper are defined once in\n`..\u002F..\u002Freferences\u002Fdurations-parsing.md` (\"Measurement command\"). Every command\nbelow writes `\u003Ctest_command>` for the resolved command and `\u003Cflags>` for\n`-p no:cacheprovider -p no:randomly`, plus `-n 0` when that section says to (an\nxdist-configured suite).\n\nThe static detectors search with `rg` (ripgrep). Run `rg --version`; when it is\nmissing, stop with the halted-run shape naming ripgrep as the missing\nprerequisite, since a scan without it would report no hypotheses as if the suite\nwere clean.\n\nIf the project has no pytest suite, or the test command cannot start (pytest is\nnot installed for it), stop with the halted-run shape in\n`..\u002F..\u002Freferences\u002Foutput-contract.md`: one clause naming that, no interpreter paths.\n\n## Step 2: Resolve memory and check idempotency\n\nResolve the memory directory by the lookup order in\n`..\u002F..\u002Freferences\u002Fmemory-schema.md`; create it there if none exists. Save the\ncollection order:\n\n```console\n$ \u003Ctest_command> --collect-only -q \u003Cflags>\n```\n\nWrite the node-id lines (unsorted) to `collection.txt`. Digest HEAD and every\ndirty or untracked byte of the working tree:\n\n```console\n$ python3 \u003Cisolate.py> inputs \\\n    --cwd .\n```\n\nCompute the idempotency token defined in the schema with `measure.py token\n--head \u003CHEAD sha> --collection collection.txt --version \u003Cname>=\u003Cversion> ...`\n(pytest and each plugin) `--inputs-digest \u003Cdigest> --command \"\u003Ctest_command>\"`.\nStep 7 stores it in `state.json` as `env_token`, with `base_head` set to the same\n`HEAD` sha, `inputs_digest`, `dirty` (the digest's flag), and `hygiene` set to\nwhether `--hygiene` was passed. A dirty tree makes the scan inspection-only (the\nschema's \"Idempotency token\" holds the rule). Then ask whether the recorded scan\nstill stands:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    unchanged \u003Cmemory-dir>\u002Fstate.json \\\n    --token \u003Ctoken> \\\n    --hygiene \u003Ctrue|false> \\\n    --require hypotheses.json\n```\n\nWhen `unchanged` is true and `--force` is not passed, reply with one sentence\nsaying the suite was already scanned and naming `--force` to rescan, then stop.\n\nResolve `\u003Cruns-dir>` as `..\u002F..\u002Freferences\u002Fmemory-schema.md` (\"Run files\") says\nand create it. Run files live there, never in the working directory.\n\n## Step 3: Detect capabilities\n\nProbe the installed pytest and plugins against\n`..\u002F..\u002Freferences\u002Fversion-matrix.md` and write `capabilities.json`, one probe per\ncall:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    update \u003Cmemory-dir>\u002Fcapabilities.json \\\n    --set 'durations_min=true'\n```\n\nUse only\navailable features below; fall back as the matrix directs. Install nothing into\nthe project's environment to widen the probe: an ephemeral `uv run --with \u003Cpkg>`\nis fine, any other install needs the user's confirmation of the exact package and\nenvironment, and without it the detector takes its fallback.\n\n## Step 4: Establish the baseline and noise band\n\nRun the command below once without the redirect as a warm-up; its `seconds` is\n`t`. Price the scan (the warm-up, `--runs` baseline runs, and the profile run)\nand print its `estimate` before the first timed run; the project's own limit,\nwhen its docs set one, replaces the 900-second default:\n\n```console\n$ python3 \u003Cmeasure.py> budget \\\n    --phase scan \\\n    --seconds \u003Ct> \\\n    --runs \u003CN>\n```\n\nWhen `over` is true, ask the user to confirm or lower `--runs` (never below 3).\nWithout an interactive question tool, use `--runs=3` when that budget call says\nit fits and say so in the closing line; when even three runs exceed it, stop\nbefore the first timed run and print the estimate. Then time `--runs`\nmeasurement runs. Delete `\u003Cruns-dir>\u002Fbaseline-runs.jsonl` first, then append each\nJSON line to it; pass the `timeout` the budget call printed as `--timeout` so a\nhung suite is killed:\n\n```console\n$ python3 \u003Cmeasure.py> run \\\n    --timeout \u003Cseconds> \\\n    -- \u003Ctest_command> \u003Cflags> \\\n    >> \u003Cruns-dir>\u002Fbaseline-runs.jsonl\n```\n\nRun `isolate.py inputs` again: when its\ndigest differs from Step 2's, the timed runs wrote files, so list them from\n`git status --short` in the closing line. `measure.py baseline` computes the\nmedian, MAD and noise band (floored at the larger of 50 ms and 1% of the\nmedian) and writes `baseline.json` with the environment, versions, capabilities,\nmeasurement flags and passed\u002Ftotal counts (the shape and arguments are in\n`..\u002F..\u002Freferences\u002Fmemory-schema.md`):\n\n```console\n$ python3 \u003Cmeasure.py> baseline \\\n    \u003Cruns-dir>\u002Fbaseline-runs.jsonl \\\n    --out \u003Cmemory-dir>\u002Fbaseline.json \\\n    --test-command \"\u003Ctest_command>\" \\\n    --pytest-version \u003Cversion> \\\n    --plugin \u003Cname>=\u003Cversion> \\\n    --flag=-p \\\n    --flag=no:cacheprovider \\\n    --flag=-p \\\n    --flag=no:randomly \\\n    --capabilities \u003Cmemory-dir>\u002Fcapabilities.json\n```\n\nRepeat `--plugin` for each installed plugin and `--flag` for each measurement\nflag, `-n 0` included when it applies.\n\nIf it exits 1, nothing is written: stop and report its `reason`. Failed tests, a\ntimeout, too few runs, unavailable outcome counts and inconsistent counts are\ndistinct failures. Remeasure unavailable counts only when the same runner and\nselection expose an outcome summary; never fill them from a separate collection\ncommand. See `..\u002F..\u002Freferences\u002Fdurations-parsing.md`.\n\n## Step 5: Profile slowest tests and fixtures\n\nCapture per-phase timings into a run file:\n\n```console\n$ \u003Ctest_command> --durations=0 --durations-min=0.005 \u003Cflags> \\\n    > \u003Cruns-dir>\u002Fdurations.txt\n```\n\nStore them by running the Step 4 `baseline` command again with `--durations\n\u003Cruns-dir>\u002Fdurations.txt` added; it keeps the other fields and records one row per\n`(nodeid, phase)`. Rank the slowest test bodies (`call` rows) and the slowest\nfixture setup and teardown rows. Note the attribution for a shared higher-scope\nfixture billed to one nodeid, and offer the opt-in timing plugin when precise\nper-fixture cost is needed.\n\n## Step 6: Run the static detectors\n\nRun every detector in `..\u002F..\u002Freferences\u002Fheuristic-catalog.md`, using\n`..\u002F..\u002Freferences\u002Ffixture-analysis.md` for the fixture recipes and\n`..\u002F..\u002Freferences\u002Fparametrize-convention.md` for the typing and parametrize\ngaps (only under `--hygiene`). Emit the parallelism candidate only when\n`time \u003Ctest_command> --co -q` is a small share of the baseline (the\ncollection-time check rules it out). Apply the `getfixturevalue` guard before\nproposing any fixture deletion.\n\n## Step 7: Emit hypotheses\n\nWrite `hypotheses.json`: one entry per firing detector with its heuristic id,\nraw evidence, and prior risk\u002Feffort. Take each `id` and write each entry through\nthe scripts, since the id derives from content:\n\n```console\n$ python3 \u003Cmeasure.py> hyp-id \\\n    --heuristic \u003CHnn> \\\n    --file \u003Ceach target file> \\\n    --evidence \"\u003Craw evidence>\"\n```\n\n```console\n$ python3 \u003Cmeasure.py> record \u003Cmemory-dir>\u002Fhypotheses.json \\\n    --id \u003Cid> \\\n    --set 'heuristic=\"\u003CHnn>\"' \\\n    --set 'evidence=\"\u003Craw evidence>\"' \\\n    --set 'est_risk=\"\u003Clow|medium|high>\"' \\\n    --set 'est_effort=\"\u003Ctrivial|small|large>\"' \\\n    --set 'status=\"open\"'\n```\n\nThe measurement heuristics and the safety gates appear in the report sections,\nnever as entries.\nEstimate no impact here; `01-benchmark` measures it. Then record the scan, which\nalso clears the later phases' flags:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    complete \u003Cmemory-dir>\u002Fstate.json \\\n    --phase scan \\\n    --set 'env_token=\"\u003Ctoken>\"' \\\n    --set 'base_head=\"\u003CHEAD sha>\"' \\\n    --set 'inputs_digest=\"\u003Cdigest>\"' \\\n    --set 'dirty=\u003Ctrue|false>' \\\n    --set 'hygiene=\u003Ctrue|false>'\n```\n\n## Step 8: Report\n\nEmit the `00-scan` sections from `..\u002F..\u002Freferences\u002Foutput-contract.md`. Write the\nprose per `..\u002F..\u002Freferences\u002Fprose-rules.md`. Report measured numbers. State no projected speedup or recoverable time before `01-benchmark`, and no verdict on whether a hypothesis can show a saving (a wide noise band is reported as a number, not as a prediction), and do not remark on the omission. Name time that no run attributed as unattributed; never call it startup or collection the suite cannot reduce, since nothing measured that. Reply in this shape, as plain text outside any\ncode fence, with plain bullets, no bold (never `- **Label:** ...`), and no local\npaths:\n\n```text\n✓ scan complete: baseline 12.5s, noise band 0.44s, 2 hypotheses\n\n## Environment\n\n- pytest 9.1.1 with xdist 3.8.0; deadfixtures not installed, so its check is skipped.\n\n## Baseline\n\n- Median 12.5s over 5 runs; trust floor 125ms (1% of the median).\n\n## Slowest tests\n\n- test_export_large spends 0.61s in one call (H01 slow test body, a measurement, not a hypothesis).\n\n## Slowest fixtures\n\n- db_session setup runs 3 times at 4.8s each, once per test (H02 slow fixture setup).\n\n## Hypotheses\n\n- H10 mis-scoped fixture: widen db_session to session scope, 4.8s of setup repeated per test.\n- H33 fixed sleep in test_report: time.sleep(0.02) in the test body.\n\nBenchmarking the 2 hypotheses measures what each recovers.\n```\n\nEnvironment names the runner, its plugins and the skipped checks only; the\nscan's own notes and exclude line are never reported. After the last section\nwrite at most one closing sentence (files the timed runs wrote, a dirty tree, a\nlowered run count), then an `AskUserQuestion` panel\noffering to benchmark the hypotheses, narrow scope, or stop. Without a question\ntool, follow the output contract's next-step rule.\n","# 00-scan\n\nProfile, detect, hypothesize. This phase never edits the suite and never\ninstalls anything into the user's environment without asking. It writes JSON and\none collection listing to the memory directory, run files under the git\ndirectory (or the memory directory when that is unwritable), and one line in the\nlocal git exclude file when it creates an in-tree memory directory. It does run\nthe project's tests, which can write files. A project runner can also update the\nproject environment first (`uv run` creates it or brings it up to date, per the\n[uv project layout](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fconcepts\u002Fprojects\u002Flayout\u002F) docs):\nStep 4 reports any change in the working tree.\n\n`$ARGUMENTS` may scope the run to a path or marker, set `--runs=N` (baseline\nsample count, default 5), `--force` to ignore the idempotency token,\n`--hygiene` to run the typing and parametrize detectors, and\n`--memory-dir` to override the memory location. Those detectors rewrite test\nsignatures and case ids to one house convention, so they stay off unless asked.\n\nArithmetic goes through `..\u002F..\u002Fscripts\u002Fmeasure.py` and the working-tree digest\nthrough `..\u002F..\u002Fscripts\u002Fisolate.py` (Python 3 standard library). Both paths\nresolve from this skill's own directory, not the project's working directory:\nresolve this file's directory, join each path, print the absolute paths once,\nand write those literal paths in each command below where `\u003Cmeasure.py>` and\n`\u003Cisolate.py>` appear.\n\n## Step 1: Preflight\n\nRead the project's own test command from `AGENTS.md`, `CLAUDE.md`,\n`justfile`, `tox.ini`, or `pyproject.toml`. Append the scope from `$ARGUMENTS`\n(a path or `-m \u003Cmarker>`) to it, record the result as `test_command`, and\nsubstitute it wherever this file writes `pytest`. Every later phase reuses\n`test_command` unchanged, so baseline and candidates measure the same tests.\n\nThe measurement flags and how they attach to a wrapper are defined once in\n`..\u002F..\u002Freferences\u002Fdurations-parsing.md` (\"Measurement command\"). Every command\nbelow writes `\u003Ctest_command>` for the resolved command and `\u003Cflags>` for\n`-p no:cacheprovider -p no:randomly`, plus `-n 0` when that section says to (an\nxdist-configured suite).\n\nThe static detectors search with `rg` (ripgrep). Run `rg --version`; when it is\nmissing, stop with the halted-run shape naming ripgrep as the missing\nprerequisite, since a scan without it would report no hypotheses as if the suite\nwere clean.\n\nIf the project has no pytest suite, or the test command cannot start (pytest is\nnot installed for it), stop with the halted-run shape in\n`..\u002F..\u002Freferences\u002Foutput-contract.md`: one clause naming that, no interpreter paths.\n\n## Step 2: Resolve memory and check idempotency\n\nResolve the memory directory by the lookup order in\n`..\u002F..\u002Freferences\u002Fmemory-schema.md`; create it there if none exists. Save the\ncollection order:\n\n```console\n$ \u003Ctest_command> --collect-only -q \u003Cflags>\n```\n\nWrite the node-id lines (unsorted) to `collection.txt`. Digest HEAD and every\ndirty or untracked byte of the working tree:\n\n```console\n$ python3 \u003Cisolate.py> inputs \\\n    --cwd .\n```\n\nCompute the idempotency token defined in the schema with `measure.py token\n--head \u003CHEAD sha> --collection collection.txt --version \u003Cname>=\u003Cversion> ...`\n(pytest and each plugin) `--inputs-digest \u003Cdigest> --command \"\u003Ctest_command>\"`.\nStep 7 stores it in `state.json` as `env_token`, with `base_head` set to the same\n`HEAD` sha, `inputs_digest`, `dirty` (the digest's flag), and `hygiene` set to\nwhether `--hygiene` was passed. A dirty tree makes the scan inspection-only (the\nschema's \"Idempotency token\" holds the rule). Then ask whether the recorded scan\nstill stands:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    unchanged \u003Cmemory-dir>\u002Fstate.json \\\n    --token \u003Ctoken> \\\n    --hygiene \u003Ctrue|false> \\\n    --require hypotheses.json\n```\n\nWhen `unchanged` is true and `--force` is not passed, reply with one sentence\nsaying the suite was already scanned and naming `--force` to rescan, then stop.\n\nResolve `\u003Cruns-dir>` as `..\u002F..\u002Freferences\u002Fmemory-schema.md` (\"Run files\") says\nand create it. Run files live there, never in the working directory.\n\n## Step 3: Detect capabilities\n\nProbe the installed pytest and plugins against\n`..\u002F..\u002Freferences\u002Fversion-matrix.md` and write `capabilities.json`, one probe per\ncall:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    update \u003Cmemory-dir>\u002Fcapabilities.json \\\n    --set 'durations_min=true'\n```\n\nUse only\navailable features below; fall back as the matrix directs. Install nothing into\nthe project's environment to widen the probe: an ephemeral `uv run --with \u003Cpkg>`\nis fine, any other install needs the user's confirmation of the exact package and\nenvironment, and without it the detector takes its fallback.\n\n## Step 4: Establish the baseline and noise band\n\nRun the command below once without the redirect as a warm-up; its `seconds` is\n`t`. Price the scan (the warm-up, `--runs` baseline runs, and the profile run)\nand print its `estimate` before the first timed run; the project's own limit,\nwhen its docs set one, replaces the 900-second default:\n\n```console\n$ python3 \u003Cmeasure.py> budget \\\n    --phase scan \\\n    --seconds \u003Ct> \\\n    --runs \u003CN>\n```\n\nWhen `over` is true, ask the user to confirm or lower `--runs` (never below 3).\nWithout an interactive question tool, use `--runs=3` when that budget call says\nit fits and say so in the closing line; when even three runs exceed it, stop\nbefore the first timed run and print the estimate. Then time `--runs`\nmeasurement runs. Delete `\u003Cruns-dir>\u002Fbaseline-runs.jsonl` first, then append each\nJSON line to it; pass the `timeout` the budget call printed as `--timeout` so a\nhung suite is killed:\n\n```console\n$ python3 \u003Cmeasure.py> run \\\n    --timeout \u003Cseconds> \\\n    -- \u003Ctest_command> \u003Cflags> \\\n    >> \u003Cruns-dir>\u002Fbaseline-runs.jsonl\n```\n\nRun `isolate.py inputs` again: when its\ndigest differs from Step 2's, the timed runs wrote files, so list them from\n`git status --short` in the closing line. `measure.py baseline` computes the\nmedian, MAD and noise band (floored at the larger of 50 ms and 1% of the\nmedian) and writes `baseline.json` with the environment, versions, capabilities,\nmeasurement flags and passed\u002Ftotal counts (the shape and arguments are in\n`..\u002F..\u002Freferences\u002Fmemory-schema.md`):\n\n```console\n$ python3 \u003Cmeasure.py> baseline \\\n    \u003Cruns-dir>\u002Fbaseline-runs.jsonl \\\n    --out \u003Cmemory-dir>\u002Fbaseline.json \\\n    --test-command \"\u003Ctest_command>\" \\\n    --pytest-version \u003Cversion> \\\n    --plugin \u003Cname>=\u003Cversion> \\\n    --flag=-p \\\n    --flag=no:cacheprovider \\\n    --flag=-p \\\n    --flag=no:randomly \\\n    --capabilities \u003Cmemory-dir>\u002Fcapabilities.json\n```\n\nRepeat `--plugin` for each installed plugin and `--flag` for each measurement\nflag, `-n 0` included when it applies.\n\nIf it exits 1, nothing is written: stop and report its `reason`. Failed tests, a\ntimeout, too few runs, unavailable outcome counts and inconsistent counts are\ndistinct failures. Remeasure unavailable counts only when the same runner and\nselection expose an outcome summary; never fill them from a separate collection\ncommand. See `..\u002F..\u002Freferences\u002Fdurations-parsing.md`.\n\n## Step 5: Profile slowest tests and fixtures\n\nCapture per-phase timings into a run file:\n\n```console\n$ \u003Ctest_command> --durations=0 --durations-min=0.005 \u003Cflags> \\\n    > \u003Cruns-dir>\u002Fdurations.txt\n```\n\nStore them by running the Step 4 `baseline` command again with `--durations\n\u003Cruns-dir>\u002Fdurations.txt` added; it keeps the other fields and records one row per\n`(nodeid, phase)`. Rank the slowest test bodies (`call` rows) and the slowest\nfixture setup and teardown rows. Note the attribution for a shared higher-scope\nfixture billed to one nodeid, and offer the opt-in timing plugin when precise\nper-fixture cost is needed.\n\n## Step 6: Run the static detectors\n\nRun every detector in `..\u002F..\u002Freferences\u002Fheuristic-catalog.md`, using\n`..\u002F..\u002Freferences\u002Ffixture-analysis.md` for the fixture recipes and\n`..\u002F..\u002Freferences\u002Fparametrize-convention.md` for the typing and parametrize\ngaps (only under `--hygiene`). Emit the parallelism candidate only when\n`time \u003Ctest_command> --co -q` is a small share of the baseline (the\ncollection-time check rules it out). Apply the `getfixturevalue` guard before\nproposing any fixture deletion.\n\n## Step 7: Emit hypotheses\n\nWrite `hypotheses.json`: one entry per firing detector with its heuristic id,\nraw evidence, and prior risk\u002Feffort. Take each `id` and write each entry through\nthe scripts, since the id derives from content:\n\n```console\n$ python3 \u003Cmeasure.py> hyp-id \\\n    --heuristic \u003CHnn> \\\n    --file \u003Ceach target file> \\\n    --evidence \"\u003Craw evidence>\"\n```\n\n```console\n$ python3 \u003Cmeasure.py> record \u003Cmemory-dir>\u002Fhypotheses.json \\\n    --id \u003Cid> \\\n    --set 'heuristic=\"\u003CHnn>\"' \\\n    --set 'evidence=\"\u003Craw evidence>\"' \\\n    --set 'est_risk=\"\u003Clow|medium|high>\"' \\\n    --set 'est_effort=\"\u003Ctrivial|small|large>\"' \\\n    --set 'status=\"open\"'\n```\n\nThe measurement heuristics and the safety gates appear in the report sections,\nnever as entries.\nEstimate no impact here; `01-benchmark` measures it. Then record the scan, which\nalso clears the later phases' flags:\n\n```console\n$ python3 \u003Cmeasure.py> state \\\n    complete \u003Cmemory-dir>\u002Fstate.json \\\n    --phase scan \\\n    --set 'env_token=\"\u003Ctoken>\"' \\\n    --set 'base_head=\"\u003CHEAD sha>\"' \\\n    --set 'inputs_digest=\"\u003Cdigest>\"' \\\n    --set 'dirty=\u003Ctrue|false>' \\\n    --set 'hygiene=\u003Ctrue|false>'\n```\n\n## Step 8: Report\n\nEmit the `00-scan` sections from `..\u002F..\u002Freferences\u002Foutput-contract.md`. Write the\nprose per `..\u002F..\u002Freferences\u002Fprose-rules.md`. Report measured numbers. State no projected speedup or recoverable time before `01-benchmark`, and no verdict on whether a hypothesis can show a saving (a wide noise band is reported as a number, not as a prediction), and do not remark on the omission. Name time that no run attributed as unattributed; never call it startup or collection the suite cannot reduce, since nothing measured that. Reply in this shape, as plain text outside any\ncode fence, with plain bullets, no bold (never `- **Label:** ...`), and no local\npaths:\n\n```text\n✓ scan complete: baseline 12.5s, noise band 0.44s, 2 hypotheses\n\n## Environment\n\n- pytest 9.1.1 with xdist 3.8.0; deadfixtures not installed, so its check is skipped.\n\n## Baseline\n\n- Median 12.5s over 5 runs; trust floor 125ms (1% of the median).\n\n## Slowest tests\n\n- test_export_large spends 0.61s in one call (H01 slow test body, a measurement, not a hypothesis).\n\n## Slowest fixtures\n\n- db_session setup runs 3 times at 4.8s each, once per test (H02 slow fixture setup).\n\n## Hypotheses\n\n- H10 mis-scoped fixture: widen db_session to session scope, 4.8s of setup repeated per test.\n- H33 fixed sleep in test_report: time.sleep(0.02) in the test body.\n\nBenchmarking the 2 hypotheses measures what each recovers.\n```\n\nEnvironment names the runner, its plugins and the skipped checks only; the\nscan's own notes and exclude line are never reported. After the last section\nwrite at most one closing sentence (files the timed runs wrote, a dirty tree, a\nlowered run count), then an `AskUserQuestion` panel\noffering to benchmark the hypotheses, narrow scope, or stop. Without a question\ntool, follow the output contract's next-step rule.\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":31,"disable-model-invocation":32},[25,26,27,28,29,30],"Bash","Read","Grep","Glob","Write","AskUserQuestion","[test-path-or-marker] [--force] [--runs=N] [--hygiene] [--memory-dir=\u003Cpath>]",true,"main","5fbeb3b47beedea13813be7b7023f736a8d97a65","plugins\u002Fpytest-optimizer\u002Fskills\u002F00-scan","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills","https:\u002F\u002Fgithub.com\u002Ftony","https:\u002F\u002Ftony.sh","lighthouse keeper","2026-11-08 17:57:34",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":32},[43,46,49],{"tool":44,"command":45},"npx","npx skills add tony\u002Fskills --skill 00-scan",{"tool":47,"command":48},"bunx","bunx skills add tony\u002Fskills --skill 00-scan",{"tool":50,"command":51},"pnpm","pnpm dlx skills add tony\u002Fskills --skill 00-scan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fpytest-optimizer\u002Fskills\u002F00-scan\u002FSKILL.md",[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"agents\u002Fopenai.yaml","REFERENCE","参考文档",307,"https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fpytest-optimizer\u002Fskills\u002F00-scan\u002Fagents\u002Fopenai.yaml",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7E8NCSHXV2JPW4J61R0TQS7","serene-bliss","Use when asked to make a CLI --help, docs page, error message, or tooling UX more serene or calmer for developer experience; returns text, no edits.","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Fserene-bliss\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7E8N87MAVJD8RRQKQB1ZPS6","review","Weave code review: run independent adversarial reviews in parallel, then synthesize findings","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E8N402XG4ZBFNACQ413163","refine","Use when asked to refine a draft, iterate on code until cleaner, or polish a README through repeated critique and improvement.","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Frefine\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7E8N01KB86A7136P00GVKJW","prompt","Weave prompt: compare independent adversarial implementations, then adopt the single best one","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Fprompt\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7E8MW7YJW2PCMDW3G9RTGNK","plan","Weave planning: compare independent adversarial plans, then synthesize the best one","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Fplan\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7E8MSBYXNCV4ZYWDS4PFJXK","fix-review","Fix weave review findings: validate, add test coverage, fix, and commit each as atomic changes","https:\u002F\u002Fgithub.com\u002Ftony\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fweave\u002Fskills\u002Ffix-review\u002FSKILL.md",[],[]]