git-workflow-and-versioning

Structures git commits, branching, and semantic versioning into disciplined workflows.

1|Updated Sep 4, 2026
One-click install
npx skills add https://github.com/SanHsien/agent-skills --skill git-workflow-and-versioning-sanhsien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow-and-versioning
Source: https://github.com/SanHsien/agent-skills/tree/main/skills/git-workflow-and-versioning
Command: npx skills add https://github.com/SanHsien/agent-skills --skill git-workflow-and-versioning-sanhsien

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents generate code at high speed, and without version control discipline this produces giant unreviewable commits, messy working trees, and releases with no clear version contract. This Skill enforces atomic commits, trunk-based branching, and semantic versioning so every change stays reviewable, revertable, and traceable. ## Core Features & Use Cases - Atomic Commit Discipline: Enforces one logical change per commit with conventional message types (feat, fix, refactor, test, docs, chore) and pre-commit hygiene checks for secrets, tests, and linting. - Branching & Worktrees: Guides trunk-based development with short-lived feature branches and git worktrees for running parallel AI agent work in isolated directories. - Release & Versioning: Applies semantic versioning (MAJOR.MINOR.PATCH), annotated git tags as the source of truth, and human-readable changelogs grouped by impact. - Use Case: An agent finishes a messy coding session with mixed changes in the working tree. Use this Skill to split the work into clean atomic commits, write descriptive messages, and open a reviewable pull request. ## Quick Start Ask the agent to organize the current uncommitted changes into atomic commits with conventional messages and prepare a pull request.

Frequently Asked Questions about git-workflow-and-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a messy working tree into atomic commits?

Stage and commit one logical change at a time, keeping each commit self-contained around a single concern. Separate formatting changes from behavior changes and refactors from features so each commit is easy to review and revert.

What is trunk-based development and why use it?

Trunk-based development keeps main always deployable with short-lived feature branches merged within 1-3 days. Long-lived branches accumulate merge risk and delay integration, while feature flags let incomplete work ship safely.

How do I choose between major, minor, and patch version bumps?

Use major for breaking changes, minor for backward-compatible features, and patch for backward-compatible fixes. When unsure whether a change is breaking, assume it is, since consumers may rely on behavior beyond the documented API.

Can multiple AI agents work on the same repo in parallel?

Yes, use git worktrees to give each agent its own directory checked out to a separate branch. Changes stay isolated until explicitly merged, and a failed experiment can be discarded by removing the worktree.

What should I check before every git commit?

Review the staged diff, scan for secrets like passwords or API keys, run tests, linting, and type checking. Automate these checks with git hooks using tools like lint-staged and husky.

Why is a changelog different from git log output?

A changelog is a curated, consumer-facing summary grouped by impact categories like Added, Fixed, and Deprecated. Raw commit logs bury what matters, so write changelog entries with each change rather than reconstructing them at release time.