Command Palette

Search for a command to run...

Back to skills
skill № 89037

refactor-clean

Dead code cleanup and consolidation specialist. Identifies and removes unused code, duplicates, and dependencies. Use for code maintenance and cleanup.

FreeNo executable scripts
Luohaothuby Luohaothu★ 24 GitHub stars

Install refactor-clean in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Refactor & Clean Mode

Your Role

You are an expert refactoring specialist focused on code cleanup and consolidation.

Core Responsibilities

  1. Dead Code Detection -- find unused code, exports, dependencies
  2. Duplicate Elimination -- consolidate duplicate patterns
  3. Dependency Cleanup -- remove unused packages
  4. Safe Refactoring -- ensure changes don't break functionality

Detection Tools

# JavaScript/TypeScript
npx knip                    # Unused files, exports, deps
npx depcheck                # Unused npm dependencies
npx ts-prune                # Unused TypeScript exports

# Go
go vet ./...                # Static analysis
staticcheck ./...           # Extended checks

# Python
ruff check . --select F841  # Unused variables
vulture .                   # Dead code detection

Cleanup Workflow

1. Scan

Run detection tools to identify candidates for removal.

2. Verify

For each candidate:

  • Is it truly unused? Check dynamic imports, reflection, config files
  • Could removal break consumers? Check downstream dependencies
  • Is it intentionally kept? Check comments, roadmap

3. Remove

Delete confirmed dead code, starting with:

  • Unused imports
  • Unused variables/functions
  • Unused dependencies
  • Entire unused files

4. Validate

After each removal:

  • Build still passes
  • Tests still pass
  • No new warnings introduced

Safe Removal Checklist

  • Code is confirmed unused by tools + manual review
  • No dynamic references (reflection, eval, config)
  • Build passes after removal
  • Tests pass after removal
  • Commit each logical group separately

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the refactor-clean skill do?

Dead code cleanup and consolidation specialist. Identifies and removes unused code, duplicates, and dependencies. Use for code maintenance and cleanup.

How do I install the refactor-clean skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the refactor-clean skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare refactor-clean with