nextbase-architecture
Skill827 starsChanged 3 months agoMITView on GitHub
Use for NextBase architecture decisions, adding or moving routes, components, data access, packages, or shared modules, and deciding server/client or trust boundaries in this repository.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- nextbase-auth-ssrSkill
- nextbase-cache-componentsSkill
- nextbase-database-testingSkill
- nextbase-safe-actions-dataSkill
- nextbase-testingSkill
- nextbase-ui-patternsSkill
- next-cache-components-optimizerSkill
- safe-action-advancedSkill
- safe-action-clientSkill
- safe-action-hooksSkill
- safe-action-middlewareSkill
- safe-action-testingSkill
- shadcnSkill
- supabase-postgres-best-practicesSkill
- supabase-schema-migrationsSkill
- supabaseSkill
- turborepoSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this repository's existing structure as the source of truth.
- Very specific: line 33
Default to Server Components.
- Very specific: line 34
Keep secrets, cookie access, database clients, and authenticated data access on the server.
- Distinctive: line 35
Treat route protection and hidden UI as navigation conveniences, not authorization.
- Distinctive: line 37
Use aliases from the existing TypeScript and shadcn configuration.
- Very specific: line 45
Verify the narrow package first, then the relevant root task: pnpm lint, pnpm typecheck, pnpm test, and pnpm build as risk requires.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NextBase Architecture
Use this repository's existing structure as the source of truth. Inspect neighboring files before creating a new pattern.
Repository Map
apps/webis the Next.js application.apps/databaseowns the local Supabase project, declarative schemas, generated migrations, and pgTap tests.- Root commands delegate work through Turborepo. Put package-specific commands in the owning package, then expose them through
turbo.jsonwhen the whole repository needs them. - Shared packages belong under
packagesonly when more than one app consumes them. Do not create a package to avoid a local import.
Web Placement
src/app/(external-pages): public marketing and informational routes.src/app/(auth-pages): sign-in, sign-up, password, and auth callback routes.src/app/(app-pages): authenticated application routes.src/components/ui: shadcn primitives owned by this repository.src/components: product-level composition around those primitives.src/data/anon: reads that do not require an authenticated action context. The name does not waive RLS.src/data/auth: authentication actions.src/data/user: authenticated mutations and user-scoped queries.src/rsc-data: request-memoized server reads used by React Server Components.src/supabase-clients: browser, server, and middleware Supabase client factories.src/lib: shared application infrastructure;src/utils: focused helpers and adapters.
Boundaries
- Default to Server Components. Add
'use client'only to the smallest interactive leaf. - Keep secrets, cookie access, database clients, and authenticated data access on the server. Mark server-only infrastructure with
import 'server-only'where appropriate. - Treat route protection and hidden UI as navigation conveniences, not authorization. RLS and server-side ownership checks are the trust boundary.
- Validate every mutation at the server action boundary. Never accept an owner or user ID from form input when it is available from authenticated context.
- Use aliases from the existing TypeScript and shadcn configuration. Do not reach across packages with relative imports.
- Preserve route-group intent. Route groups organize layouts and access patterns without changing public URLs.
Change Workflow
- Inspect the closest route, data module, component, and package scripts.
- Choose the owning layer before writing code.
- Reuse an existing client, action client, schema, component, or task rather than introducing a parallel abstraction.
- Verify the narrow package first, then the relevant root task:
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildas risk requires. - For schema, auth, cache, UI, or testing work, also load the matching NextBase overlay and relevant maintainer skill.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

