agentleFS
Fractal-TessFractal-Tess/agents/skills/shell-secrets/SKILL.md

shell-secrets

Skill1 starsChanged 3 months agoMITView on GitHub

Which API keys and secrets are loaded into the user's shell on every host, under which environment variable names, and how to add a new one. Use before asking the user for an API key or token, when a tool or script needs a credential (OpenRouter, Dokploy, fal.ai, MiniMax, Z.ai, Moonshot, OpenCode, React Bits), when an expected variable is empty, or when adding a secret to the NixOS config.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    All secrets are SOPS-encrypted in ~/nixos/secrets/*.json and rendered by the modules in ~/nixos/modules/nixos/services/sops/.

    line 12
  2. Very specific:

    Not exported, on purpose: Gitadel (gtd reads /run/secrets/gitadel_api_token itself), Syncthing and SSH material (files), and service-only …

    line 31
  3. Very specific:

    If a variable is missing on a host, the host has not been rebuilt since the module changed.

    line 57
  4. Very specific:

    Import it in modules/nixos/services/sops/default.nix.

    line 72
  5. Distinctive:

    Add a row to the table above (and remove or edit rows when a secret is removed or renamed).

    line 73

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

Shell secrets

Keep this skill current. Whenever a secret is added, removed, renamed, or its variable changes in ~/nixos (secrets/*.json or modules/nixos/services/sops/), update the table below in the same change.

All secrets are SOPS-encrypted in ~/nixos/secrets/*.json and rendered by the modules in ~/nixos/modules/nixos/services/sops/. Every module is on by default, so all hosts (vd, kiwi, neo) get the same set. API keys meant for the shell are rendered to ~/.secrets.d/<name>.fish (mode 0600), and fish sources every file there at startup.

What is exported

VariableSource secretModuleAlso available as a file
OPENROUTER_API_KEYsecrets/openrouter.jsondefault.nix~/.config/secrets/openrouter_api_key
MOONSHOT_API_KEYsecrets/moonshot.jsondefault.nix~/.config/secrets/moonshot_ai
DOKPLOY_API_KEY, DOKPLOY_URLsecrets/dokploy-fractal-tess.json (API_KEY)dokploy.nix–
FAL_AI, FAL_KEYsecrets/fal-ai.jsonfal-ai.nix–
MINIMAX_API_KEYsecrets/minimax.jsonminimax.nix~/.config/secrets/minimax/apikey
ZAI_API_KEYsecrets/z-ai.jsonz-ai.nix~/.config/secrets/z-ai/apikey
OPENCODE_VGFRACTAL, OPENCODE_VILIAN_GERDJIKOVsecrets/opencode.jsonopencode.nix–
REACTBITS_LICENSE_KEYsecrets/reactbits.jsonreactbits.nix–

Not exported, on purpose: Gitadel (gtd reads /run/secrets/gitadel_api_token itself), Syncthing and SSH material (files), and service-only secrets (clip-sync, shadoword, cliproxyapi; Supermemory's LLM router reads the CLIProxyAPI client key as a systemd credential). secrets/hermes-agent.json and secrets/supermemory.json (the old OpenRouter key) are not wired up anywhere. secrets/bitwarden.json (bitwarden_master_password) is a file only (/run/secrets/bitwarden_master_password), read by bw-agent to unlock the vault; never read it directly. Account logins (website usernames, passwords, 2FA codes) are not shell secrets: they come from Bitwarden through bw-agent, see the bitwarden skill.

This table can drift. The live truth, names only:

grep -ho 'set -gx [A-Z_]*' ~/.secrets.d/*.fish | cut -d' ' -f3 | sort

Using a key from an agent shell

Agent shells are often zsh/bash and do not source fish files. Check the variable, then fall back to the rendered file. Never print the value.

[ -n "$OPENROUTER_API_KEY" ] || OPENROUTER_API_KEY=$(sed -n 's/^set -gx OPENROUTER_API_KEY "\(.*\)"$/\1/p' ~/.secrets.d/*.fish)

If a variable is missing on a host, the host has not been rebuilt since the module changed. Rebuild with the update script (nixos skill), then open a new shell.

Adding a key

  1. Encrypt it: cd ~/nixos && sops secrets/<name>.json (age key ~/.config/sops/age/keys.txt, recipients in .sops.yaml).
  2. Copy modules/nixos/services/sops/dokploy.nix: a sops.secrets.<name> (key = "<json field>" when the field name differs) and a sops.templates."<name>.fish" with path = "/home/${username}/.secrets.d/<name>.fish" and set -gx VAR "${config.sops.placeholder.<name>}". Make enable default to true (mkEnableOption "…" // { default = true; }). Do not add per-host toggles: hosts only set modules.services.sops.enable = true.
  3. Import it in modules/nixos/services/sops/default.nix.
  4. Add a row to the table above (and remove or edit rows when a secret is removed or renamed).
  5. Rebuild all hosts with the update script.

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.