Refactor Code Safely
curated by SkillMD · plugin · 9 skills
Restructure code while preserving behavior: confirm tests are green, refactor in small steps, keep tests green, review, and commit.
Install the whole plugin (CLI)
npx skillmds add addyosmani/code-simplification
npx skillmds add addyosmani/test-driven-development
npx skillmds add obra/verification-before-completion
npx skillmds add tinh2/dead-code
npx skillmds add pwdev-solucoes/flow-quick
npx skillmds add pwdev-solucoes/flow-simplify
npx skillmds add sdiamante13/tidy
npx skillmds add sdiamante13/sweep
npx skillmds add sdiamante13/drySkills in this plugin
- ▌ 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.