Safely determine whether a directory, file, exported symbol, function, component, constant, hook, type, or helper is unused before deleting it. Use for agent-assisted dead-code cleanup, unused code detection, unused export audits, deletion safety checks, consumer searches, and cleanup validation without breaking re-exports, aliases, public APIs, framework entrypoints, generated files, or external consumers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/page-flow-cleanup-audit:unused-code-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Treat every automated result as a candidate, not proof. Delete only when usage, entrypoint, side-effect, and public API risks have been ruled out.
Treat every automated result as a candidate, not proof. Delete only when usage, entrypoint, side-effect, and public API risks have been ruled out.
Prefer small, evidence-backed removals. Do not shrink public API surfaces merely because a type or export name has no direct import; generated declarations and inferred consumer types can still depend on it.
This skill answers "is anyone still consuming this?" It does not answer the broader question "is this still necessary?" For used-but-unnecessary code, switch to necessary-code-audit.
This skill is part of a three-skill cleanup system:
unused-code-audit to prove whether code is still consumed.necessary-code-audit when code is used but may no longer be necessary.page-flow-cleanup-audit when the target includes page state, queries, mutations, permissions, errors, or user-visible behavior.git status --short --untracked-files=all.git diff --name-status -- <scope> and git diff --cached --name-status -- <scope>.rg --files <scope> or the fastest available file search tool.Classify before searching deeply:
file: module, route, style, setup, generated entrypoint, or side-effect file.runtime export: function, component, hook, class, constant, store, or factory.public type/API: exported interface/type/config used by package declarations or factory return types.member: property, method, action, enum member, or config field.local helper: non-exported helper inside one file.The class determines the risk. Public APIs, framework entrypoints, side-effect files, and persisted data require stronger proof than local helpers.
Use evidence in this order:
Structure:
Literal search:
rg.Sweep candidates when useful:
Keep the code unless these are ruled out:
Delete only when all are true:
rg for every deleted symbol, file stem, and import path.git diff --check -- <scope> and, if staged changes exist, git diff --cached --check -- <scope>.Report three things:
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub danhuaxiansheng/claude-code-cleanup-skills --plugin claude-code-cleanup-skills