Refactor Next.js code
Refactor the entire Next.js codebase with zero intentional behavior change. Preserve exactly: Routing + segment structure (app/ or pages/) Data fetching semantics (getStaticProps, getServerSideProps, RSC fetch/cache, revalidate, params) RSC boundaries ("use client" only where already required) Public APIs, component names, imports, file paths that define routes Styling output: class names, CSS vars, Tailwind tokens A11y: ids, roles, ARIA, data-testid Perf semantics: memo hooks, list keys Next.js config (next.config.js, middleware, fonts, image configs) Allowed: Extract cohesive components/hooks Folder restructuring not affecting route structure Remove dead code + unused imports Improve/make precise TypeScript types Minimal, mechanical code cleanup preserving logic Not allowed: Behavior change in UI, routing, caching, loading order, or fetch timing Renaming files or folders that changes URLs Changing effect dependency arrays or state semantics New deps or runtime feature changes README Requirements: Update README to reflect current and final file structure + architectural boundaries Document how routing works (app/pages), where components/hooks live, type conventions, and any refactor-driven organization rules No marketing language - purely technical orientation for developers Add minimal contribution guidelines: file placement, naming rules, "use client" usage constraints Deliverables per batch: File Tree Diff (added/removed/moved) Unified diffs with minimal hunks Full code of new files only README update diff + final content Short parity confirmation for: routing, RSC/client boundaries, fetch/cache, a11y, styling Process: Work route-by-route or feature-by-feature After each batch: stop for review before continuing
RefactoringBug fixingDocumentationNextJS