rahulsub/code-practices-plugin/cleanup

Claude Code and agent skill by rahulsub/code-practices-plugin

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Systematic code cleanup after completing features. Use after refactoring or periodically to remove dead code, console statements, TODOs, and tech debt.

Install

npx vskill@latest install rahulsub/code-practices-plugin/cleanup

SKILL.md

The same SKILL.md was published earlier as rahulsub/code-practices-plugin/cleanup.

Code Cleanup Skill

Trigger

Use after completing a feature, after refactoring, or periodically to maintain code health.

The Problem

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.

Cleanup Checklist

1. Dead Code

Remove code that is never executed:

bash
# 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:

  • [ ] Functions that are never called
  • [ ] Variables that are assigned but never read
  • [ ] Imports that are never used
  • [ ] Components that are never rendered
  • [ ] CSS classes that are never applied
  • [ ] Feature flags that are always on/off
2. Commented-Out Code

Delete it. Git remembers.

typescript
// BAD: Leaving commented code
// function oldImplementation() {
// // 50 lines of dead code...
// }
function newImplementation() { ... }
// GOOD: Just delete it
function newImplementation() { ... }
3. Console Statements

Remove debugging artifacts:

bash
# Find console.log statements
grep -r "console\." src/ --include="*.ts" --include="*.tsx"
4. TODO Comments

Address or delete:

  • If it's important, do it now or create an issue
  • If it's not important, delete the comment
bash
# Find TODOs
grep -r "TODO\|FIXME\|HACK\|XXX" src/
5. Duplicate Code

Look for copy-paste patterns:

bash
# Find duplicate code blocks
npx jscpd src/

If you see the same logic in multiple places, extract it.

6. Orphaned Files

Files that aren't imported anywhere:

bash
# Find files not imported by anything
npx unimported
7. Obsolete Dependencies

Dependencies that are no longer used:

bash
npx depcheck
8. Type Assertions

Unnecessary as casts that hide type errors:

typescript
// 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)) { ... }

After Cleanup

  1. Run all tests
  2. Run the linter
  3. Run type checking
  4. Do a visual review of the changes

Output Report

## 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%)

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/rahulsub/code-practices-plugin/cleanup/badge)](https://verified-skill.com/skills/rahulsub/code-practices-plugin/cleanup)

Something wrong with this skill or its page? Tell us.