AgentSkillsCN

git-commit

以规范化的提交信息、合理的暂存流程以及良好的提交习惯,创建结构清晰的 Git 提交记录。

SKILL.md
--- frontmatter
name: git-commit
description: Create well-structured git commits with conventional commit messages, proper staging, and commit best practices.
command: /git-commit
verified: true

Git Commit Helper

This skill helps create professional, well-structured git commits following best practices.

Commit Message Format

Use conventional commit format:

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

[optional body]

[optional footer]

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or modifying tests
  • chore: Maintenance tasks

Workflow

  1. Run git status to see changes
  2. Run git diff to review what changed
  3. Stage appropriate files (prefer specific files over git add .)
  4. Create commit with descriptive message
  5. Verify commit was successful

Best Practices

  • Keep commits atomic (one logical change per commit)
  • Write clear, descriptive commit messages
  • Don't commit sensitive files (.env, credentials)
  • Review changes before committing

Examples

  • "Commit my changes with a good message"
  • "Create a commit for the login feature"
  • "Stage and commit the bug fix"