agentsclimarketplace

Cleanup

Skill rahulsub/code-practices-plugin/skills/cleanup

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

Install
npx -y skills add rahulsub/code-practices-plugin --skill cleanup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.8 KB, as published. Nobody here has run it

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:

# 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.

// 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:

# 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
# Find TODOs
grep -r "TODO\|FIXME\|HACK\|XXX" src/

5. Duplicate Code

Look for copy-paste patterns:

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

# Find files not imported by anything
npx unimported

7. Obsolete Dependencies

Dependencies that are no longer used:

npx depcheck

8. Type Assertions

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

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

Keep looking

Skills are one crate of 608,475. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.