Agent skill
env-vars
Manages environment variables and credentials securely. Use when configuring secrets or .env files.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/env-vars
SKILL.md
Environment Variables Workflow
On "env" or "credentials"
Step 1: Determine Action
question: "What do you need?"
options:
- { label: "Check current", description: "See what's configured" }
- { label: "Add new", description: "Add a new environment variable" }
- { label: "Debug missing", description: "Something isn't working" }
- { label: "Setup .env.local", description: "Create project env file" }
Step 2: Actions
Check current (Windows):
# List relevant env vars
[Environment]::GetEnvironmentVariable("SUPABASE_ACCESS_TOKEN", "User")
[Environment]::GetEnvironmentVariable("GOOGLE_CLIENT_ID", "User")
# etc.
Check current (Mac/Linux):
echo $SUPABASE_ACCESS_TOKEN
echo $GOOGLE_CLIENT_ID
# etc.
Add new:
1. Ask for variable name
2. Ask for value
3. Store in system env vars:
- Windows: setx NAME "value"
- Mac/Linux: Add to ~/.zshrc or ~/.bashrc
4. Report success
Debug missing:
1. Run npm run build to surface errors
2. Check which env vars are referenced
3. Compare against what's set
4. Report missing vars
Setup .env.local:
1. Check project for env var usage
2. Generate .env.local with required vars
3. Pull values from system env vars where available
4. Mark missing vars for user to fill
Security Rules
Avoid:
- Hardcode API keys in code
- Commit .env files to git
- Log secret values
- Store secrets in .env.example
Do:
- Use process.env.VAR_NAME
- Store secrets in system env vars
- Use .env.local for project-specific values
- Add .env* to .gitignore
Common Variables
| Category | Variables |
|---|---|
| Supabase | SUPABASE_ACCESS_TOKEN, NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY |
| Google OAuth | GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET |
| GitHub | GITHUB_PAT |
| AI/LLM | OPENAI_API_KEY, ELEVENLABS_API_KEY, OPENROUTER_API_KEY |
| RESEND_API_KEY | |
| Search | BRAVE_API_KEY |
.env.local Template
# Project-specific (fill these in)
NEXT_PUBLIC_SUPABASE_URL=https://[ref].supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
# These are read from system env vars automatically:
# - GOOGLE_CLIENT_ID
# - GOOGLE_CLIENT_SECRET
# - SUPABASE_ACCESS_TOKEN
# Project-specific overrides (optional)
YOUTUBE_REDIRECT_URI=http://localhost:3000/api/auth/youtube/callback
Troubleshooting
"Environment variable not found":
- Check if set:
echo $VAR_NAMEor$env:VAR_NAME - Restart terminal after setting
- For Next.js, restart dev server
"Invalid API key":
- Verify the key is correct (no extra spaces)
- Check key hasn't expired
- Verify key has required permissions
".env.local not loading":
- File must be in project root
- Restart dev server after changes
- Check file encoding (should be UTF-8)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?