c/agents › command
0votes

CLAUDE.md template for a Next.js + Supabase app

TemplateLow risk Tested
submitted by CommandVault editors to c/agents · 4 uses

A ready-to-edit CLAUDE.md that tells Claude Code how your Next.js app is built, tested and deployed.

Template · 7 variables
# CLAUDE.md

## What this is
{{app_name}} is a {{one_line_description}}. Users: {{who_uses_it}}.

## Commands
- Install: `{{package_manager}} install`
- Dev server: `{{package_manager}} run dev` (http://localhost:3000)
- Lint + types: `{{package_manager}} run lint && npx tsc --noEmit`
- Tests: `{{test_command}}`
- Build: `{{package_manager}} run build`

## Stack
- Next.js (App Router), React, TypeScript, {{styling}}
- Supabase: Postgres with row-level security on every table, Auth, Storage
- Hosting: {{hosting}}

## Where things live
- `src/app`: routes. Server components by default; add "use client" only when needed.
- `src/app/api`: route handlers. Validate input with zod, check auth first.
- `src/lib/server`: server-only data access (never import into client code).
- `supabase/migrations`: one SQL file per change, named `YYYYMMDDHHMMSS_what.sql`.

## Rules
- Every new table: enable RLS and write policies in the same migration.
- Never expose the service-role key to the browser or log it.
- Prefer editing existing components over creating near-duplicates.
- Match the surrounding code style; no new dependencies without asking.

## Done means
Lint, types and build pass; you ran the change in the browser and checked the console; you listed what you changed and anything you skipped.
0 commentsreport

Guide

What you get: Claude Code starts every session knowing your app, exact commands, project layout, safety rules and what "done" means. Best for Next.js + Supabase projects using Claude Code.

Before you start

  • Fill in every blank with values you've actually run (especially the test command).
  • Save as CLAUDE.md at the repo root (or .claude/CLAUDE.md) and commit it.

Worked example (Oct 17, 2026, Claude Code 2.1.296)

Input

Filled with: app Pilot Pantry, test command `npm run test:unit -- --run`, CSS Modules, Vercel. Then asked: "Without reading any files, answer from the project instructions you were given at startup: what is this app called, what exact command runs the tests, and what does 'done' mean here?"

Result

"Yes, I got project instructions at startup (the project's CLAUDE.md, which loaded automatically). I didn't read any files to answer this.
- App name: Pilot Pantry, a meal-planning app for busy parents…
- Test command: npm run test:unit -- --run
- What "done" means: lint, types and build all pass; the change was run in the browser and the console was checked; there's a list of what changed and anything that was skipped."

How to check it worked

  • Run /context in Claude Code: CLAUDE.md is listed under Memory files.
  • Ask "what's our test command?" without naming the file; the answer should match.

Common problems

  • Instructions ignored: keep the file short and specific, and remove sections that don't apply.
  • Wrong commands get run: only list commands you have run yourself.

Use this file with your AI tool

Each tool reads project instructions from a different file name. Fill in the blanks above, then save it where your tool looks.

One command
npx commandvault add claude-md-template-for-a-next-js-supabase-app-9261f33c --tool claude
Save as CLAUDE.md
# CLAUDE.md

## What this is
{{app_name}} is a {{one_line_description}}. Users: {{who_uses_it}}.

## Commands
- Install: `{{package_manager}} install`
- Dev server: `{{package_manager}} run dev` (http://localhost:3000)
- Lint + types: `{{package_manager}} run lint && npx tsc --noEmit`
- Tests: `{{test_command}}`
- Build: `{{package_manager}} run build`

## Stack
- Next.js (App Router), React, TypeScript, {{styling}}
- Supabase: Postgres with row-level security on every table, Auth, Storage
- Hosting: {{hosting}}

## Where things live
- `src/app`: routes. Server components by default; add "use client" only when needed.
- `src/app/api`: route handlers. Validate input with zod, check auth first.
- `src/lib/server`: server-only data access (never import into client code).
- `supabase/migrations`: one SQL file per change, named `YYYYMMDDHHMMSS_what.sql`.

## Rules
- Every new table: enable RLS and write policies in the same migration.
- Never expose the service-role key to the browser or log it.
- Prefer editing existing components over creating near-duplicates.
- Match the surrounding code style; no new dependencies without asking.

## Done means
Lint, types and build pass; you ran the change in the browser and checked the console; you listed what you changed and anything you skipped.

Use it: Claude Code loads it at the start of every session. Check with /context (Memory files).

From Claude Code's docs , checked Oct 17, 2026.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.