refactorlisted
Install: claude install-skill mik2win/foureyes
# Refactor
Improve the quality of changed code WITHOUT changing its behavior. Pure refactor: same
inputs produce the same outputs. This skill APPLIES the cleanups, then runs the project's
`format` and `test` commands to confirm nothing broke. It does NOT look for bugs — for
correctness/security/crash analysis run `/code-review`.
---
## Phase 0 — Load profile
Read these before touching any code. They define every project fact this skill needs:
1. `.claude/PROJECT.md` — Commands (`format`, `lint`, `test`), Architecture (layers,
boundaries, composition root), and any project-specific conventions.
2. `.claude/rules/_generic/*` — stack-agnostic rules (code quality, comments, naming). If
`CONTEXT.md` exists, align names toward its ubiquitous language (a rename to the canonical
term is behaviour-preserving and in scope).
3. Stack rule packs in `.claude/rules/*` whose `paths` (front-matter glob) match the
target files. These carry the language- and framework-specific modernization and
anti-pattern checks — do not hardcode any here; defer to them.
If `PROJECT.md` is missing or still `TEMPLATE`, fall back to the root `CLAUDE.md` (always
in context) when it carries the commands/architecture above — proceed on it, noting you're
running without a kit profile. Only if *neither* has those facts, tell the user to run
`/bootstrap` first, then stop.
---
## Phase 1 — Resolve target
`$ARGUMENTS` selects what to refactor:
- **file path** — that file.
- **directory** — all