skills/environment-setup/SKILL.md
Configure and manage development, staging, and production environments. Use when setting up environment variables, managing configurations, or separating environments. Handles .env files, config management, and environment-specific settings.
npx skillsauth add jyjeanne/ai-setup-forge environment-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
.env.example (template):
# Application
NODE_ENV=development
PORT=3000
APP_URL=http://localhost:3000
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/myapp
DATABASE_POOL_MIN=2
DATABASE_POOL_MAX=10
# Redis
REDIS_URL=redis://localhost:6379
REDIS_TTL=3600
# Authentication
JWT_ACCESS_SECRET=change-me-in-production-min-32-characters
JWT_REFRESH_SECRET=change-me-in-production-min-32-characters
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_EXPIRY=7d
# Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASSWORD=your-app-password
# External APIs
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUBLISHABLE_KEY=pk_test_xxx
AWS_ACCESS_KEY_ID=AKIAXXXXXXXX
AWS_SECRET_ACCESS_KEY=xxxxxxxx
AWS_REGION=us-east-1
AWS_S3_BUCKET=myapp-uploads
# Monitoring
SENTRY_DSN=https://[email protected]/xxx
LOG_LEVEL=info
# Feature Flags
ENABLE_2FA=false
ENABLE_ANALYTICS=true
.env.local (per developer):
# Developer personal settings (add to .gitignore)
DATABASE_URL=postgresql://localhost:5432/myapp_dev
LOG_LEVEL=debug
.env.production:
NODE_ENV=production
PORT=8080
APP_URL=https://myapp.com
DATABASE_URL=${DATABASE_URL} # Injected from environment variables
REDIS_URL=${REDIS_URL}
JWT_ACCESS_SECRET=${JWT_ACCESS_SECRET}
JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET}
LOG_LEVEL=warn
ENABLE_2FA=true
config/env.ts:
import { z } from 'zod';
import dotenv from 'dotenv';
// Load .env file
dotenv.config();
// Define schema
const envSchema = z.object({
NODE_ENV: z.enum(['development', 'production', 'test']),
PORT: z.coerce.number().default(3000),
DATABASE_URL: z.string().url(),
JWT_ACCESS_SECRET: z.string().min(32),
JWT_REFRESH_SECRET: z.string().min(32),
SMTP_HOST: z.string(),
SMTP_PORT: z.coerce.number(),
SMTP_USER: z.string().email(),
SMTP_PASSWORD: z.string(),
STRIPE_SECRET_KEY: z.string().startsWith('sk_'),
LOG_LEVEL: z.enum(['error', 'warn', 'info', 'debug']).default('info'),
});
// Validate and export
export const env = envSchema.parse(process.env);
// Usage:
// import { env } from './config/env';
// console.log(env.DATABASE_URL); // Type-safe!
Error Handling:
try {
const env = envSchema.parse(process.env);
} catch (error) {
if (error instanceof z.ZodError) {
console.error('❌ Invalid environment variables:');
error.errors.forEach((err) => {
console.error(` - ${err.path.join('.')}: ${err.message}`);
});
process.exit(1);
}
}
config/index.ts:
interface Config {
env: string;
port: number;
database: {
url: string;
pool: { min: number; max: number };
};
jwt: {
accessSecret: string;
refreshSecret: string;
accessExpiry: string;
refreshExpiry: string;
};
features: {
enable2FA: boolean;
enableAnalytics: boolean;
};
}
const config: Config = {
env: process.env.NODE_ENV || 'development',
port: parseInt(process.env.PORT || '3000'),
database: {
url: process.env.DATABASE_URL!,
pool: {
min: parseInt(process.env.DATABASE_POOL_MIN || '2'),
max: parseInt(process.env.DATABASE_POOL_MAX || '10'),
},
},
jwt: {
accessSecret: process.env.JWT_ACCESS_SECRET!,
refreshSecret: process.env.JWT_REFRESH_SECRET!,
accessExpiry: process.env.JWT_ACCESS_EXPIRY || '15m',
refreshExpiry: process.env.JWT_REFRESH_EXPIRY || '7d',
},
features: {
enable2FA: process.env.ENABLE_2FA === 'true',
enableAnalytics: process.env.ENABLE_ANALYTICS !== 'false',
},
};
// Validate required fields
const requiredEnvVars = [
'DATABASE_URL',
'JWT_ACCESS_SECRET',
'JWT_REFRESH_SECRET',
];
for (const envVar of requiredEnvVars) {
if (!process.env[envVar]) {
throw new Error(`Missing required environment variable: ${envVar}`);
}
}
export default config;
config/environments/development.ts:
export default {
logging: {
level: 'debug',
prettyPrint: true,
},
cors: {
origin: '*',
credentials: true,
},
rateLimit: {
enabled: false,
},
};
config/environments/production.ts:
export default {
logging: {
level: 'warn',
prettyPrint: false,
},
cors: {
origin: process.env.ALLOWED_ORIGINS?.split(',') || [],
credentials: true,
},
rateLimit: {
enabled: true,
windowMs: 15 * 60 * 1000,
max: 100,
},
};
config/index.ts (unified):
import development from './environments/development';
import production from './environments/production';
const env = process.env.NODE_ENV || 'development';
const configs = {
development,
production,
test: development,
};
export const environmentConfig = configs[env];
docker-compose.yml:
version: '3.8'
services:
app:
build: .
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:password@db:5432/myapp
- REDIS_URL=redis://redis:6379
env_file:
- .env.local
depends_on:
- db
- redis
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: myapp
redis:
image: redis:7-alpine
project/
├── .env.example # Template (commit)
├── .env # Local (gitignore)
├── .env.local # Per developer (gitignore)
├── .env.production # Production (gitignore or vault)
├── config/
│ ├── index.ts # Main configuration
│ ├── env.ts # Environment variable validation
│ └── environments/
│ ├── development.ts
│ ├── production.ts
│ └── test.ts
└── .gitignore
.gitignore:
.env
.env.local
.env.*.local
.env.production
#environment #configuration #env-variables #dotenv #config-management #utilities
development
Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires.
development
Apply lean thinking to UX: hypothesis-driven design, collaborative sketching, and rapid experiments instead of heavy deliverables. Use when the user mentions "Lean UX", "design hypothesis", "UX experiment", "collaborative design", or "outcome over output". Covers hypothesis statements, MVPs for UX, and cross-functional collaboration. For Build-Measure-Learn, see lean-startup. For usability audits, see ux-heuristics.
development
Design MVPs, validated learning experiments, and pivot-or-persevere decisions using Build-Measure-Learn. Use when the user mentions "MVP scope", "validated learning", "pivot or persevere", "vanity metrics", or "test assumptions". Covers innovation accounting and actionable metrics. For 5-day prototype testing, see design-sprint. For customer motivation analysis, see jobs-to-be-done.
tools
Instrument, trace, evaluate, and monitor LLM applications and AI agents with LangSmith. Use when setting up observability for LLM pipelines, running offline or online evaluations, managing prompts in the Prompt Hub, creating datasets for regression testing, or deploying agent servers. Triggers on: langsmith, langchain tracing, llm tracing, llm observability, llm evaluation, trace llm calls, @traceable, wrap_openai, langsmith evaluate, langsmith dataset, langsmith feedback, langsmith prompt hub, langsmith project, llm monitoring, llm debugging, llm quality, openevals, langsmith cli, langsmith experiment, annotate llm, llm judge.