Environment Setup
Workflow for setting up environment variables and config
CLAUDE.md
When setting up environment configuration:
- Create a .env.example file listing every required variable with placeholder values and comments.
- Create a config module that reads all env vars in one place and exports typed objects.
- Validate required variables at startup — fail fast with a clear error if any are missing.
- Never access process.env directly outside the config module.
- Add .env to .gitignore. Verify it’s not tracked before committing.
- Document which variables are required vs optional and what values they expect.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.