- Functions: 4-20 lines. Split if longer.
- Files: under 500 lines. Split by responsibility.
- One thing per function, one responsibility per module (SRP).
- Names: specific and unique. Avoid
data,handler,Manager. Prefer names that return <5 grep hits in the codebase. - Types: explicit. No
any, noDict, no untyped functions. - No code duplication. Extract shared logic into a function/module.
- Early returns over nested ifs. Max 2 levels of indentation.