Skip to content

audit-dead-code: detect unreferenced files in any language #4523

Description

@kyle-sexton

Summary

code-tidying:audit-dead-code 0.23.2 advertises "orphaned files" (SKILL.md:2). SKILL.md:36 limits
that to TS/JS, and in practice it also needs a package.json root because it comes from knip. In a
scripts-only repo, an unreferenced script is the likeliest form of dead code, and no lane checks for
it. This covers shell, PowerShell, Python entry points, standalone JS, and files in languages with
no lane.

In melodic-software/.github, a manual check proved each script file alive by a basename reference
search. The references came from .claude/settings.json:20, .cursor/environment.json:4, and
.github/workflows/ci.yml:127. The skill has no equivalent.

Fix

  • Add a language-agnostic unreferenced-file shape at T2. It reuses the grep lane's repo-wide
    reference search, keyed on the file basename and its repo-relative path, and is limited to
    source-language files.
  • Count a reference from CI workflows, settings, manifests, and docs as alive evidence. That
    evidence is what saves scripts that are invoked only by path.
  • Name the known blind spot: a file loaded by a computed path or glob. The report should list it as
    uncertain, not dead.
  • Update SKILL.md:2 and SKILL.md:36 to state the new coverage.

Verification

  • Done when a fixture with one script referenced from a workflow and one referenced nowhere yields
    exactly one unreferenced-file candidate.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageNot yet classified. Floor until a type and one priority tier are set.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions