
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-codeInstalls 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:
- 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.
Sponsors
Details
- Repository
- github.com/0xbigboss/claude-code
- Category
- Git & Pull Requests
- First seen
- Jun 3, 2026
More from 0xbigboss/claude-code
All 22- Git Rebase Sync146
- Testing Best Practices135
- E2e126
- Extract Transcripts122
- React Best Practices3K
- Typescript Best Practices2.9K
- Python Best Practices1.8K
- Web Fetch929
- Zig Best Practices388
- Nix Best Practices359
- Tamagui Best Practices290
- Openai Image Gen288
- Go Best Practices272
- Playwright Best Practices266
- Axe Ios Simulator239
- Electrobun Best Practices209
- Tilt196
- Orbstack Best Practices180
- Canton Network Repos157
- Ios Device Screenshot155
- Atlas Best Practices154