AiderNext.jsArchitecture

Next.js Aider Conventions

Aider conventions for Next.js: file naming, route organization, and App Router conventions.

CONVENTIONS.md
- Use lowercase-kebab-case for all route segment folder names
- Prefix private folders with underscore (_components) to exclude from routing
- Group related routes with Route Groups (parentheses) without affecting URLs
- Co-locate page-specific components in _components next to the page
- Name server actions in actions.ts files co-located with their feature
- Use layout.tsx for shared UI; template.tsx only when fresh mounts are needed
- Keep globals.css minimal; prefer Tailwind classes over custom CSS
- Use instrumentation.ts for OpenTelemetry setup and startup side effects

How to use with Aider

Create a `CONVENTIONS.md` file in your project root. Aider reads this and respects your conventions when generating changes.

#nextjs#aider#conventions#app-router#coding-rules

Related Rules