Before You Refactor
A pre-refactor checklist that catches untested behavior before you 'clean up' code.
Test report
- Verdict
- Tested · Works
- Score
- Tested
- Jul 16, 2026
- Environment
- Claude Code 2.x (agent harness)
- Upstream re-checked
- Jul 18, 2026 · 91fbb94
Its checklist caught a real regression a naive refactor introduced: an archived record silently 'claiming' its dedup id so a later active duplicate got dropped — the naive rewrite passed all 5 existing tests anyway and only broke on a case none of them covered; the skill's step to add a characterization test for untested behavior caught it before the edit landed.
Scored on four weighted criteria — install, triggering, output vs. baseline, docs. How scoring works
- Installs cleanly 5/5
- Triggers reliably 5/5
- Output vs. baseline 10/10
- Docs & honesty 5/5
What Before You Refactor does
A rigid pre-refactor checklist: read the existing code twice, find and run the tests that already cover it, state a one-sentence goal, and add a characterization test for any behavior the current suite doesn't pin down before changing the code's shape. Triggers on refactors, restructures, cross-file renames, or reviewing a restructuring PR; explicitly does not trigger on one-line bug fixes, new files, or formatting-only changes.
How to install Before You Refactor
git clone https://github.com/oribarilan/97
mkdir -p ~/.claude/skills
cp -r 97/skills/before-you-refactor ~/.claude/skills/before-you-refactor
Skills live in ~/.claude/skills/ (global) or .claude/skills/
(per-project). Restart Claude Code after installing.
Commands — how to trigger Before You Refactor
-
/before-you-refactorA pre-refactor checklist that catches untested behavior before you 'clean up' code.
It also activates on plain-language prompts like these:
-
before I restructure this module, what tests actually cover it? -
I'm about to rename these files across the codebase, what's the risk? -
add a characterization test before I clean up this function's shape
Frequently asked questions
- Is the Before You Refactor skill free?
- Yes. The skill itself is free from oribarilan/97. SkillProof publishes the install command and an independent test verdict at no cost.
- Does Before You Refactor work with Claude Code?
- We tested it with Claude Code 2.x (agent harness) on Jul 16, 2026. Verdict: Tested · Works. Its checklist caught a real regression a naive refactor introduced: an archived record silently 'claiming' its dedup id so a later active duplicate got dropped — the naive rewrite passed all 5 existing tests anyway and only broke on a case none of them covered; the skill's step to add a characterization test for untested behavior caught it before the edit landed.
- What is the Before You Refactor SkillProof Score?
- 10.0/10 — installs cleanly 5/5, triggers reliably 5/5, output vs. baseline 10/10, docs & honesty 5/5.
- How do I install Before You Refactor?
- Copy the install command from this page, run it in your terminal, and restart Claude Code. Skills live in ~/.claude/skills/ (global) or .claude/skills/ inside a project.
- Can I use Before You Refactor with Cursor, Copilot, Gemini CLI, Codex or other AI tools?
- The SKILL.md format is native to Claude (Claude Code, Desktop, claude.ai). The instructions inside adapt to other assistants: Cursor rules, GitHub Copilot instructions, Windsurf rules, Custom GPTs, AGENTS.md for OpenAI Codex, and GEMINI.md for Google Gemini CLI — our conversion guides cover each, and the free converter on the tools page does the wrapping for you.