Refactor Code Safely
Restructure code while preserving behavior: confirm tests are green, refactor in small steps, keep tests green, review, and commit.
Skills in this plugin
9- ▌ Code Simplification · addyosmaniSimplify code by reducing complexity while preserving exact behavior, making it easier to read, understand, modify, and debug.
- ▌ Test Driven Development · addyosmaniDrive development with tests by writing a failing test before implementing code, and reproduce bugs with tests before fixing them.
- ▌ Verification Before Completion · obraEnforces running verification commands and confirming output before claiming work is complete, fixed, or passing, to prevent false success claims.
- ▌ Dead Code · tinh2Finds 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.
- ▌ Flow Quick · pwdev-solucoes bundleDelivers 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.
- ▌ Flow Simplify · pwdev-solucoes bundleAnalyzes 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.
- ▌ Tidy · sdiamante13 bundleRefactors 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.
- ▌ Sweep · sdiamante13Reviews a codebase for structural smells and refactors them with provable safety, using micro commits and green-bar discipline.
- ▌ Dry · sdiamante13Refactors duplicated code by extracting helper methods, shared abstractions, or reusable structures, with automated testing and commits after each extraction.