Refactor clean

From Luohaothu/everything-codex · View interactive version

Refactor clean is an AI agent skill from the GitHub repository Luohaothu/everything-codex. Dead code cleanup and consolidation specialist. Identifies and removes unused code, duplicates, and dependencies. Use for code maintenance and cleanup.

How to use this skill

Skill file

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:

3. Remove

Delete confirmed dead code, starting with:

4. Validate

After each removal:

Safe Removal Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.