next-architecture
Installation
SKILL.md
Instructions
Shape application architecture for a Next.js App Router product. Stay at the system level; hand feature details to specialist skills. Do not duplicate vercel-labs/agent-skills react-best-practices / composition catalogs - link them when the question is component-level React performance.
When to Use
- Use for greenfield layout, modular boundaries, “where does this belong,” or multi-package Next apps.
- Prefer
next-server-patternsfor RSC/Actions/Route Handler mechanics. - Prefer
data-layer-handbook/database-schema-agentfor ORM choice and Prisma. - Prefer
monorepo-toolingwhen the answer is mostly turbo/pnpm workspaces.
- Clarify constraints: team size, deploy target, monorepo vs single app, auth and data vendors already chosen.
- Propose layers: presentation (app routes + UI) → application (Server Actions / use-cases) → domain → data access → adapters (PSP, email, storage).
- Boundaries: no DB imports from Client Components; no secrets in client bundles; Route Handlers for webhooks/external HTTP; Server Actions for UI-owned mutations when appropriate.
- Folders: recommend
app/,components/,lib/orserver/conventions that match the repo; avoid inventing a second framework. - Cross-cutting: point to
auth-handbook,observability-handbook,server-caching-handbook,i18n-handbookinstead of inlining those designs. - Split services only with evidence: separate worker/realtime service when connection lifespan or blast radius demands it (
realtime-handbook,container-local-dev). - React composition/perf: if the ask is “how should I write React components for perf,” cite upstream agent-skills react-best-practices rather than rewriting those rules here.