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
2Sign In
FeaturesExplore
RulesSkillsKnowledgePrompts
PricingBlogContributorsInstall Guide
Sign In

Explore

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

225 rules

Enable RLS on every table

CRITICAL

Every table must have Row Level Security enabled. Tables without RLS are fully accessible via the anon key.

nextjssupabase
Next.js + Supabase Standards

Use the anon key for public-facing pages

HIGH

Public pages (explore, content detail) should use createReadOnlyClient() with the anon key, not the service_role.

nextjssupabase
Next.js + Supabase Standards

Never import server-only code in client components

CRITICAL

Files with "use client" must never import server-only modules like database clients, API keys, or service role credentials.

nextjssupabase
Next.js + Supabase Standards

Store sensitive env vars without NEXT_PUBLIC_ prefix

CRITICAL

Only the Supabase URL and anon key should have NEXT_PUBLIC_ prefix. All other Supabase credentials are server-only.

nextjssupabase
Next.js + Supabase Standards

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.

nextjssupabase
Next.js + Supabase Standards

Configure Connection Pooling

CRITICAL

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

supabaseconnection-pooling
Managed Databases

Mutable Search Path in Functions

HIGH

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

plpgsql_checkSplinter
PostgreSQL

Use utf8mb4 Instead of utf8

MEDIUM

MySQL's utf8 charset only supports 3-byte characters. Use utf8mb4 for full Unicode support.

MySQLSchema Design
MySQL & MariaDB

Verify Backup and Recovery Configuration

CRITICAL

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

supabaseBackup & Recovery
Managed Databases

Unindexed Foreign Keys

HIGH

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

SplinterDB Linting
PostgreSQL

Use Online DDL for ALTER TABLE

CRITICAL

ALTER TABLE in MySQL can lock the entire table. Use ALGORITHM=INPLACE or tools like gh-ost for safe migrations.

Online DDLMySQL
MySQL & MariaDB

Tables Must Have Primary Keys

HIGH

Tables without primary keys cannot use logical replication and have degraded query performance.

Schema DesignSplinter
PostgreSQL

Create Indexes Concurrently

HIGH

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

Squawkpostgresql
PostgreSQL

Auth Users Table Exposed to API

CRITICAL

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

supabaseSplinter
PostgreSQL

RLS Disabled on Public Tables

CRITICAL

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

Splinterrls
PostgreSQL

Index All Foreign Key Columns

HIGH

Unlike PostgreSQL, MySQL/InnoDB requires indexes on foreign key columns. Missing indexes cause slow JOINs.

MySQLMariaDB
MySQL & MariaDB

Avoid SELECT * in Production Queries

MEDIUM

SELECT * fetches all columns, wasting bandwidth and preventing covering index optimization.

MySQLQuery Optimization
MySQL & MariaDB

Add NOT NULL Constraint Safely

HIGH

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

Squawkpostgresql
PostgreSQL

Use Database Branching for Migrations

HIGH

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

Migration SafetyNeon
Managed Databases

Escape All Output with the Correct Context Function

CRITICAL

WordPress provides context-specific escaping functions. Using the wrong one — or none — enables XSS. Match esc_html, esc_attr, esc_url, wp_kses to the output context. [CWE-79 · A07:2021]

wordpressXSS
beforemerge-wordpress-review

Always Use $wpdb->prepare() for Database Queries

CRITICAL

Passing user input directly into SQL queries via $wpdb enables SQL injection. Always use $wpdb->prepare() with typed placeholders (%d, %s, %f, %i). [CWE-89 · A03:2021]

wordpressDatabase
beforemerge-wordpress-review

Always Check Capabilities Before Privileged Operations

CRITICAL

WordPress capabilities (current_user_can) are the authorization layer. Missing checks in REST endpoints, admin handlers, and AJAX allow subscribers to perform admin actions. [CWE-862 · A01:2021]

capabilitieswordpress
beforemerge-wordpress-review

Prevent Path Traversal in File Operations and Includes

CRITICAL

User input in include/require or file read/write paths allows attackers to read wp-config.php, delete files, or execute arbitrary PHP via ../ sequences. [CWE-22 · A01:2021]

wordpresspath-traversal
beforemerge-wordpress-review

Never Unserialize User-Controlled Data

CRITICAL

PHP's unserialize() instantiates arbitrary classes and triggers magic methods. Deserialization of user input enables remote code execution via gadget chains. [CWE-502 · A08:2021]

object-injectionwordpress
beforemerge-wordpress-review

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
Sort:
Previous1234...10Next