agentleFS
LL4nc33LL4nc33/code-workspace-engine/skills/safety-gate/SKILL.md

safety-gate

Skill0 starsChanged 7 months agoMITView on GitHub

Use PROACTIVELY before any git commit, push, or publish operation. Scans for secrets, credentials, PII, and validates .gitignore. Blocks dangerous commits with actionable remediation guidance.

  • Reads credentials
  • Commits and pushes

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

8 rules. About 0 are common, 3 are distinctive, and 5 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.

  • 5

    Very specific

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

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

    Use environment variables: instead: process.env.API_KEY

    line 56
  2. Distinctive:

    If already committed, use git filter-branch or BFG Repo-Cleaner

    line 58
  3. Very specific:

    Add the missing entries to .gitignore

    line 62
  4. Very specific:

    Run git rm --cached <file> for files already tracked

    line 63
  5. Very specific:

    Consider using a .gitignore generator for your tech stack

    line 64
  6. Distinctive:

    If the gate blocks a legitimate commit:

    line 68
  7. Distinctive:

    Use git commit --no-verify to bypass (logged)

    line 69
  8. Very specific:

    Consider adding the pattern to a .safety-gate-ignore file (future)

    line 70

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

Safety Gate

Pre-commit safety scanning for secrets, credentials, and sensitive data.

When This Activates

Automatically via PreToolUse hook on:

  • git commit — scans staged files
  • git push — scans files since last push
  • git add -A / git add --all — scans all untracked/modified files

What Gets Scanned

Secrets & API Keys

CategoryPatterns
AI API Keyssk-*, pk-*, ANTHROPIC_API_KEY=, OPENAI_API_KEY=
AWSAKIA* (access key IDs)
GitHubghp_*, gho_*, github_pat_*
Slackxoxb-*, xoxp-*
Private Keys-----BEGIN.*PRIVATE KEY-----
Passwordspassword=, passwd=, secret= with literal values
Database URLspostgres://user:pass@, mongodb://user:pass@, mysql://user:pass@

Dangerous File Types

File TypeAction
.env, .env.*BLOCK — must be in .gitignore
*.pem, *.key, *.pfx, *.p12, *.crtBLOCK — certificates/keys
id_rsa*, id_ed25519*BLOCK — SSH keys

.gitignore Validation

Required entries:

  • .env — environment files
  • *.pem, *.key — certificates
  • node_modules/ — dependencies
  • .DS_Store — OS files

Remediation

If a secret is found

  1. Remove the secret from the file
  2. Use environment variables instead: process.env.API_KEY
  3. Rotate the secret — any committed secret is compromised
  4. If already committed, use git filter-branch or BFG Repo-Cleaner

If .gitignore is incomplete

  1. Add the missing entries to .gitignore
  2. Run git rm --cached <file> for files already tracked
  3. Consider using a .gitignore generator for your tech stack

False Positives

If the gate blocks a legitimate commit:

  • Use git commit --no-verify to bypass (logged)
  • Consider adding the pattern to a .safety-gate-ignore file (future)

Exit Codes

CodeMeaning
0Safe — no issues found
2BLOCKED — issues found, commit prevented

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.