โ Back to list

refactor-verify
by alexanderjamesmcleod
Ideas that make sense. Products that make cents. ๐ก๐ฐ An autonomous AI development platform.
โญ 0๐ด 0๐
Jan 8, 2026
SKILL.md
name: refactor-verify description: Before/after verification for refactoring - ensures nothing breaks
refactor-verify
Overview
Mandatory verification skill for any refactoring task. Captures state before refactor, then verifies nothing broke after.
โ ๏ธ CRITICAL: Must Use Before Any Refactor
# BEFORE refactoring - capture baseline
refactor-verify before /path/to/project
# DO YOUR REFACTORING WORK
# AFTER refactoring - verify nothing broke
refactor-verify after /path/to/project
What It Checks
Before Phase
- Runs all tests โ saves pass/fail count
- Runs code-analyze metrics โ saves file/line counts
- Runs code-analyze complexity โ saves complexity scores
- Captures git status
- Saves snapshot to
.refactor-baseline.json
After Phase
- Runs all tests โ compares to baseline
- Runs code-analyze metrics โ compares
- Runs code-analyze complexity โ compares
- Generates diff report
- FAILS if:
- Any test that passed before now fails
- Complexity increased significantly
- Dead code introduced
Usage
# Step 1: Before refactoring
cd /home/alex/kapu-ti
refactor-verify before backend/src/services
# Step 2: Do your refactoring work
# ... edit files ...
# Step 3: Verify after refactoring
refactor-verify after backend/src/services
# Optional: View baseline
refactor-verify status
# Optional: Clear baseline (start fresh)
refactor-verify reset
Commands
| Command | Description |
|---|---|
before <path> | Capture baseline before refactoring |
after <path> | Verify after refactoring, compare to baseline |
status | Show current baseline state |
reset | Clear baseline, start fresh |
Output Example
๐ REFACTOR VERIFICATION REPORT
================================
Tests:
Before: 47 passed, 0 failed
After: 47 passed, 0 failed
โ
All tests still passing
Metrics:
Before: 1,473 lines in 1 file
After: 1,512 lines in 5 files
โ
Lines increased slightly (acceptable for splitting)
Complexity:
Before: Max 45, Avg 12
After: Max 18, Avg 8
โ
Complexity reduced!
Overall: โ
REFACTOR VERIFIED
Integration with cc Workflow
cc MUST run this skill for ANY refactoring task:
- Read task file
- Search AI Kitchen RAG for patterns
- Run
refactor-verify before - Do refactoring work
- Run
refactor-verify after - Only complete task if verification passes
Files
scripts/refactor-verify.sh- Main verification script.refactor-baseline.json- Stored in project root during refactor
Dependencies
- code-analyze skill (for metrics)
- pnpm test (for test execution)
- git (for status tracking)
Score
Total Score
50/100
Based on repository quality metrics
โSKILL.md
SKILL.mdใใกใคใซใๅซใพใใฆใใ
+20
โLICENSE
ใฉใคใปใณในใ่จญๅฎใใใฆใใ
0/10
โ่ชฌๆๆ
100ๆๅญไปฅไธใฎ่ชฌๆใใใ
0/10
โไบบๆฐ
GitHub Stars 100ไปฅไธ
0/15
โๆ่ฟใฎๆดปๅ
3ใถๆไปฅๅ ใซๆดๆฐใใใ
0/10
โใใฉใผใฏ
10ๅไปฅไธใใฉใผใฏใใใฆใใ
0/5
โIssue็ฎก็
ใชใผใใณIssueใ50ๆชๆบ
+5
โ่จ่ช
ใใญใฐใฉใใณใฐ่จ่ชใ่จญๅฎใใใฆใใ
+5
โใฟใฐ
1ใคไปฅไธใฎใฟใฐใ่จญๅฎใใใฆใใ
0/5
Reviews
๐ฌ
Reviews coming soon