AgentSkillsCN

commit

按照常规提交格式创建git提交。在被要求提交更改时使用。

SKILL.md
--- frontmatter
name: commit
description: Create git commits following conventional commits format. Use when asked to commit changes.
allowed-tools: Bash, Read, Grep, Glob

Commit Changes

Create commits following the Conventional Commits specification.

Format

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

<body>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only
  • style: Formatting, no code change
  • refactor: Code change that neither fixes a bug nor adds feature
  • test: Adding or updating tests
  • chore: Build process, auxiliary tools, libraries

Rules

  1. Subject line: imperative mood, lowercase, no period, max 50 chars
  2. Body: explain why not what (the diff shows what)
  3. Wrap body at 72 characters
  4. Reference issues when relevant: "Fixes #123"

Process

  1. Run git status and git diff --staged to understand changes
  2. If nothing staged, stage relevant files with git add
  3. Determine appropriate type and scope from the changes
  4. Write commit message following the format
  5. Do NOT add "Generated by Claude" or co-author lines

Examples

code
feat(pubsub): add message timestamp to publisher

Include ROS2 clock timestamp in published messages to enable
message ordering and latency measurements.
code
fix(subscriber): handle empty message gracefully

Previously crashed on empty string. Now logs warning and continues.