
Git Workflow And Versioning
Keep agent-generated changes reviewable with trunk-based habits, atomic commits, and clear messages every time you touch the repo.
Overview
git-workflow-and-versioning is a journey-wide agent skill that structures trunk-friendly Git habits—atomic commits, short branches, and clear messages—usable whenever a solo builder needs reversible, reviewable changes b
Install
npx skills add https://github.com/addyosmani/agent-skills --skill git-workflow-and-versioningWhat is this skill?
- Explicit rule: use on every code change—commits, branches, and conflict resolution
- Recommends trunk-based development with main always deployable and feature branches living 1–3 days
- Frames commits as save points and branches as sandboxes to tame high-velocity AI edits
- Adapts atomic commit and message discipline to gitflow teams without endorsing long-lived dev branches
- Cites DORA alignment between trunk-based flow and high-performing delivery
- Recommends feature branches of 1–3 days maximum
Adoption & trust: 4k installs on skills.sh; 49.1k GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+200% hot-view momentum).
What problem does it solve?
Agents can land large, messy diffs fast, and without Git discipline you lose the ability to review, bisect, or roll back safely.
Who is it for?
Solo builders and tiny teams using AI coding agents who want main to stay shippable without a heavyweight release branch strategy.
Skip if: Repos where you only edit markdown locally with no version control, or regulated environments that mandate a fixed gitflow you cannot adapt—skip only if Git is genuinely out of scope.
When should I use this skill?
Making any code change; committing, branching, resolving conflicts; or organizing work across multiple parallel streams.
What do I get? / Deliverables
Your work flows through small, descriptive commits on short-lived branches so main stays deployable and conflicts stay manageable.
- Branching plan aligned to trunk-based defaults
- Atomic commits with descriptive messages
- Resolvable merge history suitable for review and rollback
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Spin a two-day experiment branch without polluting main before you decide to build.
Slice UI agent output into atomic commits so bisect finds the breaking change.
Open a small PR with messages that document intent for your future self.
Hotfix on a short branch, merge back fast, and keep main deployable.
Tag a release commit with clean history before publishing binaries or changelogs.
How it compares
Use for procedural Git discipline instead of ad-hoc giant commits at the end of an agent session.
Common Questions / FAQ
Who is git-workflow-and-versioning for?
Solo and indie builders on Claude Code, Cursor, or similar tools who need consistent commit and branching rules while agents generate code quickly.
When should I use git-workflow-and-versioning?
Use it across Build when implementing features, Ship when opening PRs and merging, Operate when hotfixing production, and Validate when prototyping in branches—always when committing, branching, or resolving conflicts.
Is git-workflow-and-versioning safe to install?
See the Security Audits panel on this Prism page for package signals; the skill is procedural guidance only and does not execute Git commands by itself.
SKILL.md
READMESKILL.md - Git Workflow And Versioning
# 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 feature - `fix` — Bug fix - `refactor` — Code change that neither fixes a bug nor adds a feature - `test` — Adding or updating tests - `docs` — Documentation only - `chore` — 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 in