agentleFS
Evan-DaruwallaEvan-Daruwalla/claude-skill-suite/local-secrets-manage/SKILL.md

local-secrets-manage

Skill0 starsChanged 46 days agoMITView on GitHub

Read-only audit of secret-bearing FILES by name (.env, *.pem, *.key, credentials): TRACKED-SECRET / UNIGNORED / OK; proposes .gitignore lines, never applies them. Contents: history-leak-scan. Use when: "is my .env ignored", before a repo goes public.

  • 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:

    MUST print CANARY PASS n/n before you trust a result.

    line 97

≈ “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

local-secrets-manage — is my secret file tracked or ignored?

The engine is local-secrets.js (portable Node, zero deps). It answers a narrow, high-value question: for every file whose NAME looks like it holds credentials, is git about to leak it? It walks the working tree, matches basenames against the secret-file name rules, and for each candidate asks git — ls-files (tracked?) and check-ignore (ignored?) — then assigns a verdict. That is the whole job.

This is the FILE-STATUS half of secret hygiene. It scans names, never contents: it never opens a candidate file, never prints a byte of one, never edits .gitignore. The CONTENT / git-history half — is an actual key string committed anywhere in history — is history-leak-scan's job (pm-secretscan.js). Run both: this one catches "my .env is about to be added", that one catches "an AWS key is already in commit abc123".

Verdicts

verdictmeaningfix
TRACKED-SECRETthe file is in the git index — already leaking (or one push from public)rotate the credential, then git rm --cached <path> and ignore it
UNIGNOREDon disk, not tracked yet, and not ignored — one git add . from leakingadd a .gitignore line (--fix-print gives you the exact line)
OKignored — git refuses to add it without -fnone

Commands

node local-secrets.js [--dir <path>]          audit repo at cwd (or <path>)
node local-secrets.js [--dir <path>] --fix-print   also print proposed .gitignore lines
node local-secrets.js --canary                self-test (the done-check)
node local-secrets.js --help
  • audit prints a table (verdict / path / matched rule) plus a count line. Exit 1 if any TRACKED-SECRET or UNIGNORED; exit 0 clean.
  • --fix-print appends the .gitignore lines it WOULD add — the exact path per risky row (/.env, /config/id_rsa, …), so a sibling is never over-ignored. It prints them to stdout only; you copy them in. It never writes the file.

Candidate name rules (basename): .env*, *.pem, *.key, id_rsa*, id_ed25519*, *_keys.env, credentials*.json, secrets.*. Names containing example/sample/template/fixture (and .dist/.sample suffixes) are exempt — a placeholder is not a secret. .git, node_modules, .venv, and similar build/dep dirs are skipped during the walk.

Examples

  • Before making a repo public — confirm no key file is staged: node local-secrets.js --dir /path/to/repo. A *_keys.env (e.g. a provider API-key file) showing TRACKED-SECRET means rotate the credential first, then untrack; UNIGNORED means add the ignore line now.
  • A backend service holding sensitive user data — a .env with a database URL must read OK. If it shows UNIGNORED: node local-secrets.js --dir /path/to/service --fix-print and paste the proposed /.env line into .gitignore yourself.
  • This repo — a quick pre-commit sanity check from the repo root: node local-secrets.js. Clean → exit 0.

Windows notes

  • Paths with spaces: quote --dir (--dir "D:/path with spaces"). Forward slashes work in both PowerShell and Git Bash; git resolves them.
  • This tool never writes .gitignore. If you do apply the --fix-print lines by hand in PowerShell, use Add-Content -Encoding utf8 (Set-Content defaults to the ANSI codepage) — a single non-ASCII byte in .gitignore is harmless, but keep the file UTF-8 to be safe.

Storage / side effects

None. Read-only toward the world: it runs git ls-files / git check-ignore (both read-only) and fs.readdirSync on directory entries. It writes nothing outside its own --canary temp dir.

Exit codes

0 clean · 1 any TRACKED-SECRET/UNIGNORED (or canary failure) · 2 usage error (missing --dir, not a git repo, git unavailable).

Verification (the done-check)

node local-secrets.js --canary

Builds a throwaway git repo, plants a committed .env (→ TRACKED-SECRET), an on-disk .env.local (→ UNIGNORED), an ignored .env.ok (→ OK), and an exempt .env.example; asserts all four verdicts, exit 1, and the exact --fix-print lines — then asserts a clean repo exits 0 and a non-repo exits 2. Cleans up. MUST print CANARY PASS n/n before you trust a result.

node local-secrets.js --canary — MUST print CANARY PASS 29/29 before you trust a result.

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.