addyosmani avatar

Git Workflow And Versioning

This is a comprehensive workflow discipline for keeping AI-generated code manageable through git. It pushes trunk-based development with short-lived branches (1-3 days max), atomic commits around 100 lines, and a save point pattern where every successful increment gets committed immediately. The change summary format is especially practical for AI work: explicitly documenting what you didn't touch prevents scope creep and makes reviews faster. Includes worktree patterns for running multiple agents in parallel and pre-commit hygiene checks. The core insight is that when code generation is fast, version control becomes your primary defense against chaos. Best for teams struggling with large AI-generated PRs or merge conflict hell.

skills.sh installs
68.8K
GitHub stars
114.6K
last updated
Aug 21, 2026

Install

$ npx -y skills add addyosmani/agent-skills --skill git-workflow-and-versioning --agent claude-code

Installs into .claude/skills of the current project.

Files

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.

Sponsors

Details

Repository
github.com/addyosmani/agent-skills
Categories
Git & Pull Requests, Documentation, AI & Agent Building, Release Management, Automation & Workflows
First seen
Apr 16, 2026

More from addyosmani/agent-skills

All 25
1wshobson avatarchangelog-automationwshobson/agentsAutomate changelog generation from commits, PRs, and releases following Keep a Changelog format. Use when setting up release workflows, generating release notes14.2Kskills.sh installs
2sanyuan0704 avatarcode-review-expertsanyuan0704/sanyuan-skillsExpert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements.13.8Kskills.sh installs
3callstackincubator avatargithubcallstackincubator/agent-skillsGitHub patterns using gh CLI for pull requests, stacked PRs, code review, branching strategies, and repository automation. Use when working with GitHub PRs, mer9.1Kskills.sh installs
4getsentry avatargha-security-reviewgetsentry/skillsGitHub Actions security review for workflow exploitation vulnerabilities. Use when asked to "review GitHub Actions", "audit workflows", "check CI security", "GH5Kskills.sh installs
5getsentry avatarcommitgetsentry/skillsUse for every request to commit changes or draft a commit message. Creates Sentry-style conventional commits with issue references.4.9Kskills.sh installs
6getsentry avatarcreate-branchgetsentry/skillsCreate a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new 4.4Kskills.sh installs