Rules Hub
Coding Rules Library
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
Commit .env as a documented template with non-secret defaults; gitignore only .env*.local and put real secrets there.
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)
Gitignoring the base .env removes the documented template, and adding a separate env file per task multiplies config files. Contributors lose the single place that documents what variables exist.
Objašnjenje (HR)
Gitignoreanje osnovnog .env-a uklanja dokumentirani predlozak, a dodavanje zasebne env datoteke po zadatku umnaza konfiguracijske datoteke. Suradnici gube jedno mjesto koje dokumentira koje varijable postoje.
Good example
| 1 | # .gitignore — only the private overrides are ignored |
| 2 | .env*.local |
| 3 |
|
| 4 | # committed .env documents variables and holds safe defaults: |
| 5 | # PORT= |
| 6 | # FIGMA_PERSONAL_TOKEN= |
| 7 | # API_ACCESS_KEY= |
| 8 | # Real secrets live only in .env.local (gitignored) |
Explanation (EN)
A committed .env doubles as the template and the place for non-secret defaults, while .env.local holds actual credentials and stays out of git. One convention, no extra files.
Objašnjenje (HR)
Commitani .env sluzi i kao predlozak i kao mjesto za ne-tajne defaulte, dok .env.local drzi stvarne pristupne podatke i ostaje izvan gita. Jedna konvencija, bez dodatnih datoteka.
Notes (EN)
This mirrors Vite's env-file convention; reuse the standard stacked .env / .env.local naming instead of inventing per-feature env files.
Bilješke (HR)
Ovo prati Viteovu konvenciju env datoteka; ponovno koristi standardno slozeno .env / .env.local imenovanje umjesto izmisljanja env datoteka po znacajki.