AgentSkillsCN

git-commit

在提交更改或撰写提交信息时应用此规则。

SKILL.md
--- frontmatter
name: git-commit
description: Apply when committing changes or writing commit messages.

Git Commit

Commit Messages

  1. Check branch for issue prefix:
bash
git branch --show-current

Extract PREFIX-NUMBER (e.g., JIRA-123, GH-456) → prepend as [PREFIX-NUMBER]

  1. If user provides PR ID (#XXX), append it.

  2. Rules:

    • Imperative mood ("Add" not "Added")
    • Stand-alone without conversation context
    • Never add Co-authored-by attribution
    • Body only when explaining "why" beyond subject

Input: Branch JIRA-1234/add-auth, added JWT login Output:

code
[JIRA-1234] Add JWT authentication flow

Implement login endpoint with token validation middleware.

Input: Branch feat/dark-mode, added theme toggle, PR #567 Output:

code
Add dark mode theme toggle (#567)