Skip to content
Back to skills

Refactor Clean

ASecurity

Remove dead code, unused dependencies, and reduce complexity. Invokes the refactor-cleaner agent.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 14, 2026
ai-agentsrefactoring

Security analysis

A100/100

Scanned October 14, 2026

npx -y skills add peopleforrester/claude-dotfiles --skill refactor-clean --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactor Clean?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refactor Clean
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peopleforrester-refactor-clean/badge)](https://www.skillsdirectory.com/skills/peopleforrester-refactor-clean)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refactor-clean
description: Remove dead code, unused dependencies, and reduce complexity. Invokes the refactor-cleaner agent.
user-invocable: true
---
# /refactor-clean - Dead Code Removal

Invoke the **refactor-cleaner** agent to clean up the codebase.

## Usage

```
/refactor-clean                 # Full codebase scan
/refactor-clean src/            # Scan specific directory
/refactor-clean --deps          # Focus on unused dependencies
/refactor-clean --imports       # Focus on unused imports only
```

## What Gets Cleaned

1. **Dead Code** - Unused functions, variables, and exports
2. **Unused Dependencies** - Packages in package.json not imported anywhere
3. **Unused Imports** - Import statements with no references
4. **TODO/FIXME Audit** - Stale comments that should be resolved or tracked
5. **Complexity Hotspots** - Functions over 50 lines, files over 500 lines

## Safety Guarantees

- Tests must pass before any refactoring begins
- One change at a time with test verification
- Code is removed completely (never commented out)
- All callers are verified before removing functions
- Refactoring commits are kept separate from feature commits

## Output

```markdown
## Refactoring Report

### Dead Code Found
| Type | Location | Action |
|------|----------|--------|
| Unused function | file:line | Removed |
| Unused import | file:line | Removed |

### Metrics
- Dead code removed: X lines
- Dependencies cleaned: Y packages
- Complexity reduced: Z functions simplified
```

## When to Use

- After completing a feature (cleanup pass)
- Before major releases
- When onboarding new team members (reduce confusion)
- Periodically (monthly codebase hygiene)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.