AgentSkillsCN

git-commit

应在运行任何 git commit 命令之前使用此技能。触发条件为即将运行 `git commit`。确保提交信息符合 Conventional Commits 规范,并提示输入 Jira 工单编号。

SKILL.md
--- frontmatter
name: git-commit
description: >-
  This skill should be used BEFORE running any git commit command. Triggers when
  about to run `git commit`. Ensures commit messages follow Conventional Commits
  specification and prompts for Jira ticket number.

Git Commit Messages

Write commit messages following the Conventional Commits specification.

Format

code
<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Types

TypePurpose
featNew feature
fixBug fix
docsDocumentation only
styleCode style (formatting, no logic change)
refactorCode change that neither fixes a bug nor adds a feature
perfPerformance improvement
testAdding or correcting tests
buildBuild system or external dependencies
ciCI configuration
choreMaintenance tasks
revertReverts a previous commit

Rules

  1. Use imperative mood in description ("add feature" not "added feature")
  2. Do not end description with a period
  3. Keep description under 72 characters
  4. Separate subject from body with a blank line
  5. Use the body to explain intent, nuances, gotchas, or background behind the change — not a paraphrase of the diff
  6. Always ask the user for the Jira ticket number before committing. If there is one, include it as the last line in the commit body (e.g., XY-123). If there isn't one, omit it.

Breaking Changes

Add ! after type/scope or include BREAKING CHANGE: in footer:

code
feat(api)!: remove deprecated endpoints

BREAKING CHANGE: The /v1/users endpoint has been removed.

Scope

Optional. Use to specify area of change (e.g., api, ui, auth, db).