mcpField
S
safe-repo

safe-repo

github.com/helderbertoSecurity1949 installsUpdated 2d ago
Repository

About safe-repo

A repository security-audit skill for identifying credentials, company-specific information, and PII in tracked files. It supports full scans with history review and faster scans limited to changed files.

Key features

  1. 01Credential-pattern scanning
  2. 02Sensitive filename checks
  3. 03Git history review
  4. 04Changed-file diff mode
  5. 05Gitignore pattern review
  6. 06Secret-safe finding reports

Use cases

  1. 01Audit a repository before release
  2. 02Check pending changes before commit
  3. 03Review history for removed secrets

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/helderberto/agent-skills --skill safe-repo

After installing, type/safe-repoin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
report-template.md
scripts/
scan-secrets.sh
scan-secrets.test.sh

Details

From the project README

Safe Repository Check

Context

Security audit for sensitive data in repository. Check for credentials, API keys, company-specific information, and PII.

Modes

  • Default (full-scan): scans all git-tracked files plus history. Use for periodic audits or first-time repo review.
  • --diff [<base>]: scans only what changed: the branch's commits since <base>, plus staged + unstaged changes. No <base> → staged + unstaged only. Use before a commit, from review, or from to-pr --safe. Fast, no false positives from pre-existing files.

Workflow

Default (full-scan)
  1. Run bash ${CLAUDE_SKILL_DIR}/scripts/scan-secrets.sh to scan all tracked files for credential patterns
  2. Check for sensitive tracked files by name: .env* (except .env.example), *.pem, *.key, *_rsa*, *secret*, *credential*
  3. Analyze git history for removed secrets: git log --all --full-history -- "*.env" "*.pem" "*.key" "*secret*" "*credential*"
  4. Review .gitignore for proper patterns
  5. Report findings (see assets/report-template.md)
--diff mode
  1. Compute changed files: git diff --name-only <base>...HEAD when a base is given, plus git diff --name-only HEAD + git diff --name-only --cached
  2. Scan only those files with the regexes in ${CLAUDE_SKILL_DIR}/scripts/scan-secrets.sh (grep them directly) plus the filename checks above
  3. Skip history analysis (not relevant for in-flight changes)
  4. Report findings scoped to changed files only

Rules

  • Only check git-tracked files (git ls-files) - ignore local configs
  • Check current tracked files AND git history
  • Filter false positives: minified JS, node_modules, test fixtures, docs
  • Verify .gitignore covers sensitive patterns
  • Report tracked files with secrets and historical commits
  • Never output actual secret values in report

Error Handling

  • If git history scan is slow → limit to last 100 commits with git log --oneline -100

Comments

Markdown supported