Agent-skills-standard common-git-collaboration
Enforce version control best practices for commits, branching, pull requests, and repository security. Use when writing commits, creating branches, merging, or opening pull requests. (triggers: commit, branch, merge, pull-request, git)
install
source · Clone the upstream repo
git clone https://github.com/HoangNguyen0403/agent-skills-standard
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/HoangNguyen0403/agent-skills-standard "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/common/common-git-collaboration" ~/.claude/skills/hoangnguyen0403-agent-skills-standard-common-git-collaboration-82e51f && rm -rf "$T"
manifest:
skills/common/common-git-collaboration/SKILL.mdsource content
Git & Collaboration
Priority: P0 (OPERATIONAL)
1. Write Conventional Commits
- Format:
(e.g.,<type>(<scope>): <description>
).feat(auth): add login validation - Types:
,feat
,fix
,docs
,style
,refactor
,perf
,test
.chore - Use imperative mood: "add feature" not "added feature".
- One commit = one logical change — no mega-commits.
See implementation examples for conventional commit examples.
2. Manage Branches
- Name with prefixes:
,feat/
,fix/
,hotfix/
,refactor/
.docs/ - Create new branch for every task to keep main stable and deployable.
- Never push directly to
ormain
— use Pull Requests.develop - Pull before you push to resolve conflicts locally.
- Prefer
over merge for linear history on feature branches.git rebase - Use
to squash messy commits before pushing.git rebase -i
3. Submit Quality Pull Requests
- Limit to < 300 lines of code for effective review.
- State what changed, why, and how to test. Link issues (
).Closes #123 - Self-review for obvious errors before requesting peers.
- PRs must pass all CI checks (lint, test, build) before merging.
4. Protect Secrets and Metadata
- Never commit
, keys, or certificates — use.env
strictly..gitignore - Use
orhusky
for local Git Hooks enforcement.lefthook - Tag releases with SemVer (
) and updatevX.Y.Z
.CHANGELOG.md
Anti-Patterns
- No direct push to main: All changes via PR, no exceptions.
- No mega-commits: One commit = one logical change. Split large ones.
- No secrets in history: Use
to purge; rotate secret.git filter-repo