选项
首页首页 Skill 代码审查 commit-standards

按照常规提交标准编写提交信息。适用场景:编写提交信息、执行 git commit 命令、审查提交历史。关键词:commit、git、message、conventional、提交、信息、feat、fix、refactor。

...展开全部
49
更新时间 2026-06-29

关于“commit-standards”

“commit-standards”技能通过遵循“conventional commits”标准,强制要求提交信息采用统一的格式。这确保了提交信息清晰、简洁且信息丰富。 它通过提供结构化的提交信息编写方法,解决了提交信息不一致或含糊不清的问题,从而促进提交历史记录更加条理清晰、易于理解。该标准对于软件开发项目的协作尤为有用,因为清晰的版本控制和变更记录对于团队和自动化系统而言都至关重要。

该技能旨在提供一种简单直观的方式来格式化提交信息。它使用一组预定义的提交类型(如“feat”、“fix”、“refactor”等)来有效分类变更。 用户可以遵循包含主题、正文和页脚的严格格式,其中对主题行长度、大写规则和标点符号都有具体规定。该技能还支持多语言提交信息格式,包括英语、繁体中文和双语选项,以适应多样化的开发环境。

该技能非常适合希望保持提交信息一致且专业风格的开发者、团队和开源贡献者。对于代码审查员、版本控制管理员以及任何依赖提交历史记录来理解代码变更的相关人员而言,它尤其有益。 该技能的配置系统支持根据项目偏好进行灵活定制,使其能够适应各种工作流程和团队需求。

常见问题

如何配置提交信息语言?

您可以在项目的 'CONTRIBUTING.md' 文件中配置提交信息语言。如果未找到相关配置,系统将默认使用英语。可选语言包括英语、繁体中文和双语。

如果我的提交信息不符合标准会怎样?

该技能不会自动强制执行任何错误检查,但鼓励遵循最佳实践以确保一致性和清晰度。是否确保提交信息符合格式规范,由您的团队自行决定。

我可以将此技能用于非软件开发项目吗?

可以,虽然该技能主要针对软件项目设计,但任何需要清晰版本控制和变更记录的项目都能从中受益。

该技能是否支持提交信息中的多语言?

是的,该技能支持英语、繁体中文以及双语提交信息。您可以在 'CONTRIBUTING.md' 文件中选择首选的语言配置。

该技能支持哪些提交类型?

该技能支持多种提交类型,包括“feat”、“fix”、“refactor”、“docs”、“style”、“test”、“perf”、“build”、“ci”、“chore”、“revert”和“security”。

在 GitHub 上查看

Commit Message Standards

This skill ensures consistent, meaningful commit messages following conventional commits.

Quick Reference

Basic Format

<type>(<scope>): <subject><body><footer>

Commit Types

English中文When to Use
feat新增New feature
fix修正Bug fix
refactor重構Code refactoring (no functional change)
docs文件Documentation only
style樣式Formatting (no code logic change)
test測試Adding or updating tests
perf效能Performance improvement
build建置Build system or dependencies
ci整合CI/CD pipeline changes
chore維護Maintenance tasks
revert回退Revert previous commit
security安全Security vulnerability fix

Subject Line Rules

  1. Length: ≤72 characters (50 ideal)
  2. Tense: Imperative mood ("Add feature" not "Added feature")
  3. Capitalization: First letter capitalized
  4. No period: Don't end with a period

Detailed Guidelines

For complete standards, see:

  • Conventional Commits Guide
  • Language Options

Examples

✅ Good Examples (English)

feat(auth): Add OAuth2 Google login supportfix(api): Resolve memory leak in user session cacherefactor(database): Extract query builder to separate classdocs(readme): Update installation instructions for Node 20

✅ Good Examples (中文)

新增(認證): 實作 OAuth2 Google 登入支援修正(API): 解決使用者 session 快取記憶體洩漏重構(資料庫): 提取查詢建構器為獨立類別

✅ Good Example (Bilingual)

feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援。Implement Google OAuth2 authentication flow for user login.實作 Google OAuth2 認證流程供使用者登入。Closes #123

❌ Bad Examples

fixed bug                    # Too vague, no scopefeat(auth): added google login  # Past tenseUpdate stuff.                # Period, vagueWIP                          # Not descriptive

Body Guidelines

Use the body to explain WHY the change was made:

fix(api): Resolve race condition in concurrent user updatesWhy this occurred:- Two simultaneous PUT requests could overwrite each other- No optimistic locking implementedWhat this fix does:- Add version field to User model- Return 409 Conflict if version mismatchFixes #789

Breaking Changes

Always document breaking changes in footer:

feat(api): Change user endpoint response formatBREAKING CHANGE: User API response format changedMigration guide:1. Update API clients to remove .data wrapper2. Use created_at instead of createdAt

Issue References

Closes #123    # Automatically closes issueFixes #456     # Automatically closes issueRefs #789      # Links without closing

Configuration Detection

This skill supports project-specific language configuration.

Detection Order

  1. Check CONTRIBUTING.md for "Commit Message Language" section
  2. If found, use the specified option (English / Traditional Chinese / Bilingual)
  3. If not found, default to English for maximum tool compatibility

First-Time Setup

If no configuration found and context is unclear:

  1. Ask the user: "This project hasn't configured commit message language preference. Which option would you like to use? (English / 中文 / Bilingual)"
  2. After user selection, suggest documenting in CONTRIBUTING.md:
## Commit Message LanguageThis project uses **[chosen option]** commit types.<!-- Options: English | Traditional Chinese | Bilingual -->

Configuration Example

In project's CONTRIBUTING.md:

## Commit Message LanguageThis project uses **English** commit types.### Allowed Typesfeat, fix, refactor, docs, style, test, perf, build, ci, chore, revert, security

License: CC BY 4.0 | Source: universal-dev-standards

安装 commit-standards

下载技能文件并将其解压到 .claude/skills/ 目录中。

下载ZIP

克隆仓库并复制技能文件到您的项目中。

git clone https://github.com/AsiaOstrich/universal-dev-skills/blob/main/skills/commit-standards/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

复制 复制
快速设置: 将技能文件夹复制到 .claude/skills/ 目录下,Claude 会自动检测并使用该技能

相关技能

code-simplify
更新时间 2026-07-02
requesting-code-review
更新时间 2026-06-29
Git Commit Helper
更新时间 2026-06-29
fetch-pr-review-comments
更新时间 2026-06-29
OR