refactor-cleaner_skill

This skill proactively detects and removes dead code, duplicates, and unused exports to keep JavaScript projects lean and maintainable.
  • JavaScript

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill itou-daiki/easy_stat_edu --skill refactor-cleaner

  • SKILL.md7.5 KB

Overview

This skill is a dead-code cleanup and consolidation specialist for JavaScript/TypeScript projects. It proactively detects unused files, exports, imports, and dependencies, then safely removes or consolidates them while preserving functionality. The goal is to reduce bundle size, lower maintenance cost, and keep the codebase lean and readable.

How this skill works

It runs a suite of analysis tools (knip, depcheck, ts-prune, eslint) to catalog unused exports, dependencies, and unreachable code. Findings are categorized by risk (SAFE, CAREFUL, RISKY) and validated with grep checks, git history review, and test runs. Removals are applied in controlled batches with commits and documented in a deletion log so every change is traceable and reversible.

When to use it

  • During maintenance windows or dedicated refactor sprints, not during active feature development
  • When tests and CI are green and you can run full test suites after changes
  • To reduce bundle size, remove legacy features, or tidy accumulated technical debt
  • Before preparing a release where minimizing footprint and complexity is important
  • When duplicate implementations appear across components or utilities

Best practices

  • Run detection tools in parallel, then validate findings manually before removal
  • Start with SAFE items (unused deps, internal exports) and remove one category at a time
  • Create one git commit per logical removal batch and keep a backup branch
  • Update docs/DELETION_LOG.md with every session and include impact metrics
  • Run build and full test suite after each batch and monitor production after deploy

Example use cases

  • Remove unused npm packages identified by depcheck to shrink node_modules and bundle size
  • Eliminate unused TypeScript exports found by ts-prune and clean up public modules
  • Consolidate duplicate components into a single implementation and update imports
  • Delete obsolete files discovered by knip and record changes in the deletion log
  • Find and remove unused imports and unreachable code branches flagged by eslint

FAQ

Revert the commit, run the build/tests, investigate dynamic imports or missed references, then mark the item as DO NOT REMOVE if needed.

How do you ensure you don't remove public API code?

Classify items as RISKY when part of public API, grep for external references, review git history, and avoid removing without explicit approval.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
refactor-cleaner skill by itou-daiki/easy_stat_edu | VeilStrat