git-expert — скилл для Claude Code: что делает и как установить
Скилл git-expert для Claude Code даёт агенту рецепты для git: отмены коммита, извлечения работы из main и чистки истории. Разбирает проблемы с git, возникшие посреди работы.
Apache-2.0 279 установок ★ 45 обновлён 2026-10-12
npx skills add personamanagmentlayer/pcl --skill git-expert -a claude-codeЧто делает git-expert
Скилл даёт агенту готовые рецепты для git: отменить или поправить коммит, вернуть удалённый файл, обрезать слитые ветки, спрятать правки в git stash перед pull. Проблемы разбираются от симптома к команде, поэтому не приходится вспоминать флаги.
Отдельная часть посвящена переписыванию истории и починке репозитория. Для чистки истории скилл советует git filter-repo, а он ставится отдельно: pip install git-filter-repo. Без него удаление большого файла из истории не заработает, останется медленный git filter-branch.
Подробности лежат в references/CORE_CONCEPTS.md: агент читает файл по необходимости, а не тащит всё в контекст. Нужен git 2.30 и новее. Инструменты ограничены чтением, правкой и Bash(git:*), поэтому за пределы git-команд агент не выйдет.
Какие задачи решает
- отменить последний коммит, не потеряв изменения
- перенести случайный коммит из
mainв отдельную ветку - удалить большой файл из истории репозитория
- разобраться с отклонённым push через
git pull --rebase - починить повреждённый репозиторий через
git fsckиgit gc
Примеры запросов агенту
- Я случайно закоммитил прямо в
main. Как перенести это в отдельную ветку и вернутьmainкorigin/main? - Файл удалён и уже в коммите, чем его достать?
- История раздулась из-за большого бинарника, убери его через
git filter-repo.
Как установить git-expert
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill git-expert -a claude-code2Вручную: положить файлы
~/.claude/skills/git-expert/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/git-expert/
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill git-expert -a codex2Вручную: положить файлы
.agents/skills/git-expert/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill git-expert -a cursor2Вручную: положить файлы
.cursor/skills/git-expert/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install personamanagmentlayer/pcl stdlib/tools/git-expert2Вручную: положить файлы
.github/skills/git-expert/SKILL.md1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill git-expert -a gemini-cli2Командой платформы
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/tools/git-expertВручную: положить файлы
.devin/skills/git-expert/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill git-expert -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о git-expert
Как установить git-expert в Claude Code?
Выполните npx skills add personamanagmentlayer/pcl --skill git-expert -a claude-code. Скилл встанет в ~/.claude/skills/git-expert/SKILL.md.
Что делает git-expert?
Подсказывает команды под типовые git-проблемы: отмена и правка коммитов, revert уже запушенного, чистка неотслеживаемых файлов, ветки и конфликты при pull.
Какая версия git нужна для git-expert?
2.30 или новее. Для работы с историей дополнительно нужен git filter-repo, он ставится через pip install git-filter-repo.
Исходный текст
SKILL.md · Apache-2.0
--- name: git-expert version: 1.1.0 description: >- Expert-level Git version control with advanced workflows, branching strategies, and best practices for team collaboration. Use when the user mentions version control, collaboration, or workflow, or when the task involves Essential Git Commands, Advanced Git Techniques, Branching Strategies, or Conflict Resolution. category: tools author: PCL Team license: Apache-2.0 tags: - git - version-control - collaboration - workflow allowed-tools: - Read - Write - Edit - Bash(git:*) - Glob - Grep requirements: git: '>=2.30' --- # Git Expert You are an expert in Git version control with deep knowledge of advanced workflows, branching strategies, collaboration patterns, and best practices. You help teams manage code efficiently and resolve complex version control issues. ## Common Workflows ### Fixing Mistakes **Undo Last Commit (not pushed):** ```bash # Keep changes staged git reset --soft HEAD~1 # Keep changes unstaged git reset HEAD~1 # Discard changes completely git reset --hard HEAD~1 ``` **Amend Last Commit:** ```bash # Change commit message git commit --amend -m "new message" # Add forgotten files git add forgotten-file.txt git commit --amend --no-edit ``` **Revert Commit (already pushed):** ```bash # Create new commit that undoes changes git revert commit-hash # Revert multiple commits git revert commit1 commit2 commit3 # Revert merge commit git revert -m 1 merge-commit-hash ``` **Recover Deleted Files:** ```bash # File deleted but not committed git checkout HEAD file.txt # File deleted and committed git log --all --full-history -- file.txt git checkout commit-hash -- file.txt ``` ### Cleaning Repository **Remove Untracked Files:** ```bash # Dry run git clean -n # Remove files git clean -f # Remove files and directories git clean -fd # Remove files, directories, and ignored files git clean -fdx ``` **Prune Branches:** ```bash # Remove remote-tracking branches that no longer exist git fetch --prune # Delete merged branches git branch --merged | grep -v "\*" | xargs -n 1 git branch -d ``` **Reduce Repository Size:** ```bash # Remove file from history (CAUTION: rewrites history) git filter-branch --tree-filter 'rm -f large-file.bin' HEAD # Better: use git-filter-repo pip install git-filter-repo git filter-repo --path large-file.bin --invert-paths # Garbage collection git gc --aggressive --prune=now ``` ## Troubleshooting **Common Issues:** ```bash # Detached HEAD state git checkout -b temp-branch # Create branch from detached HEAD # Accidentally committed to main instead of branch git branch feature-branch # Create branch at current commit git reset --hard origin/main # Reset main to remote git checkout feature-branch # Switch to feature branch # Need to pull but have local changes git stash git pull git stash pop # Push rejected (non-fast-forward) git pull --rebase origin main git push # Large files stuck in history git filter-repo --strip-blobs-bigger-than 10M # Corrupted repository git fsck --full # Check for corruption git reflog expire --expire=now --all git gc --prune=now --aggressive ``` ## Approach When working with Git: 1. **Commit Often**: Small, atomic commits are easier to manage 2. **Write Clear Messages**: Follow conventional commit format 3. **Keep History Clean**: Use rebase for feature branches 4. **Never Rewrite Public History**: Don't force push to shared branches 5. **Review Before Pushing**: Check diff and status 6. **Use Branches**: One feature = one branch 7. **Pull Before Push**: Stay synchronized with team 8. **Resolve Conflicts Carefully**: Understand both changes Always use Git workflows that match your team's conventions and maintain a clean, understandable project history. ## Reference Documentation Detailed material lives alongside this skill and is read on demand: - [Core Expertise](references/CORE_CONCEPTS.md) — Essential Git Commands, Advanced Git Techniques, Branching Strategies, Conflict Resolution, Advanced Configuration, Best Practices
© PCL Team · Apache-2.0 · personamanagmentlayer/pcl