# Beforemerge Nextjs Supabase Standards

> Opinionated best practices for full-stack Next.js 14+ App Router applications with Supabase. Covers project structure, data fetching, auth, RLS, server actions, components, TypeScript, performance, error handling, security, and testing. Use this skill when building, reviewing, or auditing Next.js + Supabase applications. Triggers on tasks involving Supabase client usage, RLS policies, server actions, middleware auth, migration patterns, or component architecture decisions.

- Skill: `beforemerge/beforemerge-nextjs-supabase-standards` (Agent Skill, multi-file: 56 files)
- Install (CLI): `npx skillmds@latest add beforemerge/beforemerge-nextjs-supabase-standards`
- Raw SKILL.md: https://api.skillmd.com/api/skills/beforemerge/beforemerge-nextjs-supabase-standards/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- License: MIT
- Author: beforemerge (https://skillmd.com/u/beforemerge)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/beforemerge/beforemerge-nextjs-supabase-standards

---


# BeforeMerge: Next.js + Supabase Standards

A curated collection of 53 opinionated, production-proven best practices for building full-stack applications with Next.js (App Router) and Supabase.

## When to Apply

Reference these rules when:
- Building new features in a Next.js + Supabase application
- Reviewing pull requests that touch Supabase queries, RLS policies, or server actions
- Setting up auth middleware or session management
- Writing database migrations or RLS policies
- Auditing security of Supabase client usage
- Optimizing performance of server/client component boundaries

## Rule Categories by Priority

| Priority | Category | Count | Prefix | Focus |
|----------|----------|-------|--------|-------|
| 1 | Security | 17 | `sec-` | Client types, RLS, secrets, auth, input validation |
| 2 | Performance | 9 | `perf-` | Server components, parallel fetches, images, indexes |
| 3 | Architecture | 7 | `arch-` | Route groups, server actions, project structure |
| 4 | Quality | 20 | `qual-` | Error handling, TypeScript, logging, migrations |

## How to Use

Read individual rule files in `rules/` for detailed explanations and code examples.

Each rule contains:
- Brief explanation of why it matters
- Good and bad code examples
- Impact rating (CRITICAL, HIGH, MEDIUM, LOW)
- Detection hints for automated enforcement

