Summary
code-tidying:audit-dead-code 0.23.2 detects dead JS/TS only through knip, and knip runs only
under a package.json root. Standalone scripts get no dead-code check at all. Examples are
.github/scripts/*.mjs, CI helpers, and dotfiles tooling. This is common in org .github, CI, and
config repos.
In melodic-software/.github, a manual whole-word grep found contentsUrl and runLiveCheck in
.github/scripts/pr-section-drift.mjs. Both are exported but used only inside that file. The skill
never saw the file.
Fix
Options, cheapest first. Measure precision on the trap fixtures before choosing a tier.
- Grep-lane fallback. Only
shell|pwsh files enter the grep lane (scripts/dead-code-scan.sh:225),
and dc_symbol_defs extracts definitions only for those two
(scripts/lib/dead-code-shapes.sh:442-469). The repo-wide reference search already covers every
tracked file (scan:638-640). Route TS/JS files that no package.json root owns to the grep
lane, and add a definition regex for function, class, const and export declarations.
- knip without a manifest. Check whether knip can run over loose files with a generated
temporary config outside the repo. Not verified.
- Exports used only in their own file. Report them at the lowest tier from whichever lane
covers the file. Whether knip itself flags them by default is not verified.
Verification
- Done when a fixture with a standalone
.mjs that holds one unreferenced function produces a
candidate for it, and a referenced function does not.
- Precision is measured on the existing trap-fixture corpus and recorded in the SKILL.md lane table.
Related
Summary
code-tidying:audit-dead-code0.23.2 detects dead JS/TS only through knip, and knip runs onlyunder a
package.jsonroot. Standalone scripts get no dead-code check at all. Examples are.github/scripts/*.mjs, CI helpers, and dotfiles tooling. This is common in org.github, CI, andconfig repos.
In
melodic-software/.github, a manual whole-word grep foundcontentsUrlandrunLiveCheckin.github/scripts/pr-section-drift.mjs. Both are exported but used only inside that file. The skillnever saw the file.
Fix
Options, cheapest first. Measure precision on the trap fixtures before choosing a tier.
shell|pwshfiles enter the grep lane (scripts/dead-code-scan.sh:225),and
dc_symbol_defsextracts definitions only for those two(
scripts/lib/dead-code-shapes.sh:442-469). The repo-wide reference search already covers everytracked file (
scan:638-640). Route TS/JS files that nopackage.jsonroot owns to the greplane, and add a definition regex for
function,class,constandexportdeclarations.temporary config outside the repo. Not verified.
covers the file. Whether knip itself flags them by default is not verified.
Verification
.mjsthat holds one unreferenced function produces acandidate for it, and a referenced function does not.
Related
playbooks:repo-sweepsweep ofmelodic-software/.github(PR chore(skill-quality): harden static checker + record terminal retrofit scope #153).