0xbigboss avatar

Git Best Practices

Enforces conventional commits, explicit staging, and safe force push practices across all git operations. Loads branch discovery commands upfront so you're always targeting the right base, includes a full rewrite-history workflow for cleaning up WIP commits before PRs, and adds checkpoint commit patterns for long-running agent tasks. The force-with-lease requirement and staged file verification catch the most common ways to shoot yourself in the foot. Opinionated about commit discipline but defers to repo-specific merge policies when they exist. If you've ever had an agent commit secrets or orphan a branch stack, this blocks those paths.

skills.sh installs
149
GitHub stars
48
last updated
Jun 3, 2026

Install

$ npx -y skills add 0xbigboss/claude-code --skill git-best-practices --agent claude-code

Installs into .claude/skills of the current project.

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.

Sponsors

Details

Repository
github.com/0xbigboss/claude-code
Category
Git & Pull Requests
First seen
Jun 3, 2026

More from 0xbigboss/claude-code

All 22
1sickn33 avatargitlab-automationsickn33/antigravity-awesome-skillsgitlab automation139skills.sh installs
2buiducnhat avataras-reviewbuiducnhat/agent-skillsas review131skills.sh installs
3absolutelyskilled avatargit-advancedabsolutelyskilled/absolutelyskilledgit advanced130skills.sh installs
4flora131 avatarado-commitflora131/atomicado commit116skills.sh installs
5flora131 avatarado-create-prflora131/atomicado create pr115skills.sh installs
6ganyuanran avatarfinishing-a-development-branchganyuanran/aegisYou've finished implementing a feature and all tests pass.0skills.sh installs