Refactor
Restructure messy codebases into clean, modular architecture.
Domain
Process — structural organization, architectural skeleton.
When to Use
- "refactor my project", "clean up my code"
- "split this file", "restructure my files"
- Codebase is monolithic or messy
What It Does
- Splits oversized files (>300 lines)
- Establishes modular folder structure
- Extracts duplicated logic
- Enforces single responsibility
- Preserves all functionality (no breaking changes)
Workflow
- Analyze — map project, identify files >300 lines
- Plan — new folder structure, file-by-file mapping
- Execute — refactor files, update imports
- Verify — all routes/UI preserved, no file >300 lines
Hard Limits
- No file >300 lines
- Every function <80 lines
- Single responsibility per file
Composability
yaml
domain: process
composable: true
yields_to: []Related Skills
- Harden — use after refactor for production patterns
- Refactor = WHERE code lives, Harden = WHAT goes inside