🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Git Repo Auditor

by @derick001

Audit Git repositories for security issues, large files, sensitive data, and repository health metrics.

Versionv1.0.0
⚑ When to Use
TriggerAction
- You want to detect accidental commits of secrets or sensitive data
- You're preparing a repository for open-source release
- You need to identify performance issues (large files in history)
- You're onboarding new developers and want to ensure repository hygiene
- You need to generate security audit reports for compliance requirements
- You want to automate security scanning in CI/CD pipelines
- You're cleaning up old repositories and need to identify issues
πŸ’‘ Examples

Example 1: Basic security scan

python3 scripts/main.py scan ~/projects/my-app

Output:

πŸ” Scanning repository: /home/user/projects/my-app
πŸ“Š Repository info: 247 commits, 5 branches, 3 contributors

πŸ” SECURITY ISSUES FOUND (3): ⚠️ High: AWS_ACCESS_KEY_ID found in commit abc123 (2024-02-15) File: config/old-config.env Pattern: AWS_ACCESS_KEY_ID=AKIA.* Remediation: Rotate key immediately, remove from history with BFG

⚠️ Medium: Hardcoded database password in commit def456 (2024-01-20) File: src/database.js Pattern: password: "secret123" Remediation: Move to environment variables, use secret manager

⚠️ Low: Private key file extension in commit ghi789 (2023-12-05) File: backup/id_rsa.old Pattern: Private key file (.pem, .key, .ppk, id_rsa) Remediation: Remove file from repository history

πŸ’Ύ LARGE FILES FOUND (2): πŸ“¦ 42MB: assets/video/demo.mp4 (commit xyz123) πŸ“¦ 18MB: database/backup.sql (commit uvw456)

βœ… Repository health: Good ⏰ Stale branches: 2 branches older than 90 days

Example 2: JSON output for CI/CD integration

python3 scripts/main.py scan . --json > security-report.json

Output (excerpt):

{
  "repository": "/home/user/projects/my-app",
  "scan_date": "2024-03-06T10:30:00Z",
  "security_issues": [
    {
      "severity": "high",
      "type": "aws_access_key",
      "commit": "abc123",
      "date": "2024-02-15",
      "file": "config/old-config.env",
      "pattern": "AWS_ACCESS_KEY_ID=AKIA.*",
      "remediation": "Rotate key immediately, remove from history with BFG"
    }
  ],
  "large_files": [
    {
      "size_mb": 42,
      "path": "assets/video/demo.mp4",
      "commit": "xyz123"
    }
  ],
  "summary": {
    "total_issues": 3,
    "by_severity": {"high": 1, "medium": 1, "low": 1},
    "large_files_count": 2,
    "total_size_mb": 60
  }
}

Example 3: Check repository health

python3 scripts/main.py health .

Output:

πŸ“ˆ Repository Health Report: /home/user/projects/my-app

πŸ“Š Basic Metrics:

  • Commits: 1,247
  • Branches: 12 (3 active, 9 stale)
  • Contributors: 8
  • First commit: 2022-05-15
  • Last commit: 2024-03-06
  • ⚠️ Health Issues:

  • Stale branches: 9 branches with no commits in >90 days
  • Large files: 2 files >10MB in history
  • Binary files: 45 binary files (consider Git LFS)
  • Merge conflicts: 3 unresolved merge markers in code
  • βœ… Good Practices:

  • .gitignore present and comprehensive
  • No secrets detected in recent commits
  • Regular commit activity (avg 15 commits/week)
  • Meaningful commit messages (87% good)
  • πŸ’‘ Recommendations: 1. Clean up stale branches: git branch -d branch1 branch2... 2. Consider Git LFS for binary files 3. Resolve merge conflicts in: src/app.js, config/settings.yaml

    Example 4: Large files detection only

    python3 scripts/main.py scan . --check large-files --threshold 20
    

    Output:

    πŸ’Ύ Large Files (>20MB) in Repository History:

    1. assets/videos/presentation.mp4 - Size: 42MB - Commit: xyz123 (2024-01-15) - Author: Jane Doe - Message: "Add presentation video"

    2. database/backup/archive.sql.gz - Size: 38MB - Commit: uvw456 (2023-12-20) - Author: John Smith - Message: "Database backup"

    Total: 2 files, 80MB Recommendation: Consider using Git LFS for files >20MB

    View on ClawHub
    TERMINAL
    clawhub install git-repo-auditor

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’