necessary-code-auditlisted
Install: claude install-skill danhuaxiansheng/code-cleanup-skills
# Necessary Code Audit
## Principle
Optimize for current necessity, not only for zero references. A symbol can be used and still be unnecessary when it is only a wrapper, compatibility surface, defensive branch, stale public API, or speculative extension point.
The core trigger is: "this code is used, but does current code really need it?"
Do not delete real runtime constraints. Keep branches that represent actual loading, empty, error, permission, lifecycle, browser, SSR, quota, external input, or domain-nullable states.
## Skill System
This skill is the primary entrypoint for a three-skill cleanup system:
- Use `necessary-code-audit` to decide whether used code is still necessary.
- Use `unused-code-audit` to prove whether deletion candidates are still consumed.
- Use `page-flow-cleanup-audit` when the target includes page state, query/mutation flow, permissions, error states, stores, or user-visible behavior.
Do not require repository-specific graph tools or project-specific agent skills. Use the best local tools available in the environment, such as file listings, language tooling, typecheck/build commands, manifests, import graphs, and text search.
This skill is useful for any AI coding agent or human reviewer that can read Markdown instructions. Do not assume a specific AI product.
## Baseline
Start with:
- `git status --short --untracked-files=all`
- `git diff --name-status -- <scope>`
- `git diff --cached --name-status -- <scope>`
- File inventory for the