← ClaudeAtlas

nts-architecture-patternslisted

Reference patterns for ongoing development on a Next.js + tRPC + Prisma project scaffolded with nextjs-trpc-prisma-starter. Use this whenever adding a new module, writing a new tRPC procedure, deciding between tRPC vs route handler vs MCP tool, wiring permissions, structuring services, handling errors, or making any architectural decision in a project that was bootstrapped with this plugin. Triggers on phrases like 'add a new module', 'create a tRPC procedure', 'where should this logic go', 'follow project conventions', or any 'how do I do X in this project' question.
juncoding/nextjs-trpc-prisma-starter · ★ 0 · Web & Frontend · score 70
Install: claude install-skill juncoding/nextjs-trpc-prisma-starter
# Architecture patterns for ongoing development For projects already scaffolded with `nextjs-trpc-prisma-starter`. Explains the patterns to follow when adding features. Companion to the `nts-scaffold-internal-tool` skill which only handles initial setup. ## Use this skill when - Adding a new business module (e.g. `customer`, `order`, `invoice`). - Adding a new tRPC procedure or route handler. - Deciding whether something belongs in tRPC, a route handler, a MCP tool, or a cron job. - Wiring permissions on a new resource. - Structuring a service that touches multiple modules. - Handling errors at any layer. - Reviewing whether a PR follows project conventions. ## The four-rule cheat sheet 1. **`src/app/` is a thin delivery layer.** No business logic. No DB queries. Just: validate, call a service, return. 2. **`src/server/` is the entire backend.** Every file starts with `import "server-only";`. 3. **Permissions live in services.** Every service method touching user-owned data takes `userId` first and calls `requirePermission`. 4. **Audit calls live in services**, inside the same transaction as the mutation. If you remember nothing else, remember these four. ## Reference index Read the file matching your task: | Doing this... | Read this | |---|---| | Creating a new business module (service, schema, types) | `references/service-layer.md` | | Writing a tRPC procedure | `references/trpc-procedures.md` | | Wiring auth / RBAC for a new resource | `references/permissions-and