[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75JH338VQEBKPDX0FTYGR6J":3,"skill-same:01M75JH338VQEBKPDX0FTYGR6J":68},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M75JH338VQEBKPDX0FTYGR6J","dead-code-cleanup",null,"Scans a repo for likely-unreferenced top-level symbols (JS\u002FTS exports, Python def\u002Fclass, Go func, Bash functions), reports dead, test-only and over-exported ones as candidates, and writes a structured `dead-code-report.md` (summary + candidate tables, including languages it skipped). Use when asked to find dead code, unused exports, or unreferenced functions, or to clean up a codebase. Advisory-first — never deletes without explicit confirmation.","sunitghub\u002Fcanon-skills","sunitghub","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F154850182?v=4","01M75JGBZ2TQM1BG49YHTRGHZR","Sunit Joshi","01M75JGC05YY1W8RW5SJAWWTB8",9,"MIT","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdead-code-cleanup\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: dead-code-cleanup\ndescription: Scans a repo for likely-unreferenced top-level symbols (JS\u002FTS exports, Python def\u002Fclass, Go func, Bash functions), reports dead, test-only and over-exported ones as candidates, and writes a structured `dead-code-report.md` (summary + candidate tables, including languages it skipped). Use when asked to find dead code, unused exports, or unreferenced functions, or to clean up a codebase. Advisory-first — never deletes without explicit confirmation.\ncategory: dev\ntags: [cleanup, code-quality, dead-code, verification]\n---\n\n# Dead Code Cleanup\n\nFinds code that nothing calls and reports it — it does not delete anything on its own. The scan\nedits no existing file; it writes a structured `dead-code-report.md` (confirm-first) and, only on\nper-candidate confirmation, removes code as a normal gated edit.\nComplements `mutation-test` (which checks whether *existing* tests have teeth): this skill checks\nwhether the code those tests cover is still reachable at all.\n\n**Advisory-first, manual-trigger only.** No scheduling, no auto-PR, no auto-delete. Removal, once\nthe user confirms a candidate, is a normal code edit that goes through the sprint's existing\nreview\u002Feval gates like any other change — this skill never bypasses them.\n\n## Scope\n\n- Default scope is the repo root (`git rev-parse --show-toplevel`). A user-supplied path or glob\n  narrows it.\n- Always exclude `node_modules`, `.git`, `dist`, `build`, `__pycache__`, and any vendor directory.\n- If scope resolution fails (not a git repo, or `git rev-parse` errors), report that and stop —\n  never fall back to scanning an unbounded filesystem path.\n\n## The scan (follow exactly)\n\n**Run the scanner first.** Steps 1–3 are implemented by canon's `dead-code-scan.sh` (Bash, git and\nawk only, so it runs in Git Bash on Windows): `bash ~\u002F.canon\u002Ftools\u002Fdead-code-scan.sh [\u003Cpath>...]`\n(in the canon repo itself, `bash tools\u002Fdead-code-scan.sh`). It prints one tab-separated row per\ncandidate — `class  file:line  symbol  lang  entry  refs`, class `DEAD`\u002F`TESTONLY`\u002F`OVEREXP` — then\n`# scanned:`, `# skipped:` and `# checked:` lines; it exits 2 outside a git repo. It reads tracked\nfiles only (commit or `git add` new code first). Copy `# scanned:` and `# skipped:` into the\nSummary's `Languages scanned`\u002F`Languages skipped` rows as printed — a language with no candidates\nwas still scanned. Its rows are the\ncandidate list: report **every** row, never a sample, and do not re-derive them by hand — a model\nchecking hundreds of symbols one grep at a time skips most of them. Your part is the judgment the\nscript cannot make: the entry points and dynamic dispatch in step 3 and the Gotchas. Only if the\nscript is missing, follow steps 1–3 by hand and say in the report that the scan was manual and may\nbe incomplete.\n\n1. **Extract candidate declarations.** Grep-based, one pattern set per language present in\n   scope:\n   - JS\u002FTS (`.js`, `.ts`, `.jsx`, `.tsx`): `export [async] (function|const|class) \u003CName>` (an *export*)\n   - Python (`.py`): top-level `def \u003Cname>` \u002F `class \u003CName>` not prefixed with `_`\n   - Go (`.go`): top-level `func \u003CName>(` — exported (uppercase start, an *export*) and unexported\n     (lowercase start) alike. Exclude `main`, `init`, and `Test*`\u002F`Benchmark*`\u002F`Example*`\n     (runtime\u002Ftest-runner convention, not a static reference — see Gotchas). Methods\n     (`func (r T) Name(`) are not candidates: interface satisfaction calls them without a name.\n   - Bash (`.sh`, `.bash`, and extensionless files whose first line is a `sh`\u002F`bash` shebang, e.g.\n     `#!\u002Fusr\u002Fbin\u002Fenv bash`): top-level `\u003Cname>() {` or `function \u003Cname>` declarations\n\n   Skip any language not in this list — do not guess a pattern for an unfamiliar language. But\n   never skip silently: count the files in scope with one of these common source extensions —\n   `.cs .rs .java .kt .rb .php .swift .c .h .cpp .scala .lua .ps1` — and report each extension\n   found, with its file count, under `Languages skipped` (step 4). Data and doc files (`.md`,\n   `.json`, `.yml`, …) are not source and are never listed.\n\n2. **Count code references.** For each candidate symbol, `grep -rnw` the symbol across the scope,\n   excluding the declaration's own line. Only a **code reference** counts. Drop a match when:\n   - it is in a doc file: `*.md`, `*.txt`, `CHANGELOG*`, or anything under `.tickets\u002F` or\n     `.reports\u002F` (mentions in prose, tickets, changelogs and earlier reports never keep code alive);\n   - its line is comment-only — its first non-space characters are `#`, `\u002F\u002F`, `\u002F*` or `*` (a\n     shebang line counts as a comment).\n\n   Then sort the remaining code references by where they are:\n   - **test** — in a test file: anything under `tests\u002F`, `test\u002F` or `__tests__\u002F`, or named\n     `*.test.*`, `*.spec.*`, `*_test.go`, `test_*.py` or `*_test.py`;\n   - **own file** — in the declaring file itself;\n   - **other** — any other non-test file.\n\n3. **Classify.** Each candidate lands in at most one class:\n   - **Dead** — no code reference at all.\n   - **Test-only** — code references exist, but only in test files (the production code is\n     reachable only from its tests).\n   - **Over-exported** — an *export* (JS\u002FTS export or exported Go func) whose only code references\n     are in its own file — no other file and no test uses it: live code, but the export (or Go\n     capital letter) is unneeded. A test that imports the export needs it, so that is live.\n   - Otherwise live — not reported. For a non-export (Python, unexported Go, Bash), a call in its\n     own file is a normal use and makes it live.\n\n   A candidate declared **in a test file** can only be Dead: a test helper used by tests is live,\n   never Test-only or Over-exported.\n\n   Then set confidence on Dead rows (a Test-only or Over-exported row in an entry-point file\n   just says so in its Reason):\n   - **High** — the declaring file is not an entry-point pattern.\n   - **Low** — the declaring file matches an entry-point pattern:\n     `index.*`, `__init__.py`, `main.go`, `cli.*`, or any file a `package.json`\u002Fshebang\u002Fbuild\n     config names directly. These are likely public API surface or process entry points invoked\n     by name from outside grep's reach — flag them, don't bury them, but don't recommend removal.\n     **Exception — Bash functions and unexported Go funcs never take the downgrade:** a Bash\n     function can only be called from its own script or a file that `source`s it, and an unexported\n     Go func only from its own package; grep sees all of those, so they stay High. The scanner's\n     `entry` column applies the filename and shebang patterns and this exception; check the\n     `package.json`\u002Fbuild-config case yourself.\n\n4. **Report.** The scan itself edits no file. Print the Summary inline, then — **confirm-first**,\n   mirroring `context-check`\u002F`context-doctor` — write a structured `dead-code-report.md` at the\n   repo root: ask `Write dead-code-report.md to the repo root? (y to confirm)`, overwrite if present\n   (a point-in-time snapshot, not a log). Structure:\n\n   ```markdown\n   # Dead Code Report\n\n   _Scope: \u003Cpath> · Generated: \u003CISO date>_\n\n   ## Summary\n\n   | Metric | Count |\n   |---|---|\n   | High-confidence dead | N |\n   | Low-confidence dead (entry-point) | M |\n   | Test-only callers | T |\n   | Over-exported | O |\n   | Languages scanned | js, py, go, sh |\n   | Languages skipped | .rs (12 files), .cs (3 files) — or `none` |\n\n   > Advisory only — nothing removed. Confirm candidates to remove; removals go through the sprint's gates.\n\n   ## High-confidence candidates\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Ffoo.js:12 | oldHelper | function | no code references in scope |\n\n   ## Low-confidence — verify manually\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | cli\u002Findex.py:1 | main | function | entry-point file — likely invoked by name |\n\n   ## Test-only callers\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Ffmt.py:40 | legacy_format | function | called only from tests\u002Ftest_fmt.py |\n\n   ## Over-exported\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Fview.js:29 | rowFor | function | exported, used only in its own file — drop the export |\n\n   ## Caveats\n\n   - Dynamic dispatch\u002Freflection, barrel re-exports, string-only references, CLI entry points, and\n     test-runner conventions can hide real callers — spot-check before removing (see Gotchas).\n   - Languages skipped were not scanned at all: zero candidates says nothing about them.\n   ```\n\n   Render `None.` under a candidate section with no rows. If **all** tables are empty, still write\n   the report (all `None.`) and say so — a clean result, not a no-op — and name any languages\n   skipped in that sentence, so a clean result never hides an unscanned codebase. The `Kind` column is the\n   declaration type (`function`\u002F`class`\u002F…); confidence is expressed by which table a row lands in.\n\n## Confirm-then-remove loop\n\nAfter the report:\n\n1. Ask the user which candidates (if any) to remove — accept a batch selection, not just one at\n   a time. **Before applying any removal, surface the working-tree state** — check\n   `git status --porcelain`; if there are uncommitted changes, tell the user the removals will be\n   added to their current diff and offer **commit-first \u002F proceed-anyway \u002F cancel**. This is an\n   *informed confirmation, not a hard clean-tree gate*: git makes every removal revertible\n   per-file (`git restore \u003Cfile>`) whether or not the tree was clean, so never block on a dirty\n   tree — just make the undo choice visible (t-2201). A clean tree only buys a tidier isolated\n   diff, which the user may or may not want.\n2. For each confirmed candidate, remove the declaration (and now-orphaned code it alone made\n   reachable, if obviously scoped to it) with a normal edit.\n3. The removal becomes part of whatever sprint is active. It is graded by that sprint's own\n   acceptance criteria and gates — this skill does not run its own separate close process.\n4. If no sprint is active when removal is confirmed, say so and suggest `sprint start` before\n   editing — don't edit outside an active sprint's diff.\n\n## Gotchas\n\n- **`evals.json` is source text.** A real symbol named in an eval prompt counts as a reference, so a scan finds it live. A skill whose job covers every item of a large set hands the loop to a script: models following prose sample the set (Haiku found 0 of 3) (`t-271a`).\n- **Dynamic dispatch and reflection** (`getattr(obj, name)`, `eval`, string-keyed routing\n  tables) call a symbol by name at runtime — grep finds zero static references even though the\n  symbol is live. Treat any candidate near a router\u002Fregistry\u002Fdispatch table with suspicion; ask\n  before removing.\n- **String-only references** — a mention in docs, tickets, CHANGELOG, earlier reports or a\n  comment is dropped (step 2): it never keeps code alive. A mention in a YAML config or CI\n  workflow still counts — it may be a real call (`run: tools\u002Ffoo.sh`). The pattern is name-based,\n  not import-graph-based, so `grep -w` can also miss a real caller to word-boundary quirks (e.g.\n  template-literal interpolation, a Bash function name containing `-`). Spot-check a sample of\n  Dead results before trusting the count at scale.\n- **Bash string-built calls** — `\"cmd_$sub\"` or `$handler \"$@\"` calls a function whose name grep\n  never sees whole. A static `case` dispatch (`start) cmd_start \"$@\" ;;`) is a normal reference.\n  Before reporting a Bash function Dead, check its file for a variable used as a command name; if\n  one exists and the function's name fits the prefix, move it to Low-confidence.\n- **Barrel\u002Fre-export files** (`export * from '.\u002Ffoo'`) make a symbol look referenced by the\n  barrel file itself even when nothing imports it *from* the barrel — this heuristic will\n  under-report in that case, not over-report; treat \"zero candidates\" from a heavily-barrelled\n  codebase with caution.\n- **Test-only callers** — production code reachable only from its tests is its own class, not\n  live: the tests keep it compiling, nothing ships through it. Remove the code and its tests\n  together, or keep it if the test pins a contract a future caller needs. Helpers declared inside\n  test files are not reported unless Dead (step 3).\n- **CLI entry points invoked only by name** from `package.json` `bin`\u002F`scripts`, a shebang, or a\n  Makefile are real usages grep won't see as a symbol reference — this is exactly what the\n  low-confidence entry-point classification exists to catch; don't loosen that filter.\n- **Go `Test*` functions are called by the test runner via naming convention, not by any textual\n  reference** — `func TestFoo(t *testing.T)` matches the exported-func pattern (uppercase start)\n  and will show zero other references, since nothing ever calls it by name in source. Live-checked\n  against canon's own `tools\u002Fcanon-go\u002Finternal\u002Fdaemon\u002Fmain_test.go`: `TestPreviewRootFor` has exactly one\n  match repo-wide — its own declaration. Always exclude `^func Test[A-Z]` (and `^func Benchmark[A-Z]`\n  \u002F `^func Example[A-Z]`) from Go candidates before counting references, rather than relying on\n  the entry-point low-confidence filter to catch them — they aren't entry-point files, they're a\n  distinct convention-dispatched class.\n","# Dead Code Cleanup\n\nFinds code that nothing calls and reports it — it does not delete anything on its own. The scan\nedits no existing file; it writes a structured `dead-code-report.md` (confirm-first) and, only on\nper-candidate confirmation, removes code as a normal gated edit.\nComplements `mutation-test` (which checks whether *existing* tests have teeth): this skill checks\nwhether the code those tests cover is still reachable at all.\n\n**Advisory-first, manual-trigger only.** No scheduling, no auto-PR, no auto-delete. Removal, once\nthe user confirms a candidate, is a normal code edit that goes through the sprint's existing\nreview\u002Feval gates like any other change — this skill never bypasses them.\n\n## Scope\n\n- Default scope is the repo root (`git rev-parse --show-toplevel`). A user-supplied path or glob\n  narrows it.\n- Always exclude `node_modules`, `.git`, `dist`, `build`, `__pycache__`, and any vendor directory.\n- If scope resolution fails (not a git repo, or `git rev-parse` errors), report that and stop —\n  never fall back to scanning an unbounded filesystem path.\n\n## The scan (follow exactly)\n\n**Run the scanner first.** Steps 1–3 are implemented by canon's `dead-code-scan.sh` (Bash, git and\nawk only, so it runs in Git Bash on Windows): `bash ~\u002F.canon\u002Ftools\u002Fdead-code-scan.sh [\u003Cpath>...]`\n(in the canon repo itself, `bash tools\u002Fdead-code-scan.sh`). It prints one tab-separated row per\ncandidate — `class  file:line  symbol  lang  entry  refs`, class `DEAD`\u002F`TESTONLY`\u002F`OVEREXP` — then\n`# scanned:`, `# skipped:` and `# checked:` lines; it exits 2 outside a git repo. It reads tracked\nfiles only (commit or `git add` new code first). Copy `# scanned:` and `# skipped:` into the\nSummary's `Languages scanned`\u002F`Languages skipped` rows as printed — a language with no candidates\nwas still scanned. Its rows are the\ncandidate list: report **every** row, never a sample, and do not re-derive them by hand — a model\nchecking hundreds of symbols one grep at a time skips most of them. Your part is the judgment the\nscript cannot make: the entry points and dynamic dispatch in step 3 and the Gotchas. Only if the\nscript is missing, follow steps 1–3 by hand and say in the report that the scan was manual and may\nbe incomplete.\n\n1. **Extract candidate declarations.** Grep-based, one pattern set per language present in\n   scope:\n   - JS\u002FTS (`.js`, `.ts`, `.jsx`, `.tsx`): `export [async] (function|const|class) \u003CName>` (an *export*)\n   - Python (`.py`): top-level `def \u003Cname>` \u002F `class \u003CName>` not prefixed with `_`\n   - Go (`.go`): top-level `func \u003CName>(` — exported (uppercase start, an *export*) and unexported\n     (lowercase start) alike. Exclude `main`, `init`, and `Test*`\u002F`Benchmark*`\u002F`Example*`\n     (runtime\u002Ftest-runner convention, not a static reference — see Gotchas). Methods\n     (`func (r T) Name(`) are not candidates: interface satisfaction calls them without a name.\n   - Bash (`.sh`, `.bash`, and extensionless files whose first line is a `sh`\u002F`bash` shebang, e.g.\n     `#!\u002Fusr\u002Fbin\u002Fenv bash`): top-level `\u003Cname>() {` or `function \u003Cname>` declarations\n\n   Skip any language not in this list — do not guess a pattern for an unfamiliar language. But\n   never skip silently: count the files in scope with one of these common source extensions —\n   `.cs .rs .java .kt .rb .php .swift .c .h .cpp .scala .lua .ps1` — and report each extension\n   found, with its file count, under `Languages skipped` (step 4). Data and doc files (`.md`,\n   `.json`, `.yml`, …) are not source and are never listed.\n\n2. **Count code references.** For each candidate symbol, `grep -rnw` the symbol across the scope,\n   excluding the declaration's own line. Only a **code reference** counts. Drop a match when:\n   - it is in a doc file: `*.md`, `*.txt`, `CHANGELOG*`, or anything under `.tickets\u002F` or\n     `.reports\u002F` (mentions in prose, tickets, changelogs and earlier reports never keep code alive);\n   - its line is comment-only — its first non-space characters are `#`, `\u002F\u002F`, `\u002F*` or `*` (a\n     shebang line counts as a comment).\n\n   Then sort the remaining code references by where they are:\n   - **test** — in a test file: anything under `tests\u002F`, `test\u002F` or `__tests__\u002F`, or named\n     `*.test.*`, `*.spec.*`, `*_test.go`, `test_*.py` or `*_test.py`;\n   - **own file** — in the declaring file itself;\n   - **other** — any other non-test file.\n\n3. **Classify.** Each candidate lands in at most one class:\n   - **Dead** — no code reference at all.\n   - **Test-only** — code references exist, but only in test files (the production code is\n     reachable only from its tests).\n   - **Over-exported** — an *export* (JS\u002FTS export or exported Go func) whose only code references\n     are in its own file — no other file and no test uses it: live code, but the export (or Go\n     capital letter) is unneeded. A test that imports the export needs it, so that is live.\n   - Otherwise live — not reported. For a non-export (Python, unexported Go, Bash), a call in its\n     own file is a normal use and makes it live.\n\n   A candidate declared **in a test file** can only be Dead: a test helper used by tests is live,\n   never Test-only or Over-exported.\n\n   Then set confidence on Dead rows (a Test-only or Over-exported row in an entry-point file\n   just says so in its Reason):\n   - **High** — the declaring file is not an entry-point pattern.\n   - **Low** — the declaring file matches an entry-point pattern:\n     `index.*`, `__init__.py`, `main.go`, `cli.*`, or any file a `package.json`\u002Fshebang\u002Fbuild\n     config names directly. These are likely public API surface or process entry points invoked\n     by name from outside grep's reach — flag them, don't bury them, but don't recommend removal.\n     **Exception — Bash functions and unexported Go funcs never take the downgrade:** a Bash\n     function can only be called from its own script or a file that `source`s it, and an unexported\n     Go func only from its own package; grep sees all of those, so they stay High. The scanner's\n     `entry` column applies the filename and shebang patterns and this exception; check the\n     `package.json`\u002Fbuild-config case yourself.\n\n4. **Report.** The scan itself edits no file. Print the Summary inline, then — **confirm-first**,\n   mirroring `context-check`\u002F`context-doctor` — write a structured `dead-code-report.md` at the\n   repo root: ask `Write dead-code-report.md to the repo root? (y to confirm)`, overwrite if present\n   (a point-in-time snapshot, not a log). Structure:\n\n   ```markdown\n   # Dead Code Report\n\n   _Scope: \u003Cpath> · Generated: \u003CISO date>_\n\n   ## Summary\n\n   | Metric | Count |\n   |---|---|\n   | High-confidence dead | N |\n   | Low-confidence dead (entry-point) | M |\n   | Test-only callers | T |\n   | Over-exported | O |\n   | Languages scanned | js, py, go, sh |\n   | Languages skipped | .rs (12 files), .cs (3 files) — or `none` |\n\n   > Advisory only — nothing removed. Confirm candidates to remove; removals go through the sprint's gates.\n\n   ## High-confidence candidates\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Ffoo.js:12 | oldHelper | function | no code references in scope |\n\n   ## Low-confidence — verify manually\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | cli\u002Findex.py:1 | main | function | entry-point file — likely invoked by name |\n\n   ## Test-only callers\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Ffmt.py:40 | legacy_format | function | called only from tests\u002Ftest_fmt.py |\n\n   ## Over-exported\n\n   | File:line | Symbol | Kind | Reason |\n   |---|---|---|---|\n   | src\u002Fview.js:29 | rowFor | function | exported, used only in its own file — drop the export |\n\n   ## Caveats\n\n   - Dynamic dispatch\u002Freflection, barrel re-exports, string-only references, CLI entry points, and\n     test-runner conventions can hide real callers — spot-check before removing (see Gotchas).\n   - Languages skipped were not scanned at all: zero candidates says nothing about them.\n   ```\n\n   Render `None.` under a candidate section with no rows. If **all** tables are empty, still write\n   the report (all `None.`) and say so — a clean result, not a no-op — and name any languages\n   skipped in that sentence, so a clean result never hides an unscanned codebase. The `Kind` column is the\n   declaration type (`function`\u002F`class`\u002F…); confidence is expressed by which table a row lands in.\n\n## Confirm-then-remove loop\n\nAfter the report:\n\n1. Ask the user which candidates (if any) to remove — accept a batch selection, not just one at\n   a time. **Before applying any removal, surface the working-tree state** — check\n   `git status --porcelain`; if there are uncommitted changes, tell the user the removals will be\n   added to their current diff and offer **commit-first \u002F proceed-anyway \u002F cancel**. This is an\n   *informed confirmation, not a hard clean-tree gate*: git makes every removal revertible\n   per-file (`git restore \u003Cfile>`) whether or not the tree was clean, so never block on a dirty\n   tree — just make the undo choice visible (t-2201). A clean tree only buys a tidier isolated\n   diff, which the user may or may not want.\n2. For each confirmed candidate, remove the declaration (and now-orphaned code it alone made\n   reachable, if obviously scoped to it) with a normal edit.\n3. The removal becomes part of whatever sprint is active. It is graded by that sprint's own\n   acceptance criteria and gates — this skill does not run its own separate close process.\n4. If no sprint is active when removal is confirmed, say so and suggest `sprint start` before\n   editing — don't edit outside an active sprint's diff.\n\n## Gotchas\n\n- **`evals.json` is source text.** A real symbol named in an eval prompt counts as a reference, so a scan finds it live. A skill whose job covers every item of a large set hands the loop to a script: models following prose sample the set (Haiku found 0 of 3) (`t-271a`).\n- **Dynamic dispatch and reflection** (`getattr(obj, name)`, `eval`, string-keyed routing\n  tables) call a symbol by name at runtime — grep finds zero static references even though the\n  symbol is live. Treat any candidate near a router\u002Fregistry\u002Fdispatch table with suspicion; ask\n  before removing.\n- **String-only references** — a mention in docs, tickets, CHANGELOG, earlier reports or a\n  comment is dropped (step 2): it never keeps code alive. A mention in a YAML config or CI\n  workflow still counts — it may be a real call (`run: tools\u002Ffoo.sh`). The pattern is name-based,\n  not import-graph-based, so `grep -w` can also miss a real caller to word-boundary quirks (e.g.\n  template-literal interpolation, a Bash function name containing `-`). Spot-check a sample of\n  Dead results before trusting the count at scale.\n- **Bash string-built calls** — `\"cmd_$sub\"` or `$handler \"$@\"` calls a function whose name grep\n  never sees whole. A static `case` dispatch (`start) cmd_start \"$@\" ;;`) is a normal reference.\n  Before reporting a Bash function Dead, check its file for a variable used as a command name; if\n  one exists and the function's name fits the prefix, move it to Low-confidence.\n- **Barrel\u002Fre-export files** (`export * from '.\u002Ffoo'`) make a symbol look referenced by the\n  barrel file itself even when nothing imports it *from* the barrel — this heuristic will\n  under-report in that case, not over-report; treat \"zero candidates\" from a heavily-barrelled\n  codebase with caution.\n- **Test-only callers** — production code reachable only from its tests is its own class, not\n  live: the tests keep it compiling, nothing ships through it. Remove the code and its tests\n  together, or keep it if the test pins a contract a future caller needs. Helpers declared inside\n  test files are not reported unless Dead (step 3).\n- **CLI entry points invoked only by name** from `package.json` `bin`\u002F`scripts`, a shebang, or a\n  Makefile are real usages grep won't see as a symbol reference — this is exactly what the\n  low-confidence entry-point classification exists to catch; don't loosen that filter.\n- **Go `Test*` functions are called by the test runner via naming convention, not by any textual\n  reference** — `func TestFoo(t *testing.T)` matches the exported-func pattern (uppercase start)\n  and will show zero other references, since nothing ever calls it by name in source. Live-checked\n  against canon's own `tools\u002Fcanon-go\u002Finternal\u002Fdaemon\u002Fmain_test.go`: `TestPreviewRootFor` has exactly one\n  match repo-wide — its own declaration. Always exclude `^func Test[A-Z]` (and `^func Benchmark[A-Z]`\n  \u002F `^func Example[A-Z]`) from Go candidates before counting references, rather than relying on\n  the entry-point low-confidence filter to catch them — they aren't entry-point files, they're a\n  distinct convention-dispatched class.\n",{"name":5,"tags":24,"category":29,"description":7},[25,26,27,28],"cleanup","code-quality","dead-code","verification","dev","main","3e6c9d35455e8e206133380135b560ddb8b58c0e","skills\u002Fdead-code-cleanup",1,"https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills","https:\u002F\u002Fgetcanon.dev","https:\u002F\u002Fgithub.com\u002Fsunitghub","2026-11-15 03:47:49",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add sunitghub\u002Fcanon-skills --skill dead-code-cleanup",{"tool":44,"command":45},"bunx","bunx skills add sunitghub\u002Fcanon-skills --skill dead-code-cleanup",{"tool":47,"command":48},"pnpm","pnpm dlx skills add sunitghub\u002Fcanon-skills --skill dead-code-cleanup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdead-code-cleanup\u002FSKILL.md",true,[52,58,64],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"evals\u002Fevals.json","REFERENCE","参考文档",6302,"https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdead-code-cleanup\u002Fevals\u002Fevals.json",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"evals\u002Fhistory.jsonl","OTHER","其他",69,"https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdead-code-cleanup\u002Fevals\u002Fhistory.jsonl",{"path":65,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":66,"sourceHtmlUrl":67},"skill-eval-result.md",3466,"https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdead-code-cleanup\u002Fskill-eval-result.md",[69,76,83,90,96,103],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M75JK2VBM156TBGG9CM9RS34","no-evals","A skill with no evals folder.","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-check\u002Fno-evals\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M75JK0PTGT7Y2HMWTGPVYT16","hooks","Registers a hook and pushes code.","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-check\u002Fhooks\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M75JJYWMTD3CWT18DRYHG82H","good","Formats commit messages. Use when the user asks for a commit message.","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-check\u002Fgood\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":6,"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},"01M75JJX1CRZJS5XJECST8QR9Q","bad-frontmatter","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-check\u002Fbad-frontmatter\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},"01M75JJTCMGGRFG5RNEJMKJ8AN","wrapup","Internal close-pipeline invoked by sprint complete — quality checks, code review, cleanup. Not for direct use; a normal\u002Fhigh-risk sprint's own \"sprint complete\" step calls this automatically.","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrapup\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M75JJP7CEJQDYQ490EEJKFCP","sprint","Manages the sprint workflow for focused changes. Use when asked to add, fix, update, implement, debug, or build — see the Workflow tiers section for what's out of scope.","https:\u002F\u002Fgithub.com\u002Fsunitghub\u002Fcanon-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsprint\u002FSKILL.md",[],[]]