AgentSkillsCN

commit

按照常规提交规范,创建Git提交,且不附带Claude签名。

SKILL.md
--- frontmatter
name: commit
description: Create a git commit following conventional commits standard without Claude signature
allowed-tools: ["Bash"]

Git Commit Skill

Create a git commit for the current changes. Follow these steps:

Steps

  1. Run the following commands in parallel to understand the current state:
    • git status — see untracked and modified files
    • git diff — see unstaged changes
    • git diff --staged — see already staged changes
    • git log --oneline -10 — understand the commit message style
  2. If there are no changes (no untracked files, no modifications, no staged changes), inform the user and stop.
  3. Analyze all changes and draft a commit message following the rules below.
  4. Stage the relevant files (prefer git add <specific-files> over git add .). If changes are already staged, use them as-is unless there are additional unstaged changes that should be included.
  5. Create the commit. Pass the message via HEREDOC to avoid escaping issues:
    bash
    git commit -m "$(cat <<'EOF'
    <commit message here>
    EOF
    )"
    
  6. Run git status to verify the commit succeeded.
  7. If the commit fails due to a pre-commit hook, fix the issue, re-stage, and create a new commit. NEVER use --no-verify to skip hooks.
  8. After a successful commit, run git push to push to the remote.

Commit Message Rules

Follow the Conventional Commits specification:

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

[optional body]

Guidelines

  • Always write commit messages in English, consistent with the project's existing style
  • Infer scope from the changed directory or module (e.g., feat(auth), fix(api))
  • Keep the description concise (under 72 characters)
  • Use imperative mood ("add feature" not "added feature")
  • Focus on the "why" rather than the "what"
  • Use the body for additional context when needed
  • Do not commit files that likely contain secrets (.env, credentials, etc.)
  • NEVER add Co-Authored-By, Generated by, or any Claude/AI signature to the commit message