# Declutter

> Refactors code by removing unused imports, variables, methods, redundant comments, and fixing formatting, with automatic test runs and commits after each step.

- Skill: `sdiamante13/declutter` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sdiamante13/declutter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sdiamante13/declutter/raw
- Safety review: CAUTION (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools, Refactoring
- Tags: Code Cleanup, Dead Code, Git Commit, Refactoring, Unused Imports, Unused Variables
- Author: SDiamante13 (https://skillmd.com/u/sdiamante13)
- Updated: 2026-08-22
- Page: https://skillmd.com/skills/sdiamante13/declutter

---


# Declutter Refactor

Ask the user for the file or directory to refactor. Support multiple files if a directory is provided.

## Process

Work through these steps in order, making a separate commit for each step that finds issues:

1. Remove unused imports
2. Remove unused variables
3. Remove unused methods
4. Remove redundant/unnecessary comments
5. Fix inconsistent formatting

After EACH step:
- Run tests automatically
- If tests fail, revert the change immediately
- If tests pass and changes were made, commit using Arlo's Commit Notation: `. r <brief description>`
- If no issues found in that category, skip silently to next step

## Output

Provide a brief summary at the end listing what was removed (e.g., "Removed 3 unused imports, 2 unused methods").

## Commit Format

Use Arlo's Commit Notation (ACN):
- Format: `. r <description>`
- Example: `. r remove unused imports`
- The `.` indicates "proven safe" (tests passed)
- The `r` indicates refactoring

