🛠️
QualityShell

Refactor

by testdouble

Refactor is a Quality skill for Claude Code, published by testdouble in han.

253 stars22 forkson testdouble/hanAdded 2026/09/02+9% in starsRepository updated 2026/09/01
claudeclaude-codeclaude-code-pluginclaude-skillscode-reviewdocumentationinvestigationplanningreview
Install in seconds
Install Refactor
Copy Refactor into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/testdouble/han/tree/main/han-coding/skills/refactor ~/.claude/skills/refactor

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/testdouble/han.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
han-coding/skills/refactor/SKILL.md in testdouble/han
Installs to
~/.claude/skills/refactor
Collection
One of 25 skills cataloged from this repository
Category
Quality1418 skills

What Refactor does

Refactor restructures existing code without changing behavior using a test-gated loop. Use it to clean up, simplify, or reshape code after tests are green and the target’s behavior is covered.

Refactor is cataloged under Quality on DirSkills. Refactor comes from a repository tagged claude, claude-code, claude-code-plugin, claude-skills and code-review.

Documentation

README

Project Context

  • git installed: !which git 2>/dev/null || echo "not installed"
  • current branch: !git branch --show-current 2>/dev/null || echo unknown
  • working tree: !git status --porcelain 2>/dev/null | head -5
  • CLAUDE.md: !find . -maxdepth 1 -name "CLAUDE.md" -type f
  • project-discovery.md: !find . -maxdepth 3 -name "project-discovery.md" -type f
  • personal config directory: !bash "${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh" 2>/dev/null || echo "$HOME/.claude"
  • project .han/config.md: !cat .han/config.md 2>/dev/null || echo ""

This is the opening of the README. Read the full README on GitHub.

Commands Refactor provides

Slash commands named in this skill’s SKILL.md, listed in the order they first appear.

  • /tdd
  • /code-review
  • /architectural-analysis
  • /investigate
  • /issue-triage

Frequently asked about Refactor

  • What else does testdouble publish alongside Refactor?

    Refactor is one of 25 skills that DirSkills catalogs from testdouble/han, the repository it ships in. Its siblings there include Architectural Analysis, Automated Test Planning and Code Overview. Each one is a separate skill with its own page in this directory, installs the same way Refactor does, and is maintained by testdouble in that same repository. The rest of the collection is listed on the testdouble/han page.

  • How does Refactor compare to other Quality skills?

    Refactor ranks #1287 by stars among the 1418 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Refactor against them. Open each page to compare what they document and how they install.

More from testdouble/han

Refactor is one of 25 skills cataloged on DirSkills from testdouble/han.

See all 25 skills
🏗️
1h ago

Architectural Analysis

Architectural Analysis examines a named module, directory, or feature and produces a structured architecture report. Use it when you need design, behavior, risk, and boundary guidance without changing code.
Quality
25322
🧪
1h ago

Automated Test Planning

Automated Test Planning analyzes source code to identify coverage gaps, edge cases, and the tests a branch needs. Use it when you need a standalone test plan for files or directories, not manual test steps or test code.
Quality
25322
🧭
1h ago

Code Overview

Code Overview produces a progressive-disclosure summary of unfamiliar code or a pull request’s changes, explaining why it exists, what it does, and where to start. Use it to get oriented before working on or reviewing code; it writes only a scratch file and does not change the target.
Writing
25322
📄
1h ago

Code Overview To Confluence

Code Overview To Confluence turns unfamiliar code or a pull request into a progressive-disclosure overview and publishes it to a Confluence location you specify. Use it when you need code explained and posted for review or sharing.
Writing
25322
🔍
1h ago

Code Review

Code Review guides an AI agent through a structured review process for changes. Use it to assess diffs for bugs, regressions, test gaps, YAGNI, and severity-ranked findings.
Quality
25322
🧭
1h ago

Code Walkthrough

Code Walkthrough walks a person through code changes one step at a time, starting at the entry point and following the flow that changed. It is used to learn, teach, or prepare to review existing code before extending it.
Quality
25322