- List required keys for prod.
- Keep .env.example in sync.
- Add a CI step that parses the example.
- Never commit real .env files.
- Use the env validator tool while editing.
Tutorial
Validate .env.example in CI
Fail builds when required keys are missing from the example.