Next.js Route Structure
Audits the App Router file/directory structure: route groups, parallel routes, intercepting routes, layouts.
The App Router's file-system routing carries semantic meaning beyond filenames. Route groups ((group)), parallel routes (@slot), and intercepting routes ((...)route) each unlock specific UI patterns. Misnaming or mislocating these files silently breaks routing without throwing errors. This analysis surfaces structural issues so they can be corrected before they confuse contributors.
Severity guide
- info
- A structural pattern is present and worth documenting; review for opportunities.
- warning
- Route structure deviates from convention; navigation may behave unexpectedly.
- critical
- Route structure is incompatible with the App Router; this file will not route correctly.
Remediation
Align file/directory naming with App Router conventions; consolidate route groups; verify parallel/intercepting slot semantics.
Reference the Next.js App Router docs for the specific pattern. Route groups must use parentheses around the directory name. Parallel routes require @-prefixed slots. Intercepting routes follow (.), (..), (..)(..), and (...) prefix conventions.