| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 7 | 8 | 0% |
| Commands | 0 | 13 | 0 | 0% |
| Section tags | 2 | 3 | 2 | 29% |
What each file covers
Sections
0 shared · 7 only in A · 8 only in B- − Supabase Monorepo
- − Structure
- − Common Commands
- − CI
- − Conventions
- − Skills
- − Studio
- + Copilot Code Review Instructions
- + Review Policy — Read This First
- + Confidence Threshold
- + What NOT to Comment On
- + What TO Comment On (Priority Order)
- + Comment Style
- + Repo Context
- + Topic-Specific Guidelines
Commands
0 shared · 13 only in A · 0 only in B- − pnpm dev:studio
- − pnpm dev:docs
- − pnpm dev:www
- − pnpm test:studio
- − pnpm e2e
- − pnpm build --filter=studio
- − pnpm lint --filter=studio
- − pnpm typecheck
- − pnpm format
- − pnpm generate:types
- − pnpm api:codegen
- − eslint-config-supabase
- − vitest
Section tags
2 shared · 3 only in A · 2 only in B- − test
- − architecture
- − monorepo
- + git-pr
- + agent-behaviour
- lint-format
- code-style
Line diff
supabase/supabase · .claude/CLAUDE.md
@@ −1 @@
1# Supabase Monorepo
2
3pnpm 11 + Turborepo monorepo. Requires Node >= 22.13.
4
5## Structure
6
7| Directory | Purpose |
8| ------------------------ | --------------------------------------------------------------------------- |
9| `apps/studio` | Supabase Studio/Dashboard — has its own `apps/studio/CLAUDE.md` (see below) |
10| `apps/docs` | Documentation site — Next.js app router, MDX (port 3001) |
11| `apps/www` | Marketing website — Next.js, app + pages (port 3000) |
12| `apps/design-system` | Component demos — source of truth for Studio UI patterns (port 3003) |
13| `apps/ui-library` | shadcn-style registry site for Supabase UI blocks (port 3004) |
14| `apps/lite-studio` | Lightweight Studio — different stack: React Router 7 + Vite + Tailwind v4 |
15| `packages/ui` | Shared UI components (shadcn/ui based) — `import { Button } from 'ui'` |
16| `packages/ui-patterns` | Composite components — subpath imports, e.g. `ui-patterns/AssistantChat` |
17| `packages/common` | Shared utils, telemetry constants, feature flags |
18| `packages/api-types` | Generated platform Management API types |
19| `packages/pg-meta` | SQL builders for Postgres introspection (`SafeSqlFragment`) |
20| `packages/shared-data` | Static data: pricing, plans, regions, error codes |
21| `e2e/studio`, `e2e/docs` | Playwright E2E tests |
22| `supabase/` | Local Supabase project: edge functions, migrations, config.toml |
23
24## Common Commands
25
26```bash
27pnpm dev:studio # run Studio dev server → http://localhost:8082
28pnpm dev:docs # run docs dev server
29pnpm dev:www # run www dev server
30pnpm test:studio # Studio unit tests (vitest)
31pnpm e2e # Studio E2E tests (playwright)
32pnpm build --filter=studio # build Studio
33pnpm lint --filter=studio # lint Studio
34pnpm typecheck # typecheck all packages
35pnpm format # Prettier write (check: pnpm test:prettier)
36pnpm generate:types # local DB types → supabase/functions/common/database-types.ts
37pnpm api:codegen # platform Management API types → packages/api-types
38```
39
40## CI
41
42Every PR must pass typecheck + lint (one workflow), Prettier, and a typos check. Other checks are path-filtered: Studio unit tests/build and the lint ratchet (ESLint warning count must not increase) run on `apps/studio/**` changes; app-specific test suites run on their own paths.
43
44Never hand-edit generated files: `packages/api-types/types/**`, `**/routeTree.gen.ts`, `**/__generated__/**`, `apps/docs/features/docs/generated/**`, `apps/www/.generated/**`, `supabase/functions/common/database-types.ts`.
45
46## Conventions
47
48**UI** — import from `'ui'`; primitives are shadcn/ui-based and exported unsuffixed (`Input`, `Select`, `Form`, …). Use `Button` — the in-house component and the standard everywhere (a raw shadcn `Button_Shadcn_` also exists but is rarely the right choice). Check `packages/ui/index.tsx` before creating new primitives. Higher-level patterns live in `packages/ui-patterns`.
49
50**Styling** — Tailwind only, semantic tokens (`bg-muted`, `text-foreground-light`), no hardcoded colors.
51
52**Exports** — named exports only; default exports are allowed only where a framework requires them (`pages/**`, `app/**`, config files — the eslint preset has the exact carve-out list). Lint-enforced across all apps via `eslint-config-supabase` (severity `warn` everywhere; hard-enforced in Studio by the lint ratchet).
53
54**Language** — Use U.S. English everywhere.
55
56## Skills
57
58The skills in `.claude/skills/` are the source of truth for conventions — load the relevant ones before working, don't guess:
59
60- `copywriting` — any user-facing text, anywhere in the monorepo
61- `docs-content` — anything under `apps/docs`
62- `telemetry-standards` — PostHog events, `packages/common/telemetry-constants.ts`
63- `dev-toolbar-review` — `packages/dev-tools`, `packages/common/posthog-client.ts`, `packages/common/feature-flags.tsx`
64- `safe-sql-execution` — any code that builds or executes SQL against user databases
65- `react-hook-form` — writing or modifying any form code, anywhere in the monorepo
66- `vitest` / `vercel-composition-patterns` — generic unit-testing and React composition references
67
68## Studio
69
70Before working on anything in `apps/studio`, read `apps/studio/CLAUDE.md` if it isn't already in context — it maps Studio tasks to required skills and covers the TanStack Start migration rules.
71
supabase/supabase · .github/copilot-instructions.md
@@ +1 @@
1# Copilot Code Review Instructions
2
3## Review Policy — Read This First
4
5You are a code reviewer for a large TypeScript/Next.js/React monorepo. Your reviews must be **low-noise and high-signal**. The team acts on fewer than 20% of default Copilot suggestions, so every comment you leave must earn its place.
6
7### Confidence Threshold
8
9Only comment when you are **>85% confident** the issue is a real bug, security vulnerability, or logic error. If you are unsure, do not comment. Silence is better than noise.
10
11### What NOT to Comment On
12
13Our CI pipeline already validates the following. **Never comment on these topics:**
14
15- **Formatting or whitespace** — Prettier runs on every PR
16- **Linting issues** — ESLint with auto-fix runs on every PR
17- **Type errors** — TypeScript strict-mode typecheck runs on every PR
18- **Typos or spelling** — Automated typo detection runs on every PR
19- **Missing tests for trivial changes** — Handled by topic-specific test instructions
20- **Import ordering or grouping** — Handled by linter
21- **Naming style preferences** (camelCase vs snake_case debates) — Follow existing file conventions
22- **Accessibility attributes on shadcn/Radix UI components** — See `studio-shadcn-components.instructions.md` for details
23
24### What TO Comment On (Priority Order)
25
261. **Logic errors and bugs** — Off-by-one, null derefs, wrong conditional, unreachable code, incorrect early returns
272. **Security vulnerabilities** — XSS, SQL injection, auth bypass, secrets in code, unsafe `dangerouslySetInnerHTML`
283. **Race conditions and async bugs** — Missing `await`, unhandled promise rejections, stale closures, effect cleanup issues
294. **Data loss risks** — Destructive operations without confirmation, missing error handling on writes
305. **API contract violations** — Wrong HTTP method, missing auth headers, incorrect request/response shapes
31
32### Comment Style
33
34- **Be advisory, not prescriptive.** Use "Consider..." or "This may..." — never demand changes.
35- **One comment per distinct issue.** Do not leave multiple comments about the same underlying problem.
36- **No self-contradictions.** If you suggest a change, do not then flag a problem with your own suggestion.
37- **Do not comment on individual commits.** Review the final state of the PR diff only.
38
39## Repo Context
40
41This is a TypeScript/Next.js/React monorepo:
42
43- `apps/studio/` — Supabase Dashboard (primary review target)
44- `apps/www/` — Marketing site
45- `apps/docs/` — Documentation
46- `packages/common/` — Shared code including telemetry definitions
47
48## Topic-Specific Guidelines
49
50Path-specific rules in `.github/instructions/`:
51
52- **Telemetry**: `studio-telemetry.instructions.md` — event naming, property conventions, feature flag measurement
53- **Testing**: `studio-testing.instructions.md` — test strategy, extraction patterns, coverage expectations
54- **Error Handling**: `studio-error-handling.instructions.md` — error classification, `ErrorMatcher` usage
55- **E2E Tests**: `studio-e2e-tests.instructions.md` — selector priority, anti-patterns (`waitForTimeout`, `force: true`)
56- **Composition Patterns**: `studio-composition-patterns.instructions.md` — avoid boolean props, use compound components
57- **UI Copy**: `studio-copy.instructions.md` → `apps/design-system/content/docs/copywriting.mdx`
58- **shadcn/Radix Components**: `studio-shadcn-components.instructions.md` — accessibility handled by primitives, do not flag
59- **Keyboard Shortcuts**: `studio-shortcuts.instructions.md` — shortcut registry pattern, search-input escape handler, when to flag missing coverage
60
61These files are scoped to `apps/studio/` and applied automatically during reviews.
62
@@ −1 +1 @@
1−# Supabase Monorepo
1+# Copilot Code Review Instructions
22
3−pnpm 11 + Turborepo monorepo. Requires Node >= 22.13.
3+## Review Policy — Read This First
44
5−## Structure
5+You are a code reviewer for a large TypeScript/Next.js/React monorepo. Your reviews must be **low-noise and high-signal**. The team acts on fewer than 20% of default Copilot suggestions, so every comment you leave must earn its place.
66
7−| Directory | Purpose |
8−| ------------------------ | --------------------------------------------------------------------------- |
9−| `apps/studio` | Supabase Studio/Dashboard — has its own `apps/studio/CLAUDE.md` (see below) |
10−| `apps/docs` | Documentation site — Next.js app router, MDX (port 3001) |
11−| `apps/www` | Marketing website — Next.js, app + pages (port 3000) |
12−| `apps/design-system` | Component demos — source of truth for Studio UI patterns (port 3003) |
13−| `apps/ui-library` | shadcn-style registry site for Supabase UI blocks (port 3004) |
14−| `apps/lite-studio` | Lightweight Studio — different stack: React Router 7 + Vite + Tailwind v4 |
15−| `packages/ui` | Shared UI components (shadcn/ui based) — `import { Button } from 'ui'` |
16−| `packages/ui-patterns` | Composite components — subpath imports, e.g. `ui-patterns/AssistantChat` |
17−| `packages/common` | Shared utils, telemetry constants, feature flags |
18−| `packages/api-types` | Generated platform Management API types |
19−| `packages/pg-meta` | SQL builders for Postgres introspection (`SafeSqlFragment`) |
20−| `packages/shared-data` | Static data: pricing, plans, regions, error codes |
21−| `e2e/studio`, `e2e/docs` | Playwright E2E tests |
22−| `supabase/` | Local Supabase project: edge functions, migrations, config.toml |
7+### Confidence Threshold
238
24−## Common Commands
9+Only comment when you are **>85% confident** the issue is a real bug, security vulnerability, or logic error. If you are unsure, do not comment. Silence is better than noise.
2510
26−```bash
27−pnpm dev:studio # run Studio dev server → http://localhost:8082
28−pnpm dev:docs # run docs dev server
29−pnpm dev:www # run www dev server
30−pnpm test:studio # Studio unit tests (vitest)
31−pnpm e2e # Studio E2E tests (playwright)
32−pnpm build --filter=studio # build Studio
33−pnpm lint --filter=studio # lint Studio
34−pnpm typecheck # typecheck all packages
35−pnpm format # Prettier write (check: pnpm test:prettier)
36−pnpm generate:types # local DB types → supabase/functions/common/database-types.ts
37−pnpm api:codegen # platform Management API types → packages/api-types
38−```
11+### What NOT to Comment On
3912
40−## CI
13+Our CI pipeline already validates the following. **Never comment on these topics:**
4114
42−Every PR must pass typecheck + lint (one workflow), Prettier, and a typos check. Other checks are path-filtered: Studio unit tests/build and the lint ratchet (ESLint warning count must not increase) run on `apps/studio/**` changes; app-specific test suites run on their own paths.
15+- **Formatting or whitespace** — Prettier runs on every PR
16+- **Linting issues** — ESLint with auto-fix runs on every PR
17+- **Type errors** — TypeScript strict-mode typecheck runs on every PR
18+- **Typos or spelling** — Automated typo detection runs on every PR
19+- **Missing tests for trivial changes** — Handled by topic-specific test instructions
20+- **Import ordering or grouping** — Handled by linter
21+- **Naming style preferences** (camelCase vs snake_case debates) — Follow existing file conventions
22+- **Accessibility attributes on shadcn/Radix UI components** — See `studio-shadcn-components.instructions.md` for details
4323
44−Never hand-edit generated files: `packages/api-types/types/**`, `**/routeTree.gen.ts`, `**/__generated__/**`, `apps/docs/features/docs/generated/**`, `apps/www/.generated/**`, `supabase/functions/common/database-types.ts`.
24+### What TO Comment On (Priority Order)
4525
46−## Conventions
26+1. **Logic errors and bugs** — Off-by-one, null derefs, wrong conditional, unreachable code, incorrect early returns
27+2. **Security vulnerabilities** — XSS, SQL injection, auth bypass, secrets in code, unsafe `dangerouslySetInnerHTML`
28+3. **Race conditions and async bugs** — Missing `await`, unhandled promise rejections, stale closures, effect cleanup issues
29+4. **Data loss risks** — Destructive operations without confirmation, missing error handling on writes
30+5. **API contract violations** — Wrong HTTP method, missing auth headers, incorrect request/response shapes
4731
48−**UI** — import from `'ui'`; primitives are shadcn/ui-based and exported unsuffixed (`Input`, `Select`, `Form`, …). Use `Button` — the in-house component and the standard everywhere (a raw shadcn `Button_Shadcn_` also exists but is rarely the right choice). Check `packages/ui/index.tsx` before creating new primitives. Higher-level patterns live in `packages/ui-patterns`.
32+### Comment Style
4933
50−**Styling** — Tailwind only, semantic tokens (`bg-muted`, `text-foreground-light`), no hardcoded colors.
34+- **Be advisory, not prescriptive.** Use "Consider..." or "This may..." — never demand changes.
35+- **One comment per distinct issue.** Do not leave multiple comments about the same underlying problem.
36+- **No self-contradictions.** If you suggest a change, do not then flag a problem with your own suggestion.
37+- **Do not comment on individual commits.** Review the final state of the PR diff only.
5138
52−**Exports** — named exports only; default exports are allowed only where a framework requires them (`pages/**`, `app/**`, config files — the eslint preset has the exact carve-out list). Lint-enforced across all apps via `eslint-config-supabase` (severity `warn` everywhere; hard-enforced in Studio by the lint ratchet).
39+## Repo Context
5340
54−**Language** — Use U.S. English everywhere.
41+This is a TypeScript/Next.js/React monorepo:
5542
56−## Skills
43+- `apps/studio/` — Supabase Dashboard (primary review target)
44+- `apps/www/` — Marketing site
45+- `apps/docs/` — Documentation
46+- `packages/common/` — Shared code including telemetry definitions
5747
58−The skills in `.claude/skills/` are the source of truth for conventions — load the relevant ones before working, don't guess:
48+## Topic-Specific Guidelines
5949
60−- `copywriting` — any user-facing text, anywhere in the monorepo
61−- `docs-content` — anything under `apps/docs`
62−- `telemetry-standards` — PostHog events, `packages/common/telemetry-constants.ts`
63−- `dev-toolbar-review` — `packages/dev-tools`, `packages/common/posthog-client.ts`, `packages/common/feature-flags.tsx`
64−- `safe-sql-execution` — any code that builds or executes SQL against user databases
65−- `react-hook-form` — writing or modifying any form code, anywhere in the monorepo
66−- `vitest` / `vercel-composition-patterns` — generic unit-testing and React composition references
50+Path-specific rules in `.github/instructions/`:
6751
68−## Studio
52+- **Telemetry**: `studio-telemetry.instructions.md` — event naming, property conventions, feature flag measurement
53+- **Testing**: `studio-testing.instructions.md` — test strategy, extraction patterns, coverage expectations
54+- **Error Handling**: `studio-error-handling.instructions.md` — error classification, `ErrorMatcher` usage
55+- **E2E Tests**: `studio-e2e-tests.instructions.md` — selector priority, anti-patterns (`waitForTimeout`, `force: true`)
56+- **Composition Patterns**: `studio-composition-patterns.instructions.md` — avoid boolean props, use compound components
57+- **UI Copy**: `studio-copy.instructions.md` → `apps/design-system/content/docs/copywriting.mdx`
58+- **shadcn/Radix Components**: `studio-shadcn-components.instructions.md` — accessibility handled by primitives, do not flag
59+- **Keyboard Shortcuts**: `studio-shortcuts.instructions.md` — shortcut registry pattern, search-input escape handler, when to flag missing coverage
6960
70−Before working on anything in `apps/studio`, read `apps/studio/CLAUDE.md` if it isn't already in context — it maps Studio tasks to required skills and covers the TanStack Start migration rules.
61+These files are scoped to `apps/studio/` and applied automatically during reviews.
7162
