← 返回
未分类 中文

Commit Message Validation

Strict Conventional Commits v1.0.0, atomic commit discipline, and Trunk-Based Development guardrails for git work. Use when preparing a commit, staging chang...
严格的约定式提交 v1.0.0、原子提交规范及主干开发准则。用于准备提交或暂存变更时。
omaression
未分类 clawhub v1.0.0-alpha 1 版本 100000 Key: 无需
★ 0
Stars
📥 429
下载
💾 0
安装
1
版本
#latest

概述

Commit Message Writing

Every commit: valid Conventional Commit, atomic, on the right short-lived branch.

Required workflow

  1. git status --short and git diff --stat.
  2. Verify you're on a short-lived branch dedicated to one feature, bug, fix, or coding area. If not, create/switch first.
  3. Confirm the changes are one logical unit. If mixed, split before committing.
  4. Confirm automated tests appropriate to the scope will run.
  5. Pick the most specific commit type.
  6. Write the message:
<type>[optional scope][!]: <imperative lowercase description>

[optional body]

[optional footer(s)]
  1. Validate with scripts/validate_commit_message.py before committing.

Hard rules

  • One short-lived branch per feature, bug, fix, or distinct coding area.
  • Keep branches narrow, merge back quickly, avoid long-lived divergence.
  • Every PR must have robust automated tests so bugs are caught early.
  • Always include a lowercase type followed by : .
  • Imperative, lowercase description, no trailing period, ≤72 chars.
  • Body: one blank line after description. Footers: one blank line after body.
  • Footer format: Token: value. Hyphens in tokens except BREAKING CHANGE.
  • Use ! and/or BREAKING CHANGE: footer for breaking changes.
  • Never use WIP, misc, update, or vague summaries.

Types

TypeWhenSemVer
---------
featnew featureminor
fixbug fixpatch
refactorrestructure, no behavior changenone
perfperformance improvementnone (patch if fixes bug)
docsdocumentation onlynone
testtests onlynone
buildbuild system / depsnone
ciCI/CD changesnone
choremaintenance / toolingnone
styleformatting onlynone
revertrevert prior commitdepends

Scope

Use a consistent noun for the dominant area. Omit only when truly cross-cutting. Never multiple scopes in one commit line.

Splitting rules

Split when:

  • feature + bug fix
  • code + formatting-only cleanup
  • deps/build + application logic
  • refactor + standalone behavior change
  • generated files + loosely coupled source

One type, one intent per commit. If you can't describe it that way, split.

Validation

python3 scripts/validate_commit_message.py --message "feat(auth): add otp fallback"

版本历史

共 1 个版本

  • v1.0.0-alpha 当前
    2026-03-30 14:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Skill Auditor & Enhancer

omaression
定期审计所有工作区技能、学习记录、记忆和配置文件,以推荐重构方案、新技能创意和工作流程改进建议。
★ 0 📥 602

Auto Improving Agent

omaression
利用信号过滤自动将更正、失败和可复用发现捕获至`.learnings/`文件。当用户更正时触发……
★ 0 📥 468

Atomic Memory Manager

omaression
为 OpenClaw 代理利用 MEMORY.md、memory/YYYY-MM-DD.md、memory_search 和 memory_get 回读写工作区记忆。当用户询问优先级时使用。
★ 0 📥 652