Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2universalStack: universal
documentationcommentsdata-modellingclarity
Add a clarifying comment when a field's meaning or unit changes
When a field changes semantics (e.g. int to decimal where the decimal encodes a fraction), document what the values mean so callers are not surprised.
PR: vinify-backend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | quantity: number; // was int, now decimal — meaning unclear |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | /** Accepts decimals. 1.2 = 1 full bottle + 20% of a bottle. */ |
| 2 | quantity: number; |
Explanation (EN)
Objašnjenje (HR)