forinda/euc-app/env-wiring-check
Claude Code and agent skill by forinda/euc-app
- community
Checking that the SKILL.md file is still in the repository.
Use when ConfigService.get('SOME_KEY') returns undefined or @Value silently falls back to process.env.
Install
npx vskill@latest install forinda/euc-app/env-wiring-checkSKILL.md
The same SKILL.md was published earlier as forinda/euc-app/env-wiring-check.
Fastest path: kick explain "ConfigService.get('MY_KEY') returned undefined" — pipe a failing run straight in if you prefer (pnpm test 2>&1 | kick explain). It distinguishes the entry-file cause from the test-file one, which is the step most people lose time on. The manual checks below are the same reasoning.
Diagnosis (in order):
- Open
src/index.ts. The first non-`reflect-metadata` import MUST beimport './config'. - Open
src/config/index.ts. It MUST run the loader as a top-level side effect — not just declare the schema. This is whatkick newgenerates:
``ts import { loadEnvFromSchema } from '@forinda/kickjs/config' import { fromZod } from '@forinda/kickjs-schema/zod' const envSchema = fromZod(z.object({ DATABASE_URL: z.string().url() })) export const env = loadEnvFromSchema(envSchema) ` (loadEnv(zodSchema) from @forinda/kickjs` is the equivalent for a bare Zod object. Either is fine — what matters is that it RUNS at module load.)
- The new key MUST be declared in the Zod schema.
@Value('NEW_KEY')accepts any string at the type level and falls back to raw `process.env` when the schema doesn't know the key — silently skipping Zod coercion. - After adding a key, re-run
kick typegen(or restartkick devif the typegen watcher missed it) so the globalKickEnvaugmentation picks it up.
- In a test?
createTestAppnever loadssrc/index.ts, so the entry's
import './config' never runs no matter how correct it is. The test file must import it itself: ``ts import '@/config' `` Symptom is identical to the missing-entry-import case, and step 1 will look fine, which is what makes it slow to spot.
Why `@Value` "works" but `ConfigService.get` doesn't: @Value has the process.env fallback that masks missing-side-effect-import bugs; ConfigService has none. If @Value('FOO') returns a value but ConfigService.get('FOO') returns undefined, the side-effect import of ./config is missing.
`reloadEnv` vs `resetEnvCache` — distinct, frequently mixed up:
reloadEnv()— re-readsprocess.envagainst the already registered schema. Use in HMR plugins after.envfile changes. Schema survives.resetEnvCache()— drops the registered schema entirely. Test-only. Calling it between dev requests drops the project's keys.
Nuances:
loadEnv()cache is sticky: onceloadEnv(extendedSchema)runs anywhere, no-arg calls reuse it — but only if it actually ran. Schema downgrades silently ifsrc/config/index.tsisn't imported.createConfigService(envSchema)is deprecated; the typegen-drivenConfigServicecovers it.dotenvis an optional peer dep in v5+ — projects upgrading from older versions may need to add it explicitly.- For HMR-friendly
.envedits, addenvWatchPlugin()tovite.config.ts— callsreloadEnv()automatically.
Fix recipe: add the key to the schema; add import './config' as the first non-reflect-metadata import in src/index.ts; add import '@/config' to any test that reads config; re-run kick typegen.
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 repositoryCheckingserver/.agents/skills/env-wiring-check/SKILL.md
Popularity
- 7-day trend score
- 0
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/forinda/euc-app/env-wiring-check)