AgentSkillsCN

git-commit-helper

通过分析Git差异,依据项目特定的政策生成具有描述性的提交信息。当用户请求协助撰写提交信息,或希望审核暂存的变更时,可使用此功能。

SKILL.md
--- frontmatter
name: git-commit-helper
description: Generate descriptive commit messages by analyzing git diffs following the project's specific policy. Use when the user asks for help writing commit messages or reviewing staged changes.

Git Commit Helper

Instructions

When the user requests a git commit or help with a commit message, follow these steps:

  1. Analyze changes: Review staged and unstaged changes to understand the scope and purpose of the work.
  2. Determine Domain: Identify the primary component or domain affected (e.g., (nfs), (open-webui)). Use lowercase and kebab-case.
  3. Select Type & Gitmoji: Choose the appropriate type and its corresponding gitmoji from the table below.
  4. Draft Message: Create the message in English using the required format.

Format

code
<gitmoji> <type>(<domain>): <title>

<description>

Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
  • Title: Concise, imperative mood, lowercase after the type.
  • Description: Optional, explain "why" or provide context.
  • Co-Authored-By: Always include Co-Authored-By: Cursor Agent <cursoragent@cursor.com>.

Gitmoji & Type Mapping

GitmojiTypeDescription
🔧choreRoutine maintenance or minor corrections
🛠️fixIntentional functional configuration changes
featNew features
✏️typoFix a typo
🐛bugFix a bug
⬆️depUpgrade dependencies
🔐securityAdd or update secrets
🗑️removeDeprecate or clean up code
♻️refactorRefactor code
📝docsAdd or update documentation
🎨styleImprove structure / format
perfImprove performance
testAdd, update, or pass tests
🔨buildAdd or update development scripts

Workflow

  1. Propose message: Present the drafted message in a markdown code block.
  2. Request confirmation: Ask the user if they want to proceed with the commit.
  3. Commit & Push:
    • Only execute git commit after explicit user approval.
    • After committing, ask if they want to push to the remote.
    • Only execute git push after receiving explicit user approval.

Additional Resources