Agent skill · Testing & QA

refactor

The behavior-preserving restructure gate. Routed to by /refactor for a rename, extract, inline, move, dedup, or internal-implementation swap. Six gated phases prove behavioral parity through unmodified pre-existing tests; any diff that classifies as `feat` is not a refactor and is routed to tdd. A modified pre-existing test is rejected as evidence — it is a behavior change in disguise.

arbiterForgegithub.com/arbiterForgeGitHub ↗
claude-codecodexAGPL-3.0
Install
npx skills add arbiterForge/codeArbiter --skill refactor --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 8 KB
Bundled scripts: none
Path: core/surface/skills/refactor/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 138 · +1 this week
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# refactor Restructure, do not rewrite. Externally observable behavior before equals after — proven by mechanism, not inspection. Routed to by `/refactor`. ## Pre-flight Read these, or STOP and surface the gap — never guess a command or a threshold: - `{{PROJECT_DIR}}/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value) and project context. - `{{PROJECT_DIR}}/.codearbiter/tech-stack.md` — the test, coverage, lint, and type-check invocations; file layout. - `{{PROJECT_DIR}}/.codearbiter/coding-standards.md` — style, structure, naming. Required for Phase 4. The working tree MUST be clean over the named surface before Phase 1. A dirty surface conflates the refactor diff with unrelated edits and breaks parity verification — STOP and surface it. ## Phase 1 — Surface identification · gate: BLOCK Enumerate the exact blast radius before any other work. Restate the planned refactor in one sentence and confirm it back to the user, then record a surface table: - Files (repo-relative paths). - Top-level symbols touched — function, class, and exported member names. - Public method signatures within those symbols. - External consumers — call sites in other modules. Reject vag

What's inside
Steps it walks through
  1. Pre-flight
  2. Phase 1 — Surface identification · gate: BLOCK
  3. Phase 2 — Behavioral parity coverage proof · gate: BLOCK
  4. Phase 3 — Red parity tests (conditional) · gate: BLOCK
  5. Phase 4 — Implementation · gate: BLOCK
  6. Phase 5 — Parity verification · gate: BLOCK
  7. Phase 6 — Lint and coverage · gate: BLOCK
  8. Hard rules
More from codeArbiter
All skills →
About this skill
What does the refactor skill do?

The behavior-preserving restructure gate. Routed to by /refactor for a rename, extract, inline, move, dedup, or internal-implementation swap. Six gated phases prove behavioral parity through unmodified pre-existing tests; any diff that classifies as `feat` is not a refactor and is routed to tdd. A modified pre-existing test is rejected as evidence — it is a behavior change in disguise.

How do I install it?

Run `npx skills add arbiterForge/codeArbiter --skill refactor --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From arbiterForge/codeArbiter, a repository with 138 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going