Env validation
Skill stevekinney/lesson-plan-adapter/.claude/skills/env-validation
npx -y skills add stevekinney/lesson-plan-adapter --skill env-validationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, as published. Nobody here has run it
Skill: Environment Variable Validation
Patterns for managing environment variables with @t3-oss/env-core.
Per-Package Ownership
Each package owns its environment variables in its own src/env.ts:
| Package | Variables |
|---|---|
packages/database | DATABASE_URL, DATABASE_URL_UNPOOLED |
packages/mcp | MCP_TOKEN_TTL_SECONDS |
applications/web | BETTER_AUTH_URL, BETTER_AUTH_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET |
Adding a New Variable
- Determine which package owns the variable
- Add to that package's
src/env.ts:server: { MY_NEW_VAR: z.string().min(1), }, runtimeEnv: { MY_NEW_VAR: process.env.MY_NEW_VAR, }, - Add to root
.env.examplewith a comment - Add to
.env.localfor local development - Set on Railway:
railway variable set MY_NEW_VAR=value - If needed in CI, add as a GitHub secret
Rules
- Never read
process.envdirectly — always go throughenv.ts - Never use SvelteKit's
$env/static/privateor$env/dynamic/private - Always set
emptyStringAsUndefined: true - Use
skipValidation: process.env.SKIP_ENV_VALIDATION === 'true'for CI - Client variables must be prefixed with
PUBLIC_