agentleFS
WhispersOfJWhispersOfJ/arrfleet-toolkit/skills/secret-injector/SKILL.md

secret-injector

Skill1 starsChanged 4 months agoMITView on GitHub

Generate and validate an Arr-stack compose project's .env file — ensure every API key/secret required by docker-compose.yml is present, well-formed, and never logged or committed. Use when the user is setting up a stack fresh, rotating an API key, adding a new service that needs a secret, or asking "why isn't my API key being picked up". Trigger phrases: "generate the .env", "check for missing secrets", "rotate the radarr api key", "validate my env file", "is a secret leaking anywhere".

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is 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.

  • 1

    Very specific

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

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

    Run from the repo root (where .env and docker-compose.yml live), or pass --env-file/--compose-file.

    line 36

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

Secret Injector

Manages .env for a compose stack without ever printing secret values to stdout, logs, or committing them. This skill only ever prints key names and pass/fail status — never the value — and refuses to write a value it wasn't explicitly given (it does not invent, guess, or default a secret).

What it does

  1. Required-key audit — diffs the keys actually referenced in docker-compose.yml (${VAR} / ${VAR:-default} syntax) against what's present in .env, and reports which are missing. Does not report values, only names.
  2. Format validation — light sanity checks per known key pattern (every *arr app's API key is 32-char lowercase hex) without needing the true value to be "correct" beyond shape. Add more patterns to injector.py::KEY_PATTERNS for other secrets this project cares about checking.
  3. Injection — writes a new key=value pair to .env, given the value on stdin (never as a CLI argument, since CLI args land in shell history and ps output).
  4. Leak scan — greps the working tree (excluding .env/.git) for any value currently in .env, to catch an accidentally hardcoded secret before a commit.

Usage

python3 injector.py audit                                  # missing keys vs docker-compose.yml
python3 injector.py validate                                # format-check keys already present
echo -n "abc123..." | python3 injector.py set RADARR_API_KEY   # write a value from stdin only
python3 injector.py leak-scan                                # scan repo for any .env value appearing elsewhere

Run from the repo root (where .env and docker-compose.yml live), or pass --env-file/--compose-file.

Safety rules

  • Never accept a secret value as a bare CLI argument — set only reads from stdin, specifically to avoid the value landing in shell history or ps aux output.
  • Never print a secret value in any command's output, including error messages — only key names and boolean/status results.
  • set on an existing key requires --force; without it the script refuses to silently overwrite a live credential (rotation should be a deliberate, visible action).
  • leak-scan output redacts the matched value itself, showing only the file/line where a match was found — enough to locate and fix it without re-printing the secret.
  • This skill never commits .env and never suggests doing so; .env must stay in .gitignore. If asked to "just commit the env file", refuse and explain why.

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.