From fc105793a59a0fe9bea33f39493f3d9aa16c2594 Mon Sep 17 00:00:00 2001 From: YBF <47051132+YBFACC@users.noreply.github.com> Date: Thu, 17 Sep 2026 03:04:47 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AE=8C=E5=96=84=E5=8F=91=E5=B8=83?= =?UTF-8?q?=20Git=20=E5=88=86=E6=94=AF=20skill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skills/publishing-git-branches/SKILL.md | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.agents/skills/publishing-git-branches/SKILL.md b/.agents/skills/publishing-git-branches/SKILL.md index b76faa6..d2c879a 100644 --- a/.agents/skills/publishing-git-branches/SKILL.md +++ b/.agents/skills/publishing-git-branches/SKILL.md @@ -31,7 +31,31 @@ paths and wait for an explicit next instruction. the remote, update it only with `git push --force-with-lease origin HEAD`. Never use plain `--force`. 6. Create a PR with the current branch as head and remote `main` as base. Use - the repository's configured PR tooling and report its URL. + the repository's configured PR tooling, write its title and body in Chinese, + and report its URL. + +## Naming And PR Language + +When a branch needs a new name, use `/`. Choose the +type for the actual change: + +| Type | Use for | +| --- | --- | +| `feat` | 新功能或用户可见能力 | +| `fix` | 缺陷修复 | +| `chore` | 维护、工具或流程变更 | +| `docs` | 文档变更 | +| `refactor` | 不改变预期行为的重构 | +| `test` | 测试覆盖或测试工具变更 | +| `ci` | 持续集成或发布自动化变更 | + +Do not rename an existing branch solely to normalize its style; this convention +applies when creating a branch or correcting an obvious semantic mismatch. + +PR title and body must be Chinese. The title must begin with the conventional +type prefix that matches the change, for example `fix: 修复 Chrome 消息回调兼容性`; +its descriptive text must be Chinese. The body must describe the change, +validation, and any risk or follow-up in Chinese. ## Invariants @@ -39,6 +63,8 @@ paths and wait for an explicit next instruction. `main`; changes reach `main` only through the PR. - Branch renaming is required only for an obvious semantic mismatch, not a stylistic preference. State the evidence used to judge the mismatch. +- PR title must use the type prefix that matches the change, such as `feat:` or + `fix:`; the remaining title text and body use Chinese. - Do not assume permissions for unrelated cleanup, conflict resolution, merging the PR, deleting a branch, or force-pushing any branch other than the current rebased branch. @@ -52,13 +78,16 @@ or requested. The Git and PR sequence should have this shape: git branch --show-current git log --oneline origin/main..HEAD git diff --stat origin/main...HEAD -# rename with `git branch -m ` if the name clearly mismatches +# rename with `git branch -m /` if the name clearly mismatches git fetch origin main git rebase origin/main git push origin HEAD # if the rebased branch already exists on origin: git push --force-with-lease origin HEAD -gh pr create --base main --head "$(git branch --show-current)" +# PR 标题和正文使用中文;标题必须以 `feat:`、`fix:` 或 `chore:` 等类型前缀开头 +gh pr create --base main --head "$(git branch --show-current)" \ + --title ": <中文标题>" \ + --body "<中文正文:改动、验证、风险或后续事项>" ``` Do not run the force-with-lease command after a successful ordinary push. @@ -70,3 +99,4 @@ Do not run the force-with-lease command after a successful ordinary push. - “It is only a typo/urgent fix” does not excuse retaining a clearly mismatched branch name or bypassing the PR route. - “A merge is quicker” does not replace the required rebase. +- English PR titles or bodies do not meet this project's PR writing convention.