agentleFS
opalinehqopalinehq/cli/.claude/skills/environment-variables/SKILL.md

environment-variables

Skill311 starsChanged 9 days agoApache-2.0View on GitHub

Environment variable management patterns. CRITICAL use when adding new environment variables (secrets, API keys, config), debugging "X not defined" or missing env var errors, tests passing locally but failing in CI, Turborepo not passing env vars to tasks, or troubleshooting deployment configuration errors.

  • Reads credentials

4 other projects use a version of this; 2 new projects in the last 4 weeks, against 0 the 4 before.

Adopted by

Surging: 2 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projectsWeek of Nov 22: 2 new projects
Oct 2026Nov 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 2 in all, so this is a hint, not a trend.

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never hardcode secrets or commit real values.

    line 13
  2. Distinctive:

    When adding a new environment variable:

    line 20
  3. Very specific:

    Add the variable with a safe placeholder and description to .env.example.

    line 24
  4. Very specific:

    CRITICAL: Add to package-specific turbo.json, NOT root.

    line 47
  5. Distinctive:

    Hosted deployments: ask the core team to verify the private secrets manager and deployment mapping

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Environment Variables Management

Source of Truth

.env.example documents the variables supported by the public repo. Contributors put local values in an untracked .env file or export them in the current shell. Never hardcode secrets or commit real values.

The core team injects hosted-service values through a private secrets manager. Hosted-service configuration and operations are intentionally outside this repo.

Four Integration Points

When adding a new environment variable:

1. Contributor Environment

Add the variable with a safe placeholder and description to .env.example. Contributors set the real value in .env or their shell.

2. GitHub CI Workflow

Map from GitHub Secrets in .github/workflows/ci.yml:

jobs:
  test:
    env:
      CLICKHOUSE_URL: ${{ secrets.CLICKHOUSE_URL }}
      API_KEY: ${{ secrets.API_KEY }}

Secrets must exist in repository settings → Secrets → Actions first.

3. Frontend VITE_* Variables

Frontend variables prefixed with VITE_ are baked into the UI by Vite when apps/desktop/ui is built (bun run build:selfhost builds it for the app). Set them in the environment of that build, and declare their types in apps/desktop/ui/src/vite-env.d.ts.

4. Package-Specific turbo.json

CRITICAL: Add to package-specific turbo.json, NOT root.

{
  "extends": ["//"],
  "tasks": {
    "test": {
      "passThroughEnv": ["CLICKHOUSE_URL", "API_KEY"]
    }
  }
}

Checklist: Adding New Environment Variable

  • Add a safe placeholder and description to .env.example
  • Set the local value in an untracked .env file or the current shell
  • Add to GitHub Secrets (if used in CI)
  • Add to .github/workflows/ci.yml (if used in CI)
  • If VITE_*: declare it in apps/desktop/ui/src/vite-env.d.ts
  • Add to package-specific turbo.json → passThroughEnv
  • Validate tests pass locally and in CI

Debugging Missing Env Vars

Check in order:

  1. Local environment: confirm the variable is exported or present in the untracked .env
  2. Package turbo.json: cat packages/your-package/turbo.json | grep -A 10 passThroughEnv
  3. GitHub Secrets: Repository settings → Secrets → Actions
  4. Hosted deployments: ask the core team to verify the private secrets manager and deployment mapping

Common Mistakes

❌ Adding to root turbo.json instead of package-specific ❌ Reading a VITE_* var at runtime: it is fixed when the UI is built

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.