← ClaudeAtlas

nfs-architecture-patternslisted

Reference patterns for ongoing development on a Next.js fullstack project scaffolded with nextjs-fullstack-starter — Server Components for reads, Server Actions for writes, services in src/server/modules/. Use this whenever adding a new module, writing a new page or Server Action, deciding between Server Action vs route handler vs MCP tool, wiring permissions, structuring services, handling errors, caching with cacheTag / updateTag, or making any architectural decision in a project that was bootstrapped with this plugin. Triggers on phrases like 'add a new module', 'create a Server Action', 'where should this logic go', 'follow project conventions', 'how do I invalidate the cache', 'should this be a page or an action', or any 'how do I do X in this project' question.
juncoding/nextjs-fullstack-starter · ★ 0 · API & Backend · score 70
Install: claude install-skill juncoding/nextjs-fullstack-starter
# Architecture patterns for ongoing development For projects already scaffolded with `nextjs-fullstack-starter`. Explains the patterns to follow when adding features. Companion to the `nfs-scaffold-app` skill which only handles initial setup. ## Use this skill when - Adding a new business module (e.g. `customer`, `order`, `invoice`). - Writing a new page, Server Action, or route handler. - Deciding whether something belongs in a page, a Server Action, a route handler, an MCP tool, or a cron job. - Wiring permissions on a new resource. - Structuring a service that touches multiple modules. - Caching with `cacheTag` / `updateTag` and not sure when to use which. - 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 Server Component page that reads