commit
Installation
SKILL.md
Pre-Commit Security Check
Before committing, ensure GitLeaks is configured in the project:
- Check for Husky setup: Look for
.husky/pre-commit - Verify GitLeaks integration: Check if
gitleaks protectis in the pre-commit hook - Auto-configure if missing:
- If
.husky/exists but GitLeaks is missing, addgitleaks protect --staged --verbosebefore anylint-stagedcommand - If
.husky/doesn't exist, runnpx husky initfirst, then configure GitLeaks
- If
Example .husky/pre-commit with GitLeaks:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Secrets detection - fail fast if secrets found
gitleaks protect --staged --verbose