BeforeMerge

AI-native code review knowledge base. Structured rules that catch what linters miss.

Product

  • Features
  • Explore
  • Pricing
  • Docs
  • GitHub

Company

  • About
  • Blog
  • Contributors
  • Contributing

Legal

  • Privacy Policy
  • Terms of Service
  • MIT License

© 2026 BeforeMerge. Built by Peter Krzyzek

BeforeMerge
Features
Explore
PricingBlogContributorsInstall Guide
3Sign In
FeaturesExplore
RulesSkillsKnowledgePrompts
PricingBlogContributorsInstall Guide
Sign In

Explore

Browse 354 rules, 42 knowledge articles, and 28 prompt templates across security, performance, architecture, and quality.

Sort:
Previous1...789...15Next

Automate these checks on every PR

BeforeMerge scans your pull requests against these rules automatically. Get actionable feedback before code ships to production.

Join WaitlistLearn More

354 rules

Push "use client" boundary as low as possible

HIGH

Don't add "use client" to page or layout files. Extract the interactive part into a small client component.

PerformancenextjssupabaseNext.js + Supabase Standards

Use loading.tsx for route-level loading states

MEDIUM

Add loading.tsx to route segments with slow data fetching. It provides instant visual feedback during navigation.

Qualitynextjssupabase

Use error.tsx for route-level error boundaries

HIGH

Every route group should have an error.tsx to prevent crashes from propagating to the entire app.

Qualitynextjssupabase

Never pass server-only data as props to client components

HIGH

Props to client components are serialized as JSON and sent to the browser. Don't pass full database records with sensitive fields.

Securitynextjssupabase

Enable strict mode in tsconfig.json

HIGH

Set "strict": true in tsconfig.json to catch null errors, implicit any, and type coercion bugs at compile time.

Qualitynextjssupabase

Never use any — use unknown for truly unknown types

HIGH

The any type disables all type checking. Use unknown and narrow the type, or use a specific type.

Qualitynextjssupabase

Use next/image for all images

HIGH

Use the Image component from next/image instead of raw HTML img tags. It auto-optimizes format, size, and loading.

Performancenextjssupabase

Use dynamic imports for heavy client components

MEDIUM

Use next/dynamic to code-split large client-only components like editors, charts, and maps.

Performancenextjssupabase

Add error.tsx to every route group

HIGH

Each route group ((auth), (dashboard), (content)) should have its own error boundary to contain failures.

Qualitynextjssupabase

Use structured logging — never console.log in production

HIGH

Use a structured logger like pino instead of console.log. Structured logs have timestamps, levels, and are filterable.

Qualitynextjssupabase

Never hardcode API keys or secrets in source code

CRITICAL

Always use environment variables for API keys, database credentials, and other secrets.

Securitynextjssupabase

Validate and sanitize all user input

HIGH

Use Zod or similar validation on all API routes and server actions. Never pass raw user input to database queries.

Securitynextjssupabase

Keep .env.example in sync with actual environment variables

HIGH

Maintain a .env.example file with all required variables (no values). New developers can't set up the project without it.

Qualitynextjssupabase

Test RLS policies explicitly

HIGH

Write tests that verify: User A cannot read User B's data. Anon users cannot read private data. RLS bugs are data breaches.

Securitynextjssupabase

Use requireAuth() as the first call in every authenticated server action

HIGH

Every server action that modifies data must call requireAuth() first to validate the user session and get orgId.

Securitynextjssupabase

RLS Disabled on Public Tables

CRITICAL

Tables in the public schema without Row Level Security allow unrestricted access through the API.

SecuritySplinterrls

Verify Backup and Recovery Configuration

CRITICAL

Every hosted database should have point-in-time recovery (PITR) enabled and tested.

ArchitecturesupabaseBackup & Recovery

Configure Connection Pooling

CRITICAL

Serverless and edge environments exhaust database connections without a pooler. Use PgBouncer, Supavisor, or platform-native pooling.

Performancesupabaseconnection-pooling

Use Database Branching for Migrations

HIGH

Test migrations on a branch/copy before applying to production. Neon and PlanetScale have native branching.

ArchitectureMigration Safety

Mutable Search Path in Functions

HIGH

Functions without a fixed search_path are vulnerable to search path injection attacks.

Securityplpgsql_checkSplinter

Add NOT NULL Constraint Safely

HIGH

Adding NOT NULL to an existing column requires a full table scan and exclusive lock.

PerformanceSquawkpostgresql

Create Indexes Concurrently

HIGH

Non-concurrent index creation locks the table for writes during the entire build.

PerformanceSquawkpostgresql

Auth Users Table Exposed to API

CRITICAL

The auth.users table is accessible through the API schema, leaking user data.

SecuritysupabaseSplinter

Unindexed Foreign Keys

HIGH

Foreign key columns without indexes cause slow JOINs and cascade operations.

PerformanceSplinterDB Linting
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
Next.js + Supabase Standards
PostgreSQL
Managed Databases
Managed Databases
Neon
Managed Databases
PostgreSQL
PostgreSQL
PostgreSQL
PostgreSQL
PostgreSQL