Skip to content

docs(harness): commit 规范分两层,squash 用 PR description - #2647

Merged
DoctorReid merged 2 commits into
verify-squash-bodyfrom
docs/squash-pr-desc
Aug 3, 2026
Merged

docs(harness): commit 规范分两层,squash 用 PR description#2647
DoctorReid merged 2 commits into
verify-squash-bodyfrom
docs/squash-pr-desc

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

回应 issue #2615(@ShadowLemoon):squash 后拼迭代 commit,可读性低。仓库 squash 设置改用 PR description,收尾时把 PR title + description 维护成 Conventional Commits 总结(第一个 ## 前 = squash commit body);commit 规范分两层 —— 单个迭代 commit 宽松 / 需要额外提供 commit message 的 merge 严格(依据 Conventional Commits 1.0.0)。两层规范主体在 AGENTS.md「提交流程」,收尾动作在 pr-finishing skill。

关联

  • issue: Squash内容可读性不高 #2615
  • 仓库 squash 设置:主仓 + 测试仓均已改 PR_BODY + PR_TITLE
  • 这个 PR 的 squash merge 正好实测 GitHub PR_BODY 截断(第一个 ## 前是否进 commit body)

Summary by CodeRabbit

  • 文档
    • 新增迭代提交信息规范,支持简洁描述并建议使用类型前缀。
    • 补充合并提交的 Conventional Commits 格式、变更原因、关联测试及 issue 的填写要求。
    • 更新跨仓库 PR 完成流程,明确标题、描述、关联 PR 和合并前检查步骤。
    • 明确 PR 描述作为 squash 提交信息来源的规则,以及 AI 不执行合并操作。

回应 issue #2615:仓库 squash 设置改用 PR description(PR_BODY),收尾
时把 PR title+desc 维护成 Conventional Commits 总结。commit 规范分两层
(依据 Conventional Commits 1.0.0):单个迭代 commit 宽松 / 需要额外
提供 commit message 的 merge 严格。

- AGENTS.md「提交流程」加两层 commit 规范
- pr-finishing skill 加「收尾维护 PR title+desc」步骤(design.md 决策 12)
- CLAUDE.local.md Conventional Commits 重新定位两层

Closes #2615

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid
DoctorReid requested a review from ShadowLemoon August 3, 2026 06:39
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

本次更新提交信息规范和 PR 收尾流程。内容覆盖 Conventional Commits、PR description、squash 总结、跨仓 PR 的 git 校验及流程编号调整。

Changes

提交与 PR 收尾流程

Layer / File(s) Summary
提交信息规范
AGENTS.md
新增迭代 commit 与 merge message 的分层要求。需要额外提供 message 的 merge 必须使用 type(scope): subject 格式,并补充 description、关联信息及 squash 约束。
PR 收尾流程
skills/zzz-od-dev-pr-finishing/SKILL.md, skills/zzz-od-dev-pr-finishing/design.md
新增合并前整理 PR title 和 description 的步骤。流程要求符合 Conventional Commits,记录关联测试仓 PR,并明确 AI 不执行 merge。关联跨仓 PR 的流程编号调整为 7。设计决策补充 git 分支差异验证、squash 总结规则、截断规则和内容排除项。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • OneDragon-Anything/ZenlessZoneZero-OneDragon issue 2615:本次更新补充 PR description 和 squash commit message 规范,涉及该 issue 的流程目标。

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了提交规范分层和使用 PR description 进行 squash 的主要变更。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/squash-pr-desc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Line 105: 将 PR title/description 与 Conventional Commits 规则的适用范围限定为 squash
merge,并在 AGENTS.md 中明确普通 merge commit 的 message 生成规则,或明确其不适用该绑定;同步更新
skills/zzz-od-dev-pr-finishing/SKILL.md 第60-62行,确保其中关于 PR title/description
的说明仅指向 squash merge。

In `@skills/zzz-od-dev-pr-finishing/design.md`:
- Line 36: 在 design.md 中保留首个“##”截断行为的待验证备注,不要将其写成稳定合同;先通过实际合并 PR 验证 PR_BODY 的
squash 行为。验证确认后,再移除该备注,并同步更新 SKILL.md,确保 issue 与测试仓链接的放置方式与实际 commit body 行为一致。
- Line 31: Update the repository verification commands in the documented git
workflow to use the clone’s default origin remote consistently, including both
fetch and log comparisons. If retaining the https remote name, add an explicit
setup step before these commands so the workflow works on a standard clone.

In `@skills/zzz-od-dev-pr-finishing/SKILL.md`:
- Line 64: 补充关联测试仓尚未切换到 PR_BODY 时的明确处理规则,修改该条关联 PR
整理说明以指定应继续使用旧规则、暂缓整理或阻止主仓合并中的实际策略,并确保与测试仓后续通过 GUI 修改的计划及关联 PR 的 message 流程一致。
- Around line 59-66: 将 SKILL.md 第 5 节改为可复用的方法论:用 <test-repo>、<remote>、<branch>
等通用占位符替代 zzz-od-test、PR_BODY、两仓 squash 设置及具体 gh pr edit 命令;把这些仓库专属流程、命令和示例移至对应的
design.md,并保留通用的 PR 标题、描述维护时机及合并职责说明。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a203bb89-ff74-4920-b55f-9de26a05c7f4

📥 Commits

Reviewing files that changed from the base of the PR and between ae00153 and 3b95ac8.

📒 Files selected for processing (3)
  • AGENTS.md
  • skills/zzz-od-dev-pr-finishing/SKILL.md
  • skills/zzz-od-dev-pr-finishing/design.md

Comment thread AGENTS.md Outdated
Comment thread skills/zzz-od-dev-pr-finishing/design.md Outdated
Comment thread skills/zzz-od-dev-pr-finishing/design.md Outdated
Comment on lines +59 to +66
### 5. 整理 PR title + description(供 merge commit message,合并前)
需要额外提供 commit message 的 merge(squash、merge commit 等)时,PR title + desc 是最终 message 的来源(仓库 squash 设置已用 PR description,第一个 `##` 前 = commit body)。收尾时把 title + desc 维护成严格 Conventional Commits 的 message(规范见 AGENTS.md「commit message 分两层」):
- **title**:`type(scope): subject`(≤50、祈使句);已合规则不动。
- **description**:开头一段总结(why / 关键决策,2-5 行,每行 ≤72;不列改动清单、不写 `Co-Authored-By`)+ `##` 后的关联(issue / 测试仓 PR 链接)。第一个 `##` 前 = squash commit body。
- 命令:`gh pr edit <PR> --title "type(scope): subject" --body "..."`(body 多行用 heredoc 或临时文件传)。
- **关联 PR(测试仓)**:同样整理(两仓 squash 设置都已改 `PR_BODY` 时)。
- **时机**:只在收尾(done、合并前)做一次,不每次 push。
- AI 不执行 merge;这步只把 desc 准备好,merge 由用户决定(边界同下一条「合并前」)。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

将项目专属流程细节移到 design.md

本段新增了 zzz-od-testPR_BODY、两仓 squash 设置和具体 GitHub 命令。这些内容属于本仓库的实现细节,不是可复用的方法论。请在 SKILL.md 中改用 <test-repo><remote><branch> 等通用占位符,并将具体规则保留在 design.md

As per coding guidelines:SKILL.md 应写方法论,不写与外部代码强相关的具体内容;具体例子和踩坑放入 design.md

Based on learnings:skills/**/SKILL.md 只描述可复用方法论,特定 workflow、远端和分支细节应放入 design.md

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/zzz-od-dev-pr-finishing/SKILL.md` around lines 59 - 66, 将 SKILL.md 第 5
节改为可复用的方法论:用 <test-repo>、<remote>、<branch> 等通用占位符替代 zzz-od-test、PR_BODY、两仓
squash 设置及具体 gh pr edit 命令;把这些仓库专属流程、命令和示例移至对应的 design.md,并保留通用的 PR
标题、描述维护时机及合并职责说明。

Sources: Coding guidelines, Learnings

Comment thread skills/zzz-od-dev-pr-finishing/SKILL.md Outdated
12. **PR description 作为 squash 总结(issue #2615)**:仓库 squash 设置改用 PR description(非拼 commit);收尾时按 AGENTS.md commit 规范把 title + desc 维护成总结。
- **规范分层(决策 7)**:单个迭代 commit 宽松 / 需要额外提供 commit message 的 merge 严格 Conventional Commits,两层规范都在 AGENTS.md;本 skill 收尾动作只管严格层(PR title + desc,即 merge 最终 message 的来源)。
- **为什么不把七规则写进本 skill**:七规则读者是所有写 commit 的 AI,不止收尾 AI;埋在本 skill(仅收尾触发)里其他场景看不到 → 规范进 AGENTS.md(每会话进 context,单一源),本 skill 只放收尾动作 + 指针。
- **依赖 GitHub 截断**:`PR_BODY` 模式取 desc 第一个 `##` 前内容作 commit body,`##` 后不进 commit;实施时用一个 PR 实测确认(降级:若取整段,desc 只放 commit message 内容,关联移 PR comment)。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实测是取整段desc的

- AGENTS.md:squash → squash/merge commit 都用 PR description(+ rebase 靠 commit 本身)
- SKILL.md 流程 5:去假设、直接陈述;关联仓未切 PR desc 时暂缓整理
- SKILL.md 流程 7 + design.md 决策 11:fetch https → origin(标准 remote,非本地约定)
- design.md 决策 12:标题准确化 + 本项目设置/查询命令 + ## 截断标「待验证,非合同」

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid
DoctorReid changed the base branch from main to verify-squash-body August 3, 2026 07:42
@DoctorReid
DoctorReid merged commit 5fc17ad into verify-squash-body Aug 3, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants