SIDDARTHA577/envguard-node / .agents/skills/envguard-setup
envguard-setup
UnverifiedGuides the installation and configuration of EnvGuard in a Node.js/TypeScript project, generating appropriate schema files, .env.example, and startup validation checks tailored to the project's package manager.
envguard-setup Skill
Guides the installation, configuration file generation, and startup fail-fast validation integration of EnvGuard in Node.js and TypeScript projects.
When to Trigger
- The user asks to install or configure EnvGuard in a project.
- The project needs fail-fast runtime environment validation at startup.
- Initializing
envguard.config.tsorenvguard.config.jsonwith matching.env.example.
When NOT to Trigger
- EnvGuard is already installed and properly validating configurations.
- Conducting a non-destructive audit without installing packages (use
envguard-audit). - Migrating legacy libraries with extensive existing refactoring needs (use
envguard-migrate).
Supported Projects & Environments
- Node.js 22.x, 24.x, and 26.x.
- Package managers:
npm,pnpm,yarn,bun. - Module formats: modern ESM (
"type": "module") and CommonJS. - TypeScript (
tsconfig.json) or plain JavaScript environments.
Required Tools & Permissions
- Tools: File reader, file writer, command execution (
read_file,write_file,run_command). - Permissions: Project workspace read and write permissions to install packages and write configuration files.
Expected Inputs
- Project root path containing
package.json. - Desired environment variables or existing
.env.example.
Step-by-Step Workflow
Step 1: Detect Project Tooling & Module System
- Inspect
package.jsonfor module system ("type": "module"for ESM, otherwise CommonJS). - Detect the active package manager via lockfiles (
pnpm-lock.yaml,yarn.lock,package-lock.json). - Check for TypeScript presence via
tsconfig.jsonor devDependencies.
Step 2: Install envguard-node
- Run the detected package manager install command:
- npm:
npm install envguard-node - pnpm:
pnpm add envguard-node - yarn:
yarn add envguard-node
- npm:
Step 3: Initialize Configuration File
- Generate
envguard.config.ts(orenvguard.config.js/envguard.config.json) defining the schema. - Create or update
.env.examplewith safe placeholder values matching the schema.
Step 4: Inject Startup Fail-Fast Check
- Integrate validation at the earliest entry point (
src/index.ts,src/server.ts, orsrc/app.js):import { guard } from 'envguard-node'; import configSchema from './envguard.config.js'; const config = guard(configSchema, undefined, { throwOnError: true }).data; export { config };
Validation Steps
- Verify
package.jsonincludesenvguard-nodein dependencies. - Execute
npx envguard checkto verify configuration syntax. - Run
npm testor the project build command to ensure no type or runtime regression.
Expected Outputs
package.jsonupdated withenvguard-node.- A newly created
envguard.config.tsorenvguard.config.json. - A synchronized
.env.examplefile. - Entrypoint updated with fail-fast initialization.
Failure Handling
- If installation fails due to package manager errors, display the exact error and suggest manual installation.
- If overwriting an existing configuration file is required, prompt for explicit user confirmation.
Safety & Privacy Boundaries
- NEVER write or overwrite actual
.envfiles containing secrets. - NEVER log or expose raw environment values during setup commands.
- Ensure
.gitignoreignores.envand.env.localbefore completing setup.
Example User Prompts
- "Configure startup environment validation with envguard-setup"
- "Install and set up EnvGuard in this project"
- "Initialize envguard.config.ts and fail-fast startup checks"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |