Skip to main content
skill CX Codex

env-setup-wizard — Claude Code skill: what it does, how to install

env-setup-wizard structures .env files, configures Zod schema validation, and prevents secret leaks into git repositories.

MIT 308 installs ★ 440 updated 2026-10-20

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OneWave-AI/claude-skills --skill env-setup-wizard -a claude-code
Open on GitHub

What env-setup-wizard does

The skill organizes application environment configuration across development, staging, and production tiers. It scaffolds files like .env.example, creates .gitignore exception rules, and sets up centralized modules such as src/lib/env.ts for database strings and API credentials.

Rather than reading untyped values from process.env, it writes startup validation logic using Zod. If a critical variable is missing, the process terminates immediately with an error log. It also handles Next.js environments by separating server secrets from client-exposed variables prefixed with NEXT_PUBLIC_, or via @t3-oss/env-nextjs.

Because the validation code relies on Zod and TypeScript, projects need those dependencies installed before running the generated checks.

What it helps with

  • Scaffold clean .env.example templates and .gitignore rules
  • Add runtime environment validation using Zod schemas
  • Isolate server secrets from browser variables in Next.js
  • Prevent broken deployments caused by missing configuration

Example prompts for the agent

  • Set up environment variables and validation for a Next.js app with Postgres
  • Generate an .env.example template and a type-safe src/lib/env.ts file
  • Configure startup env validation with Zod and handle client-side variables

How to install env-setup-wizard

1Skills CLI (Vercel)

npx skills add OneWave-AI/claude-skills --skill env-setup-wizard -a claude-code

2Manually: put the files in place

~/.claude/skills/env-setup-wizard/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/env-setup-wizard/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about env-setup-wizard

How do I install env-setup-wizard in Claude Code?

Run this command in your terminal: npx skills add OneWave-AI/claude-skills --skill env-setup-wizard -a claude-code.

What does env-setup-wizard do?

It outlines environment hierarchy, writes example configuration files, and generates schema validation code to catch missing variables at startup.

Does env-setup-wizard support Next.js?

Yes, it configures separate client and server schemas, using NEXT_PUBLIC_ prefixes or the @t3-oss/env-nextjs helper.

Source text

SKILL.md · MIT
---
name: env-setup-wizard
description: Set up environment variables, .env files, and configuration management. Use when configuring environment variables, creating .env files, or managing app configuration.
---

# Environment Setup Wizard

## Instructions

When setting up environment configuration:

1. **Identify required variables** for the project
2. **Create .env structure** with proper organization
3. **Set up type-safe access** to env vars
4. **Add validation** on startup
5. **Document all variables**

## File Structure

```
project/
├── .env                  # Local development (git-ignored)
├── .env.example          # Template (committed to git)
├── .env.local            # Local overrides (git-ignored)
├── .env.development      # Development defaults
├── .env.production       # Production defaults
└── src/
    └── lib/
        └── env.ts        # Type-safe env access
```

## .env.example Template

```bash
# ===================
# Application
# ===================
NODE_ENV=development
APP_URL=http://localhost:3000
PORT=3000

# ===================
# Database
# ===================
DATABASE_URL=postgresql://user:password@localhost:5432/dbname

# ===================
# Authentication
# ===================
# Generate with: openssl rand -base64 32
JWT_SECRET=
NEXTAUTH_SECRET=
NEXTAUTH_URL=http://localhost:3000

# ===================
# Third-party APIs
# ===================
# Get from: https://stripe.com/dashboard
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=

# Get from: https://resend.com
RESEND_API_KEY=

# ===================
# Storage
# ===================
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
S3_BUCKET_NAME=
```

## Type-Safe Environment (Zod)

