# Dotenv Integration

> Dotenv Integration is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Integrate dotenv for environment variable loading with validation and type coercion.

- Skill name: `dotenv-integration`
- Category: [Development](https://www.openparable.com/skill/development/1)
- Source: https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/cli-mcp-development/skills/dotenv-integration/SKILL.md
- Repository: a5c-ai/babysitter (1,548 GitHub stars when collected)

## SKILL.md

# Dotenv Integration

Integrate dotenv for environment variable loading.

## Generated Patterns

```typescript
import { config } from 'dotenv';
import { expand } from 'dotenv-expand';
import { z } from 'zod';

// Load .env files in order
for (const file of ['.env.local', `.env.${process.env.NODE_ENV}`, '.env']) {
  expand(config({ path: file }));
}

const envSchema = z.object({
  NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
  PORT: z.coerce.number().default(3000),
  DATABASE_URL: z.string().url(),
  API_KEY: z.string().min(1),
});

export const env = envSchema.parse(process.env);
```

## Target Processes

- configuration-management-system
- mcp-server-bootstrap
- cli-application-bootstrap

---

Source: https://www.openparable.com/skill/development/dotenv-integration (OpenParable). Cite the canonical URL above.
