PlugWiki

refactor skill (github/awesome-copilot): small, behavior-safe code refactors

A refactoring guide that makes your agent clean up code in small steps without changing what it does.

Installs
22.5K
on skills.sh
Stars
40.7K
on GitHub
Updated
Oct 2026
last repo commit

This refactor skill makes your agent improve code structure while keeping behavior the same. It triggers on requests like "clean up this code", "refactor this" or "improve this". The SKILL.md says it is gradual and less drastic than the repo-rebuilder skill.

It sets five golden rules, ten code smells with before and after examples, extract-method and typing walkthroughs, two design pattern refactors and a five-step process. It bundles no scripts. The examples are short JavaScript and TypeScript code samples.

Good for

  • Developers cleaning up long functions, duplicated code and god classes
  • Teams that want refactors in small, tested, committed steps
  • Anyone moving untyped code toward typed code

Install refactor

Claude Code

  1. 1

    Copy this prompt.

    Install the refactor skill in Claude Code. Run this command:
    
    npx skills add https://github.com/github/awesome-copilot --skill refactor
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

Sections in SKILL.md

  1. Overview
  2. When to Use
  3. Refactoring Principles
  4. The Golden Rules
  5. When NOT to Refactor
  6. Common Code Smells & Fixes
  7. 1. Long Method/Function
  8. 2. Duplicated Code
  9. 3. Large Class/Module
  10. 4. Long Parameter List
  11. 5. Feature Envy
  12. 6. Primitive Obsession
  13. 7. Magic Numbers/Strings
  14. 8. Nested Conditionals
  15. 9. Dead Code
  16. 10. Inappropriate Intimacy

Key facts

Installs on skills.sh
22,465 as of 2026-11-02
License
MIT (as detected by GitHub)
Last commit to the repo
2026-10-30

What it includes

  • Keep behavior, small steps, version control, tests, one thing at a time

    Without tests, the skill says you are editing, not refactoring.

    Read · Five golden rules

  • Working code that will not change, untested critical code, tight deadlines

    Says to add tests first for critical production code without them.

    Read · When not to refactor

  • Long method, duplication, large class, long parameter list and more

    Also feature envy, primitive obsession, magic numbers, nested conditionals, dead code and inappropriate intimacy. Each has a BAD and GOOD example.

    Try: “Refactor this 200-line function into focused functions and add types.”

    Write · Ten code smells

  • Before and after for splitting a function and adding types

    Walks through breaking one long function into extracted methods, and moving from untyped to fully typed code.

    Write · Extract method and typing

  • Strategy and Chain of Responsibility

    Shows replacing conditional logic with a strategy, and nested validation with a chain.

    Write · Design patterns

  • Prepare, identify, refactor in small steps, verify, clean up

    Ensure tests exist, commit, branch, change one thing, run tests, commit if they pass.

    Runs code · Safe refactoring process

  • Quality, structure, type safety and testing checks

    Includes a table of 17 common refactoring operations from Extract Method to Replace Inheritance with Delegation.

    Read · Checklist and operations table

From the official docs

Questions

What does the refactor skill do?

It makes your agent refactor code in small steps that keep behavior the same. It covers code smells, extract method, type safety and a few design patterns, with a checklist at the end.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box at the top of this page. The awesome-copilot README describes the collection as customizations for GitHub Copilot, and the SKILL.md does not list other clients.

Which languages does it cover?

The SKILL.md's examples are JavaScript and TypeScript (the typing walkthrough uses TypeScript types and interfaces). Its rules are stated in general terms, so they apply to other languages, but there are no examples for them.

Does it run my tests?

It bundles no scripts. Its process tells the agent to run tests after each small change, so your project needs tests it can run. Without tests, the skill says to write them first.

How is it different from repo-rebuilder?

The SKILL.md describes itself as less drastic than repo-rebuilder and for gradual improvements. This page does not cover repo-rebuilder.

Is it safe to install?

It is one markdown file with no scripts. The risk is the code changes your agent makes. Commit before you start and review each diff, as the skill itself advises.

Information

updated Nov 2, 2026

Folder
skills/refactor

github/awesome-copilotskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. refactor SKILL.md · github.com
  2. awesome-copilot README · github.com

Updated Nov 2, 2026.