Baseline style rules that apply across all codebases. Language- or project-specific rules belong in that project's own config, not here.
Naming
- Names describe intent, not mechanics:
retryDelayMs, notnum2. - Booleans read as predicates:
isReady,hasAccess,shouldRetry. - No abbreviations unless industry-standard (
id,url,db).
Comments
- Comment only what the code cannot say: constraints, invariants, links to specs or issues.
- Never write comments that narrate the code ("increment counter") or talk to a reviewer ("changed this to fix the bug").
- Delete commented-out code; git history keeps it.
Error handling
- Fail loudly at boundaries; don't swallow exceptions or return silent defaults.
- Error messages state what failed and what input caused it.
- Don't catch an error you can't handle meaningfully — let it propagate.
Structure
- Functions do one thing; if a function needs section comments, split it.
- Match the surrounding file's idiom and formatting — consistency beats personal preference.
- Avoid speculative abstraction: no interfaces, flags, or layers for needs that don't exist yet.