| name | refactor-clean |
| description | Remove dead code and clean up structure |
Clean up the codebase by removing dead code and improving structure.
Scope: the task/scope the user described when invoking this skill (if none given, ask or infer from context) (or entire project if not specified)
Process
- Use tooling first where available:
npx knip, npx depcheck, npx ts-prune.
- Cross-reference every candidate with Grep to verify it's truly unused (check for dynamic/string-based imports, reflection).
- Detect: unused exports/functions/variables/types, unused imports, duplicated logic, unused packages in package.json.
- Remove confirmed dead code in small batches.
- Run build/tests after each batch.
- Report all changes made.
Rules
- Verify before removing — grep for dynamic usage.
- Remove in small batches, test between each.
- Don't remove code marked TODO/FIXME without flagging it.
- Preserve public API surface unless explicitly asked to change it.