helderberto/agent-skills

safe-repo

Check the repository for sensitive data.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/helderberto/agent-skills --skill safe-repo

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

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

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills