git-best-practices
Installation
SKILL.md
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
Related skills
More from 0xbigboss/claude-code
react-best-practices
Use when reading or writing React components (.tsx, .jsx files with React imports).
2.6Ktypescript-best-practices
Use when reading or writing TypeScript or JavaScript files (.ts, .tsx, .js, tsconfig.json).
2.1Kpython-best-practices
Use when reading or writing Python files (.py, pyproject.toml, requirements.txt).
1.3Kweb-fetch
Fetches web content as clean markdown by preferring markdown-native responses and falling back to selector-based HTML extraction. Use for documentation, articles, and reference pages at http/https URLs.
780zig-best-practices
Use when reading or writing Zig files (.zig, build.zig, build.zig.zon).
349nix-best-practices
Use when working with Nix flakes, overlays, shell.nix, or flake.nix files.
318