repo-audit — скилл для Claude Code: что делает и как установить
Анализирует историю Git: находит частые изменения в файлах, распределение авторов и утечки секретов в коммитах.
npx skills add zebbern/claude-code-guide --skill repo-audit -a claude-codeЧто делает repo-audit
Скилл исследует историю репозитория с помощью трёх bash-скриптов. Скрипт scripts/hotfiles.sh ищет самые нестабильные файлы, по умолчанию выводя 20 наиболее часто редактируемых путей. Это помогает выявить кандидатов на рефакторинг и уделить им больше внимания на код-ревью.
Скрипт scripts/ownership.sh собирает статистику по авторам: число коммитов, добавленные и удалённые строки, а также дату последней активности по всему проекту или отдельной папке. Для проверки безопасности используется scripts/secret-scan.sh. Он сканирует все ветки и даже удалённые коммиты на наличие ключей AWS, токенов GitHub, GitLab, Slack и SSH-ключей.
Для запуска обязательны git версии 2.20 или новее, bash 4.0 и стандартные системные утилиты вроде awk, sort, head и grep. Внешние API или платные сервисы не требуются. Без свежей версии bash на старых системах скрипты завершатся ошибкой.
Какие задачи решает
- найти файлы с наибольшим числом правок для рефакторинга
- определить ведущих авторов конкретного модуля перед назначением ревью
- просканировать всю историю Git на случайно закоммиченные ключи и токены
- отследить дату последней активности участников проекта в репозитории
Примеры запросов агенту
- Просканируй историю репозитория на утечки токенов и приватных ключей
- Найди топ-20 самых часто меняемых файлов за последний месяц
- Покажи, кто чаще всего коммитит в папку
src/auth
Как установить repo-audit
1Через Skills CLI (Vercel)
npx skills add zebbern/claude-code-guide --skill repo-audit -a claude-code2Вручную: положить файлы
~/.claude/skills/repo-audit/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/repo-audit/
1Через Skills CLI (Vercel)
npx skills add zebbern/claude-code-guide --skill repo-audit -a codex2Вручную: положить файлы
.agents/skills/repo-audit/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add zebbern/claude-code-guide --skill repo-audit -a cursor2Вручную: положить файлы
.cursor/skills/repo-audit/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install zebbern/claude-code-guide repo-audit2Вручную: положить файлы
.github/skills/repo-audit/SKILL.md1Через Skills CLI (Vercel)
npx skills add zebbern/claude-code-guide --skill repo-audit -a gemini-cli2Командой платформы
gemini skills install https://github.com/zebbern/claude-code-guide --path skills/repo-auditВручную: положить файлы
.devin/skills/repo-audit/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add zebbern/claude-code-guide --skill repo-audit -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о repo-audit
Как установить repo-audit в Claude Code?
Выполните команду npx skills add zebbern/claude-code-guide --skill repo-audit -a claude-code. Также файл скилла можно сохранить вручную по пути ~/.claude/skills/repo-audit/SKILL.md.
Что делает скилл repo-audit?
Он запускает аудит Git-репозитория: находит файлы с частыми правками, считает долю коммитов и строк кода по разработчикам и ищет секреты во всех ветках, включая удалённые коммиты.
Какие зависимости нужны для работы repo-audit?
Требуются установленные git версии от 2.20, bash от 4.0, а также стандартные утилиты awk, sort, head и grep. Никаких сторонних библиотек и платных API не нужно.
Исходный текст
SKILL.md · MIT
--- name: repo-audit description: "Deep analysis of Git history: identify frequently changed hotspot files, analyze code ownership by contributor, and scan for leaked secrets. Triggered when users ask about Git analysis, code hotspots, who owns what code, secret scanning, security audits of commit history, or optimizing code review assignments." type: tool license: MIT tags: - git - security - analysis - devops --- # Repo Audit — Deep Analysis of Git History Perform three-dimensional analysis on a Git repository: **hotspot file detection**, **code ownership analysis**, and **secret leak scanning**. ## Feature Overview ### 1. Hotspot File Analysis (`scripts/hotfiles.sh`) Identify the most frequently changed files in a repository to help spot: - High-risk code areas (frequent changes = potential instability) - Files that deserve extra attention during code review - Modules that may need splitting or refactoring **Usage:** ```bash bash scripts/hotfiles.sh [options] ``` | Option | Description | Default | |--------|-------------|---------| | `--repo PATH` | Repository path | Current directory | | `--top N` | Show top N files | 20 | | `--since DATE` | Start date (e.g. `2024-01-01`) | None | | `--until DATE` | End date | None | | `--author AUTHOR` | Filter by author | None | | `--format FORMAT` | Output format: `table` / `csv` / `json` | table | ### 2. Code Ownership Analysis (`scripts/ownership.sh`) Analyze actual code ownership, reporting for each contributor within the specified scope: - Commit count and percentage - Lines changed (additions/deletions) - Last active date **Usage:** ```bash bash scripts/ownership.sh [options] ``` | Option | Description | Default | |--------|-------------|---------| | `--repo PATH` | Repository path | Current directory | | `--path SUBPATH` | Analyze a specific subdirectory or file | Entire repo | | `--top N` | Show top N contributors | 10 | | `--since DATE` | Start date | None | | `--format FORMAT` | Output format: `table` / `csv` / `json` | table | ### 3. Secret Leak Scanning (`scripts/secret-scan.sh`) Scan the full Git history (including deleted commits) for common secrets and sensitive information: - AWS Access Key / Secret Key - GitHub / GitLab / Slack Tokens - SSH Private Keys - Generic API Keys, passwords, and secret patterns **Usage:** ```bash bash scripts/secret-scan.sh [options] ``` | Option | Description | Default | |--------|-------------|---------| | `--repo PATH` | Repository path | Current directory | | `--branch BRANCH` | Scan a specific branch | All branches | | `--since DATE` | Start date | None | | `--format FORMAT` | Output format: `table` / `csv` / `json` | table | | `--severity LEVEL` | Minimum severity level: `low` / `medium` / `high` | low | ## Use Cases - **Security audits**: Scan history for leaked secrets before deploying to production - **Code review optimization**: Identify hotspot files and prioritize reviewing high-risk areas - **Team collaboration**: Understand who knows which parts of the code best, and assign reviews accordingly - **Tech debt assessment**: Frequently changed files are strong candidates for refactoring ## Dependencies - `git` (>= 2.20) - `bash` (>= 4.0) - Standard Unix utilities: `awk`, `sort`, `head`, `grep` No additional dependencies or paid APIs required.
© zebbern · MIT · zebbern/claude-code-guide