Skip to content
Productivity
Skill

/environment-variables

Add environment variable

BOOST
From plugin
inbox-zero
12k25 skills2 agents
Install
$ npx -y skills add elie222/inbox-zero --skill environment-variables --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/environment-variables

Context preview

The summary Claude sees to decide when to auto-load this skill.

Add environment variable

SKILL.md

environment-variables.SKILL.md
name: environment-variables
description: Add environment variable

Environment Variables

This is how we add environment variables to the project:

1. Add to `.env.example`:

      NEW_VARIABLE=value_example

2. Add to `apps/web/env.ts`:

      // 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,
      }

3. For client-side variables:

  • Must be prefixed with `NEXT_PUBLIC_`
  • Add to both `client` and `experimental__runtimeEnv` sections

4. Add to `turbo.json` under `globalDependencies`:

      {
        "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
Read more
Ships withinbox-zero

The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.

Get the whole plugin
Stats
12,401
Stars
1,559
Forks
Active
Maintenance
TypeScript
Language
7h ago
Last commit
3y ago
Created
3h ago
Added

Repo: elie222/inbox-zero

Other skills on inbox-zero.