01 / Behavioral framing
Prove the contract violation
Reproduction is the start of triage. The file requires evidence from documented behavior, types, or established runtime semantics before treating the result as a bug.
Source excerpt starting at line 56.56- A reproducible error is not automatically a bug. First prove the behavior violates Better Auth's documented contract, TypeScript contract, or established runtime semantics.
02 / Good and bad pairs
Separate invalid input from an empty result
The session example distinguishes missing request headers from a real request without a session cookie, showing the API boundary that validation must preserve.
Source excerpt starting at line 59.59- Distinguish invalid usage from valid empty state. Example: a server session check without request headers is invalid usage; a server session check with headers but no session cookie is a valid request that returns `null`.
03 / Hard prohibitions
Name the portable representation
A specific byte type gives the cross-runtime requirement a practical consequence in everyday code. Tests have an explicit exception.
Source excerpt starting at line 29.29- Use `Uint8Array` instead of `Buffer` (except in tests)
04 / Verification by change type
Bound test execution
The file prohibits the root command because it runs every package, and supplies a file-and-pattern command for focused feedback.
Source excerpt starting at line 19.19- NEVER run `pnpm test` (runs all packages). Use `vitest path/to/test -t <pattern>`