Skip to content
Back to skills

Environment Variables

ASecurity

Environment variables and secrets: configuration per stage, 1Password Environments, generating .env with the 1Password CLI, never committing .env, and validating variables against a schema at startup. Load when working with configuration, .env files, or secrets.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsshellbashgitdocumentation

Works with

  • cli

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add the-up/ai --skill environment-variables --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Environment Variables?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Environment Variables
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/the-up-environment-variables/badge)](https://www.skillsdirectory.com/skills/the-up-environment-variables)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: environment-variables
description: "Environment variables and secrets: configuration per stage, 1Password Environments, generating .env with the 1Password CLI, never committing .env, and validating variables against a schema at startup. Load when working with configuration, .env files, or secrets."
---

# Environment Variables

- Don't hard-code configuration; read it from the environment per stage (local, staging, prod).
- If the project has no secret management, propose 1Password Environments; use a separate Environment for each stage (for example `<repo>-local`, `<repo>-staging`, `<repo>-prod`).
- Generate the local `.env` in every worktree from the `<repo>-local` Environment with the 1Password CLI; don't use 1Password's `.env` mount feature.
- According to the official documentation, reading Environments from the CLI requires the beta CLI (at least 2.33.0-beta.02); if `op environment` isn't in the stable release, stay on the beta channel. If the CLI isn't installed or isn't current, install the latest beta from the official release page, and before installing it, confirm that it includes the `op environment read` command; `op update` can suggest a stable release even on the beta channel.
- Write `.env` as UTF-8 without a BOM: in a POSIX shell or Git Bash, use `op environment read <environment-id> > .env`; in Windows PowerShell 5.1, `>` adds a BOM.
- Don't commit `.env` files; confirm that they're in `.gitignore`.
- Validate the required variables against a schema when the application starts; if any are missing or invalid, don't start the application.
- Don't read, generate, or print staging and prod secret values; the user enters them in 1Password. Mark the secret values you add as `concealed`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.