git-analysis — скилл для Claude Code: разбор истории репозитория
Отвечает на вопросы по истории git: что менялось, кто автор строки, где сломалось. Полезен при ревью, поиске регрессий и черновике changelog.
npx skills add autohandai/code-cli --skill git-analysis -a claude-codeЧто делает git-analysis
Скилл разворачивает работу с агентом в другую сторону: сначала история, потом код. Он разбирает диапазон коммитов и группирует изменения по модулям, объясняет смысл конкретной строки через git blame -L и git show, ищет последний хороший и первый плохой коммит и сужает диапазон через git bisect run <test command>, если тест есть. Без теста бисекция идёт вручную по коммитам, которые трогали нужный путь.
Ещё он показывает, кто чаще правит область (git shortlog -sn -- <path>), что рискованно в релизе — крупные диффы, свежие правки без тестов, обновления зависимостей — и как связаны ветки: граф, базы слияния, коммиты, которых нет в main. Внутри скилла доступны read_file, find_grep, git_log, git_diff, git_diff_range, git_status, git_branch и run_command.
Работает только на чтение. Переписывать историю — rebase, reset — скилл не станет, пока вы не попросите об этом прямо и не подтвердите. На больших репозиториях запросы стоит ограничивать путями, --since и -n, иначе вывод разрастается. Хеши и даты он цитирует, а не пересказывает сообщение коммита своими словами.
Какие задачи решает
- найти коммит, после которого появился баг
- объяснить, почему в коде есть эта строка
- собрать черновик changelog между двумя релизами
- посмотреть, кто чаще всего правит модуль
- оценить рискованные места в предстоящем релизе
Примеры запросов агенту
- Что изменилось между тегами
v1.4.0иv1.5.0? Сгруппируй по модулям - Почему в
src/auth/session.tsесть эта проверка? Покажи коммит и его сообщение - Найди, где сломался тест
test_orders.py: последний хороший и первый плохой коммит
Как установить git-analysis
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill git-analysis -a claude-code2Вручную: положить файлы
~/.claude/skills/git-analysis/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/git-analysis/
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill git-analysis -a codex2Вручную: положить файлы
.agents/skills/git-analysis/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill git-analysis -a cursor2Вручную: положить файлы
.cursor/skills/git-analysis/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install autohandai/code-cli git-analysis2Вручную: положить файлы
.github/skills/git-analysis/SKILL.md1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill git-analysis -a gemini-cli2Командой платформы
gemini skills install https://github.com/autohandai/code-cli --path src/skills/builtin/git-analysisВручную: положить файлы
.devin/skills/git-analysis/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill git-analysis -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о git-analysis
Как установить git-analysis в Claude Code?
Выполните npx skills add autohandai/code-cli --skill git-analysis -a claude-code. Файл скилла появится по пути ~/.claude/skills/git-analysis/SKILL.md.
Что делает git-analysis?
Отвечает на вопросы по истории репозитория: что и когда менялось, кто автор строки, какие коммиты трогали область, где вошла регрессия, как связаны ветки. Подходит для blame, сужения диапазона в стиле bisect, черновика changelog и диффов релиза.
Скилл может переписать историю?
Нет, по умолчанию он работает только на чтение. Rebase, reset и правку истории он сделает лишь по прямой просьбе с подтверждением.
Исходный текст
SKILL.md · Apache-2.0
--- name: git-analysis description: Answer questions from repository history, including what changed, when, by whom, why a line exists, which commits touched an area, where a regression entered, and how branches relate. Use for blame, bisect-style narrowing, changelog drafting, and release diffs. allowed-tools: read_file find_grep git_log git_diff git_diff_range git_status git_branch run_command --- # Read the history, not just the tree Git already knows most of what a reviewer wants to ask. Use it before reading code, and cite commits. ## Techniques - **What changed between X and Y**: `git_diff_range`, then group by module; summarize behavior changes, not file lists. - **Why does this line exist**: `git blame -L` through `run_command`, then `git show` the commit and read its message and the surrounding diff. - **When did it break**: find the last known good and first known bad, then narrow with `git bisect run <test command>` when a test exists; otherwise bisect by hand on the commits touching the area (`git log -- <path>`). - **Who owns this area**: `git shortlog -sn -- <path>` and recent authors. - **What is risky in this release**: largest diffs, files with many recent touches, changes without tests, dependency bumps. - **Branch relationships**: `git log --oneline --graph`, merge bases, commits not yet in main. ## Rules - Quote commit hashes and dates; never paraphrase a commit message as fact without showing it. - Read-only by default. Do not rebase, reset, or rewrite history unless the user asks for that specific operation and confirms. - Large histories: bound queries with paths, `--since`, and `-n`. ## Output A short narrative with the commits that matter, then a table of commit, date, author, summary, and the evidence line for each claim. End with the open questions the history cannot answer.
© autohandai · Apache-2.0 · autohandai/code-cli