Help us improve
Share bugs, ideas, or general feedback.
From code-practices
Systematic code cleanup after completing features. Use after refactoring or periodically to remove dead code, console statements, TODOs, and tech debt.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin rahulsub-code-practices-pluginHow this skill is triggered — by the user, by Claude, or both
Slash command
/code-practices:cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use after completing a feature, after refactoring, or periodically to maintain code health.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides systematic root-cause debugging when tests fail, builds break, or unexpected errors occur. Provides a structured triage checklist to preserve evidence, localize, and fix issues instead of guessing.
Share bugs, ideas, or general feedback.
Use after completing a feature, after refactoring, or periodically to maintain code health.
Karpathy: "They don't clean up dead code after themselves... They will implement an inefficient, bloated, brittle construction."
LLMs leave messes. This skill systematically cleans them up.
Remove code that is never executed:
# Find unused exports in TypeScript
npx ts-prune
# Find unused dependencies
npx depcheck
# Find unused variables (ESLint)
npx eslint --rule 'no-unused-vars: error' src/
Manual checks:
Delete it. Git remembers.
// BAD: Leaving commented code
// function oldImplementation() {
// // 50 lines of dead code...
// }
function newImplementation() { ... }
// GOOD: Just delete it
function newImplementation() { ... }
Remove debugging artifacts:
# Find console.log statements
grep -r "console\." src/ --include="*.ts" --include="*.tsx"
Address or delete:
# Find TODOs
grep -r "TODO\|FIXME\|HACK\|XXX" src/
Look for copy-paste patterns:
# Find duplicate code blocks
npx jscpd src/
If you see the same logic in multiple places, extract it.
Files that aren't imported anywhere:
# Find files not imported by anything
npx unimported
Dependencies that are no longer used:
npx depcheck
Unnecessary as casts that hide type errors:
// BAD: Hiding type errors
const user = data as User;
// GOOD: Proper type guards
function isUser(data: unknown): data is User {
return typeof data === 'object' && data !== null && 'id' in data;
}
if (isUser(data)) { ... }
## Cleanup Summary
### Removed
- 3 unused functions (150 lines)
- 12 unused imports
- 5 commented-out code blocks
- 2 unused dependencies
### Remaining Issues
- 8 TODO comments (see issues #12, #13)
- 3 console.log statements (intentional for debugging feature X)
### Lines Before: 5,432
### Lines After: 5,150
### Reduction: 282 lines (5.2%)