[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75M0XTC4M2E2Y50S3PR5HWN":3,"skill-same:01M75M0XTC4M2E2Y50S3PR5HWN":83},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M75M0XTC4M2E2Y50S3PR5HWN","lean-elaboration-test",null,"Run a repeatable elaboration test of ONE Lean 4 repo and write a dated report — snapshot size (date, commit, lines excluding comment-only files), clean project-only rebuild with wall\u002FCPU\u002Fparallelism\u002FRSS, heavy-tail and per-namespace breakdown, warm own-file profiles of the worst files with likely causes, and improvement suggestions. Use when asked to run an elaboration test, profile a repo build, or track elaboration health over time.","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"CC-BY-4.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: lean-elaboration-test\ndescription: Run a repeatable elaboration test of ONE Lean 4 repo and write a dated report — snapshot size (date, commit, lines excluding comment-only files), clean project-only rebuild with wall\u002FCPU\u002Fparallelism\u002FRSS, heavy-tail and per-namespace breakdown, warm own-file profiles of the worst files with likely causes, and improvement suggestions. Use when asked to run an elaboration test, profile a repo build, or track elaboration health over time.\n---\n\n# Lean Elaboration Test\n\nA standardized, comparable snapshot of how one repository elaborates. The\nmethod incorporates repeated report-series corrections for partial default\ntargets, contention artifacts, and build-log versus own-file timing.\n\n**Scope rule: elaborate JUST THIS REPO.** Never mathlib, never upstream\npath-dependencies (their oleans are inputs, not measurands). A healthy timed\nbuild compiles only this repo's own modules; if the log shows upstream\ncompilation, the run is invalid — kill it, fix the cache, restart.\n\nThe companion skill **lean-elaboration** consumes this test's findings.\n\n## Phase 0 — Preconditions (all mandatory)\n\n1. **Sync if asked \u002F note the commit.** All size numbers come from git at the\n   measured commit, never `find` on a working tree (mid-flight agent edits\n   corrupted a baseline once): `git rev-parse HEAD`, `git status --short`.\n   Require `git diff --quiet HEAD -- '*.lean'` before a commit-attributed run;\n   staged, modified, or deleted tracked Lean files must not enter the baseline.\n   Review untracked `.lean` files and build configuration changes too. If they\n   affect the selected target, stop or measure a separate explicitly labeled\n   working-tree snapshot with matching size counts. Recheck source state after\n   the run; concurrent source edits invalidate a commit-attributed baseline.\n2. **Upstream olean guards.** Count oleans for Mathlib and any dependencies\n   (e.g. `find .lake\u002Fpackages\u002Fmathlib\u002F.lake\u002Fbuild\u002Flib -name '*.olean' | wc -l`);\n   compare against repository-documented thresholds. If no threshold exists,\n   verify that required dependency artifacts are populated before a timed run.\n   If artifacts are missing, stop and use only the repository-approved cache\n   restoration or one-time dependency setup procedure.\n3. **Separate machine load from artifact ownership.** You may record\n   `pgrep -x lake` and `ps -eo user,etime,args | grep -E \"[l]ake|[l]ean \"`\n   (bracket trick so grep doesn't match itself) to disclose co-running load.\n   Other checkouts' processes are load information, not a reason to refuse the\n   test. Before artifact invalidation, require exclusive use of this checkout's\n   build tree through a lock honored by every build wrapper, held through the\n   timed run, or use an isolated checkout with its own project artifacts.\n   Confirm that an isolated `.lake\u002Fbuild` does not resolve to a shared tree.\n   A process listing alone cannot prevent a new same-checkout build from\n   starting. If exclusive artifact ownership cannot be established, do not\n   delete artifacts or run the clean baseline; report it as not performed.\n4. **Read the repo's agent instructions** (olean preservation, guard hooks,\n   default build target). Respect them; the test must be a no-op for\n   everyone else on the machine.\n5. **NEVER `lake clean`. NEVER `lake update`.**\n\n## Phase 1 — Size snapshot\n\nRecord: **date (UTC), commit, .lean file count, total lines, non-comment code\nlines, comment-only files excluded**. Use\n[scripts\u002Fcount_lean_lines.py](scripts\u002Fcount_lean_lines.py) (self-contained;\ncounts from `git ls-tree` at the measured commit; a file is comment-only if\nit has no non-comment, non-whitespace character — such files are excluded\nfrom the file\u002Fline counts and listed by name). It also counts and lists\nnon-module files (no `module` header; `lakefile.lean` exempt). Record the\ncount. It must be 0; the script reports it but does not fail.\n\nAlso record what the *build root* covers if it differs from the git tree\n(quarantined\u002Foff-facade modules make tree > built; report both).\n\n**Verify the default target covers what you think it covers.** A prior report\nseries measured partial builds because the root facade silently omitted a\nlarge subtree. Check the root `.lean` facade's imports, or\nenumerate targets explicitly. Record the complete transitive set of project\nmodules selected by those targets, including the root facade. Map them to exact\ngit-tree source paths in `built-files.json`, a nonempty JSON array such as\n`[\"Project.lean\", \"Project\u002FBasic.lean\"]`. Reconcile this manifest with all own-module\nbuild records in Phase 2, including records without displayed timings; total\nLake job counts may include non-module jobs and are not a source-file count.\n\nFrom the measured repository root, count the exact selected files with the\nbundled counter (replace `\u003Cskill-dir>` with this installed skill's directory):\n\n```bash\ncommit=$(git rev-parse HEAD)\npython3 \u003Cskill-dir>\u002Fscripts\u002Fcount_lean_lines.py \"$commit\" --files-from built-files.json\n```\n\nUse this count for built-module per-line metrics. Prefix filters alone do not\nidentify a target's dependency closure. Keep the unrestricted tree-wide count\nas a separate size snapshot; do not include excluded or off-target modules in\nthe built denominator.\n\n## Phase 2 — Clean project-only rebuild (the timed run)\n\nUse the repository's guarded project-only rebuild command when it has one.\nEstablish exclusive artifact ownership as required by Phase 0 before calling\nany wrapper that invalidates artifacts. If no wrapper exists, identify the exact\nlibrary root (for example `Project`) and prepare\nan explicit project-artifact invalidation plan. Confirm every resolved path is\ninside this repository's own build subtree and cannot match a dependency tree\nbefore removing anything. A generic shape is:\n\n```bash\nrm -rf .lake\u002Fbuild\u002Flib\u002Flean\u002F\u003CRoot>\nrm -f .lake\u002Fbuild\u002Flib\u002Flean\u002F\u003CRoot>.{olean,ilean,trace,olean.hash,ilean.hash}\nrm -rf .lake\u002Fbuild\u002Fir\u002F\u003CRoot>\n\u002Fusr\u002Fbin\u002Ftime -v \u003Crepo-approved-build-command> > \u003Cunique-log-path> 2>&1\n```\n\nTreat the snippet as a template, not authorization to delete unresolved or\nbroad paths. Run invalidation and the build within the same exclusive lease;\nan ad hoc lock that other builders do not honor offers no protection. Do not\nuse the template when local instructions provide a wrapper.\n\nUse GNU `time -v` (gives %CPU and peak RSS; bash `time` doesn't): typically\n`\u002Fusr\u002Fbin\u002Ftime` on Linux or `gtime` on macOS, whose `\u002Fusr\u002Fbin\u002Ftime` is BSD time.\nNote the tool in the report — cross-tool CPU splits aren't comparable.\n\n**Watch the first minutes**: any `.lake\u002Fpackages\u002Fmathlib` compile lines, or\nbulk upstream-module compiles → kill immediately, diagnose, do not let it\nrun.\n\nRecord from `\u002Fusr\u002Fbin\u002Ftime -v` + the log:\n- exit status, error count, `sorry` count (vs authorized list), warning count\n- wall-clock (Elapsed), user CPU, sys CPU, total CPU (user + sys), %CPU, peak RSS\n- total jobs (`[N\u002FM]` progress lines), and confirm only own-repo modules\n  compiled\n\n## Phase 3 — Per-file extraction from the build log\n\n```bash\nrg --only-matching 'Built \u003CRoot>(\\.[^ ]+)? \\(([0-9.]+)s\\)' \u003Clog>\n```\n\nThe pattern includes the root module and its submodules; replace `\u003CRoot>` with\nthe regex-escaped root name. Check the pinned Lake version's log format before\nusing this seconds-only template. Lake's [build timing source](https:\u002F\u002Fgithub.com\u002Fleanprover\u002Flean4\u002Fblob\u002Fmaster\u002Fsrc\u002Flake\u002FLake\u002FBuild\u002FCommon.lean)\nuses `IO.monoMsNow`; inspect the corresponding file in the selected Lean tag\nwhen checking a different toolchain.\n\n- **Cumulative logged elapsed time** = Σ of displayed Built durations. Lake\n  measures these with a monotonic clock, not a CPU clock. Sub-threshold timings\n  may be omitted; report the timing-visible fraction of built modules.\n- **Logged overlap ratio** = cumulative logged elapsed time ÷ wall-clock.\n  Overlapping jobs and contention affect this ratio; it is not CPU parallelism.\n- **Average CPU parallelism** = total CPU from Phase 2 ÷ wall-clock.\n- **Per-line CPU cost** = total CPU ÷ built-module code lines (ms\u002Fline).\n  If also reporting logged elapsed time per line, label it separately and\n  disclose omitted timings. Use the exact Phase 1 module manifest as the\n  denominator, not the whole git tree.\n- **Heavy-tail tiers**: file counts ≥10s \u002F ≥20s \u002F ≥30s \u002F ≥40s (the policy\n  metric that should only ratchet down).\n- **Top-30 worst files**, annotated `vs \u003Cprior report date>` where a prior\n  snapshot exists.\n- **Per-namespace \u002F per-directory aggregation** of logged elapsed time with Δ vs\n  prior — this localizes regressions to groups of files.\n\n## Phase 4 — Warm own-file profiling of the worst files\n\nBuild wall-clock ≠ own-file cost (includes upstream rebuilds, olean\u002FIR\nwrites, contention; ~25–40% inflated under parallel load, 2.5× observed).\nConfirm each candidate **serially, after the build, one at a time**:\n\n```bash\nprofile_log=$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Flean-profile.XXXXXX\")\nif \u003Crepo-approved-lean-command> --profile \u003CRoot>\u002F\u003CPath>\u002FFile.lean > \"$profile_log\" 2>&1; then\n  profile_status=0\nelse\n  profile_status=$?\nfi\ntail -n 25 \"$profile_log\"\nprintf 'Lean exit status: %s; full log: %s\\n' \"$profile_status\" \"$profile_log\"\n(exit \"$profile_status\")\n```\n\nThe last subshell returns Lean's status after displaying the tail; the full\nlog remains available. Classify the file only when `profile_status` is zero.\n\nFor the top 5–10 files record wall + the `cumulative profiling times` block\n(typeclass inference \u002F simp \u002F elaboration \u002F interpretation:\u003Ctactic> \u002F\nimport \u002F tactic execution \u002F type checking), events >100ms. Classify each\nfile's dominant phase and likely cause:\n- `import`-dominated → not a local problem; candidate is upstream or the\n  file's import list.\n- `interpretation:nlinarith`\u002F`linarith` → arithmetic-closer elimination.\n- `typeclass inference`, few large events → head-class cache candidate (name\n  the searched class! e.g. eight ~1s `SMul` searches = one missing cache).\n- `typeclass inference`, thousands of sub-100ms events → diffuse floor;\n  don't promise a fix.\n- large unattributed `elaboration` → rerun with\n  `-D trace.profiler.output=out.json` for per-declaration attribution before\n  claiming a cause.\n\n## Phase 5 — Trend comparison (when prior reports exist)\n\n- Compare wall-clock and logged elapsed times only with the same timing tool,\n  build scope, toolchain, and comparable parallelism and machine load. Report\n  measured total CPU separately; neither logged elapsed time nor default\n  profile phase time is immune to contention.\n- Contention artifact check before believing any regression: (a) user CPU\n  down while logged-sum up? (b) parallelism jumped? (c) same-file timings\n  moving in opposite directions? Any two → report the run as\n  contention-bound and skip structural conclusions.\n- Predicted-vs-actual: Δbuilt code lines × prior CPU ms\u002Fline vs actual Δtotal\n  CPU. Big ratios (>2×) warrant checking load and downstream effects before\n  attributing the change to code growth or a regression.\n- Flag any single file on a monotonic climb across ≥3 reports.\n\n## Phase 6 — The report\n\nWrite `ELABORATION_REPORT_\u003CYYYY-MM-DD>.md` (or the repo's established\nnaming) at the repo root. Sections, in order:\n\n1. **Setup\u002Fprovenance** — date-time window, commit, host, tool, exact\n   commands, co-running load observed, which build target.\n2. **Size snapshot** — files, lines, non-comment lines, comment-only files\n   excluded, built-vs-tree scope note.\n3. **Headline table** — wall, user\u002Fsys\u002Ftotal CPU, %CPU, average CPU parallelism,\n   logged elapsed sum and overlap ratio, peak RSS, jobs, built-module per-line\n   CPU ms; columns vs prior snapshots with comparability caveats.\n4. **Build health** — exit status, errors, sorries vs authorized, warning\n   census (top kinds), rule compliance (no upstream compiles, file-size\n   limits, heartbeat overrides).\n5. **Heavy tail** — tier table (≥10\u002F20\u002F30\u002F40s) with Δ vs prior; top-30 files.\n6. **Per-namespace logged elapsed time** with Δ vs prior.\n7. **Own-file profiles** of the worst files — the phase table, dominant\n   category per file.\n8. **Findings ranked by actionability** — each with the evidence, the named\n   lever (per the lean-elaboration skill), and expected value; separate\n   \"measurement only, no fix applied\" honestly.\n9. **What is NOT established** — unattributed time, unprofiled tails,\n   contention limits. Every number a future reader might over-trust gets a\n   caveat here.\n10. **Methodology** — commands verbatim, so the next run is identical.\n11. **Pointers** — prior reports with their roles (last clean baseline, peak\n    regression, etc.).\n\n## Cost & etiquette notes\n\n- The timed rebuild can be expensive. Estimate from the repository's prior\n  reports when available; on a shared machine, warn before\n  running. Other agents' builds may run concurrently; record the load and mark\n  timing comparisons contention-bound when appropriate. Concurrent builds must\n  use separate artifact trees; keep the Phase 0 exclusive-ownership guard.\n- Profiling (Phase 4) is cheap (~10–60s\u002Ffile) but must be serial.\n- If the measured artifact tree changes concurrently, report clearly that the\n  numbers are contaminated; do not infer contamination from a process listing.\n- The report is measurement; applying fixes is the lean-elaboration skill's\n  loop with per-change A\u002FB — do not mix the two in one pass.\n","# Lean Elaboration Test\n\nA standardized, comparable snapshot of how one repository elaborates. The\nmethod incorporates repeated report-series corrections for partial default\ntargets, contention artifacts, and build-log versus own-file timing.\n\n**Scope rule: elaborate JUST THIS REPO.** Never mathlib, never upstream\npath-dependencies (their oleans are inputs, not measurands). A healthy timed\nbuild compiles only this repo's own modules; if the log shows upstream\ncompilation, the run is invalid — kill it, fix the cache, restart.\n\nThe companion skill **lean-elaboration** consumes this test's findings.\n\n## Phase 0 — Preconditions (all mandatory)\n\n1. **Sync if asked \u002F note the commit.** All size numbers come from git at the\n   measured commit, never `find` on a working tree (mid-flight agent edits\n   corrupted a baseline once): `git rev-parse HEAD`, `git status --short`.\n   Require `git diff --quiet HEAD -- '*.lean'` before a commit-attributed run;\n   staged, modified, or deleted tracked Lean files must not enter the baseline.\n   Review untracked `.lean` files and build configuration changes too. If they\n   affect the selected target, stop or measure a separate explicitly labeled\n   working-tree snapshot with matching size counts. Recheck source state after\n   the run; concurrent source edits invalidate a commit-attributed baseline.\n2. **Upstream olean guards.** Count oleans for Mathlib and any dependencies\n   (e.g. `find .lake\u002Fpackages\u002Fmathlib\u002F.lake\u002Fbuild\u002Flib -name '*.olean' | wc -l`);\n   compare against repository-documented thresholds. If no threshold exists,\n   verify that required dependency artifacts are populated before a timed run.\n   If artifacts are missing, stop and use only the repository-approved cache\n   restoration or one-time dependency setup procedure.\n3. **Separate machine load from artifact ownership.** You may record\n   `pgrep -x lake` and `ps -eo user,etime,args | grep -E \"[l]ake|[l]ean \"`\n   (bracket trick so grep doesn't match itself) to disclose co-running load.\n   Other checkouts' processes are load information, not a reason to refuse the\n   test. Before artifact invalidation, require exclusive use of this checkout's\n   build tree through a lock honored by every build wrapper, held through the\n   timed run, or use an isolated checkout with its own project artifacts.\n   Confirm that an isolated `.lake\u002Fbuild` does not resolve to a shared tree.\n   A process listing alone cannot prevent a new same-checkout build from\n   starting. If exclusive artifact ownership cannot be established, do not\n   delete artifacts or run the clean baseline; report it as not performed.\n4. **Read the repo's agent instructions** (olean preservation, guard hooks,\n   default build target). Respect them; the test must be a no-op for\n   everyone else on the machine.\n5. **NEVER `lake clean`. NEVER `lake update`.**\n\n## Phase 1 — Size snapshot\n\nRecord: **date (UTC), commit, .lean file count, total lines, non-comment code\nlines, comment-only files excluded**. Use\n[scripts\u002Fcount_lean_lines.py](scripts\u002Fcount_lean_lines.py) (self-contained;\ncounts from `git ls-tree` at the measured commit; a file is comment-only if\nit has no non-comment, non-whitespace character — such files are excluded\nfrom the file\u002Fline counts and listed by name). It also counts and lists\nnon-module files (no `module` header; `lakefile.lean` exempt). Record the\ncount. It must be 0; the script reports it but does not fail.\n\nAlso record what the *build root* covers if it differs from the git tree\n(quarantined\u002Foff-facade modules make tree > built; report both).\n\n**Verify the default target covers what you think it covers.** A prior report\nseries measured partial builds because the root facade silently omitted a\nlarge subtree. Check the root `.lean` facade's imports, or\nenumerate targets explicitly. Record the complete transitive set of project\nmodules selected by those targets, including the root facade. Map them to exact\ngit-tree source paths in `built-files.json`, a nonempty JSON array such as\n`[\"Project.lean\", \"Project\u002FBasic.lean\"]`. Reconcile this manifest with all own-module\nbuild records in Phase 2, including records without displayed timings; total\nLake job counts may include non-module jobs and are not a source-file count.\n\nFrom the measured repository root, count the exact selected files with the\nbundled counter (replace `\u003Cskill-dir>` with this installed skill's directory):\n\n```bash\ncommit=$(git rev-parse HEAD)\npython3 \u003Cskill-dir>\u002Fscripts\u002Fcount_lean_lines.py \"$commit\" --files-from built-files.json\n```\n\nUse this count for built-module per-line metrics. Prefix filters alone do not\nidentify a target's dependency closure. Keep the unrestricted tree-wide count\nas a separate size snapshot; do not include excluded or off-target modules in\nthe built denominator.\n\n## Phase 2 — Clean project-only rebuild (the timed run)\n\nUse the repository's guarded project-only rebuild command when it has one.\nEstablish exclusive artifact ownership as required by Phase 0 before calling\nany wrapper that invalidates artifacts. If no wrapper exists, identify the exact\nlibrary root (for example `Project`) and prepare\nan explicit project-artifact invalidation plan. Confirm every resolved path is\ninside this repository's own build subtree and cannot match a dependency tree\nbefore removing anything. A generic shape is:\n\n```bash\nrm -rf .lake\u002Fbuild\u002Flib\u002Flean\u002F\u003CRoot>\nrm -f .lake\u002Fbuild\u002Flib\u002Flean\u002F\u003CRoot>.{olean,ilean,trace,olean.hash,ilean.hash}\nrm -rf .lake\u002Fbuild\u002Fir\u002F\u003CRoot>\n\u002Fusr\u002Fbin\u002Ftime -v \u003Crepo-approved-build-command> > \u003Cunique-log-path> 2>&1\n```\n\nTreat the snippet as a template, not authorization to delete unresolved or\nbroad paths. Run invalidation and the build within the same exclusive lease;\nan ad hoc lock that other builders do not honor offers no protection. Do not\nuse the template when local instructions provide a wrapper.\n\nUse GNU `time -v` (gives %CPU and peak RSS; bash `time` doesn't): typically\n`\u002Fusr\u002Fbin\u002Ftime` on Linux or `gtime` on macOS, whose `\u002Fusr\u002Fbin\u002Ftime` is BSD time.\nNote the tool in the report — cross-tool CPU splits aren't comparable.\n\n**Watch the first minutes**: any `.lake\u002Fpackages\u002Fmathlib` compile lines, or\nbulk upstream-module compiles → kill immediately, diagnose, do not let it\nrun.\n\nRecord from `\u002Fusr\u002Fbin\u002Ftime -v` + the log:\n- exit status, error count, `sorry` count (vs authorized list), warning count\n- wall-clock (Elapsed), user CPU, sys CPU, total CPU (user + sys), %CPU, peak RSS\n- total jobs (`[N\u002FM]` progress lines), and confirm only own-repo modules\n  compiled\n\n## Phase 3 — Per-file extraction from the build log\n\n```bash\nrg --only-matching 'Built \u003CRoot>(\\.[^ ]+)? \\(([0-9.]+)s\\)' \u003Clog>\n```\n\nThe pattern includes the root module and its submodules; replace `\u003CRoot>` with\nthe regex-escaped root name. Check the pinned Lake version's log format before\nusing this seconds-only template. Lake's [build timing source](https:\u002F\u002Fgithub.com\u002Fleanprover\u002Flean4\u002Fblob\u002Fmaster\u002Fsrc\u002Flake\u002FLake\u002FBuild\u002FCommon.lean)\nuses `IO.monoMsNow`; inspect the corresponding file in the selected Lean tag\nwhen checking a different toolchain.\n\n- **Cumulative logged elapsed time** = Σ of displayed Built durations. Lake\n  measures these with a monotonic clock, not a CPU clock. Sub-threshold timings\n  may be omitted; report the timing-visible fraction of built modules.\n- **Logged overlap ratio** = cumulative logged elapsed time ÷ wall-clock.\n  Overlapping jobs and contention affect this ratio; it is not CPU parallelism.\n- **Average CPU parallelism** = total CPU from Phase 2 ÷ wall-clock.\n- **Per-line CPU cost** = total CPU ÷ built-module code lines (ms\u002Fline).\n  If also reporting logged elapsed time per line, label it separately and\n  disclose omitted timings. Use the exact Phase 1 module manifest as the\n  denominator, not the whole git tree.\n- **Heavy-tail tiers**: file counts ≥10s \u002F ≥20s \u002F ≥30s \u002F ≥40s (the policy\n  metric that should only ratchet down).\n- **Top-30 worst files**, annotated `vs \u003Cprior report date>` where a prior\n  snapshot exists.\n- **Per-namespace \u002F per-directory aggregation** of logged elapsed time with Δ vs\n  prior — this localizes regressions to groups of files.\n\n## Phase 4 — Warm own-file profiling of the worst files\n\nBuild wall-clock ≠ own-file cost (includes upstream rebuilds, olean\u002FIR\nwrites, contention; ~25–40% inflated under parallel load, 2.5× observed).\nConfirm each candidate **serially, after the build, one at a time**:\n\n```bash\nprofile_log=$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Flean-profile.XXXXXX\")\nif \u003Crepo-approved-lean-command> --profile \u003CRoot>\u002F\u003CPath>\u002FFile.lean > \"$profile_log\" 2>&1; then\n  profile_status=0\nelse\n  profile_status=$?\nfi\ntail -n 25 \"$profile_log\"\nprintf 'Lean exit status: %s; full log: %s\\n' \"$profile_status\" \"$profile_log\"\n(exit \"$profile_status\")\n```\n\nThe last subshell returns Lean's status after displaying the tail; the full\nlog remains available. Classify the file only when `profile_status` is zero.\n\nFor the top 5–10 files record wall + the `cumulative profiling times` block\n(typeclass inference \u002F simp \u002F elaboration \u002F interpretation:\u003Ctactic> \u002F\nimport \u002F tactic execution \u002F type checking), events >100ms. Classify each\nfile's dominant phase and likely cause:\n- `import`-dominated → not a local problem; candidate is upstream or the\n  file's import list.\n- `interpretation:nlinarith`\u002F`linarith` → arithmetic-closer elimination.\n- `typeclass inference`, few large events → head-class cache candidate (name\n  the searched class! e.g. eight ~1s `SMul` searches = one missing cache).\n- `typeclass inference`, thousands of sub-100ms events → diffuse floor;\n  don't promise a fix.\n- large unattributed `elaboration` → rerun with\n  `-D trace.profiler.output=out.json` for per-declaration attribution before\n  claiming a cause.\n\n## Phase 5 — Trend comparison (when prior reports exist)\n\n- Compare wall-clock and logged elapsed times only with the same timing tool,\n  build scope, toolchain, and comparable parallelism and machine load. Report\n  measured total CPU separately; neither logged elapsed time nor default\n  profile phase time is immune to contention.\n- Contention artifact check before believing any regression: (a) user CPU\n  down while logged-sum up? (b) parallelism jumped? (c) same-file timings\n  moving in opposite directions? Any two → report the run as\n  contention-bound and skip structural conclusions.\n- Predicted-vs-actual: Δbuilt code lines × prior CPU ms\u002Fline vs actual Δtotal\n  CPU. Big ratios (>2×) warrant checking load and downstream effects before\n  attributing the change to code growth or a regression.\n- Flag any single file on a monotonic climb across ≥3 reports.\n\n## Phase 6 — The report\n\nWrite `ELABORATION_REPORT_\u003CYYYY-MM-DD>.md` (or the repo's established\nnaming) at the repo root. Sections, in order:\n\n1. **Setup\u002Fprovenance** — date-time window, commit, host, tool, exact\n   commands, co-running load observed, which build target.\n2. **Size snapshot** — files, lines, non-comment lines, comment-only files\n   excluded, built-vs-tree scope note.\n3. **Headline table** — wall, user\u002Fsys\u002Ftotal CPU, %CPU, average CPU parallelism,\n   logged elapsed sum and overlap ratio, peak RSS, jobs, built-module per-line\n   CPU ms; columns vs prior snapshots with comparability caveats.\n4. **Build health** — exit status, errors, sorries vs authorized, warning\n   census (top kinds), rule compliance (no upstream compiles, file-size\n   limits, heartbeat overrides).\n5. **Heavy tail** — tier table (≥10\u002F20\u002F30\u002F40s) with Δ vs prior; top-30 files.\n6. **Per-namespace logged elapsed time** with Δ vs prior.\n7. **Own-file profiles** of the worst files — the phase table, dominant\n   category per file.\n8. **Findings ranked by actionability** — each with the evidence, the named\n   lever (per the lean-elaboration skill), and expected value; separate\n   \"measurement only, no fix applied\" honestly.\n9. **What is NOT established** — unattributed time, unprofiled tails,\n   contention limits. Every number a future reader might over-trust gets a\n   caveat here.\n10. **Methodology** — commands verbatim, so the next run is identical.\n11. **Pointers** — prior reports with their roles (last clean baseline, peak\n    regression, etc.).\n\n## Cost & etiquette notes\n\n- The timed rebuild can be expensive. Estimate from the repository's prior\n  reports when available; on a shared machine, warn before\n  running. Other agents' builds may run concurrently; record the load and mark\n  timing comparisons contention-bound when appropriate. Concurrent builds must\n  use separate artifact trees; keep the Phase 0 exclusive-ownership guard.\n- Profiling (Phase 4) is cheap (~10–60s\u002Ffile) but must be serial.\n- If the measured artifact tree changes concurrently, report clearly that the\n  numbers are contaminated; do not infer contamination from a process listing.\n- The report is measurement; applying fixes is the lean-elaboration skill's\n  loop with per-change A\u002FB — do not mix the two in one pass.\n",{"name":5,"description":7},"master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Flean-elaboration-test",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add stanfish06\u002Fskillquarium --skill lean-elaboration-test",{"tool":39,"command":40},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill lean-elaboration-test",{"tool":42,"command":43},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill lean-elaboration-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FSKILL.md",true,[47,53,57,61,65,69,75,79],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"agents\u002Fopenai.yaml","REFERENCE","参考文档",234,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002Fagents\u002Fopenai.yaml",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"INDEX.md",2985,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FINDEX.md",{"path":58,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":16},"LICENSE","许可证",18656,{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"LICENSES\u002FApache-2.0.txt",11358,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FLICENSES\u002FApache-2.0.txt",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"PROVENANCE.md",2674,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FPROVENANCE.md",{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"scripts\u002Fcount_lean_lines.py","SCRIPT","脚本",7214,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002Fscripts\u002Fcount_lean_lines.py",{"path":76,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":77,"sourceHtmlUrl":78},"SOURCES.md",1513,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FSOURCES.md",{"path":80,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":81,"sourceHtmlUrl":82},"THIRD_PARTY_NOTICES.md",2165,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Flean-elaboration-test\u002FTHIRD_PARTY_NOTICES.md",[84,92,101,108,115,122],{"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":88,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":20},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":20},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":20},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":20},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]