param087/saas-starter-skills/environment-and-config
Claude Code and agent skill by param087/saas-starter-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when wiring up env vars, secrets, or runtime config — validate them with zod at boot, split server-only from public (NEXT_PUBLIC_) values, and fail fast with a clear error instead of a cryptic undefined at runtime.
Install
npx vskill@latest install param087/saas-starter-skills/environment-and-configSKILL.md
The same SKILL.md was published earlier as param087/saas-starter-skills/environment-and-config.
Environment & Config
Overview
Untyped process.env is a runtime landmine: a missing STRIPE_SECRET_KEY shows up as undefined three layers deep at 2am. Validate the whole environment once at boot with zod, expose a typed env object, and make a misconfiguration a startup crash with an actionable message.
When to use
- Adding any new secret or config value.
- A bug traces back to an undefined/empty env var.
- You need to keep server secrets out of the client bundle.
The pattern
Import env everywhere instead of process.env. TypeScript now knows every key exists and its type.
Server vs client
- Only
NEXT_PUBLIC_*vars reach the browser. Never prefix a secret withNEXT_PUBLIC_. - Keep a
clientschema separate so it's obvious which values are public. - For strict isolation, put
import "server-only"in aenv.server.tsand only merge public keys into a client-safe export.
Operational hygiene
- Commit a `.env.example` with every key (empty or dummy values) — it's the contract for new devs and CI.
- Add
.env*.localto.gitignore; never commit real secrets. - In CI/prod, set vars in the platform (Vercel/Doppler/1Password), not in files.
Pitfalls
- Reading `process.env` directly — bypasses validation and types; you lose the safety net.
- `NEXT_PUBLIC_` on a secret — it gets inlined into client JS and shipped to every visitor.
- Validating lazily per-request — validate once at module load so boot fails loudly.
- No `.env.example` — onboarding becomes guesswork and CI breaks mysteriously.
- Trusting defaults in prod — require critical vars; only default the harmless ones.
Hand-off
A typed env that the whole app trusts. database-schema, authentication, payments-stripe, and transactional-email all read their secrets from here.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/environment-and-config/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/param087/saas-starter-skills/environment-and-config)