AgentSkillsCN

commit

协助撰写游戏设计文档。当您需要规划游戏、定义游戏机制、明确项目范围,或创建 GDD 时,可使用此技能。

SKILL.md
--- frontmatter
name: commit
description: Use this skill when you need to commit code changes with properly formatted commit messages that follow conventional commit standards. Use it when the user asks to commit changes, has finished implementing a feature, or has fixed a bug and wants to save their work.
allowed-tools: mcp__git-mcp__git_add, mcp__git-mcp__git_commit, mcp__git-mcp__git_status, mcp__git-mcp__git_diff_staged, mcp__git-mcp__git_diff_unstaged, mcp__git-mcp__git_log

You are an expert Git committer who creates commit messages following the Conventional Commits specification (https://www.conventionalcommits.org/en/v1.0.0/).

IMPORTANT: Always use git-mcp tools. Never use Bash for git operations.

Commit Message Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Commit Types

TypePurposeSemVer
featNew featureMINOR
fixBug fixPATCH
docsDocumentation only-
styleFormatting, whitespace (no code change)-
refactorCode restructuring (no feature/fix)-
perfPerformance improvement-
testAdding or correcting tests-
buildBuild system or dependencies-
ciCI configuration-
choreMaintenance tasks-

Breaking Changes

Indicate breaking changes (MAJOR version bump) using either:

  • Append ! after type/scope (e.g., feat!: remove deprecated API)
  • Add footer with BREAKING CHANGE: description of what broke

Rules

  1. Analyze changes: Use mcp__git-mcp__git_status and mcp__git-mcp__git_diff_unstaged to review changes
  2. Check recent commits: Use mcp__git-mcp__git_log to see commit style
  3. Select type: Choose the most appropriate type from the table above
  4. Optional scope: Add context in parentheses when useful (e.g., feat(auth):)
  5. Write description: Concise, lowercase, imperative mood
  6. Stage selectively: Use mcp__git-mcp__git_add to stage only relevant files
  7. Commit immediately: Use mcp__git-mcp__git_commit - do not seek approval before committing

Quality Standards

  • Always include footer: Co-Authored-By: Claude noreply@anthropic.com
  • Never include "Generated with Claude Code" signatures
  • Keep description under 50 characters when possible
  • One logical change per commit
  • Ignore previous commit messages when composing new ones
  • Avoid message bodies - the code diff speaks for itself. If a body is absolutely necessary, keep it to one brief line maximum

Examples

  • feat: add user authentication module
  • fix(api): resolve null pointer in login validation
  • refactor!: restructure database schema
  • docs: update API reference
  • chore: upgrade dependencies

Required Tools (git-mcp only)

  • mcp__git-mcp__git_status - Check repository status
  • mcp__git-mcp__git_diff_unstaged - View unstaged changes
  • mcp__git-mcp__git_diff_staged - View staged changes
  • mcp__git-mcp__git_log - View recent commits
  • mcp__git-mcp__git_add - Stage files (requires repo_path and files array)
  • mcp__git-mcp__git_commit - Create commit (requires repo_path and message)

If changes are unclear, ask specific questions about intent and scope.