askill
refactor-cleaner

refactor-cleanerSafety 90Repository

Find and safely remove dead code, unused exports/files/dependencies, and consolidate duplicates with minimal risk. Use during refactors, bundle-size/performance cleanups, or before releases; apply changes in small batches and verify with build/tests.

0 stars
1.2k downloads
Updated 2/4/2026

Package Files

Loading files...
SKILL.md

Refactor Cleaner

Goal

  • Reduce codebase surface area safely: delete unused code, dependencies, exports, and files; consolidate duplicates; keep behavior unchanged.

Workflow

  1. Define scope and safety constraints (what is allowed to change, public API boundaries, and time budget).
  2. Collect evidence before deleting:
    • Search usages with fast text search.
    • Run dead-code detectors and linters when available.
  3. Classify findings by risk:
    • Safe: clearly unused internal exports, unreachable code, unused dependencies.
    • Careful: dynamic imports, reflection, config-driven usage, string-based lookups.
    • Risky: public APIs, plugin hooks, framework conventions, runtime-only references.
  4. Apply changes in small batches:
    • Remove one category at a time (deps → exports → files → duplicates).
    • Run build/typecheck/tests after each batch.
  5. Record deletions:
    • Append a concise entry to the project's deletion log if it exists; otherwise, summarize removals in the final output.
  6. Stop and ask when evidence is ambiguous.

Output

  • Summarize what was removed and why.
  • Call out any risky candidates that need human confirmation.
  • List verification steps and results (build/test commands run).

Reference

  • Read references/refactor-cleaner.md for detailed commands, checklists, and templates.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 2/16/2026

Well-structured refactoring skill with strong safety practices and clear workflow. Main limitation is deferring specific commands to an external reference file rather than including them directly.

90
85
90
80
75

Metadata

Licenseunknown
Version-
Updated2/4/2026
Publisherd0ublecl1ck

Tags

apici-cdgithub-actionstesting