shared/environment-config/SKILL.md
The environment-config skill standardizes how agents manage environment variables, secrets, and application configuration across local development and deployed environments.
npx skillsauth add 7a336e6e/skills environment-configInstall 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.
Keep application configuration secure, consistent, and well-documented so that any agent or developer can set up and run the project without guessing at required values.
Every environment variable used by the project must appear in .env.example with a placeholder value and a comment:
# .env.example — checked into git, safe to share
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/myapp_dev
DATABASE_POOL_SIZE=5
# Authentication
JWT_SECRET=replace-with-a-strong-random-string
JWT_EXPIRY_SECONDS=3600
# External APIs
STRIPE_API_KEY=sk_test_placeholder
SENDGRID_API_KEY=SG.placeholder
Copy this file to .env for local development and fill in real values. The .env file must be in .gitignore.
Python (Flask / FastAPI):
import os
from dotenv import load_dotenv
load_dotenv() # reads .env into os.environ
class Config:
DATABASE_URL: str = os.environ["DATABASE_URL"]
JWT_SECRET: str = os.environ["JWT_SECRET"]
JWT_EXPIRY: int = int(os.environ.get("JWT_EXPIRY_SECONDS", "3600"))
DEBUG: bool = os.environ.get("DEBUG", "false").lower() == "true"
config = Config()
Node.js (Express / Vite):
// config.js
import "dotenv/config";
export const config = {
databaseUrl: requireEnv("DATABASE_URL"),
jwtSecret: requireEnv("JWT_SECRET"),
jwtExpiry: parseInt(process.env.JWT_EXPIRY_SECONDS || "3600", 10),
debug: process.env.DEBUG === "true",
};
function requireEnv(name) {
const value = process.env[name];
if (!value) {
throw new Error(`Missing required environment variable: ${name}`);
}
return value;
}
Fail fast if required variables are missing. Do not let the application start with invalid configuration — a clear error at boot is better than a cryptic failure at runtime.
# Python validation example
REQUIRED_VARS = ["DATABASE_URL", "JWT_SECRET", "STRIPE_API_KEY"]
missing = [v for v in REQUIRED_VARS if not os.environ.get(v)]
if missing:
raise RuntimeError(f"Missing required env vars: {', '.join(missing)}")
// Node.js validation example
const REQUIRED = ["DATABASE_URL", "JWT_SECRET", "STRIPE_API_KEY"];
const missing = REQUIRED.filter((key) => !process.env[key]);
if (missing.length > 0) {
throw new Error(`Missing required env vars: ${missing.join(", ")}`);
}
Add a comment in .env.example explaining each variable's purpose, expected format, and where to obtain its value (e.g., "Get from Stripe dashboard > API keys").
.env.example as the single source of truth for required variables.env and .env.local to .gitignore before the first commit.env files containing real credentialsConfiguration files (.env.example, config modules) written to the project root and documented in the project README when applicable.
../git-workflow/SKILL.md — ensures .env is excluded via .gitignoredevelopment
Implement features using the Red-Green-Refactor cycle to ensure testability and correctness from the start.
data-ai
Manage the `tasks.md` ledger with strict locking and collision avoidance protocols to allow multiple agents to work in parallel safely.
development
The git-workflow skill defines branching conventions, commit message formats, and pull request standards that all agents must follow for consistent version control.
development
Create clear, maintainable documentation for APIs, codebases, and end-users. Treat documentation as code.