refactor:discover {path}
Foundation pass. Spawns Task sub-agents to scope the codebase, writes Claude Code skills + REFACTOR_PLAN.md + .claude/refactor/discovery.json. Internal Q&A loop.
refactor-me is a CLI orchestrator. It drives Claude Code sub-agents to read a legacy repo end-to-end, then scaffolds a fresh Laravel + Livewire + Flux app inside it — staged, milestone-scoped, test-first.
php artisan refactor:run /path/to/repo
▌
Sheet 02 · The pipeline
Halts on failure. Pauses for input. The orchestrator is dumb on purpose — the agents do the thinking.
Foundation pass. Spawns Task sub-agents to scope the codebase, writes Claude Code skills + REFACTOR_PLAN.md + .claude/refactor/discovery.json. Internal Q&A loop.
Per-area deep dives that emit refactored/requirements/<milestone>/week-N/<issue>.md — concrete, milestone-scoped, ready to feed back to the agent.
Generates refactored/src/ — a fresh Laravel + Livewire + Flux + Tailwind app, built from the discovery and scope artifacts.
Sheet 03 · The artefact
Everything the pipeline writes lives under refactored/ and .claude/refactor/. Your old code stays exactly where it is.
Laravel 13. with Livewire 4, Flux 2, Tailwind 4 — the boost-guideline stack
Pest 4 tests. feature tests scaffolded per area, pinned to discovery findings
Milestone scoping. requirements grouped by milestone/week, each one re-runnable
Skills written in. plain Markdown — the agent re-uses them on the next pass
cloned-repo/ ├─ app/ // untouched, legacy ├─ routes/ // untouched, legacy ├─ … │ ├─ .claude/refactor/ │ └─ discovery.json ← stage 1 state │ ├─ REFACTOR_PLAN.md ← human-readable plan │ └─ refactored/ ├─ requirements/ │ └─ m1/week-1/ │ ├─ auth.md │ └─ billing.md └─ src/ ← the new app ├─ app/ ├─ resources/ └─ tests/Pest/
Sheet 04 · Field notes
Mechanical translators flatten the parts of a codebase that matter most: the implicit invariants, the load-bearing weirdness, the bits the original author would tell you about over coffee. An agent reading the repo end-to-end can preserve those. refactor-me is the harness that lets it do so deliberately — one milestone at a time, with everything it learns written down and re-readable.