code-refactoring-refactor-clean — Claude Code skill
The code-refactoring-refactor-clean Claude Code skill restructures existing code using clean-code principles and SOLID patterns. It activates for tangled modules, duplication, and testability work.
MIT 154 installs ★ 2,070 updated 2026-10-14
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a claude-codeWhat code-refactoring-refactor-clean does
The skill inspects code smells, dependencies, and risky areas, then lays out an ordered refactoring plan. It applies changes in small slices while keeping behavior stable. Detailed patterns are available in resources/implementation-playbook.md.
It updates tests and checks for regressions after making changes. The response covers problem areas, planned steps, proposed edits, and verification notes. External behavior stays unchanged unless explicitly approved.
What it helps with
- untangle hard-to-maintain modules
- locate duplication and code smells
- make code easier to test
- prepare modules for new features while preserving behavior
Example prompts for the agent
- Review this module for duplication and outline a refactoring plan.
- Improve this code's testability and update the related tests.
- Prepare this module for a new feature without changing its external behavior.
How to install code-refactoring-refactor-clean
1Skills CLI (Vercel)
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a claude-code2Manually: put the files in place
~/.claude/skills/code-refactoring-refactor-clean/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/code-refactoring-refactor-clean/
1Skills CLI (Vercel)
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a codex2Manually: put the files in place
.agents/skills/code-refactoring-refactor-clean/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a cursor2Manually: put the files in place
.cursor/skills/code-refactoring-refactor-clean/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install rmyndharis/antigravity-skills skills/code-refactoring-refactor-clean2Manually: put the files in place
.github/skills/code-refactoring-refactor-clean/SKILL.md1Skills CLI (Vercel)
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a gemini-cli2Platform CLI
gemini skills install https://github.com/rmyndharis/antigravity-skills --path skills/code-refactoring-refactor-cleanManually: put the files in place
.devin/skills/code-refactoring-refactor-clean/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about code-refactoring-refactor-clean
How do I install code-refactoring-refactor-clean in Claude Code?
Run npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a claude-code. The skill file is at ~/.claude/skills/code-refactoring-refactor-clean/SKILL.md.
What does code-refactoring-refactor-clean do?
It examines problematic code, proposes an ordered refactoring plan, and applies edits in small steps. It then updates tests and checks for regressions.
When does this skill activate?
It handles cleanup and restructuring of existing code, including duplication and testability concerns. It is not intended for a one-line fix, documentation-only requests, or work during a change freeze.
Source text
SKILL.md · MIT
--- name: code-refactoring-refactor-clean description: "Refactor code with clean code principles, SOLID design patterns, and modern software engineering practices to improve quality, maintainability, and performance. Use when cleaning up or restructuring existing code." --- # 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 Take the requirements, target, and scope from the user's request. ## 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.
© rmyndharis · MIT · rmyndharis/antigravity-skills