git-workflow-and-versioning
Что он делает
Этот скилл помогает упорядочить код, который вы и ИИ создаёте. Он учит часто сохранять прогресс (коммиты), работать над отдельными частями кода в разных ветках и давать этим частям понятные названия. Так всё остаётся организованным и легко исправимым, если что-то пойдёт не так.
Когда использовать
- ✓Всякий раз, когда вы или ИИ вносите изменения в код.
- ✓Когда сохраняете прогресс (делаете коммит) или создаёте новое направление работы (ветку).
- ✓Когда нужно параллельно вести несколько разных задач.
Ссылка на скилл
https://github.com/addyosmani/agent-skills/blob/main/skills/git-workflow-and-versioning/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Как сохранить мою текущую работу в новую аккуратную «версию»?”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ предлагает часто сохранять небольшие фрагменты работы, как «точки сохранения». Каждый такой сохранённый фрагмент (коммит) должен делать только одно логическое действие и иметь сообщение, которое объясняет, зачем это сделано, а не только что изменилось.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Git Workflow and Versioning
Overview
Git is your safety net. Treat commits as save points, branches as sandboxes, and history as documentation. With AI agents generating code at high speed, disciplined version control is the mechanism that keeps changes manageable, reviewable, and reversible.
When to Use
Always. Every code change flows through git.
Core Principles
Trunk-Based Development (Recommended)
Keep main always deployable. Work in short-lived feature branches that merge back within 1-3 days. Long-lived development branches are hidden costs — they diverge, create merge conflicts, and delay integration. DORA research consistently shows trunk-based development correlates with high-performing engineering teams.
main ──●──●──●──●──●──●──●──●──●── (always deployable)
╲ ╱ ╲ ╱
●──●─╱ ●──╱ ← short-lived feature branches (1-3 days)
This is the recommended default. Teams using gitflow or long-lived branches can adapt the principles (atomic commits, small changes, descriptive messages) to their branching model — the commit discipline matters more than the specific branching strategy.
- Dev branches are costs. Every day a branch lives, it accumulates merge risk.
- Release branches are acceptable. When you need to stabilize a release while main moves forward.
- Feature flags > long branches. Prefer deploying incomplete work behind flags rather than keeping it on a branch for weeks.
1. Commit Early, Commit Often
Each successful increment gets its own commit. Don't accumulate large uncommitted changes.
Work pattern:
Implement slice → Test → Verify → Commit → Next slice
Not this:
Implement everything → Hope it works → Giant commit
Commits are save points. If the next change breaks something, you can revert to the last known-good state instantly.
2. Atomic Commits
Each commit does one logical thing:
# Good: Each commit is self-contained
git log --oneline
a1b2c3d Add task creation endpoint with validation
d4e5f6g Add task creation form component
h7i8j9k Connect form to API and add loading state
m1n2o3p Add task creation tests (unit + integration)
# Bad: Everything mixed together
git log --oneline
x1y2z3a Add task feature, fix sidebar, update deps, refactor utils
3. Descriptive Messages
Commit messages explain the why, not just the what:
# Good: Explains intent
feat: add email validation to registration endpoint
Prevents invalid email formats from reaching the database.
Uses Zod schema validation at the route handler level,
consistent with existing validation patterns in auth.ts.
# Bad: Describes what's obvious from the diff
update auth.ts
Format:
<type>: <short description>
<optional body explaining why, not what>
Types:
feat— New featurefix— Bug fixrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsdocs— Documentation onlychore— Tooling, dependencies, config
4. Keep Concerns Separate
Don't combine formatting changes with behavior changes. Don't combine refactors with features. Each type of change should be a separate commit — and ideally a separate PR:
# Good: Separate concerns
git commit -m "refactor: extract validation logic to shared utility"
git commit -m "feat: add phone number validation to registration"
# Bad: Mixed concerns
git commit -m "refactor validation and add phone number field"
Separate refactoring from feature work. A refactoring change and a feature change are two different changes — submit them separately. This makes each change easier to review, revert, and understand in history. Small cleanups (renaming a variable) can be included in a feature commit at reviewer discretion.
5. Size Your Changes
Target ~100 lines per commit/PR. Changes over ~1000 lines should be split. See the splitting strategies in code-review-and-quality for how to break down large changes.
~100 lines → Easy to review, easy to revert
~300 lines → Acceptable for a single logical change
~1000 lines → Split into smaller changes
Branching Strategy
Feature Branches
main (always deployable)
│
├── feature/task-creation ← One feature per branch
├── feature/user-settings ← Parallel work
└── fix/duplicate-tasks ← Bug fixes
- Branch from
main(or the team's default branch)
…
Частые вопросы
Что такое коммит?
Коммит похож на точку сохранения в вашем проекте. Он фиксирует набор изменений в коде, позволяя при необходимости вернуться к этой версии.
Что такое ветка?
Ветка похожа на отдельную копию проекта, в которой можно работать над новыми идеями или исправлениями, не затрагивая основную версию. Это безопасное место для экспериментов.
Почему важно часто сохранять работу?
Частые сохранения (атомарные коммиты) помогают не потерять работу и облегчают поиск и исправление проблем. Если что-то сломалось, можно легко вернуться к предыдущей точке сохранения, в которой всё работало.
Подробности
Оригинальное описание автора
Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging,
repo: addyosmani/agent-skills
Популярность
- Звёзды на GitHub
- 107k
- Место в рейтинге
- #773
- Лицензия
- MIT
- Обновлён
- 13.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
api-and-interface-design
107kПомогает создавать чётко определённые API и интерфейсы, когда вы проектируете, как части программы будут общаться.
browser-testing-with-devtools
107kАгент тестирует код прямо в настоящих браузерах, находя ошибки и проблемы производительности там, где код будет работать.
ci-cd-and-automation
107kУчит ИИ-агента автоматизировать повторяющиеся задачи, выпускать проекты и управлять инфраструктурой.
code-review-and-quality
107kПроводит подробное ревью кода по многим направлениям перед слиянием изменений, чтобы сохранить качество и избежать проблем.
Похожие скиллы
openclaw-update
394kПомогает агенту обновить уже работающий OpenClaw Gateway, выбрав способ обновления по тому, как он был установлен, и сохранив вашу сессию.
diagnose-gateway
394kПомогает агенту выяснить, почему ваш OpenClaw Gateway не работает, проверяя настройки, каналы и порты, но ничего не меняя.
crabbox-apps
394kПомогает агенту открыть и запустить приложение на временной облачной машине, а затем показать его вид на боковой панели чата.