Commit standards

From AsiaOstrich/universal-dev-standards · View interactive version

Commit standards is an AI agent skill from the GitHub repository AsiaOstrich/universal-dev-standards. [UDS] 生成符合 Conventional Commits 规范的 commit message,包含双语格式。 Use when: 为已暂存的变更撰写 commit message、选择 type 与 scope、产出英文与中文并列的主旨与正文。 Not for: 判断这份变更是否已可提交——请用 /checkin;把多个 commit 汇整成发布说明——请用 /changelog。 Keywords: commit message, Conventional Commits, feat, fix, refactor, scope, bilingual, 提交信息, 双语 commit,

How to use this skill

Skill file

Commit Message 助手

语言: English | 简体中文

根据 staged 的变更,产生符合 Conventional Commits 格式的 commit message。

工作流程

  1. 检测语言 - 读取 .standards/manifest.json → 检查 options.output_language。若找不到,默认为 english。
  2. 检查状态 - 执行 git status 和 git diff --staged 了解变更内容
  3. 分析变更 - 判断类型(feat、fix、refactor 等)和范围
  4. 产生消息 - 按检测到的语言,依以下对应格式建立 commit message(见下方)
  5. 确认并提交 - 在执行 git commit 前询问用户确认

消息格式

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

<body>

<footer>

提交类型

| 类型 | 使用时机 |

|------|---------|

| feat | 新功能 |

| fix | 修复错误 |

| refactor | 重构(无功能变更) |

| docs | 文档更新 |

| style | 格式调整(无逻辑变更) |

| test | 测试相关 |

| perf | 性能优化 |

| chore | 维护任务 |

规则

双语格式

当 output_language 为 bilingual 时,你必须使用以下格式:

<type>(<scope>): <English subject>. <中文主旨>.

<English body — explain what and why in English>

<中文正文 — 用中文说明做了什么及为什么>

<footer>

必须遵守的规则

  1. 英文正文在前,中文正文在后
  2. 英文正文与中文正文之间以空白行分隔
  3. 严禁在同一段落内混用语言
  4. 严禁省略中文正文——两种语言皆为必填
  5. Footer(BREAKING CHANGE、Fixes #、Co-authored-by)置于两段正文之后的最末端

双语示例

feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登录支持.

Implement Google OAuth2 authentication flow for user login.

- Add Google OAuth2 SDK integration
- Create callback endpoint for OAuth flow
- Store refresh tokens securely

实现 Google OAuth2 认证流程供用户登录。

- 集成 Google OAuth2 SDK
- 建立 OAuth 流程回调端点
- 安全存储刷新令牌

Closes #123

繁体中文格式

当 output_language 为 traditional-chinese 时,类型保持英文(feat、fix、docs……),主旨与正文使用繁体中文。不可使用 新增 这类中文类型:

feat(auth): 新增 OAuth2 Google 登入支持

实现 Google OAuth2 认证流程供用户登录。

关闭 #123

使用方式

下一步引导

/commit 完成后,AI 助手应建议:

提交完成。建议下一步:

- 执行 git push 推送到远端 ⭐ 推荐 — 推送到远端

- 准备发布时 → 执行 /changelog + /release — 准备发布时执行

- 发现重复模式或规范摩擦 → 执行 /audit --report 回报 — 检测到模式或摩擦时回报反馈

参考

AI 代理行为

完整的 AI 行为定义请参阅对应的命令文件:CODE0

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.