# General Rules

- Diagnose before fixing: explain possible causes before changing code
- Functions should be no more than 50 lines; break larger ones into helpers
- Single responsibility per function/module
- Descriptive names: `calculateInvoiceTotal` not `doCalc`
- Remove commented-out code and debug statements before completing
- Never swallow exceptions silently
