AgentSkillsCN

git-commit

在任何 Git 提交之前主动使用。在以下场景中调用:提交代码、创建 PR、推送变更、保存工作。涵盖签名提交、GPG 签名、提交信息、squash 合并、原子提交等操作。

SKILL.md
--- frontmatter
name: git-commit
description: "Use proactively before ANY git commit. Invoke when: committing code, creating PR, submitting changes, saving work. Covers: signed commits, GPG, commit messages, squash, atomic commits"

Git Commit

  • Sign: Always use -S flag (GitHub vigilant mode)
  • Atomic: One complete unit per commit.
    • Squash: iterative fixes to earlier commits in the same branch (typos, forgotten files, "oops" fixes)
    • Keep separate: independent changes with distinct purposes
  • Comprehensive messages: Capture full context - business domain, technical decisions, architectural rationale, system design. Intent: enable future investigation and crime scene work from git history.
  • Holistic rewrites: When squashing or amending, rewrite the message to encapsulate all changes as a unified whole. Don't patch on top - create a coherent message that makes sense standalone.
  • Domain language: Use relevant domain terminology. Human readable but technical - specific over vague.