# Refactor Clean

Refactor cleanly instead of layering sediment.

- Repository: https://github.com/dzhng/skills (1394 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add dzhng/skills --skill refactor-clean -g -a claude-code -y`
Codex: `npx skills add dzhng/skills --skill refactor-clean -g -a codex -y`
Cursor: `npx skills add dzhng/skills --skill refactor-clean -g -a cursor -y`
Gemini CLI: `npx skills add dzhng/skills --skill refactor-clean -g -a gemini-cli -y`

## Description

Refactor cleanly instead of layering sediment. Use for rename requests, stale or misleading names, legacy leftovers, changed scope, or when a change reveals duplicated concepts, local adapters, obsolete owners, redundant inputs or guards, compatibility wrappers, parallel abstractions, an over-large module that has accreted many responsibilities, or "just tack this on" pressure in any code area.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Clean Refactoring

Replace the old shape with the simpler shape the codebase would want if it were
designed today. Refactoring is not adding a compatibility layer beside the problem;
it is moving ownership until every concept has exactly one clear home. That cuts
both ways: merging N duplicated owners into one, and splitting one over-loaded
module into the several owners it was hiding.

## Workflow

The rest: https://github.com/dzhng/skills/blob/HEAD/skills/engineering/refactor-clean/SKILL.md
