git-best-practices

Installation
SKILL.md

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 namegit add path/to/file for each file; verify with git status
  4. Write a conventional committype(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
Related skills
Installs
120
GitHub Stars
47
First Seen
Feb 13, 2026