What problem does it solve? Deciding where new code should live in a Next.js App Router project is a recurring source of inconsistency: queries end up inline in pages, routes import from sibling routes, and shared logic gets copy-pasted. This Skill prescribes a two-layer structure — route sidecars under /app/<route>/ and shared domain primitives under /lib/<domain>/ — so every file has a defined home. ## Core Features & Use Cases - Placement decision table: Maps each kind of code (reads, mutations, schemas, cache tags, pure logic) to its correct file, such as data.ts, actions.ts, service.ts, or validations.ts. - Promotion triggers: Defines exactly when code moves from a route sidecar into /lib/<domain>/ — shared cache tags, queries used by 2+ routes, non-trivial domain logic, and write-path business logic. - Structural rules: Enforces pure data.ts files with tenant-key filtering, server-only imports, no /lib to /app imports, and no cross-route imports. - Use Case: When asked to build a new admin page for discount codes, the Skill scaffolds /app/system/discount-codes/ with page.tsx, data.ts, actions.ts, and validations.ts, while placing shared queries, the write service, and cache tags in /lib/discounts/. ## Quick Start Ask the assistant to scaffold a new route or domain in your Next.js app, for example: create a dashboard route that lists orders with a form to create new ones.