Command Palette

Search for a command to run...

Назад к скиллам
скилл № 89037

refactor-clean

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

БесплатноБез исполняемых скриптов
Luohaothuот Luohaothu★ 24 звезды на GitHub

Установить refactor-clean в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

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

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл refactor-clean?

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

Как установить скилл refactor-clean?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл refactor-clean запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить refactor-clean с