AgentSkillsCN

git-commit

采用带有作用域的常规提交方式创建 Git 提交。适用于用户要求提交、进行提交、保存更改,或执行任何 Git 提交操作时使用。切勿在提交信息中加入共同作者行、AI 代理提及,或任何关于 Claude、AI 或自动化工具的引用。

SKILL.md
--- frontmatter
name: git-commit
description: Create git commits using conventional commits with scopes. Use when the user asks to commit, make a commit, save changes, or any git commit operation. Never include Co-Authored-By lines, AI agent mentions, or any reference to Claude, AI, or automated tooling in commit messages.

Git Commit

Rules

  • Never add Co-Authored-By lines to commit messages
  • Never mention Claude, AI, agent, copilot, or any automated tooling
  • Commits must look like they were written by a human developer

Format

text
type(scope): subject

body (optional)
  • subject: lowercase, imperative mood, no period, max 72 chars
  • body: wrap at 72 chars, explain why not what, separated by blank line

Types

TypeUse for
featNew feature
fixBug fix
refactorCode change that neither fixes nor adds
docsDocumentation only
styleFormatting, semicolons, no code change
testAdding or updating tests
choreBuild, tooling, deps, no production code
perfPerformance improvement
ciCI/CD configuration

Scope

Derive the scope from the primary area of change:

  • Module or package name (auth, api, db)
  • Feature area (login, checkout, search)
  • Layer (ui, server, cli)

Omit scope only when the change is truly project-wide.

Workflow

  1. Run git status and git diff --staged (or git diff if nothing staged)
  2. Identify the primary change type and scope
  3. Write the commit message
  4. Stage relevant files by name (avoid git add . or git add -A)
  5. Commit using a HEREDOC:
bash
git commit -m "$(cat <<'EOF'
type(scope): subject

optional body
EOF
)"

Examples

text
feat(auth): add password reset flow

Allow users to reset their password via email link.
Tokens expire after 30 minutes.
text
fix(api): handle null response from payment gateway
text
refactor(db): extract query builder into separate module
text
chore(deps): upgrade react to v19