environment-setup
Set up environment variables across dev, staging, and production
Managing environment variables across multiple environments is error-prone and time-consuming. This skill provides templates and best practices for .env files, TypeScript configuration validation, and Docker environment handling so you can set up environments correctly the first time.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "environment-setup". Create .env template for a Node.js API
Expected outcome:
Generated .env.example with sections for Application, Database, Redis, Authentication, Email (SMTP), External APIs (Stripe), AWS, Monitoring (Sentry), and Feature Flags. Each section includes comments explaining the variable purpose.
Using "environment-setup". Add environment validation with Zod
Expected outcome:
Created config/env.ts with Zod schema that validates DATABASE_URL is a valid URL, JWT secrets are at least 32 characters, SMTP_PORT is a number, and LOG_LEVEL is one of error/warn/info/debug. Throws descriptive errors on validation failure.
Using "environment-setup". Generate .gitignore rules for environment files
Expected outcome:
Added rules to prevent committing .env files: .env, .env.local, .env.*.local, and .env.production. Created .gitignore content block ready to copy into project.
Security Audit
Medium RiskThis skill is a documentation/education resource that provides templates and best practices for environment configuration. Static analysis flagged many patterns (credential examples, dotenv usage, environment variable access) but these are all placeholder examples in documentation, not actual executable code. The skill declares Read Write Edit Bash permissions, which is appropriate for configuration management. No malicious intent detected - all flagged patterns are legitimate documentation content. Users should be aware this skill can modify configuration files.
Medium Risk Issues (2)
Low Risk Issues (2)
Risk Factors
🔑 Env variables (5)
⚙️ External commands (1)
Detected Patterns
Quality Score
What You Can Build
Initialize environment configuration for a new project
Set up a complete environment configuration structure including .env.example, TypeScript validation, and per-environment configs to ensure consistent setup across your team.
Migrate legacy configuration to type-safe environment handling
Replace ad-hoc process.env access with validated Zod schemas and centralized configuration management for improved reliability and type safety.
Prepare production deployment configuration
Create production-specific environment templates with variable interpolation for secrets injection from CI/CD pipelines or secret managers.
Try These Prompts
I need a .env.example template for a Node.js application that uses PostgreSQL, Redis, and sends email via SMTP. Include common variables for authentication, database pooling, and feature flags.
Add Zod validation to our existing config/index.ts to ensure all required environment variables are present and properly formatted at startup. Include error handling with clear messages.
Create a docker-compose.yml with separate environment configurations for development and production. Use env_file for local development and environment variables for production. Include PostgreSQL and Redis services.
Set up environment configuration that supports AWS Secrets Manager for credential injection in production while using local .env files in development. Include validation for both scenarios.
Best Practices
- Always use .env.example as a committed template showing required variables without actual secrets
- Implement runtime validation with Zod at application startup to catch missing configuration early
- Use environment-specific config files to keep environment-specific logic organized and maintainable
Avoid
- Do not commit actual .env files with real credentials to version control
- Avoid accessing environment variables directly throughout code; use a centralized config module
- Do not use weak default values for secrets; require explicit configuration in production
Frequently Asked Questions
How do I keep my secrets safe when using this skill?
Can this skill connect to my database to validate credentials?
What is the difference between .env and .env.local?
How do I handle different values for development vs production?
Why should I use Zod for environment validation?
Can I use this skill with languages other than TypeScript?
Developer Details
Author
supercent-ioLicense
MIT
Repository
https://github.com/supercent-io/skills-template/tree/main/.agent-skills/environment-setup/Ref
main
File structure
📄 SKILL.md