findaskill

—skills · counting…

30,375MCP servers

SkillsMCP serversAgent BuilderRun agentSoon
Sign in
  1. Home
  2. Skills
  3. Coding & Development
  4. refactor
Coding skillsVerified Skill

refactor: Claude Code Skill & Agent Tool

An open-source skill by github (opens in a new tab), published in the github/awesome-copilot (opens in a new tab) repository on GitHub. Surgical refactoring that improves maintainability without changing behavior: extract functions, rename variables, break up god functions, tighten types and remove code smells step by step.

Install refactor

Requires Node.js
$ npx skills add github/awesome-copilot --skill refactor

Run this command in your project terminal to install this skill for Claude Code.

What this skill does

refactor is a skill for surgical code refactoring: it improves the structure, readability and maintainability of existing code without changing what the code does. It is meant for gradual improvement — cleaning up a module before adding a feature, or paying down debt one file at a time — rather than rewriting a project from scratch.

The skill teaches your agent golden rules that keep refactoring safe: behavior is preserved, changes are made in small steps with tests run after each one, a commit marks every safe state, and refactoring is never mixed with feature work. It also states when not to refactor, for example code that has no tests to prove nothing broke.

At its core is a catalog of common code smells with before-and-after fixes: long functions, duplicated logic, god objects, long parameter lists, feature envy, primitive obsession, magic numbers and strings, deeply nested conditionals, dead code and inappropriate intimacy between modules. For each, the agent applies a named technique — extract method, introduce a domain type, guard clauses and early returns, named constants. Use it with Claude Code to modernize legacy code while your test suite proves nothing broke.

Key Capabilities

  • Golden rules: preserve behavior, take small steps, test after each change
  • Catalog of ten code smells with before-and-after fixes
  • Extract method, guard clauses, named constants and domain types
  • Improves type safety and removes dead and duplicated code
  • Says when not to refactor, and keeps refactors apart from feature changes

How to use with Claude Code & AI Agents

  1. 01

    Install the skill

    Run the command above at the root of your project. The CLI asks which agents to set up — Claude Code, Cursor and other supported agents — and adds refactor to the project, so teammates who pull the repository get it too. Add -g to install it for your user account across every project.
  2. 02

    Open a new agent session

    Start a fresh Claude Code session in that project so the agent loads the new skill. This skill needs no extra tool or API key.
  3. 03

    Ask in plain words

    Describe the task, for example:“Refactor processOrder into smaller functions without changing its behavior.”The agent matches your request to the skill's description and follows its SKILL.md instructions step by step. Read them on GitHub before using the skill on a system that matters.

Skill details

Author
github (opens in a new tab)
Repository
github/awesome-copilot (opens in a new tab)
Install name
refactor
Category
Coding & Development
Works with
  • Claude Code
  • Cursor
  • Agent CLI
Requirements
  • Node.js (runs the installer)
View source on GitHub (opens in a new tab)

Verified by findaskill: the repository exists and npx skills add finds this skill under this exact name.

Related Skills in Coding & Development

  • mattpocock

    code-review

    Reviews every change since a commit, branch or tag along two axes — your repository's documented coding standards and the original issue or spec — running both reviews in parallel and reporting them side by side.

    View skill
  • mattpocock

    tdd

    Generates tests first and builds features or bug fixes through a strict red-green-refactor loop, with clear guidance on where tests belong and the anti-patterns that make suites brittle.

    View skill
Back to all Coding & Development skills

By using it, you agree to our Terms and Privacy Policy. . Contact us.

Explore Skills & Tools

findaskill

The open skills directory for Claude Code & AI agents

© 2026 findaskill

Categories

  • Coding
  • SEO
  • Scraping
  • DevOps
  • Security
  • MCP

Featured Skills

  • seo-auditMarketing & Technical SEO
  • firecrawl-seo-auditWeb Crawling & Audit
  • audit-websiteAutomated Code Fixer
  • web-quality-seoLighthouse & Standards

Platform & Legal

  • Skills Catalog
  • Categories
  • MCP Directory
  • Terms
  • Privacy