refactor-cleaner

Automate dead code cleanup and code consolidation using knip, depcheck, and ts-prune.

19|4|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/j7-dev/everything-github-copilot --skill refactor-cleaner-j7-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-cleaner
Source: https://github.com/j7-dev/everything-github-copilot/tree/main/skills/refactor-cleaner
Command: npx skills add https://github.com/j7-dev/everything-github-copilot --skill refactor-cleaner-j7-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill tackles the accumulation of unused, duplicated, or overly complex code that bogs down development and increases maintenance overhead.

Core Features & Use Cases

  • Dead Code Removal: Identifies and safely removes unused functions, variables, and dependencies.
  • Duplication Elimination: Consolidates repetitive code blocks into reusable functions or modules.
  • Simplification: Refactors complex conditional logic and improves code readability.
  • Use Case: After a major feature rollout, use this skill to scan the codebase for any functions or modules that are no longer called and safely remove them, reducing the overall codebase size and complexity.

Quick Start

Run the refactor cleaner skill to analyze and remove any dead code in the current project.

Frequently Asked Questions about refactor-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and remove dead code in my project?

Dead code removal is automated by analyzing the codebase to identify and safely delete unused functions, variables, and dependencies, reducing overall maintenance overhead and codebase size.

What is the best way to eliminate code duplication and improve maintainability?

Code duplication is eliminated by scanning for repetitive code blocks and consolidating them into reusable functions or modules, directly improving long-term maintainability and readability.

How does automated refactoring handle complex conditional logic?

Automated refactoring simplifies complex conditional logic by restructuring the code to improve readability and reduce code bloat without changing the external behavior.

Does this dead code cleanup approach work with TypeScript projects?

Yes, dead code cleanup supports TypeScript projects by utilizing analysis tools like ts-prune and depcheck to accurately identify unused exports and uncalled modules.

Can I use knip and depcheck to scan for unused dependencies after a feature rollout?

Yes, you can use knip and depcheck to scan the codebase after a feature rollout, identifying uncalled functions and safely removing unused dependencies to reduce technical debt.