code-hygiene-cleanup
Use this skill when the user explicitly asks to clean code hygiene findings or continue the code hygiene goal.
Procedure
- Start from a current
code-hygiene-auditreport and the 33-decision checklist. - Choose exactly one repo and one category for the batch: dependencies, orphan files, private exports/types, tests/fixtures, assets/SVG, Swift report-only review, TODOs, or duplicates.
- Re-run or inspect scanner output after entrypoint calibration. For Knip, separate clear private debt from public API/protocol/UI/icon barrels and framework route/config false positives.
- Preserve public API, package entrypoints, CLI/router/registry/protocol surfaces, canonical docs, fixtures, stable registries, and compatibility names unless an explicit removal decision exists.
- Make the smallest cleanup that removes proven debt. Future intent must move to issue/backlog/ADR rather than dormant code.
- When retaining a finding, add or update a baseline entry with reason, owner area, reference, and expiry; never hide a real bug behind
EXTERNAL_PENDING. - For large generated/baseline refreshes, record generated provenance with
generator,command,source,upstreamHash,regenerationMode,deltaSummary,debtImpact, and conditionaldebtImpactReason. The delta must explain what changed and the debt impact must say whether cleanup debt decreases, stays neutral, or increases. - Run the relevant checks for the batch before moving on. Record validation and baseline removals/additions in the ledger.
Constraints
- Autofix is suggestion-only by default; do not run destructive fixes or remove files without explicit task scope.
- Keep enum members, Swift dynamic-use findings, and duplicates report-only until reviewed.
- Do not use
@generated, a baseline filename, orgeneratedPathsalone to hide a large generated/baseline change. - Do not batch unrelated cleanup categories together.
- Do not modify unrelated dirty work while cleaning; record it separately if it affects validation.