# refactor

> Restructure existing code without changing its behavior, through a test-gated refactoring loop: a named target, a green…

Restructure existing code without changing its behavior, through a test-gated refactoring loop: a named target, a green suite over that target before any edit, a planned sequence of small named refactorings, and the full suite re-run after every step. Use when the user wants to refactor, restructure, clean up, simplify, or improve the design of existing code, or to apply refactoring recommendations from a code-review or architectural-analysis report. This skill changes code; it does not review code (use code-review), assess architecture (use architectural-analysis), plan a multi-module restructure before executing it (use plan-a-change), map domain boundaries before restructuring along them (use ddd-analysis), or build new behavior test-first (use tdd). Do not use it on code inside an active tdd loop; the refactor step of tdd owns that cleanup. Runs its planned sequence to completion without pausing for review; to review each named refactoring as it lands, use pairing.

- Type: Skill
- Made by: testdouble
- Category: Developer tools
- Formats: Skills
- Version: d99419f
- Source: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor
- Page: https://pluginboard.ai/skills/refactor-testdouble

## Works with

- ChatGPT
- Claude
- Gemini
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- Replit
- OpenClaw
- OpenCode
- Hermes Agent

## Install

### ChatGPT

In ChatGPT: Download the refactor folder and zip it, then Plugins → Skills → Create → Upload from your computer. Business and Enterprise plans.

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Claude

In Claude (web or desktop): Download the refactor folder and zip the folder itself, then upload it in Customize → Skills.

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Gemini

In Gemini: Download the refactor folder, then at gemini.google.com click Customize → Skills → Create → Upload and pick the folder (or a .zip of it).

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.copilot/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Cursor

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.cursor/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Claude Code

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.claude/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

Or all of Han Coding, in Claude Code:

```text
/plugin marketplace add testdouble/han
/plugin install han-coding@han
```

### Codex

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.agents/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Antigravity

In Antigravity: Copy the refactor folder into ~/.gemini/config/skills (Antigravity app and IDE) or ~/.gemini/antigravity-cli/skills (Antigravity CLI).

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Gemini CLI

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.gemini/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Replit

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor .agents/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### OpenClaw

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.openclaw/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### OpenCode

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.config/opencode/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

### Hermes Agent

Run in your terminal:

```shell
npx -y degit testdouble/han/han-coding/skills/refactor ~/.hermes/skills/refactor
```

View the folder on GitHub: https://github.com/testdouble/han/tree/HEAD/han-coding/skills/refactor

---
From Pluginboard (https://pluginboard.ai).
