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:
Previous123...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

Use timestamptz, not timestamp, for points in time

MEDIUM

Store points in time as timestamptz so values are unambiguous across time zones and DST.

QualityPostgreSQL

Be autovacuum-aware on high-churn tables

MEDIUM

Tune autovacuum per-table on high-churn tables so dead tuples and bloat don't degrade performance.

PerformancePostgreSQL

Use generated (stored) columns for derived values

MEDIUM

Compute derived values with GENERATED ALWAYS AS ... STORED instead of duplicating logic in every writer.

QualityPostgreSQL

Prefer identity columns (or uuid) over serial

MEDIUM

Use GENERATED ... AS IDENTITY or uuid for surrogate keys instead of the legacy serial pseudo-type.

QualityPostgreSQL

Use partial and expression indexes for filtered queries

MEDIUM

Index only the rows or computed expressions your queries actually filter on to cut index size and speed lookups.

PerformancePostgreSQL

Limit request body size to prevent resource exhaustion

MEDIUM

Cap the maximum accepted request/payload size so large uploads cannot exhaust memory or bandwidth.

SecurityNode.js Security

Run the process with least privilege, not as root

MEDIUM

Run Node under a dedicated unprivileged user with only the permissions it needs; never run as root.

SecurityNode.js Security

Avoid leaking stack traces and internal errors to clients

MEDIUM

Return generic error messages to clients and log details server-side; never expose stack traces or internals.

SecurityNode.js Security

Use parameterized queries to prevent injection

CRITICAL

Build database queries with parameter binding or an ORM, never by concatenating user input into SQL/NoSQL strings.

SecurityNode.js Security

Rate-limit public and auth endpoints

HIGH

Apply per-IP / per-account rate limiting and throttling to login, signup, password-reset, and other public endpoints.

SecurityNode.js Security

Store secrets in env or a secret manager, never in code

CRITICAL

Keep API keys, tokens, and credentials out of source; load them from environment variables or a managed secret store.

SecurityNode.js Security

Pin and verify dependency integrity with a lockfile

MEDIUM

Commit a lockfile and install with integrity verification (npm ci) so exact, tamper-checked versions are used.

SecurityNode.js Security

Keep dependencies patched and run npm audit in CI

MEDIUM

Track and update dependencies regularly; run npm audit or an SCA tool in CI to block builds with known-vulnerable packages.

SecurityNode.js Security

Implement CSRF protection for state-changing requests

HIGH

Protect non-idempotent requests with anti-CSRF tokens or SameSite cookies plus origin verification.

SecurityNode.js Security

Use HTTPS and secure, httpOnly, sameSite cookies

MEDIUM

Serve all traffic over HTTPS and set Secure, HttpOnly, and SameSite attributes on session and auth cookies.

SecurityNode.js Security

Use connection pooling

MEDIUM

Reuse database connections through a pool instead of opening a new connection per request.

PerformanceSQL & Databases

Add NOT NULL and appropriate constraints

MEDIUM

Enforce data integrity at the schema level with NOT NULL, UNIQUE, CHECK, and FK constraints.

QualitySQL & Databases

Manage schema changes with versioned migrations

MEDIUM

Apply every schema change through ordered, reviewed migration files in version control.

QualitySQL & Databases

Avoid N+1 queries (batch or join)

HIGH

Fetch related data with a join or a single batched query instead of one query per row.

PerformanceSQL & Databases

Wrap multi-step writes in transactions

HIGH

Group related write operations in a single transaction so they commit or roll back atomically.

QualitySQL & Databases

Use keyset (cursor) pagination instead of large OFFSET

MEDIUM

Paginate with a WHERE filter on the last seen key rather than OFFSET on deep pages.

PerformanceSQL & Databases

EXPLAIN/ANALYZE slow queries before optimizing

MEDIUM

Inspect the query plan with EXPLAIN ANALYZE to find sequential scans and missing indexes.

PerformanceSQL & Databases

Use the narrowest correct data types

MEDIUM

Pick the smallest type that fits the domain instead of defaulting everything to text or bigint.

QualitySQL & Databases

Lean on inference, annotate public API boundaries

MEDIUM

Let TypeScript infer local types; add explicit annotations on exported functions and module boundaries.

QualityTypeScript