Git Best Practices
Opinionated git workflow that enforces conventional commits, explicit staging, and safe force-pushing for agents.
- CCM score
- 50 of 100
- skills.sh installs
- 271
- GitHub stars
- 49
- last updated
- Jun 3, 2026
Own this skill? Claim it
What it does
- Covers commit discipline, branch discovery, branch naming, merge strategy, and PR creation, plus history rewriting before review
- Includes a conventional commit type table (
feat,fix,refactor,chore, and others) and branch flow guidance for hotfixes and default branches - Enforces
--force-with-leasefor force pushes only after user confirmation, and requires explicit file staging by name - Designed for agents creating commits, managing branches, or opening PRs, with
git-rebase-syncreferenced for conflict resolution
Install
$ npx -y skills add alleneubank/claude-code --skill git-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Git Best Practices
Always Active Principles
When this skill is loaded, follow these directives for all git operations:
- Discover before acting — run branch discovery to determine the repo's default and production branches before branching, merging, or opening PRs
- Conventional commits — every commit uses
type(scope): descriptionformat - Stage explicitly — add files by name so only intended changes are committed
- Protect shared history — use
--force-with-leasefor force pushes; confirm with the user before any force push
Agent Git Workflow
- Check state — run
git statusandgit diff HEAD - Discover branches — identify default/current/(optional) production branch names (see Branch Discovery)
- Stage by name —
git add path/to/filefor each file; verify withgit status - Write a conventional commit —
type(scope): descriptionwith optional body - Push safely — regular push by default;
git push --force-with-lease origin {branch}only for rewritten history after user confirmation
Checkpoint Commits
Agents may create WIP checkpoint commits during long-running tasks, cleaned up before PR.
Details
- Repository
- github.com/alleneubank/claude-code
- Category
- Git & Releases
- First seen
- Jun 3, 2026
Questions
What does the git-best-practices skill do?
git-best-practices guides an agent through commits, branches, pull requests and history rewriting. It makes the agent discover the repo's default and production branches first, write conventional commits, stage files by name and use --force-with-lease for any force push.
How do I install the git-best-practices skill?
Run npx -y skills add alleneubank/claude-code --skill git-best-practices -y in a project to install it. Once loaded, git-best-practices applies its git rules to every commit, branch and PR the agent handles in that project.
Which skills lead the Git & Releases category next to git-best-practices?
git-best-practices sits in the Git & Releases category with triage, git-guardrails-claude-code, setup-pre-commit, caveman-commit and pr. Its distinct focus is the always active git rules, such as conventional commit format and force push confirmation, that it applies across all git work.
Does git-best-practices need any tools or accounts?
The SKILL.md uses the gh CLI for branch discovery and falls back to git commands when gh is unavailable or the repo has no remote. Git-best-practices needs a git repository, and the listing names no API keys or accounts.
More from alleneubank/claude-code
All 8Similar to Git Best Practices
More Git & Releasesmanaging-gitcloudai-x/claude-workflow-v2201 installsStructured guide covering Git branching strategies, Conventional Commits, branch naming, and pull request workflows with checklists.
git-workflow-and-versioningaddyosmani/agent-skills81.2K installsStructured git workflow guide covering trunk-based development, atomic commits, and parallel work with worktrees.
git-commit-pushzc277584121/mygitplugin3.4K installsCommit local changes and push them to origin, with no pull request, using enforced signoff and authorship.
conventional-commitmarcelorodrigo/agent-skills969 installsStructured git commit guidance that enforces Conventional Commits types, scopes, and subject rules.
git-rebasepedronauck/skills414 installsSafely rebase branches and resolve cross-commit conflicts while preserving both sides' intended behavior.