heykvnzhao/dotfiles/git-best-practices
Claude Code and agent skill by heykvnzhao/dotfiles
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Safe-by-default git workflow and Conventional Commits. Use for git operations (diffs, staging, commits, branches, merges, conflict resolution, rebase/cherry-pick), PR review, and releases (tagging). Prevent destructive operations without consent.
Install
npx vskill@latest install heykvnzhao/dotfiles/git-best-practicesSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as heykvnzhao/dotfiles/git-best-practices.
Git Best Practices
Safety Rules
- Read-only by default: Prefer
git status,git diff,git log,git show,git blamebefore making changes - Push requires explicit request: Never push unless user asks
- Checkout allowed for: PR review, explicit user request
- Branch changes require consent: Ask before creating/switching branches
- History rewriting requires consent: Ask before
commit --amend, interactive rebase, or force push (especially if anything may be shared) - Destructive ops require explicit user consent:
- Allow previews like
git clean -n(no deletion); do not rungit clean -fdwithout consent - Do not discard worktree changes with
git reset --hardorgit restore .without consent - Do not delete branches/tags or force push without consent
Preferred Commands
- Prefer modern porcelain:
git switch(branches) andgit restore(undo) when appropriate git restore --staged <path>is usually safe; discarding worktree changes (e.g.,git restore .) requires explicit consent
Conventional Commits
Format: <type>[optional scope][optional !]: <description>
Subject Line
- Use imperative mood (“add”, “fix”, “remove”)
- Keep it short and specific; avoid trailing periods
Types
| Type | Use for | |
|---|---|---|
feat | New features | |
fix | Bug fixes | |
docs | Documentation only | |
style | Formatting, whitespace (no code change) | |
refactor | Code change that neither fixes nor adds | |
perf | Performance improvements | |
test | Adding or correcting tests | |
build | Build system or dependencies | |
ci | CI configuration | |
chore | Other changes (tooling, config) | |
revert | Reverting a previous commit |
Scope
- Use the smallest sensible scope
- Omit scope if unclear or too broad
- Examples:
feat(auth):,fix(api):,docs(readme):
Breaking Changes
Mark with ! before the colon OR add a BREAKING CHANGE: footer:
Body and Footers
- Use body only when the subject line needs elaboration
- Footers follow git-trailer style:
Token: value - Common footers:
BREAKING CHANGE:,Fixes:,Refs:,Co-authored-by:
Examples
Pre-Commit Checklist
- Review
git status - Review
git diffandgit diff --staged - Run the smallest relevant checks if known (or ask what to run)
- Scan for secrets (tokens, keys, credentials) and unintended debug logs
- Prefer small, logical commits; use
git add -pwhen changes are mixed - Propose a commit split and draft commit messages before staging/committing
Workflow
After reviewing changes, end with:
- Short summary of proposed commits
- Clear question for next steps (stage/commit/push)
If anything is ambiguous, ask short, direct questions with options.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationWarning, 80 of 100Marginal. 1 run. Evaluated 8 months ago.
Source
- SKILL.md in the repositoryCheckingskills/git-best-practices/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 3 Apr 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/heykvnzhao/dotfiles/git-best-practices)