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

Follow this sequence when performing git operations:

  1. Check state — run git status and git diff HEAD; output: working tree and unstaged/staged delta
  2. Discover branches — identify and store 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
Related skills
Installs
1
GitHub Stars
129
First Seen
Feb 20, 2026