```typescript
// src/lib/env.ts
import { z } from 'zod';

const envSchema = z.object({
  // App
  NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
  APP_URL: z.string().url(),
  PORT: z.coerce.number().default(3000),

  // Database
  DATABASE_URL: z.string().min(1),

  // Auth
  JWT_SECRET: z.string().min(32),
  NEXTAUTH_SECRET: z.string().min(32),
  NEXTAUTH_URL: z.string().url(),

  // APIs (optional in dev)
  STRIPE_SECRET_KEY: z.string().optional(),
  RESEND_API_KEY: z.string().optional(),
});

// Validate on import
const parsed = envSchema.safeParse(process.env);

if (!parsed.success) {
  console.error('Invalid environment variables:');
  console.error(parsed.error.flatten().fieldErrors);
  process.exit(1);
}

export const env = parsed.data;

// Type export for use elsewhere
export type Env = z.infer<typeof envSchema>;
```

## Next.js Specific

```typescript
// src/lib/env.ts for Next.js
import { z } from 'zod';

// Server-side variables
const serverSchema = z.object({
  DATABASE_URL: z.string(),
  JWT_SECRET: z.string(),
});

// Client-side variables (must start with NEXT_PUBLIC_)
const clientSchema = z.object({
  NEXT_PUBLIC_APP_URL: z.string().url(),
  NEXT_PUBLIC_STRIPE_KEY: z.string(),
});

export const serverEnv = serverSchema.parse(process.env);
export const clientEnv = clientSchema.parse({
  NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
  NEXT_PUBLIC_STRIPE_KEY: process.env.NEXT_PUBLIC_STRIPE_KEY,
});
```

## T3 Env (Recommended for Next.js)

```typescript
// src/env.mjs
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
  server: {
    DATABASE_URL: z.string().url(),
    NODE_ENV: z.enum(["development", "test", "production"]),
  },
  client: {
    NEXT_PUBLIC_APP_URL: z.string().url(),
  },
  runtimeEnv: {
    DATABASE_URL: process.env.DATABASE_URL,
    NODE_ENV: process.env.NODE_ENV,
    NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
  },
});
```

## .gitignore

```gitignore
# Environment files
.env
.env.local
.env.*.local

# Keep example
!.env.example
```

## Security Best Practices

1. **Never commit secrets** to git
2. **Use different values** per environment
3. **Rotate secrets regularly**
4. **Use secret managers** in production (Vault, AWS Secrets Manager)
5. **Validate on startup** to fail fast
6. **Prefix client vars** (NEXT_PUBLIC_, VITE_, REACT_APP_)

© OneWave-AI · MIT · OneWave-AI/claude-skills

Similar skills

All skills for Backend and APIs →

From the same set185

The whole set →
error-boundary-creator error-boundary-creator sets up error boundaries, fallback UIs, and crash reporting for React and Next.js apps. Keeps uncaught component crashes from breaking the entire page. CX Codex +1 316installs docker-debugger The docker-debugger skill helps investigate container, Dockerfile, networking, and docker-compose problems. Use it when a build fails or a container behaves unexpectedly. CX Codex +1 314installs scout scout reads the running conversation and names the skill or subagent that fits the task, with a short plan for using them together. CX Codex +1 314installs test-coverage-improver test-coverage-improver — a skill that identifies coverage gaps and generates missing tests for critical code paths. CX Codex +1 312installs client-proposal-generator client-proposal-generator is a Claude Code skill that turns a client brief into proposal.md with a work plan, timeline, team, pricing, and terms. It drafts a consulting proposal for a specific client. CX Codex +1 301installs security-pentest-planner security-pentest-planner builds a penetration test plan for web applications: analyzes code, API routes, authentication and infrastructure configs, generates pentest-plan.md with concrete test cases. CX Codex +1 297installs tech-due-diligence tech-due-diligence scans the code of a company you plan to buy or fund and writes tech-dd-report.md, with risk ratings and a go/no-go verdict. CX Codex +1 294installs workflow-automator The workflow-automator skill turns a description of a manual business process into an automation plan. It produces a Markdown document with diagrams, tool suggestions, and implementation steps. CX Codex +1 285installs

Project sponsors

Companies that keep this analytics open