Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Keep .env public as a template; secrets go in .env*.local
Keep a documented nonsecret environment template and ignored/private real credentials, using the repository and framework convention.
Bad example
| 1 | # .gitignore |
| 2 | .env*.local |
| 3 | .env # gitignoring the base template too |
| 4 |
|
| 5 | # plus a separate .env.task.local.example per script — proliferation |
Explanation (EN)
Scattered undocumented configuration files make setup unclear; committing a real secret is never a documentation solution.
Objašnjenje (HR)
Raspršena nedokumentirana konfiguracija otežava postavljanje; objava stvarne tajne nikada nije rješenje za dokumentiranje.
Good example
| 1 | # .env.example, safe to commit |
| 2 | API_BASE_URL=https://api.example.com |
| 3 | API_ACCESS_KEY= |
| 4 |
|
| 5 | # .gitignore for a project that loads private .env |
| 6 | .env |
| 7 | .env.local |
Explanation (EN)
The example documents names without credentials; the ignored filename matches this project's actual configuration loader.
Objašnjenje (HR)
Predložak opisuje nazive bez vjerodajnica. Ignorirana datoteka odgovara stvarnom loaderu konfiguracije tog projekta.
Notes (EN)
Document required configuration in the repository's existing safe template convention and keep real secrets out of tracked files and client-exposed variables.
Bilješke (HR)
Potrebnu konfiguraciju dokumentiraj prema postojećoj sigurnoj konvenciji predložaka repozitorija. Stvarne tajne drži izvan praćenih datoteka i varijabli izloženih klijentu.
Exceptions / Tradeoffs (EN)
Some frameworks load committed .env defaults; others use .env.example with ignored .env. Follow the actual loader and repository policy rather than changing ignore rules globally.