Best-practice Codex workflow for refactoring a 117k LOC Next.js app (JS → TS + design system)
Hi r/codex , I’m looking for a serious Codex-first strategy for a large-scale refactor.
Context:
• Next.js + React app
• ~117k LOC
• Mostly JavaScript
• Heavy inline CSS
• Inconsistent component patterns
• Ongoing feature work (can’t freeze dev)
Goals:
- Incremental JS → TypeScript migration
- Introduce a proper component library / design system
- Remove inline styles + harmonize UI
- Keep PRs small and safe
What I’m Trying to Avoid:
• Big-bang refactors
• Codex touching unrelated files
• Massive diffs
• Subtle runtime changes
• Losing visual consistency
Any workflow tips are welcomed!
Posted Feb 20, 2026, 4:31 PM UTC
24