secure-env-setup

Configures environment-variable-driven secrets management with startup validation and placeholder-only .env.example files.

1|Updated Jun 3, 2026
One-click install
npx skills add https://github.com/tanveerriaz/Skillz --skill secure-env-setup-tanveerriaz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: secure-env-setup
Source: https://github.com/tanveerriaz/Skillz/tree/main/skills/secure-env-setup
Command: npx skills add https://github.com/tanveerriaz/Skillz --skill secure-env-setup-tanveerriaz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hardcoded credentials and accidentally committed .env files are the root cause of most secret leaks. This Skill establishes a disciplined configuration pattern so no secret is ever hardcoded, committed, logged, or silently missing at runtime. ## Core Features & Use Cases - Environment-Driven Configuration: Reads every secret via os.getenv or process.env, with zero credential literals in code. - Placeholder-Only .env.example: Generates a committed template documenting every required variable without exposing real values, while keeping .env gitignored. - Fail-Fast Startup Validation: Checks all required variables at boot, lists missing ones in a clear error, and validates formats (e.g., Stripe keys starting with sk_). - Use Case: When preparing a repository for public sharing or onboarding a new developer, use this Skill to audit the codebase for hardcoded secrets, produce a complete .env.example, and add startup validation so misconfiguration fails loudly instead of leaking. ## Quick Start Set up secure environment variable configuration for my project with a placeholder .env.example, gitignored .env, and startup validation that fails fast on missing secrets.

Frequently Asked Questions about secure-env-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage environment variables securely in a project?▼

Read every secret from the environment using os.getenv or process.env, never inline credential literals. Commit a .env.example with placeholder values, keep the real .env gitignored, and validate all required variables at startup so missing config fails fast.

How to create a .env.example file for my repository?▼

List every required variable with a placeholder value like SUPABASE_ANON_KEY=YOUR-ANON-KEY-HERE, and commit this file. Never put real values in .env.example; it serves as documentation so others know which configuration is required.

Should .env files be committed to git?▼

No, .env files must never be committed. Confirm .env and .env.* are listed in .gitignore before the first commit. Only the placeholder-only .env.example should be tracked in version control.

How do I validate environment variables at application startup?▼

Check that all required variables are present at boot and raise a clear error listing the missing ones, then exit rather than running half-configured. Add cheap format checks where possible, such as verifying a Stripe secret starts with sk_.

Are publishable or anon keys safe to expose in code?▼

Publishable keys are safe to expose but should still be loaded from environment variables so environments stay swappable. Optional feature keys should be treated as optional vars that degrade gracefully when absent rather than crashing.

What should I do when rotating an API key?▼

Update the key in your local .env and the host's secret store, then revoke the old value and treat it as compromised. Production secrets belong in the deployment platform's dashboard or secret store, never in the repository.