refactorlisted
Install: claude install-skill arbiterForge/codeArbiter
# 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-root>/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value) and project context.
- `<project-root>/.codearbiter/tech-stack.md` — the test, coverage, lint, and type-check invocations; file layout.
- `<project-root>/.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 vague surfaces. "the auth module", "the user service", "some helpers in utils" are categories, not surfaces. A surface is acceptable only when a reader could grep the repo for the listed symbols and arrive at the same file set. The table is the parity contract for Phases 2–6.
Gate: a precise, co