security-hooks
Skill1 starsChanged 6 months agoMITView on GitHub
Setup security hooks and CI workflows for secret detection in any project. Configure pre-commit with gitleaks and detect-secrets, GitHub Actions security scanning, manage false positives, and maintain baselines. Trigger phrases: setup security hooks, configure gitleaks, add pre-commit, detect secrets, setup secret scanning, security baseline, configure detect-secrets
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- diegocconsolini/ClaudeSkillCollectiontheir own version, first seen Oct 18, 2025
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- diegocconsolini/ClaudeSkillCollection★ 7same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-evaluationSkill
- academic-writingSkill
- agent-orchestrationSkill
- agents-md-writerSkill
- algorithmic-artSkill
- brand-guidelinesSkill
- codebase-architectureSkill
- code-reviewSkill
- commit-workflowSkill
- context-checkpointSkill
- doc-coauthoringSkill
- docxSkill
- etl-runnerSkill
- eval-runnerSkill
- feature-devSkill
- frontend-designSkill
- hpc-deucalionSkill
- internal-commsSkill
- langchainSkill
- langfuseSkill
- langgraphSkill
- llm-observability-stackSkill
- mcp-builderSkill
- neo4j-verifySkill
- pdfSkill
- pptxSkill
- project-conventionsSkill
- python-best-practicesSkill
- react-namingSkill
- service-verifySkill
- skill-creatorSkill
- skill-inspectorSkill
- slack-gif-creatorSkill
- sprint-contractSkill
- theme-factorySkill
- uml-modelingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-debugSkill
- xlsxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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
- Distinctive: line 64
When hooks fail, the system learns from errors to reduce false positives over time.
- Very specific: line 80
Create HOOK_CALIBRATION_LOG.md in project root:
- Very specific: line 124
Use pre-commit install --install-hooks to install everything at once
- Very specific: line 125
Run pre-commit run --all-files when adding new hooks
- Very specific: line 126
Use pre-commit autoupdate to keep hooks updated
- Very specific: line 130
Always use .gitleaks.toml for project-specific config
- Very specific: line 131
Use baseline to ignore known findings: --baseline-path
- Very specific: line 132
Prefer .gitleaksignore for one-off false positives
- Distinctive: line 133
Use composite rules (v8.28.0+) for complex detection patterns
- Very specific: line 136
Create baseline on first setup: detect-secrets scan > .secrets.baseline
- Distinctive: line 138
Update baseline when adding new false positives
- Distinctive: line 139
Use inline allowlist comments for test data
- Very specific: line 144
Use GITHUB_TOKEN with minimal permissions
- Very specific: line 145
Add CODEOWNERS for .github/workflows/
- Distinctive: line 149
Use this skill when:
≈ “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.
Files
Security Hooks Skill
Setup secret detection hooks and CI workflows for any project. Based on official documentation from pre-commit, gitleaks, detect-secrets, and GitHub Actions security best practices.
When to Use
- "setup security hooks" — Configure pre-commit and CI for a new project
- "configure gitleaks" — Setup gitleaks secret detection
- "add pre-commit" — Install pre-commit framework with security hooks
- "detect secrets" — Scan repository for hardcoded secrets
- "setup secret scanning" — Full secret detection setup (local + CI)
- "security baseline" — Create or update secret detection baseline
- "configure detect-secrets" — Setup Yelp's detect-secrets with baseline
What It Covers
- Install pre-commit framework —
pip install pre-commit && pre-commit install - Configure gitleaks —
.gitleaks.tomlwith allowlists, custom rules, composite rules - Configure detect-secrets — Baseline creation, audit, inline allowlists, plugins
- Setup GitHub Actions — CI workflow with SHA-pinned actions and least privilege permissions
- Handle false positives —
.gitleaksignore,detect-secrets audit, inline comments - Maintain and update —
pre-commit autoupdate, baseline refresh, calibration log
Workflow
1. Check if pre-commit is installed
└─ If NO → install pre-commit
2. Create .pre-commit-config.yaml
└─ Include: pre-commit-hooks, gitleaks, detect-secrets
3. Create .gitleaks.toml
└─ Extend default config
└─ Add project-specific allowlists
4. Create .secrets.baseline (detect-secrets)
└─ Run: detect-secrets scan > .secrets.baseline
└─ Audit: detect-secrets audit .secrets.baseline
5. Install hooks
└─ pre-commit install --install-hooks
6. Create .github/workflows/security.yml
└─ Pin actions to SHA
└─ Set permissions: contents: read
└─ Include: gitleaks + detect-secrets jobs
7. Test with a commit
└─ If PASS → done
└─ If FAIL → handle false positives (see Learning from Errors)
8. Update Calibration Log
└─ Record any adjustments madeLearning from Errors
When hooks fail, the system learns from errors to reduce false positives over time.
Calibration Workflow
1. Hook fails on commit → STOP
2. Analyze the finding:
a) Is it a real secret? → Fix in code → retry
b) Is it a false positive? → Add to allowlist/baseline → retry
3. Record in HOOK_CALIBRATION_LOG.md
4. After 3 similar false positives → update template/config
5. If real secret found 3+ times → strengthen detection rulesCalibration Log Format
Create HOOK_CALIBRATION_LOG.md in project root:
# Hook Calibration Log
| Date | Hook | Finding | File | False Positive? | Action | Validated |
|------|------|---------|------|-----------------|--------|-----------|
| YYYY-MM-DD | gitleaks | generic-api-key | .secrets.baseline | YES | Added to .gitleaksignore | 2024-01-15 |
| YYYY-MM-DD | detect-secrets | AWSKeyDetector | tests/mock.py | YES | Added baseline entry | 2024-01-20 |Handling False Positives
Gitleaks:
- Inline:
api_key = "EXAMPLE-VALUE" #gitleaks:allow .gitleaksignore: Add fingerprint from gitleaks report.gitleaks.toml: Add global or rule-specific allowlist
Detect-secrets:
- Inline:
secret = "value" # pragma: allowlist secret - Baseline: Run
detect-secrets audit .secrets.baselineto label false positives - Re-scan:
detect-secrets scan --baseline .secrets.baseline
Templates Available
| Template | Path | Description |
| Pre-commit config | security-hooks/templates/.pre-commit-config.yaml | Full pre-commit setup with security hooks |
| GitHub Actions | security-hooks/templates/security.yml | CI workflow for gitleaks + detect-secrets |
| Gitleaks config | security-hooks/templates/.gitleaks.toml | Gitleaks configuration with best practices |
| Baseline | security-hooks/templates/.secrets.baseline | Empty detect-secrets baseline placeholder |
Resources
- Core SKILL.md — This file
references/gitleaks-config-guide.md— Gitleaks rules, allowlists, composite rulesreferences/detect-secrets-setup.md— Baseline management, audit, pluginsreferences/github-actions-security.md— SHA pinning, permissions, CODEOWNERSexamples/setup-walkthrough.md— Complete setup example step-by-stepscripts/setup-security-hooks.sh— Automated setup script
Best Practices Summary
Pre-commit
- Use
pre-commit install --install-hooksto install everything at once - Run
pre-commit run --all-fileswhen adding new hooks - Use
pre-commit autoupdateto keep hooks updated - Pin to SHA for immutability:
rev: 0161422b... # frozen: v2.4.0
Gitleaks
- Always use
.gitleaks.tomlfor project-specific config - Use baseline to ignore known findings:
--baseline-path - Prefer
.gitleaksignorefor one-off false positives - Use composite rules (v8.28.0+) for complex detection patterns
Detect-secrets
- Create baseline on first setup:
detect-secrets scan > .secrets.baseline - Audit baseline periodically:
detect-secrets audit .secrets.baseline - Update baseline when adding new false positives
- Use inline allowlist comments for test data
GitHub Actions
- Always pin actions to full SHA (not tags)
- Set
permissions: contents: read(least privilege) - Use
GITHUB_TOKENwith minimal permissions - Add CODEOWNERS for
.github/workflows/
Use When
Use this skill when:
- Starting a new project that needs secret detection
- Adding security scanning to an existing project
- Configuring CI/CD pipelines with secret detection
- Managing false positives in secret detection tools
- Setting up pre-commit hooks for a team
Note: This skill focuses exclusively on secret detection. For broader security (SAST, dependency scanning), consider additional tools like CodeQL, Semgrep, or Dependabot.
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
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.

