agentleFS
imbhargav5imbhargav5/nextbase-nextjs-supabase-starter/.agents/skills/nextbase-architecture/SKILL.md

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.

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
  1. Distinctive:

    Use this repository's existing structure as the source of truth.

    line 8
  2. Very specific:

    Default to Server Components.

    line 33
  3. Very specific:

    Keep secrets, cookie access, database clients, and authenticated data access on the server.

    line 34
  4. Distinctive:

    Treat route protection and hidden UI as navigation conveniences, not authorization.

    line 35
  5. Distinctive:

    Use aliases from the existing TypeScript and shadcn configuration.

    line 37
  6. Very specific:

    Verify the narrow package first, then the relevant root task: pnpm lint, pnpm typecheck, pnpm test, and pnpm build as risk requires.

    line 45

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

NextBase Architecture

Use this repository's existing structure as the source of truth. Inspect neighboring files before creating a new pattern.

Repository Map

  • apps/web is the Next.js application.
  • apps/database owns 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.json when the whole repository needs them.
  • Shared packages belong under packages only 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

  1. Default to Server Components. Add 'use client' only to the smallest interactive leaf.
  2. Keep secrets, cookie access, database clients, and authenticated data access on the server. Mark server-only infrastructure with import 'server-only' where appropriate.
  3. Treat route protection and hidden UI as navigation conveniences, not authorization. RLS and server-side ownership checks are the trust boundary.
  4. 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.
  5. Use aliases from the existing TypeScript and shadcn configuration. Do not reach across packages with relative imports.
  6. Preserve route-group intent. Route groups organize layouts and access patterns without changing public URLs.

Change Workflow

  1. Inspect the closest route, data module, component, and package scripts.
  2. Choose the owning layer before writing code.
  3. Reuse an existing client, action client, schema, component, or task rather than introducing a parallel abstraction.
  4. Verify the narrow package first, then the relevant root task: pnpm lint, pnpm typecheck, pnpm test, and pnpm build as risk requires.
  5. For schema, auth, cache, UI, or testing work, also load the matching NextBase overlay and relevant maintainer skill.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.