Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rmyndharis/antigravity-skills --skill code-refactoring-refactor-clean -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/code-refactoring-refactor-clean/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/code-refactoring-refactor-clean/

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

Similar skills

All skills for Code review and refactoring →
refactor-clean Seth Hobson The refactor-clean command reviews code for structural issues, SOLID violations, and performance risks, then lays out practical cleanup steps without over-engineering. CX Codex +1 ★ 42,780repo stars golang-refactoring samber golang-refactoring — a skill for behavior-preserving restructuring of Go code at scale. Uses gopls, gofmt, and tools like gopatch to break down large functions, rename types across a project, and reorganize packages without breakage. CX Codex +1 13,600installs java-refactoring-extract-method official github The java-refactoring-extract-method skill guides Extract Method refactoring for complex Java methods while preserving behaviour. Use it when a method needs smaller, focused units backed by tests. CX Codex +1 9,284installs java-refactoring-remove-parameter official github The java-refactoring-remove-parameter skill guides an agent through removing unused or derivable parameters from Java methods and updating their callers. Use it when the change must preserve behavior and be checked with tests. CX Codex +1 8,900installs refactoring-patterns wondelai refactoring-patterns — a skill that improves code structure through named, behavior-preserving transformations. Use it to eliminate duplication, break apart long methods, or realign responsibilities across classes. CX Codex +1 6,900installs dry-refactoring kucherenko The dry-refactoring skill automates refactoring of copy-paste clones found by jscpd. It guides you through extraction strategies—function, parameterization, module or class—and highlights which files to start with. CX Codex +1 4,100installs

From the same set17

The whole set →
business-analyst Turns the agent into a business analyst. It builds KPI frameworks, forecasts, and dashboards from plain chat prompts. CX Codex +1 229installs security-auditor The security-auditor Claude Code skill reviews application security and development pipelines. It checks threats, vulnerabilities, and existing controls, then suggests remediation steps. CX Codex +1 128installs architect-review architect-review — a skill for Claude Code, Codex, Cursor, and other tools. Evaluates system architecture, scalability impacts, and distributed design patterns during major refactoring. CX Codex +1 154installs frontend-developer The frontend-developer Claude Code skill helps build React and Next.js interfaces and address state or accessibility issues. Ask it to work on components, pages, or client-side flows. CX Codex +1 257installs backend-security-coder backend-security-coder is a Claude Code skill for writing secure backend code and reviewing security-sensitive changes. It covers input checks, authentication, and API protection. CX Codex +1 142installs code-reviewer The code-reviewer Claude Code skill reviews code for security risks, performance issues, and maintainability concerns. Ask it to assess a change or inspect a production configuration. CX Codex +1 104installs bash-pro The bash-pro Claude Code skill guides Bash scripting for automation, CI/CD, and system tasks. It helps structure argument handling, error recovery, and script checks. CX Codex +1 123installs quant-analyst quant-analyst — a skill for Claude Code and Codex designed for financial modeling and backtesting. Handles portfolio optimization, risk metrics, and time series analysis. CX Codex +1 123installs

Project sponsors

Companies that keep this analytics open