From frontend-skills
Enforces type-safe environment variables using t3-env with Zod validation and blocks raw process.env access outside dedicated env files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/frontend-skills:setup-env-validationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
t3-env + zod for type-safe env vars. Single `src/env.ts` source of truth. PostToolUse hook block raw `process.env.` in TS/TSX/JS/JSX (skip env files + tests).
t3-env + zod for type-safe env vars. Single src/env.ts source of truth. PostToolUse hook block raw process.env. in TS/TSX/JS/JSX (skip env files + tests).
bun add @t3-oss/env-core zod
src/env.tsimport { createEnv } from "@t3-oss/env-core";
import { z } from "zod";
export const env = createEnv({
server: {
DATABASE_URL: z.string().url(),
API_SECRET: z.string().min(1),
},
clientPrefix: "PUBLIC_",
client: {
PUBLIC_API_URL: z.string().url(),
},
runtimeEnv: process.env,
});
Use import { env } from "@/env" everywhere instead of process.env.
Copy scripts/env-validation-check.sh + scripts/_hook-lib.sh -> .claude/hooks/. chmod +x. Add to PostToolUse (Edit|Write).
import { env } from "@/env" worksprocess.env.X in regular filesprocess.env in env.ts/env.mts/env.mjs/env.jsnpx claudepluginhub redpanda-data/ui-harness --plugin frontend-skillsLoads, validates, and provides type-safe access to environment config using dotenv and Zod. Fails fast at startup on missing or invalid variables.
Analyzes environment variables in code, generates .env.example templates, validates configurations and types, documents variables with examples, and provides naming and security best practices.
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.