audit-dead-code
Audit Dead Code
Audit reachability before deleting anything. Build a proof chain from live entrypoint to candidate, then apply the smallest safe removal.
Follow this workflow
- Map the codebase entrypoints, public surfaces, and dynamic loading surfaces in scope.
- Search for references from public surfaces inward, not just from the candidate itself.
- Classify each candidate as unused export, unreachable code, orphaned file, stale feature flag, dead registration, or legacy compatibility path.
- Build a proof chain with code search, config or registry checks, framework conventions, and typecheck, build, or tests where available.
- Prioritize findings as
P1throughP4. - Auto-fix only local, low-risk removals. Leave broader deletions as findings with a concrete removal plan.
Map live entrypoints first
Do not start deleting from leaf files without understanding how code can be reached.
Inspect the relevant equivalents of:
More from sebkay/skills
generate-agent-instructions
Generate or update AGENTS.md for AI coding agents by extracting project-specific architecture, workflows, conventions, and integration details from the repository. Use when the user asks to create, refresh, or improve AGENTS.md or agent instructions for a codebase.
23commit
Create a focused git commit for the unit of work just completed. Use when the user asks to commit changes, record finished implementation work, save a fix or refactor to git, or prepare a clean commit from the current branch with a concise message.
16ask-plan-questions
Ask high-impact clarifying questions before implementation to reduce mistakes, rework, and hidden assumptions. Use when creating, reviewing, or updating a plan; when requirements are ambiguous; or when scope/constraints are not fully specified.
15add-plan-todos
Create and maintain granular todos in the active execution plan to reduce omissions, sequencing errors, and misunderstandings. Use when drafting a plan, updating scope, starting implementation, or recovering from uncertainty/blockers.
12audit-errors
Audit code for error-handling inconsistencies, anti-patterns, and silent failures such as empty catch blocks, ignored promise rejections, log-and-continue paths, fallback values that hide faults, broad catch clauses, and inconsistent error translation across layers. Use when reviewing controllers, services, jobs, API handlers, async workflows, UI actions, or any change where errors may be swallowed, downgraded, or surfaced unreliably.
10finalise-plan
Stress-test implementation, execution, rollout, migration, or task plans for missing steps, bad sequencing, weak assumptions, hidden dependencies, vague acceptance criteria, and inadequate validation. Use when a plan has just been drafted or revised, when inheriting someone else's plan, before starting implementation, or when a plan needs one last quality pass before execution.
9