
Code Refactoring Refactor Clean
Plan and execute incremental refactors using clean code, SOLID, and smell reduction without changing behavior unexpectedly.
Overview
code-refactoring-refactor-clean is an agent skill most often used in Ship (also Build backend) that plans and applies incremental clean-code and SOLID refactors with tests.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill code-refactoring-refactor-cleanWhat is this skill?
- Assesses code smells, dependency risk, and refactor hotspots before editing
- Produces an incremental refactor plan with small, behavior-preserving slices
- Applies SOLID and clean-code guidance without over-engineering
- Requires test updates and regression verification after each slice
- Explicit do-not-use rules for one-line fixes, change freezes, and docs-only requests
- Workflow includes assess smells, incremental plan, slice changes, and test verification steps
Adoption & trust: 819 installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your codebase has duplication and design drift, and a big-bang rewrite feels too risky before you ship the next milestone.
Who is it for?
Solo builders inheriting messy modules who need disciplined, test-backed refactors before adding features or tagging a release.
Skip if: Single-line bugfixes, documentation-only tickets, or repos under a hard change freeze where refactoring is banned.
When should I use this skill?
Refactoring tangled or hard-to-maintain code, reducing duplication or complexity, or improving testability when a full refactor is in scope—not for one-line fixes.
What do I get? / Deliverables
You get a staged refactor plan, safer slices of improved code, and updated tests that confirm behavior stayed intact.
- Refactor plan with ordered steps
- Refactored source slices
- Updated or added tests
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Structured refactor review is a Ship gate before release, even when most edits happen during Build. Review subphase captures quality-focused redesign, test updates, and regression checks—not greenfield feature work.
Where it fits
Untangle a god service class so a new API endpoint can ship without copy-paste.
Run a structured refactor pass on a hot path before merging a release branch.
Pay down duplication discovered in incident postmortems without a full rewrite.
How it compares
Behavior-preserving design refactor workflow, not a linter pass or cosmetic formatter run.
Common Questions / FAQ
Who is code-refactoring-refactor-clean for?
Indie developers and small teams using AI agents to improve maintainability on real production code without stopping feature work entirely.
When should I use code-refactoring-refactor-clean?
In Ship/review before a release, during Build/backend when a module blocks new work, or in Operate/iterate when paying down debt—never for docs-only or freeze periods.
Is code-refactoring-refactor-clean safe to install?
It instructs broad codebase edits; review the Security Audits panel on this page, keep git branches, and run your test suite after each slice.
SKILL.md
READMESKILL.md - Code Refactoring Refactor Clean
# Refactor and Clean Code You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance. ## Use this skill when - Refactoring tangled or hard-to-maintain code - Reducing duplication, complexity, or code smells - Improving testability and design consistency - Preparing modules for new features safely ## Do not use this skill when - You only need a small one-line fix - Refactoring is prohibited due to change freeze - The request is for documentation only ## Context The user needs help refactoring code to make it cleaner, more maintainable, and aligned with best practices. Focus on practical improvements that enhance code quality without over-engineering. ## Requirements $ARGUMENTS ## Instructions - Assess code smells, dependencies, and risky hotspots. - Propose a refactor plan with incremental steps. - Apply changes in small slices and keep behavior stable. - Update tests and verify regressions. - If detailed patterns are required, open `resources/implementation-playbook.md`. ## Safety - Avoid changing external behavior without explicit approval. - Keep diffs reviewable and ensure tests pass. ## Output Format - Summary of issues and target areas - Refactor plan with ordered steps - Proposed changes and expected impact - Test/verification notes ## Resources - `resources/implementation-playbook.md` for detailed patterns and examples. ## Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.