website-nextjs-fullstack-layered-architecture
Installation
SKILL.md
Rule
One folder per domain, five files with fixed jobs
src/features/<domain>/
schemas.ts # Zod input schemas + inferred types (PascalCase)
repository.ts # the ONLY file that imports the Prisma client
service.ts # business logic — permission checks, orchestration
queries.ts # read-side entry points, called from Server Components
actions.ts # write-side entry points — Server Actions
<name>-table.tsx, <name>-form-fields.tsx, create-<name>-sheet.tsx, ...
Every file has exactly one direction of dependency — repository never
imports service, service never imports queries/actions, and nothing
outside the feature folder imports repository or (usually) service
directly: