branch-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to Use
使用场景
Use this skill when:
- Creating a pull request for any change
- Preparing a branch for submission
- Helping a contributor open a PR
当以下情况时使用本技能:
- 为任何变更创建拉取请求(PR)
- 准备用于提交的分支
- 协助贡献者发起PR
Critical Rules
核心规则
- Every PR MUST link an approved issue — no exceptions
- Every PR MUST have exactly one label
type:* - Automated checks must pass before merge is possible
- Blank PRs without issue linkage will be blocked by GitHub Actions
- 每个PR必须关联一个已获批的议题——无例外
- 每个PR必须恰好包含一个标签
type:* - 自动化检查必须通过才能合并
- 未关联议题的空白PR将被GitHub Actions拦截
Workflow
工作流
1. Verify issue has `status:approved` label
2. Create branch: type/description (see Branch Naming below)
3. Implement changes with conventional commits
4. Run shellcheck on modified scripts
5. Open PR using the template
6. Add exactly one type:* label
7. Wait for automated checks to pass1. 验证议题是否带有`status:approved`标签
2. 创建分支:type/description(见下方分支命名规则)
3. 使用规范提交(Conventional Commits)实现变更
4. 对修改的脚本运行shellcheck检查
5. 使用模板发起PR
6. 添加恰好一个type:*标签
7. 等待自动化检查通过Branch Naming
分支命名
Branch names MUST match this regex:
^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)\/[a-z0-9._-]+$Format: — lowercase, no spaces, only in description.
type/descriptiona-z0-9._-| Type | Branch pattern | Example |
|---|---|---|
| Feature | | |
| Bug fix | | |
| Chore | | |
| Docs | | |
| Style | | |
| Refactor | | |
| Performance | | |
| Test | | |
| Build | | |
| CI | | |
| Revert | | |
分支名称必须匹配以下正则表达式:
^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)\/[a-z0-9._-]+$格式:——全小写,无空格,描述部分仅允许使用。
type/descriptiona-z0-9._-| 类型 | 分支格式 | 示例 |
|---|---|---|
| 功能新增 | | |
| Bug修复 | | |
| 日常维护 | | |
| 文档更新 | | |
| 格式调整 | | |
| 代码重构 | | |
| 性能优化 | | |
| 测试相关 | | |
| 构建相关 | | |
| CI配置 | | |
| 版本回滚 | | |
PR Body Format
PR正文格式
The PR template is at . Every PR body MUST contain:
.github/PULL_REQUEST_TEMPLATE.mdPR模板位于。每个PR正文必须包含以下内容:
.github/PULL_REQUEST_TEMPLATE.md1. Linked Issue (REQUIRED)
1. 关联议题(必填)
markdown
Closes #<issue-number>Valid keywords: , , (case insensitive).
The linked issue MUST have the label.
Closes #NFixes #NResolves #Nstatus:approvedmarkdown
Closes #<issue-number>有效关键词:、、(不区分大小写)。关联的议题必须带有标签。
Closes #NFixes #NResolves #Nstatus:approved2. PR Type (REQUIRED)
2. PR类型(必填)
Check exactly ONE in the template and add the matching label:
| Checkbox | Label to add |
|---|---|
| Bug fix | |
| New feature | |
| Documentation only | |
| Code refactoring | |
| Maintenance/tooling | |
| Breaking change | |
在模板中勾选恰好一项,并添加对应的标签:
| 复选框 | 需添加的标签 |
|---|---|
| Bug修复 | |
| 新功能 | |
| 仅文档更新 | |
| 代码重构 | |
| 维护/工具类 | |
| 破坏性变更 | |
3. Summary
3. 变更摘要
1-3 bullet points of what the PR does.
用1-3个要点说明PR的内容。
4. Changes Table
4. 变更表格
markdown
| File | Change |
|------|--------|
| `path/to/file` | What changed |markdown
| 文件 | 变更内容 |
|------|--------|
| `path/to/file` | 具体变更 |5. Test Plan
5. 测试计划
markdown
- [x] Scripts run without errors: `shellcheck scripts/*.sh`
- [x] Manually tested the affected functionality
- [x] Skills load correctly in target agentmarkdown
- [x] 脚本运行无错误:`shellcheck scripts/*.sh`
- [x] 手动测试了受影响的功能
- [x] 技能在目标Agent中加载正常6. Contributor Checklist
6. 贡献者检查清单
All boxes must be checked:
- Linked an approved issue
- Added exactly one label
type:* - Ran shellcheck on modified scripts
- Skills tested in at least one agent
- Docs updated if behavior changed
- Conventional commit format
- No trailers
Co-Authored-By
所有选项必须勾选:
- 关联了已获批的议题
- 添加了恰好一个标签
type:* - 对修改的脚本运行了shellcheck检查
- 技能已在至少一个Agent中测试
- 若行为变更则已更新文档
- 遵循规范提交(Conventional Commits)格式
- 无标记
Co-Authored-By
Automated Checks (all must pass)
自动化检查(全部必须通过)
| Check | Job name | What it verifies |
|---|---|---|
| PR Validation | | Body contains |
| PR Validation | | Linked issue has |
| PR Validation | | PR has exactly one |
| CI | | Shell scripts pass |
| 检查项 | 任务名称 | 验证内容 |
|---|---|---|
| PR验证 | | 正文包含 |
| PR验证 | | 关联的议题带有 |
| PR验证 | | PR恰好包含一个 |
| CI | | Shell脚本通过 |
Conventional Commits
规范提交(Conventional Commits)
Commit messages MUST match this regex:
^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9\._-]+\))?!?: .+Format: or
type(scope): descriptiontype: description- — required, one of:
type,build,chore,ci,docs,feat,fix,perf,refactor,revert,styletest - — optional, lowercase with
(scope)a-z0-9._- - — optional, indicates breaking change
! - — required, starts after
description:
Type-to-label mapping:
| Commit type | PR label |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Examples:
feat(scripts): add Codex support to setup.sh
fix(skills): correct topic key format in sdd-apply
docs(readme): update multi-model configuration guide
refactor(skills): extract shared persistence logic
chore(ci): add shellcheck to PR validation workflow
perf(scripts): reduce setup.sh execution time
style(skills): fix markdown formatting
test(scripts): add setup.sh integration tests
ci(workflows): add branch name validation
revert: undo broken setup change
feat!: redesign skill loading system提交信息必须匹配以下正则表达式:
^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9\._-]+\))?!?: .+格式:或
type(scope): descriptiontype: description- ——必填,可选值:
type、build、chore、ci、docs、feat、fix、perf、refactor、revert、styletest - ——可选,全小写,允许使用
(scope)a-z0-9._- - ——可选,表示破坏性变更
! - ——必填,位于
description之后:
提交类型与PR标签的映射:
| 提交类型 | PR标签 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
示例:
feat(scripts): add Codex support to setup.sh
fix(skills): correct topic key format in sdd-apply
docs(readme): update multi-model configuration guide
refactor(skills): extract shared persistence logic
chore(ci): add shellcheck to PR validation workflow
perf(scripts): reduce setup.sh execution time
style(skills): fix markdown formatting
test(scripts): add setup.sh integration tests
ci(workflows): add branch name validation
revert: undo broken setup change
feat!: redesign skill loading systemCommands
命令
bash
undefinedbash
undefinedCreate branch
创建分支
git checkout -b feat/my-feature main
git checkout -b feat/my-feature main
Run shellcheck before pushing
推送前运行shellcheck
shellcheck scripts/*.sh
shellcheck scripts/*.sh
Push and create PR
推送并创建PR
git push -u origin feat/my-feature
gh pr create --title "feat(scope): description" --body "Closes #N"
git push -u origin feat/my-feature
gh pr create --title "feat(scope): description" --body "Closes #N"
Add type label to PR
为PR添加类型标签
gh pr edit <pr-number> --add-label "type:feature"
undefinedgh pr edit <pr-number> --add-label "type:feature"
undefined