Refactor Code Safely

Restructure code while preserving behavior: confirm tests are green, refactor in small steps, keep tests green, review, and commit.

Curated by SkillMD 9 skills 5 authors

Skills in this plugin

9
  1. ▌
    Code Simplification · addyosmani
    Simplify code by reducing complexity while preserving exact behavior, making it easier to read, understand, modify, and debug.
    69.5k repo stars
  2. ▌
    Test Driven Development · addyosmani
    Drive development with tests by writing a failing test before implementing code, and reproduce bugs with tests before fixing them.
    69.5k repo stars
  3. ▌
    Verification Before Completion · obra
    Enforces running verification commands and confirming output before claiming work is complete, fixed, or passing, to prevent false success claims.
    247k repo stars
  4. ▌
    Dead Code · tinh2
    Finds and safely removes dead code across a codebase: unreachable paths, unused exports, functions, variables, CSS selectors, dependencies, env vars, and commented-out blocks. Builds an import graph, verifies no dynamic references, and runs build and tests after cleanup.
    13 repo stars
  5. ▌
    Flow Quick · pwdev-solucoes bundle
    Delivers a small, bounded code change through inspection, a mini-plan, implementation, testing, review, and adversarial verification. Use for bug fixes, configuration changes, and features expected to touch no more than five files.
    2 repo stars
  6. ▌
    Flow Simplify · pwdev-solucoes bundle
    Analyzes a completed phase diff for high-confidence behavior-preserving simplifications and applies only explicitly approved proposals, reducing duplication, dead code, needless complexity, or avoidable inefficiency.
    2 repo stars
  7. ▌
    Tidy · sdiamante13 bundle
    Refactors production code with test coverage using a TDD workflow that applies approved refactorings one at a time, gates each on passing tests, and commits or reverts accordingly.
    7 repo stars
  8. ▌
    Sweep · sdiamante13
    Reviews a codebase for structural smells and refactors them with provable safety, using micro commits and green-bar discipline.
    7 repo stars
  9. ▌
    Dry · sdiamante13
    Refactors duplicated code by extracting helper methods, shared abstractions, or reusable structures, with automated testing and commits after each extraction.
    7 repo stars