From base
Manages and validates environment variables. Use when adding, modifying, or referencing env vars, working with .env files, or separating client vs. server variables.
How this skill is triggered — by the user, by Claude, or both
Slash command
/base:environment-variablesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
If `src/lib/env.ts` does not exist, install dependencies and create the files before proceeding:
If src/lib/env.ts does not exist, install dependencies and create the files before proceeding:
bun add @t3-oss/env-core zod
import { createEnv } from "@t3-oss/env-core";
export const env = createEnv({
emptyStringAsUndefined: true,
runtimeEnv: process.env,
server: {},
});
// src/lib/env.test.ts
import { describe, expect, test } from "vitest";
import { env } from "./env";
describe("env", () => {
test("initializes without error", () => {
expect(env).toBeDefined();
});
});
| Type | Prefix | Exposed to client | Example |
|---|---|---|---|
| Client | VITE_ | Yes | VITE_API_URL |
| Server | None | No | DATABASE_URL |
| Shared | None | Both (build-time) | NODE_ENV, DEV |
Client = public endpoints, publishable keys, UI feature flags. Server = secrets, DB strings, internal URLs.
| File | Purpose | Git |
|---|---|---|
.env | Development defaults (local URLs, non-sensitive) | Committed |
.env.local | Secrets, API keys, overrides | Ignored |
Load order: .env.local overrides .env.
src/lib/env.ts in client, server, or shared.env; secret → .env.localsrc/lib/env.test.tsimport { env } from "@/lib/env";
| Task | Action |
|---|---|
| Access var | import { env } from "@/lib/env" |
| Client var | client section, VITE_ prefix |
| Server var | server section, no prefix |
| Shared var | shared section, build-time values |
| Validation | Zod schemas: z.string(), z.boolean(), etc. |
src/lib/env.ts exists with t3-env + Zod configsrc/lib/env.test.ts exists with validation testsclient, server, shared).env, secrets in .env.localnpx claudepluginhub kvnwolf/devtools --plugin baseAnalyzes environment variables in code, generates .env.example templates, validates configurations and types, documents variables with examples, and provides naming and security best practices.
Manage environment variables, runtime config, and server-only module boundaries safely for Next.js apps. Validates env vars at build time with Zod and prevents client-side leaks.
Manages environment variables and secrets in Claude Code sessions without exposing values. Validates, loads, and audits secrets while keeping them out of logs, diffs, and assistant context.