agentleFS
fpindejfpindej/netrock/.claude/skills/add-env-var/SKILL.md

add-env-var

Skill234 starsChanged 3 months agoMITView on GitHub

Add an environment variable to backend or frontend

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 0 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add to appsettings.Development.json if it needs a dev-specific value (Aspire injects infrastructure connection strings automatically - only …

    line 10
  2. Very specific:

    If it maps to an Options class: use Section:Key naming in appsettings (e.g., Authentication:Jwt:AccessTokenLifetime)

    line 11
  3. Very specific:

    If it needs Aspire wiring for local dev: add via .WithEnvironment() in MyProject.AppHost/Program.cs

    line 12
  4. Very specific:

    If it needs an Options class: use /add-options-class

    line 13
  5. Very specific:

    Add to src/frontend/.env.example (documentation with placeholder)

    line 17
  6. Very specific:

    Add to src/frontend/.env.test (valid test value for CI)

    line 18
  7. Very specific:

    Add to src/frontend/src/lib/config/server.ts (server-only) or i18n.ts (client-safe)

    line 19
  8. Very specific:

    Never export server config from the barrel ($lib/config/index.ts)

    line 20
  9. Very specific:

    Add ARG + ENV to src/frontend/Dockerfile (before pnpm run build)

    line 25
  10. Very specific:

    Add --build-arg to .github/workflows/docker.yml

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Adds an environment variable (backend or frontend).

Backend-consumed variable

  1. Add to appsettings.Development.json if it needs a dev-specific value (Aspire injects infrastructure connection strings automatically - only add behavioral config here)
  2. If it maps to an Options class: use Section:Key naming in appsettings (e.g., Authentication:Jwt:AccessTokenLifetime)
  3. If it needs Aspire wiring for local dev: add via .WithEnvironment() in MyProject.AppHost/Program.cs
  4. If it needs an Options class: use /add-options-class

Frontend-consumed variable

  1. Add to src/frontend/.env.example (documentation with placeholder)
  2. Add to src/frontend/.env.test (valid test value for CI)
  3. Add to src/frontend/src/lib/config/server.ts (server-only) or i18n.ts (client-safe)
  4. Never export server config from the barrel ($lib/config/index.ts)

Frontend PUBLIC_* variable (SvelteKit $env/static/public)

  1. Steps 1-2 above
  2. Add ARG + ENV to src/frontend/Dockerfile (before pnpm run build)
  3. Add --build-arg to .github/workflows/docker.yml
  4. Import: import { PUBLIC_VAR } from '$env/static/public';

For secrets or keys that differ per environment (like Turnstile site keys), prefer runtime configuration via $env/dynamic/private with SSR layout data instead of build-time PUBLIC_* args.

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.