[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77M5YD2DFXNG7W69824HZTW":3,"skill-same:01M77M5YD2DFXNG7W69824HZTW":57},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":50},"01M77M5YD2DFXNG7W69824HZTW","snapshot",null,"Capture a baseline or post-change snapshot with the host qualified first: refuse a wall-clock claim from a bimodal-contention host and name the drift-immune counter instead. Interleaves before\u002Fafter arms in one run. Use when: 'capture a baseline', 'take a post snapshot', 'run the A\u002FB', 'can I even measure here'. Runs after \u002Fperformance:goal; hands off to \u002Fperformance:verify. Skip when no goal with a computed floor exists, or when the claim is code shape (\u002Fverification:measure).","melodic-software\u002Fclaude-code-plugins","melodic-software","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F58273638?v=4","01M77JVQTXNGKCE4MDFY2BC936","Melodic Software","01M77JVQVN9QDWKAH6W03ANP76",30,"MIT","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fperformance\u002Fskills\u002Fsnapshot\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Capture a baseline or post-change snapshot with the host qualified first: refuse a wall-clock claim from a bimodal-contention host and name the drift-immune counter instead. Interleaves before\u002Fafter arms in one run. Use when: 'capture a baseline', 'take a post snapshot', 'run the A\u002FB', 'can I even measure here'. Runs after \u002Fperformance:goal; hands off to \u002Fperformance:verify. Skip when no goal with a computed floor exists, or when the claim is code shape (\u002Fverification:measure).\"\nuser-invocable: true\nargument-hint: \"[baseline|post] [\u003Ctarget>]\"\ndisable-model-invocation: false\nmetadata:\n  workflow-stage: verify\n  summary: Capture a snapshot only from a host proven measurable\n---\n\n**Arguments.** `[baseline|post] [\u003Ctarget>]`. e.g. \u002Fperformance:snapshot baseline, \u002Fperformance:snapshot post\n\n## Purpose\n\nAnswers **\"what does this cost, and is this machine even able to tell me?\"**\n\nRead [`${CLAUDE_PLUGIN_ROOT}\u002Freference\u002Fharness-integrity.md`](${CLAUDE_PLUGIN_ROOT}\u002Freference\u002Fharness-integrity.md) before writing any harness\nhere, including a check written to avoid being fooled: a harness that returns a confident wrong\nanswer looks exactly like one that works.\n\n## Phase order, and why it is this order\n\n### 1. Qualify the host, before measuring anything\n\nThe lib is plugin-bundled, not installed: put its directory on `sys.path` before the import, or a\nbare `from spawn_noise import ...` raises `ModuleNotFoundError`. Anchor to the plugin root this\nbody names (substituted with the installed version's directory at load), never to the working\ndirectory, a `__file__` level count, or a hardcoded cache path:\n\n```python\nimport sys\n\nsys.path.insert(0, r\"${CLAUDE_PLUGIN_ROOT}\u002Flib\")\n\nfrom spawn_noise import spawn_probe, is_measurable  # noqa: E402\n\nsummary = spawn_probe()\nmeasurable, why = is_measurable(summary)\n```\n\n`is_measurable()` returns a verdict and its basis. A `False` is a **hard refusal to report a\nwall-clock number**, subject only to the recorded override below.\n\nThe refusal names what it can still report, since an unexplained refusal gets overridden\nreflexively: on a host that fails `is_measurable()`, the durable result is a deterministic spawn\ncount of 4 -> 1, not a duration.\n\n**Say plainly that this refusal is a house rule, not consensus.** No surveyed benchmarking tool\nrefuses above a variance threshold: pyperf, Criterion, JMH and benchstat all warn and print the\nnumber anyway.\n\n- **Pointer**: when you need pyperf's own stability thresholds, fetch\n  [pyperf check](https:\u002F\u002Fpyperf.readthedocs.io\u002Fen\u002Flatest\u002Fcli.html#check-cmd) live.\n\n### 1b. Measuring-tool integrity (before timing)\n\nBefore any timed arm runs, record the **measuring tool's identity** for every executable the goal's\nmetric command names (harness scripts, summarizers, census wrappers): resolved path, `git rev-parse\nHEAD` or content hash when the tree is a checkout, and `--version` output when the tool provides it.\nCheck that **every flag** the goal's metric command uses appears in that copy's `--help` (or is\nexercised in a dry run). Check whether the checkout is behind its upstream, when determinable from\nlocal refs (`git rev-list --count HEAD..@{u}`, never a fetch); with no upstream ref, report `not\ndeterminable`. Check that the output column or field the goal's metric names is produced (a dry run\nor sample output contains it). A stale checkout, wrong plugin root, missing flag support, a copy\nbehind its upstream, or a missing output column **stops the run**, names both fixes (update the\ntool, point at the installed plugin copy, or change the goal's metric command), and reports no\npartial numbers. Carry the record in the report:\n\n```text\nTool: \u003Cpath> @ \u003Crev|hash> (\u003Cversion>) flags-ok: \u003Cyes|no — list missing> behind-upstream: \u003Cn|not determinable> column-ok: \u003Cyes|no — name missing>\n```\n\n### 2. Capture the drift-immune counter first\n\nSpawns, syscalls, queries, allocations, round trips. The counter is the headline; the duration is\ncontext. A counter also catches harness bugs immediately, because a counter that does not move when\nit should is an unambiguous signal, while a duration that does not move is ambiguous. Re-measure it\nafter **every** change.\n\nFor a process-spawn count, run the bundled census rather than writing one:\n`bash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Frun-spawn-census.sh\" --shim-dir \u003Cstable-dir> --before \u003Ccmd>\n--after \u003Ccmd>`. It takes the rule 1 two-run proof itself and refuses a temporary shim directory.\n`spawn-census.sh` beside it counts one arm.\nReport the census as **`spawns=` (PATH-shim accounting)** in the snapshot; when the goal instead\ntracks a Windows Job Object or other host counter, state that label explicitly and cite the MSYS\n+2-per-external-command rule from\n[harness-integrity.md](..\u002F..\u002Freference\u002Fharness-integrity.md#process-counting-on-msyscygwin-git-bash)\nso a +2 delta is not chased as a mystery third process.\n\nA deterministic counter needs one run and no statistics; sample counts apply to durations. Under\nfixed-tick stepping, the number of units that miss the budget is a counter too, and it beats an\naverage. See [lab rigs](..\u002F..\u002Freference\u002Ftechniques.md#c-lab-measurement-and-rigs).\n\n### 2b. Code path under test (before each arm)\n\nThe goal names which **code path(s)** the metric is meant to exercise, and the observable that\nidentifies each (for example skip with no interpreter versus Python run path, cold cache versus\nwarm). A goal with no `Path:` line goes back to `\u002Fperformance:goal`. Before **each** arm, either\n**reset** the state files that select the path (markers, sentinel files, cache keys) or **record**\ntheir values and carry them in the report; say which was done. After the arm, report which path\nactually ran, with evidence (a marker file, exit code, or the set of processes spawned). A path\nthat cannot be observed is reported `unobserved`, never assumed. One line per arm, required in the\nreport beside the step 3 rig line:\n\n```text\nPath (\u003Carm>): \u003Cintended path from goal> -> \u003Cobserved path | unobserved> (evidence: \u003Cmarker | exit | processes>; state: reset | recorded \u003Cvalues>)\n```\n\nAn arm whose observed path does not match the goal's named path, or is `unobserved`, is\n**flagged**; its duration is not reported as the goal's headline metric. A harness that always\nexercised the rare path while the common session path stayed unmeasured is exactly the failure\nthis step prevents.\n\n### 3. Capture durations, only if step 1 allowed it\n\nThe goal's percentile list (default p50 and p95) over at least 20 samples, passed to `ab.sh` as\n`--percentiles`. A vendored `ab.sh` from before plugin 0.5.0 exits 2 on that flag: re-copy\n`ratchet.py`, `ab.sh` and `summarize.py` from `${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002F` before using it.\nEnforce the arithmetic floor: a percentile `p`\nneeds `1\u002F(1-p)` samples to be expressible at all (`percentile_floor()` in `lib\u002Fspawn_noise.py`).\nReport **no** percentile the sample count cannot support; report the raw samples instead.\n`${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fsummarize.py` enforces that floor and is what `ab.sh` summarizes\nwith, so a duration taken through `ab.sh` below already carries it.\n\nNever a single sample. Never a bare mean.\n\nRun every size the goal's `Scaling:` line records, and capture the event-level metric its `Event:`\nline names as well as the unit metric; carry the per-size results into the report, so\n`\u002Fperformance:verify` can check the bound at each size.\n\nEvery duration carries a rig line, because a number without its rig cannot be reproduced:\n\n```text\nRig:  \u003Chardware>, \u003Cruntime mode>, \u003Cthrottling>, \u003Crun count>, \u003Ctimestamp>\n```\n\nEvery arm's `Path (\u003Carm>):` line from step 2b sits beside its rig line; a duration without both is\nnot reported.\n\n### 4. Evidence for the goal's `Correlation:` line\n\nRun the same benchmark on two rigs: the counter under the deterministic rig, the duration under\nthe normal warm runtime. Drive the counter down on at least two independent hot paths (two is this\nplugin's judgment) and check that the duration moved with it. A count cut and a time cut differ in\nsize, so report both and never infer one from the other. No evidence yet means `unproven`, not a\nguess. See [prove the proxy](..\u002F..\u002Freference\u002Ftechniques.md#d-prove-the-proxy).\n\n### 5. Freeze the harness, when the goal plans a loop\n\nA goal with a `Min attempts:` value will run under `\u002Fperformance:climb`, which re-runs this\nharness on every attempt and may not change it. Freeze it at baseline time, in this order:\n\n1. **Counts on every run.** Besides the goal's counter, each run prints how many operations\n   failed and how many units of work finished (requests served, files converted, pages built).\n   Without both tallies, a run that failed fast or skipped work reads as a speedup, so a harness\n   missing either one is not frozen.\n2. **Sensitivity.** Prove the harness notices a real change before freezing it:\n   `python3 \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fdiscriminate.py\" --config \u003Cjson>`, given a patch\n   known to change the measured path, the harness as the check and the counter line as the\n   signal. On exit 1 the change does not show: change the counter or the workload and rerun. Exit\n   2 says the harness never ran. Exit 0 says the change shows, and only exit 0 permits freezing.\n3. **Record the frozen harness** in the baseline report: the command, the commit it was frozen\n   at, and the discrimination exit code.\n\n```text\nFrozen:  \u003Charness command> @ \u003Csha>  discriminate: exit \u003C0|1|2>  counts: errors=\u003Cn> work=\u003Cn>\n```\n\n## Comparing before and after\n\nA post snapshot records the same `Tool:` line and flags any difference in path, revision or hash,\nor version from the baseline's recorded line. A pair measured with two tool copies is not a\ncomparison of the change alone, so its ratio is not reported.\n\n**Never compare two separate passes on a drifting host.** A bare `bash -c true` can cost 1825 ms and\n283 ms in the same hour on the same machine at ~10% CPU. Any two-pass comparison attributes that 6x\nto the change.\n\nTwo valid modes:\n\n### Sequential interleaving (default)\n\nRun the bundled harness from the Bash tool; do not hand-roll a timing loop:\n\n```bash\nbash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fab.sh\" --a '\u003Cbaseline command>' --b '\u003Ccandidate command>' --iterations 20 --percentiles 50,95\n```\n\nIt alternates the arms within one run, randomizes the order each iteration, and reports the median of\nper-pair ratios (`ratio.py`) alongside per-arm percentiles (`summarize.py`). It also refuses what a\nhand-rolled loop gets wrong: an arm whose probe exits 127 (a command that never ran, which a loop\nrecords as a fast clean sample), a drive-letter path in an arm, a ratio from too few pairs, and a\nclock it cannot read. `bash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fab.sh\" --help` lists the options.\n\nThe paired-ratio median carries its own floor beside the percentile floor: at least 20 pairs, the\ndefault of `${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fratio.py`. Below it, report the raw per-pair ratios and no\nmedian, since six repeats of two identical arms at five pairs gave medians from 0.78x to 1.00x and\none run reported 17.12x. A lowered `BENCH_MIN_PAIRS` prints itself on the line; carry it into the\nreport.\n\nGrounded, Tier 1, `benchstat`'s own documentation: *\"The best way to do this is to interleave before\nand after runs, rather than running, say, 10 iterations of the before benchmark, and then 10\niterations of the after benchmark.\"*\n\n**Under uncontrolled concurrent load, suppress the paired ratio** and report per-arm percentiles\nonly. The arms are no longer load-matched, and pairing by index compares samples that never shared\nconditions.\n\nDo not describe this as \"paired statistics, per benchstat\". `benchstat` recommends interleaved\n*collection* and then analyzes with the **Mann-Whitney U test**, which is an independent two-sample\ntest. It documents no `-delta-test` flag. Verified 2026-09-06 against\n`https:\u002F\u002Fpkg.go.dev\u002Fgolang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat` at module version\n`v0.0.0-20260819171926-ebcb4798430d`, which documents `-filter`, `-table`, `-row`, `-col`, and\n`-ignore`, and states that benchstat uses the Mann-Whitney U-test for A\u002FB comparisons. Recheck when\nthat page lists a `-delta-test` flag again, or names a test other than Mann-Whitney U.\n\n### Simultaneous duet (for a genuinely shared machine)\n\nRun both arms **at the same time** and report only their relative performance.\n\nGrounded, Tier 2: Bulej, Horký, Tůma, Farquet & Prokopec, [\"Duet Benchmarking: Improving Measurement\nAccuracy in the Cloud\"](https:\u002F\u002Farxiv.org\u002Fabs\u002F2001.05811) (ICPE 2020) measured accuracy improvements\nof **5.03x** (ScalaBench\u002FDaCapo) and **37.4x** (SPEC CPU 2017) on shared machines from running arms\nin parallel, because both arms absorb the same interference.\n\nThis is the reverse of the sequential rule and it is not a contradiction: sequential interleaving is\nvulnerable to bursty load precisely because the arms run at different moments. **The reconciliation\n\"only the sequential form is vulnerable\" is this plugin's reading, not a sourced claim.** Duet costs\n2x the resources and needs the arms to be genuinely independent.\n\n## Warmup\n\nDiscard N warmup iterations if the target has a warm path. Do **not** claim this establishes steady\nstate: Barrett et al. (OOPSLA 2017) found *\"at most 43.5% of ⟨VM, benchmark⟩ pairs consistently\nreach a steady state of peak performance.\"* No source justifies any particular N.\n\nReport the first pass and later passes as separate numbers. A cold first execution folded into warm\nrepeats hides the cost a first-time user pays.\n\n## The override\n\nGates here hard-block. A named per-gate override exists for each gate, and using it **records itself\nin the report**:\n\n```text\nOVERRIDE: unmeasurable-host  reason: \u003Cstated by the human>  gate: is_measurable\nOVERRIDE: tool-identity  reason: \u003Cstated by the human>  gate: tool-identity\n```\n\nThe second gate is the step 1b stop and the post-versus-baseline tool comparison. An override\nwithout a recorded reason is not available, for either gate. A report carrying an override says so at\nthe top, not in a footnote.\n\n## Storage\n\nBaselines live in the memory tier, `.work\u002F\u003Ctopic-slug>\u002Fbaselines\u002F`, machine-bound, **never\ncommitted**.\n\nThat layout matches `\u002Fverification:measure`, which owns baseline capture and storage mechanics, so\nthe two never keep two different baseline stores. Before capturing, in order:\n\n1. **Check for the seam.** Look for `\u002Fverification:measure` in this session's skill list. Record\n   whether it resolves; do not assume either answer.\n2. **Invoke it, or name why not.** When it resolves, invoke it via the Skill tool. When it resolves\n   and you capture directly anyway, the reason goes in the report.\n3. **Land the capture under `.work\u002F\u003Ctopic-slug>\u002Fbaselines\u002F`.** The path is the gate: a capture\n   written anywhere else says so at the top of the report, with the path it used, because a second\n   store is the outcome this seam exists to prevent.\n\nThe report's header carries exactly one of these lines, so a reader can tell a missing dependency\nfrom a deliberate skip:\n\n```text\nCapture: assisted by \u002Fverification:measure\nCapture: unassisted, verification absent\nCapture: unassisted, verification present and skipped because \u003Creason>\n```\n\nThe dependency is a preference for reuse, not a requirement: never refuse to measure because\n`\u002Fverification:measure` is missing; this skill's own gates (host qualification, interleaving, the\ncounter, the refusal) work either way.\n\nA counter ceiling that `\u002Fperformance:protect` checks in is not a baseline: it is a limit on a\ndeterministic count, and no duration is ever committed.\n\nA committed baseline is a number that outlives the conditions that made it true. No source states\n\"a stored baseline is invalid on another machine\" outright, but four independent Tier 1\u002F2 strands\nconverge on it; the practical rule is to always re-measure both arms rather than compare against a\nstored one.\n\n## Boundary\n\n- **Does not own baseline\u002Fcompare mechanics.** `\u002Fverification:measure` does. This adds host\n  qualification, interleaving, counters, and the refusal.\n- **Does not implement the change.** `\u002Fimplementation:implement` does.\n- **Does not decide whether the goal was met.** That is `\u002Fperformance:verify`.\n\n## Next\n\n- After a baseline capture: `\u002Fimplementation:implement` for the change, then\n  `\u002Fperformance:snapshot post`.\n- After a baseline capture with a frozen harness, when the goal plans a loop: `\u002Fperformance:climb`.\n- After a post capture: `\u002Fperformance:verify`.\n\n## Gotchas\n\n- **The refusal must always name the counter it can still report.** A dead-end refusal gets\n  overridden reflexively and teaches nothing.\n- **`is_measurable()` reads the findings list, never `spread_ratio` alone.** The bimodal predicate is\n  two-part: a wide spread whose slow mode is *also* slow. A bare ratio check fires on a healthy\n  cold-then-warm host.\n- **`$(...)` is a process spawn on MSYS.** A \"builtins-only\" hot path that reports through stdout\n  still costs a full process, and a spawn census that ignores its own substitutions undercounts.\n- **A `PATH` shim directory from `mktemp -d` invalidates a `PATH`-keyed cache every run.** The\n  harness then measures its own randomization and reports \"no improvement\".\n- **A stale harness copy produces plausible wrong numbers.** Record path, revision, and flag support\n  before timing; a missing column in the output is too late to catch a nine-commit drift.\n- **Report the counter even when the duration is allowed.** The counter is what an independent\n  verifier can reproduce tomorrow.\n- **Stale markers send every sample down the wrong path.** Reset or record path-selecting state\n  before each arm, and report observed path with evidence; a mismatch, or a path that could not be\n  observed (`unobserved`), is flagged, not folded into the headline metric.\n","**Arguments.** `[baseline|post] [\u003Ctarget>]`. e.g. \u002Fperformance:snapshot baseline, \u002Fperformance:snapshot post\n\n## Purpose\n\nAnswers **\"what does this cost, and is this machine even able to tell me?\"**\n\nRead [`${CLAUDE_PLUGIN_ROOT}\u002Freference\u002Fharness-integrity.md`](${CLAUDE_PLUGIN_ROOT}\u002Freference\u002Fharness-integrity.md) before writing any harness\nhere, including a check written to avoid being fooled: a harness that returns a confident wrong\nanswer looks exactly like one that works.\n\n## Phase order, and why it is this order\n\n### 1. Qualify the host, before measuring anything\n\nThe lib is plugin-bundled, not installed: put its directory on `sys.path` before the import, or a\nbare `from spawn_noise import ...` raises `ModuleNotFoundError`. Anchor to the plugin root this\nbody names (substituted with the installed version's directory at load), never to the working\ndirectory, a `__file__` level count, or a hardcoded cache path:\n\n```python\nimport sys\n\nsys.path.insert(0, r\"${CLAUDE_PLUGIN_ROOT}\u002Flib\")\n\nfrom spawn_noise import spawn_probe, is_measurable  # noqa: E402\n\nsummary = spawn_probe()\nmeasurable, why = is_measurable(summary)\n```\n\n`is_measurable()` returns a verdict and its basis. A `False` is a **hard refusal to report a\nwall-clock number**, subject only to the recorded override below.\n\nThe refusal names what it can still report, since an unexplained refusal gets overridden\nreflexively: on a host that fails `is_measurable()`, the durable result is a deterministic spawn\ncount of 4 -> 1, not a duration.\n\n**Say plainly that this refusal is a house rule, not consensus.** No surveyed benchmarking tool\nrefuses above a variance threshold: pyperf, Criterion, JMH and benchstat all warn and print the\nnumber anyway.\n\n- **Pointer**: when you need pyperf's own stability thresholds, fetch\n  [pyperf check](https:\u002F\u002Fpyperf.readthedocs.io\u002Fen\u002Flatest\u002Fcli.html#check-cmd) live.\n\n### 1b. Measuring-tool integrity (before timing)\n\nBefore any timed arm runs, record the **measuring tool's identity** for every executable the goal's\nmetric command names (harness scripts, summarizers, census wrappers): resolved path, `git rev-parse\nHEAD` or content hash when the tree is a checkout, and `--version` output when the tool provides it.\nCheck that **every flag** the goal's metric command uses appears in that copy's `--help` (or is\nexercised in a dry run). Check whether the checkout is behind its upstream, when determinable from\nlocal refs (`git rev-list --count HEAD..@{u}`, never a fetch); with no upstream ref, report `not\ndeterminable`. Check that the output column or field the goal's metric names is produced (a dry run\nor sample output contains it). A stale checkout, wrong plugin root, missing flag support, a copy\nbehind its upstream, or a missing output column **stops the run**, names both fixes (update the\ntool, point at the installed plugin copy, or change the goal's metric command), and reports no\npartial numbers. Carry the record in the report:\n\n```text\nTool: \u003Cpath> @ \u003Crev|hash> (\u003Cversion>) flags-ok: \u003Cyes|no — list missing> behind-upstream: \u003Cn|not determinable> column-ok: \u003Cyes|no — name missing>\n```\n\n### 2. Capture the drift-immune counter first\n\nSpawns, syscalls, queries, allocations, round trips. The counter is the headline; the duration is\ncontext. A counter also catches harness bugs immediately, because a counter that does not move when\nit should is an unambiguous signal, while a duration that does not move is ambiguous. Re-measure it\nafter **every** change.\n\nFor a process-spawn count, run the bundled census rather than writing one:\n`bash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Frun-spawn-census.sh\" --shim-dir \u003Cstable-dir> --before \u003Ccmd>\n--after \u003Ccmd>`. It takes the rule 1 two-run proof itself and refuses a temporary shim directory.\n`spawn-census.sh` beside it counts one arm.\nReport the census as **`spawns=` (PATH-shim accounting)** in the snapshot; when the goal instead\ntracks a Windows Job Object or other host counter, state that label explicitly and cite the MSYS\n+2-per-external-command rule from\n[harness-integrity.md](..\u002F..\u002Freference\u002Fharness-integrity.md#process-counting-on-msyscygwin-git-bash)\nso a +2 delta is not chased as a mystery third process.\n\nA deterministic counter needs one run and no statistics; sample counts apply to durations. Under\nfixed-tick stepping, the number of units that miss the budget is a counter too, and it beats an\naverage. See [lab rigs](..\u002F..\u002Freference\u002Ftechniques.md#c-lab-measurement-and-rigs).\n\n### 2b. Code path under test (before each arm)\n\nThe goal names which **code path(s)** the metric is meant to exercise, and the observable that\nidentifies each (for example skip with no interpreter versus Python run path, cold cache versus\nwarm). A goal with no `Path:` line goes back to `\u002Fperformance:goal`. Before **each** arm, either\n**reset** the state files that select the path (markers, sentinel files, cache keys) or **record**\ntheir values and carry them in the report; say which was done. After the arm, report which path\nactually ran, with evidence (a marker file, exit code, or the set of processes spawned). A path\nthat cannot be observed is reported `unobserved`, never assumed. One line per arm, required in the\nreport beside the step 3 rig line:\n\n```text\nPath (\u003Carm>): \u003Cintended path from goal> -> \u003Cobserved path | unobserved> (evidence: \u003Cmarker | exit | processes>; state: reset | recorded \u003Cvalues>)\n```\n\nAn arm whose observed path does not match the goal's named path, or is `unobserved`, is\n**flagged**; its duration is not reported as the goal's headline metric. A harness that always\nexercised the rare path while the common session path stayed unmeasured is exactly the failure\nthis step prevents.\n\n### 3. Capture durations, only if step 1 allowed it\n\nThe goal's percentile list (default p50 and p95) over at least 20 samples, passed to `ab.sh` as\n`--percentiles`. A vendored `ab.sh` from before plugin 0.5.0 exits 2 on that flag: re-copy\n`ratchet.py`, `ab.sh` and `summarize.py` from `${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002F` before using it.\nEnforce the arithmetic floor: a percentile `p`\nneeds `1\u002F(1-p)` samples to be expressible at all (`percentile_floor()` in `lib\u002Fspawn_noise.py`).\nReport **no** percentile the sample count cannot support; report the raw samples instead.\n`${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fsummarize.py` enforces that floor and is what `ab.sh` summarizes\nwith, so a duration taken through `ab.sh` below already carries it.\n\nNever a single sample. Never a bare mean.\n\nRun every size the goal's `Scaling:` line records, and capture the event-level metric its `Event:`\nline names as well as the unit metric; carry the per-size results into the report, so\n`\u002Fperformance:verify` can check the bound at each size.\n\nEvery duration carries a rig line, because a number without its rig cannot be reproduced:\n\n```text\nRig:  \u003Chardware>, \u003Cruntime mode>, \u003Cthrottling>, \u003Crun count>, \u003Ctimestamp>\n```\n\nEvery arm's `Path (\u003Carm>):` line from step 2b sits beside its rig line; a duration without both is\nnot reported.\n\n### 4. Evidence for the goal's `Correlation:` line\n\nRun the same benchmark on two rigs: the counter under the deterministic rig, the duration under\nthe normal warm runtime. Drive the counter down on at least two independent hot paths (two is this\nplugin's judgment) and check that the duration moved with it. A count cut and a time cut differ in\nsize, so report both and never infer one from the other. No evidence yet means `unproven`, not a\nguess. See [prove the proxy](..\u002F..\u002Freference\u002Ftechniques.md#d-prove-the-proxy).\n\n### 5. Freeze the harness, when the goal plans a loop\n\nA goal with a `Min attempts:` value will run under `\u002Fperformance:climb`, which re-runs this\nharness on every attempt and may not change it. Freeze it at baseline time, in this order:\n\n1. **Counts on every run.** Besides the goal's counter, each run prints how many operations\n   failed and how many units of work finished (requests served, files converted, pages built).\n   Without both tallies, a run that failed fast or skipped work reads as a speedup, so a harness\n   missing either one is not frozen.\n2. **Sensitivity.** Prove the harness notices a real change before freezing it:\n   `python3 \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fdiscriminate.py\" --config \u003Cjson>`, given a patch\n   known to change the measured path, the harness as the check and the counter line as the\n   signal. On exit 1 the change does not show: change the counter or the workload and rerun. Exit\n   2 says the harness never ran. Exit 0 says the change shows, and only exit 0 permits freezing.\n3. **Record the frozen harness** in the baseline report: the command, the commit it was frozen\n   at, and the discrimination exit code.\n\n```text\nFrozen:  \u003Charness command> @ \u003Csha>  discriminate: exit \u003C0|1|2>  counts: errors=\u003Cn> work=\u003Cn>\n```\n\n## Comparing before and after\n\nA post snapshot records the same `Tool:` line and flags any difference in path, revision or hash,\nor version from the baseline's recorded line. A pair measured with two tool copies is not a\ncomparison of the change alone, so its ratio is not reported.\n\n**Never compare two separate passes on a drifting host.** A bare `bash -c true` can cost 1825 ms and\n283 ms in the same hour on the same machine at ~10% CPU. Any two-pass comparison attributes that 6x\nto the change.\n\nTwo valid modes:\n\n### Sequential interleaving (default)\n\nRun the bundled harness from the Bash tool; do not hand-roll a timing loop:\n\n```bash\nbash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fab.sh\" --a '\u003Cbaseline command>' --b '\u003Ccandidate command>' --iterations 20 --percentiles 50,95\n```\n\nIt alternates the arms within one run, randomizes the order each iteration, and reports the median of\nper-pair ratios (`ratio.py`) alongside per-arm percentiles (`summarize.py`). It also refuses what a\nhand-rolled loop gets wrong: an arm whose probe exits 127 (a command that never ran, which a loop\nrecords as a fast clean sample), a drive-letter path in an arm, a ratio from too few pairs, and a\nclock it cannot read. `bash \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fab.sh\" --help` lists the options.\n\nThe paired-ratio median carries its own floor beside the percentile floor: at least 20 pairs, the\ndefault of `${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fratio.py`. Below it, report the raw per-pair ratios and no\nmedian, since six repeats of two identical arms at five pairs gave medians from 0.78x to 1.00x and\none run reported 17.12x. A lowered `BENCH_MIN_PAIRS` prints itself on the line; carry it into the\nreport.\n\nGrounded, Tier 1, `benchstat`'s own documentation: *\"The best way to do this is to interleave before\nand after runs, rather than running, say, 10 iterations of the before benchmark, and then 10\niterations of the after benchmark.\"*\n\n**Under uncontrolled concurrent load, suppress the paired ratio** and report per-arm percentiles\nonly. The arms are no longer load-matched, and pairing by index compares samples that never shared\nconditions.\n\nDo not describe this as \"paired statistics, per benchstat\". `benchstat` recommends interleaved\n*collection* and then analyzes with the **Mann-Whitney U test**, which is an independent two-sample\ntest. It documents no `-delta-test` flag. Verified 2026-09-06 against\n`https:\u002F\u002Fpkg.go.dev\u002Fgolang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat` at module version\n`v0.0.0-20260819171926-ebcb4798430d`, which documents `-filter`, `-table`, `-row`, `-col`, and\n`-ignore`, and states that benchstat uses the Mann-Whitney U-test for A\u002FB comparisons. Recheck when\nthat page lists a `-delta-test` flag again, or names a test other than Mann-Whitney U.\n\n### Simultaneous duet (for a genuinely shared machine)\n\nRun both arms **at the same time** and report only their relative performance.\n\nGrounded, Tier 2: Bulej, Horký, Tůma, Farquet & Prokopec, [\"Duet Benchmarking: Improving Measurement\nAccuracy in the Cloud\"](https:\u002F\u002Farxiv.org\u002Fabs\u002F2001.05811) (ICPE 2020) measured accuracy improvements\nof **5.03x** (ScalaBench\u002FDaCapo) and **37.4x** (SPEC CPU 2017) on shared machines from running arms\nin parallel, because both arms absorb the same interference.\n\nThis is the reverse of the sequential rule and it is not a contradiction: sequential interleaving is\nvulnerable to bursty load precisely because the arms run at different moments. **The reconciliation\n\"only the sequential form is vulnerable\" is this plugin's reading, not a sourced claim.** Duet costs\n2x the resources and needs the arms to be genuinely independent.\n\n## Warmup\n\nDiscard N warmup iterations if the target has a warm path. Do **not** claim this establishes steady\nstate: Barrett et al. (OOPSLA 2017) found *\"at most 43.5% of ⟨VM, benchmark⟩ pairs consistently\nreach a steady state of peak performance.\"* No source justifies any particular N.\n\nReport the first pass and later passes as separate numbers. A cold first execution folded into warm\nrepeats hides the cost a first-time user pays.\n\n## The override\n\nGates here hard-block. A named per-gate override exists for each gate, and using it **records itself\nin the report**:\n\n```text\nOVERRIDE: unmeasurable-host  reason: \u003Cstated by the human>  gate: is_measurable\nOVERRIDE: tool-identity  reason: \u003Cstated by the human>  gate: tool-identity\n```\n\nThe second gate is the step 1b stop and the post-versus-baseline tool comparison. An override\nwithout a recorded reason is not available, for either gate. A report carrying an override says so at\nthe top, not in a footnote.\n\n## Storage\n\nBaselines live in the memory tier, `.work\u002F\u003Ctopic-slug>\u002Fbaselines\u002F`, machine-bound, **never\ncommitted**.\n\nThat layout matches `\u002Fverification:measure`, which owns baseline capture and storage mechanics, so\nthe two never keep two different baseline stores. Before capturing, in order:\n\n1. **Check for the seam.** Look for `\u002Fverification:measure` in this session's skill list. Record\n   whether it resolves; do not assume either answer.\n2. **Invoke it, or name why not.** When it resolves, invoke it via the Skill tool. When it resolves\n   and you capture directly anyway, the reason goes in the report.\n3. **Land the capture under `.work\u002F\u003Ctopic-slug>\u002Fbaselines\u002F`.** The path is the gate: a capture\n   written anywhere else says so at the top of the report, with the path it used, because a second\n   store is the outcome this seam exists to prevent.\n\nThe report's header carries exactly one of these lines, so a reader can tell a missing dependency\nfrom a deliberate skip:\n\n```text\nCapture: assisted by \u002Fverification:measure\nCapture: unassisted, verification absent\nCapture: unassisted, verification present and skipped because \u003Creason>\n```\n\nThe dependency is a preference for reuse, not a requirement: never refuse to measure because\n`\u002Fverification:measure` is missing; this skill's own gates (host qualification, interleaving, the\ncounter, the refusal) work either way.\n\nA counter ceiling that `\u002Fperformance:protect` checks in is not a baseline: it is a limit on a\ndeterministic count, and no duration is ever committed.\n\nA committed baseline is a number that outlives the conditions that made it true. No source states\n\"a stored baseline is invalid on another machine\" outright, but four independent Tier 1\u002F2 strands\nconverge on it; the practical rule is to always re-measure both arms rather than compare against a\nstored one.\n\n## Boundary\n\n- **Does not own baseline\u002Fcompare mechanics.** `\u002Fverification:measure` does. This adds host\n  qualification, interleaving, counters, and the refusal.\n- **Does not implement the change.** `\u002Fimplementation:implement` does.\n- **Does not decide whether the goal was met.** That is `\u002Fperformance:verify`.\n\n## Next\n\n- After a baseline capture: `\u002Fimplementation:implement` for the change, then\n  `\u002Fperformance:snapshot post`.\n- After a baseline capture with a frozen harness, when the goal plans a loop: `\u002Fperformance:climb`.\n- After a post capture: `\u002Fperformance:verify`.\n\n## Gotchas\n\n- **The refusal must always name the counter it can still report.** A dead-end refusal gets\n  overridden reflexively and teaches nothing.\n- **`is_measurable()` reads the findings list, never `spread_ratio` alone.** The bimodal predicate is\n  two-part: a wide spread whose slow mode is *also* slow. A bare ratio check fires on a healthy\n  cold-then-warm host.\n- **`$(...)` is a process spawn on MSYS.** A \"builtins-only\" hot path that reports through stdout\n  still costs a full process, and a spawn census that ignores its own substitutions undercounts.\n- **A `PATH` shim directory from `mktemp -d` invalidates a `PATH`-keyed cache every run.** The\n  harness then measures its own randomization and reports \"no improvement\".\n- **A stale harness copy produces plausible wrong numbers.** Record path, revision, and flag support\n  before timing; a missing column in the output is too late to catch a nine-commit drift.\n- **Report the counter even when the duration is allowed.** The counter is what an independent\n  verifier can reproduce tomorrow.\n- **Stale markers send every sample down the wrong path.** Reset or record path-selecting state\n  before each arm, and report observed path with evidence; a mismatch, or a path that could not be\n  observed (`unobserved`), is flagged, not folded into the headline metric.\n",{"metadata":24,"description":7,"argument-hint":27,"user-invocable":28,"disable-model-invocation":20},{"summary":25,"workflow-stage":26},"Capture a snapshot only from a host proven measurable","verify","[baseline|post] [\u003Ctarget>]",true,"main","d0e68c3f36b92a1d6381f0ba0060d7a0b8b886c5","plugins\u002Fperformance\u002Fskills\u002Fsnapshot",7,"https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins","https:\u002F\u002Fgithub.com\u002Fmelodic-software","https:\u002F\u002Fmelodicsoftware.com","Independent software studio building developer tools, automation, and application services, with roots in music.","2026-11-15 05:15:06",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":28},[40,43,46],{"tool":41,"command":42},"npx","npx skills add melodic-software\u002Fclaude-code-plugins --skill snapshot",{"tool":44,"command":45},"bunx","bunx skills add melodic-software\u002Fclaude-code-plugins --skill snapshot",{"tool":47,"command":48},"pnpm","pnpm dlx skills add melodic-software\u002Fclaude-code-plugins --skill snapshot","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fperformance\u002Fskills\u002Fsnapshot\u002FSKILL.md",[51],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"evals\u002Fevals.json","REFERENCE","参考文档",17804,"https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fperformance\u002Fskills\u002Fsnapshot\u002Fevals\u002Fevals.json",[58,65,72,79,84,91],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7DYYDG31B9YX7N9MB9QW2GW","track","Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fsession-flow\u002Fevals\u002Frecall-still-reports-reopened-bug\u002Fwork-items-stub\u002Fskills\u002Ftrack\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DYXVBAVG3NV30PA7GKW9Q6","reviewer-media","Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from \u002Freview:explain-change's digest, has \u002Fexplainer-video:produce render it and hands the manifest to \u002Fsource-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Freview\u002Fskills\u002Freviewer-media\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DYRZ5YD44AMYH26YR25GZ8","route","Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fdiscovery\u002Fevals\u002Fex-model-pin-without-override\u002Fmulti-agent-stub\u002Fskills\u002Froute\u002FSKILL.md",[],[],{"skillNo":80,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7DYRTVT4FWTGDJY0HCCFJMZ","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fdiscovery\u002Fevals\u002Fex-model-override-from-route\u002Fmulti-agent-stub\u002Fskills\u002Froute\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7DYNZC8PNW3T27V2ADKECKJ","principles","Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is \u002Farchitecture:improve.","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Farchitecture\u002Fskills\u002Fprinciples\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7DYNMCZNEWBFHV9KTSS6H60","write","Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').","https:\u002F\u002Fgithub.com\u002Fmelodic-software\u002Fclaude-code-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Farchitecture\u002Fevals\u002Fdeepening-defect-goes-to-bugs-write\u002Fbugs-stub\u002Fskills\u002Fwrite\u002FSKILL.md",[],[]]