This gives Claude structured patterns for refactoring code safely without changing behavior. It covers identifying common smells like long methods and deeply nested conditionals, then walks through techniques like extract method, replace conditional with polymorphism, and introduce parameter objects. The workflow is sensible: ensure test coverage first, make small changes, run tests after each step. I like that it's opinionated about when not to refactor, especially the "without tests" and "code that will be replaced soon" rules. Useful if you're working with legacy code or want Claude to clean things up during feature work without breaking stuff.

skills.sh installs
596
GitHub stars
1.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add skillcreatorai/ai-agent-skills --skill code-refactoring --agent claude-code

Installs into .claude/skills of the current project.

Files

This gives Claude structured patterns for refactoring code safely without changing behavior. It covers identifying common smells like long methods and deeply nested conditionals, then walks through techniques like extract method, replace conditional with polymorphism, and introduce parameter objects. The workflow is sensible: ensure test coverage first, make small changes, run tests after each step. I like that it's opinionated about when not to refactor, especially the "without tests" and "code that will be replaced soon" rules. Useful if you're working with legacy code or want Claude to clean things up during feature work without breaking stuff.

Browse the repository on GitHub

Sponsors

Details

Repository
github.com/skillcreatorai/ai-agent-skills
Categories
Code Review & Quality, AI & Agent Building
First seen
May 16, 2026

More from skillcreatorai/ai-agent-skills

All 30
1encoredev avatarencore-go-code-reviewencoredev/skillsReview existing Encore Go code for best practices and common anti-patterns.595skills.sh installs
2galaxy-dawn avatarreview-responsegalaxy-dawn/claude-scholarSystematic review response workflow from comment analysis to professional rebuttal writing. Use when the user asks to "write rebuttal", "respond to reviewers", 568skills.sh installs
3davila7 avatararchitecturedavila7/claude-code-templatesArchitectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing sys555skills.sh installs
4andreadellacorte avatargroove-work-reviewandreadellacorte/grooveEvaluate output, identify lessons, decide accept/rework. Use after implementation.545skills.sh installs
5manutej avatarenterprise-architecture-patternsmanutej/luxor-claude-marketplaceComplete guide for enterprise architecture patterns including domain-driven design, event sourcing, CQRS, saga patterns, API gateway, service mesh, and scalabil530skills.sh installs
6garrytan avatarplan-eng-reviewgarrytan/gstackEng manager-mode plan review. (gstack)526skills.sh installs