Skip to content
alleneubank avatar

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
View on GitHub

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-lease for 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-sync referenced for conflict resolution

Install

$ npx -y skills add alleneubank/claude-code --skill git-best-practices -y

Installs 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:

  1. Discover before acting — run branch discovery to determine the repo's default and production branches before branching, merging, or opening PRs
  2. Conventional commits — every commit uses type(scope): description format
  3. Stage explicitly — add files by name so only intended changes are committed
  4. Protect shared history — use --force-with-lease for force pushes; confirm with the user before any force push

Agent Git Workflow

  1. Check state — run git status and git diff HEAD
  2. Discover branches — identify default/current/(optional) production branch names (see Branch Discovery)
  3. Stage by name — git add path/to/file for each file; verify with git status
  4. Write a conventional commit — type(scope): description with optional body
  5. 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 8

Similar to Git Best Practices

More Git & Releases