Agent skill
environment-variables
Add environment variable
Install this agent skill to your Project
npx add-skill https://github.com/elie222/inbox-zero/tree/main/.claude/skills/environment-variables
SKILL.md
Environment Variables
This is how we add environment variables to the project:
-
Add to
.env.example:bashNEW_VARIABLE=value_example -
Add to
apps/web/env.ts:typescript// For server-only variables server: { NEW_VARIABLE: z.string(), } // For client-side variables client: { NEXT_PUBLIC_NEW_VARIABLE: z.string(), } experimental__runtimeEnv: { NEXT_PUBLIC_NEW_VARIABLE: process.env.NEXT_PUBLIC_NEW_VARIABLE, } -
For client-side variables:
- Must be prefixed with
NEXT_PUBLIC_ - Add to both
clientandexperimental__runtimeEnvsections
- Must be prefixed with
-
Add to
turbo.jsonunderglobalDependencies:json{ "tasks": { "build": { "env": [ "NEW_VARIABLE" ] } } }
examples:
-
input: |
Adding a server-side API key
.env.example
API_KEY=your_api_key_here
env.ts
server: { API_KEY: z.string(), }
turbo.json
"build": { "env": ["API_KEY"] } output: "Server-side environment variable properly added"
-
input: |
Adding a client-side feature flag
.env.example
NEXT_PUBLIC_FEATURE_ENABLED=false
env.ts
client: { NEXT_PUBLIC_FEATURE_ENABLED: z.coerce.boolean().default(false), }, experimental__runtimeEnv: { NEXT_PUBLIC_FEATURE_ENABLED: process.env.NEXT_PUBLIC_FEATURE_ENABLED, }
turbo.json
"build": { "env": ["NEXT_PUBLIC_FEATURE_ENABLED"] } output: "Client-side environment variable properly added"
references:
- apps/web/env.ts
- apps/web/.env.example
- turbo.json
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
qa-new-flow
Create a new browser QA flow file from the template
llm
Guidelines for implementing LLM (Language Model) functionality in the application
fullstack-workflow
Complete fullstack workflow combining GET API routes, server actions, SWR data fetching, and form handling. Use when building features that need both data fetching and mutations from API to UI.
write-tests
Write focused unit tests for backend and utility logic
e2e
Run and debug E2E flow tests. Use when triggering E2E tests, checking test status, debugging failures with Axiom logs, or setting up local E2E testing.
prisma
How to use Prisma
Didn't find tool you were looking for?