Browse 354 rules, 42 knowledge articles, and 28 prompt templates across security, performance, architecture, and quality.
124 rules matching filters
Pick the smallest data type that fits the domain instead of defaulting to BIGINT or wide VARCHAR.
BeforeMerge scans your pull requests against these rules automatically. Get actionable feedback before code ships to production.
Use InnoDB for transactions, foreign keys, and row-level locking instead of MyISAM.
Run with STRICT_TRANS_TABLES so invalid or out-of-range values error instead of silently changing.
Declare FOREIGN KEY constraints so the database enforces valid references between tables.
Store points in time as timestamptz so values are unambiguous across time zones and DST.
Encode column and row invariants as CHECK constraints so bad data is rejected at the database.
Compute derived values with GENERATED ALWAYS AS ... STORED instead of duplicating logic in every writer.
Use text (optionally with a CHECK) instead of varchar(n); the length cap adds no performance benefit.
Use GENERATED ... AS IDENTITY or uuid for surrogate keys instead of the legacy serial pseudo-type.
Store monetary amounts as numeric/decimal so values are exact; binary floats introduce rounding errors.
Pick the smallest type that fits the domain instead of defaulting everything to text or bigint.
Group related write operations in a single transaction so they commit or roll back atomically.
Enforce data integrity at the schema level with NOT NULL, UNIQUE, CHECK, and FK constraints.
Apply every schema change through ordered, reviewed migration files in version control.
Use union string literals instead of `enum` for simpler types, better inference, and zero runtime cost.
The `!` operator lies to the compiler about null/undefined. Check and handle the empty case explicitly.
Add a `default` branch that assigns to `never` so adding a union member becomes a compile error until handled.
Mark properties and arrays `readonly` so accidental mutation is a compile error.
Turn on `noUncheckedIndexedAccess` so index access includes `undefined` and forces a presence check.
Annotate return types of exported functions to lock the public contract and surface errors at the source.
Use `satisfies` to check a value against a type while keeping its precise inferred literal type.
Give string/number IDs a branded type so a `UserId` can't be passed where an `OrderId` is expected.
Let TypeScript infer local types; add explicit annotations on exported functions and module boundaries.
An empty or log-only catch block hides failures, leaving the app in an inconsistent state with no diagnostic trail. Always handle, rethrow, or surface caught errors.