Skip to content

chore(AIAgent): update bb-pr to create a new PR - #1400

Merged
ArgoZhang merged 2 commits into
masterfrom
feat-skill
Dec 3, 2026
Merged

ArgoZhang merged 2 commits into
masterfrom
feat-skill

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #1361

Summary By Copilot

更新 .agents/skills/bb-pr/SKILL.md:明确该 skill 每次都创建新的 PR,不再复用已有 PR;保留 Issue 创建与远端状态核验流程,并收紧分支、差异和创建前检查说明。

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

仅调整仓库内部 Agent skill 文档,不涉及运行时代码、组件或依赖。

Verification

  • Manual (required)
  • Automated

本次未运行构建或测试;按 /bb-pr skill 限制仅执行只读核对和 GitHub Issue/PR 操作。

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Require the bb-pr skill to create a new PR for each run while preserving its linked Issue workflow.

Enhancements:

  • Update the bb-pr skill to always create a new PR instead of reusing an existing one; stop and report if a matching open PR already exists.
  • Clarify checks for the current branch, uncommitted changes, and applicable PR templates, and retain Issue creation and PR verification guidance.

@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Documentation

更新 bb-pr skill 文档,明确每次创建新 PR、已有未关闭 PR 时停止,并调整创建前检查与核验流程。

  • .agents/skills/bb-pr/SKILL.md L3, L8-16

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label Dec 3, 2026

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@bb-auto bb-auto Bot added this to the v11.0.0 milestone Dec 3, 2026
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit f070e18

#1361 doc(Agents): simplify GitHub Issue/PR skill workflow · 0 of 5 met

# Requirement Status Notes
1 Simplify .agents/skills/github-issue-pr/SKILL.md. ❌ Not addressed The diff changes .agents/skills/bb-pr/SKILL.md; it does not update the skill named in the issue.
2 Retain the current-branch-only Issue/PR workflow. ❌ Not addressed The requested workflow is in github-issue-pr, which this diff does not change.
3 Retain the default-branch guard. ❌ Not addressed The guard in the requested skill is not changed because the diff updates a different skill.
4 Retain the no-build/no-unit-test rule. ❌ Not addressed The rule in the requested skill is not changed because the diff updates a different skill.
5 Retain post-operation verification. ❌ Not addressed The verification workflow in the requested skill is not changed because the diff updates a different skill.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 8 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".agents/skills/bb-pr/SKILL.md" line_range="12" />
<code_context>
-3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/) 和 [PR 模板](../../../.github/pull_request_template.md),参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
-4. 仅在步骤 2 未找到未关闭的 PR 时创建新的 PR;不要复用或更新已关闭的 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
-5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
</code_context>
<issue_to_address>
**PR omits local changes**

When uncommitted changes include work intended for the PR, the skill only reports the uncommitted files, then creates a PR from the pushed branch. Those local changes are absent, so the user gets an incomplete PR.

Stop when uncommitted changes affect the intended PR, and require them to be committed and pushed before proceeding.

Also at `.agents/skills/bb-pr/SKILL.md:13`.
</issue_to_address>

### Comment 2
<location path=".agents/skills/bb-pr/SKILL.md" line_range="15" />
<code_context>
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**Wrong Issue gets linked**

When the Issue being linked belongs to a repository other than the PR target, the PR body uses `fixes #<number>`, which GitHub resolves in the PR's repository. The intended Issue remains unlinked and open, and a same-numbered Issue in the PR repository can be closed instead.

Use a repository-qualified Issue reference for Issues outside the PR's repository.

Also at `.agents/skills/bb-pr/SKILL.md:16`.
</issue_to_address>

### Comment 3
<location path=".agents/skills/bb-pr/SKILL.md" line_range="12" />
<code_context>
-3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/) 和 [PR 模板](../../../.github/pull_request_template.md),参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
-4. 仅在步骤 2 未找到未关闭的 PR 时创建新的 PR;不要复用或更新已关闭的 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
-5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
</code_context>
<issue_to_address>
**PR creation uses an unrelated head**

When the current branch tracks a remote outside the target repository's fork network, the workflow passes that remote branch as the head to `gh pr create`. GitHub cannot create the intended PR from that source, so creation fails or uses an unintended head.

Verify that the upstream is the target repository or one of its forks before using it as the PR head.

Also at `.agents/skills/bb-pr/SKILL.md:15`.
</issue_to_address>

### Comment 4
<location path=".agents/skills/bb-pr/SKILL.md" line_range="14" />
<code_context>
-5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**New Issue is left unlinked**

When a matching open PR exists and no matching Issue exists, step 3 creates an Issue before step 4 checks for an open PR. Step 4 then stops, leaving the new Issue without a PR linking it.

Check for an existing open PR before creating an Issue, and stop without creating one when that PR has no matching Issue.

Also at `.agents/skills/bb-pr/SKILL.md:15-16`.
</issue_to_address>

### Comment 5
<location path=".agents/skills/bb-pr/SKILL.md" line_range="14" />
<code_context>
-5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**Matching Issues get duplicated**

When a matching Issue already exists for the changes, step 3 allows creating an Issue without first requiring the agent to find and reuse a match. The agent creates a duplicate and can link the PR to the wrong Issue.

Require searching for and reusing a matching Issue before creating a new one.

Also at `.agents/skills/bb-pr/SKILL.md:15`.
</issue_to_address>

### Comment 6
<location path=".agents/skills/bb-pr/SKILL.md" line_range="15" />
<code_context>
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**PR reuse instructions conflict**

When a caller follows `bb-update` and a matching open PR already exists, `bb-update` and the repository guidance allow reusing or updating a PR, but `bb-pr` says to stop when that PR exists. The caller gets conflicting instructions and the delivery flow does not return the expected PR link.

Align `bb-pr` and the repository guidance with `bb-update` on whether to reuse, update, or stop for an existing PR.

Also at `.agents/skills/bb-pr/SKILL.md:10`.
</issue_to_address>

### Comment 7
<location path=".agents/skills/bb-pr/SKILL.md" line_range="14" />
<code_context>
-5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
+1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
+2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**模板目录引用不存在**

步骤 3 要求读取 `.github/PULL_REQUEST_TEMPLATE/`,但仓库没有该路径;按步骤检查时会遇到不存在的目录,无法完成这项要求。

删除不存在目录的引用,或先创建该目录并添加适用模板。
</issue_to_address>

### Comment 8
<location path=".agents/skills/bb-pr/SKILL.md" line_range="1" />
<code_context>
 ---
 name: bb-pr
-description: 根据当前分支的已推送改动复用或创建 GitHub Issue,并复用已有或创建关联 PR。
</code_context>
<issue_to_address>
**Wrong skill updated**

The issue asks to simplify `.agents/skills/github-issue-pr/SKILL.md`, but this change updates `.agents/skills/bb-pr/SKILL.md` instead. The requested skill and its workflow requirements remain unchanged.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/) 和 [PR 模板](../../../.github/pull_request_template.md),参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
4. 仅在步骤 2 未找到未关闭的 PR 时创建新的 PR;不要复用或更新已关闭的 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · PR omits local changes

When uncommitted changes include work intended for the PR, the skill only reports the uncommitted files, then creates a PR from the pushed branch. Those local changes are absent, so the user gets an incomplete PR.

Stop when uncommitted changes affect the intended PR, and require them to be committed and pushed before proceeding.

Also at .agents/skills/bb-pr/SKILL.md:13.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 12:

**PR omits local changes**

When uncommitted changes include work intended for the PR, the skill only reports the uncommitted files, then creates a PR from the pushed branch. Those local changes are absent, so the user gets an incomplete PR.

Stop when uncommitted changes affect the intended PR, and require them to be committed and pushed before proceeding.

Also at `.agents/skills/bb-pr/SKILL.md:13`.

1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Wrong Issue gets linked

When the Issue being linked belongs to a repository other than the PR target, the PR body uses fixes #<number>, which GitHub resolves in the PR's repository. The intended Issue remains unlinked and open, and a same-numbered Issue in the PR repository can be closed instead.

Use a repository-qualified Issue reference for Issues outside the PR's repository.

Also at .agents/skills/bb-pr/SKILL.md:16.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 15:

**Wrong Issue gets linked**

When the Issue being linked belongs to a repository other than the PR target, the PR body uses `fixes #<number>`, which GitHub resolves in the PR's repository. The intended Issue remains unlinked and open, and a same-numbered Issue in the PR repository can be closed instead.

Use a repository-qualified Issue reference for Issues outside the PR's repository.

Also at `.agents/skills/bb-pr/SKILL.md:16`.

3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/) 和 [PR 模板](../../../.github/pull_request_template.md),参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
4. 仅在步骤 2 未找到未关闭的 PR 时创建新的 PR;不要复用或更新已关闭的 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · PR creation uses an unrelated head

When the current branch tracks a remote outside the target repository's fork network, the workflow passes that remote branch as the head to gh pr create. GitHub cannot create the intended PR from that source, so creation fails or uses an unintended head.

Verify that the upstream is the target repository or one of its forks before using it as the PR head.

Also at .agents/skills/bb-pr/SKILL.md:15.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 12:

**PR creation uses an unrelated head**

When the current branch tracks a remote outside the target repository's fork network, the workflow passes that remote branch as the head to `gh pr create`. GitHub cannot create the intended PR from that source, so creation fails or uses an unintended head.

Verify that the upstream is the target repository or one of its forks before using it as the PR head.

Also at `.agents/skills/bb-pr/SKILL.md:15`.

5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · New Issue is left unlinked

When a matching open PR exists and no matching Issue exists, step 3 creates an Issue before step 4 checks for an open PR. Step 4 then stops, leaving the new Issue without a PR linking it.

Check for an existing open PR before creating an Issue, and stop without creating one when that PR has no matching Issue.

Also at .agents/skills/bb-pr/SKILL.md:15-16.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 14:

**New Issue is left unlinked**

When a matching open PR exists and no matching Issue exists, step 3 creates an Issue before step 4 checks for an open PR. Step 4 then stops, leaving the new Issue without a PR linking it.

Check for an existing open PR before creating an Issue, and stop without creating one when that PR has no matching Issue.

Also at `.agents/skills/bb-pr/SKILL.md:15-16`.

5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Matching Issues get duplicated

When a matching Issue already exists for the changes, step 3 allows creating an Issue without first requiring the agent to find and reuse a match. The agent creates a duplicate and can link the PR to the wrong Issue.

Require searching for and reusing a matching Issue before creating a new one.

Also at .agents/skills/bb-pr/SKILL.md:15.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 14:

**Matching Issues get duplicated**

When a matching Issue already exists for the changes, step 3 allows creating an Issue without first requiring the agent to find and reuse a match. The agent creates a duplicate and can link the PR to the wrong Issue.

Require searching for and reusing a matching Issue before creating a new one.

Also at `.agents/skills/bb-pr/SKILL.md:15`.

1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
4. 每次都创建新的 PR,不复用或更新已有 PR。只检查同一 head 和 base 是否已有未关闭的 PR;若有则停止并提示无需新建 PR。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · PR reuse instructions conflict

When a caller follows bb-update and a matching open PR already exists, bb-update and the repository guidance allow reusing or updating a PR, but bb-pr says to stop when that PR exists. The caller gets conflicting instructions and the delivery flow does not return the expected PR link.

Align bb-pr and the repository guidance with bb-update on whether to reuse, update, or stop for an existing PR.

Also at .agents/skills/bb-pr/SKILL.md:10.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 15:

**PR reuse instructions conflict**

When a caller follows `bb-update` and a matching open PR already exists, `bb-update` and the repository guidance allow reusing or updating a PR, but `bb-pr` says to stop when that PR exists. The caller gets conflicting instructions and the delivery flow does not return the expected PR link.

Align `bb-pr` and the repository guidance with `bb-update` on whether to reuse, update, or stop for an existing PR.

Also at `.agents/skills/bb-pr/SKILL.md:10`.

5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端;若发现同一 head 和 base 的未关闭 PR,则复用并返回;确认未创建且仍无匹配 PR 后才能重试。状态无法确认时如实报告。
1. 确认目标仓库及其默认分支,当前分支必须是非默认分支;远端分支必须与本地 `HEAD` 一致。存在未提交的改动时提示有未提交文件。
2. 只读核对当前分支相对默认分支的差异,确认有改动可发布。
3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ Low · 模板目录引用不存在

步骤 3 要求读取 .github/PULL_REQUEST_TEMPLATE/,但仓库没有该路径;按步骤检查时会遇到不存在的目录,无法完成这项要求。

删除不存在目录的引用,或先创建该目录并添加适用模板。

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 14:

**模板目录引用不存在**

步骤 3 要求读取 `.github/PULL_REQUEST_TEMPLATE/`,但仓库没有该路径;按步骤检查时会遇到不存在的目录,无法完成这项要求。

删除不存在目录的引用,或先创建该目录并添加适用模板。

@@ -1,16 +1,16 @@
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Critical · Wrong skill updated

The issue asks to simplify .agents/skills/github-issue-pr/SKILL.md, but this change updates .agents/skills/bb-pr/SKILL.md instead. The requested skill and its workflow requirements remain unchanged.

Prompt for AI agents
In `.agents/skills/bb-pr/SKILL.md` at line 1:

**Wrong skill updated**

The issue asks to simplify `.agents/skills/github-issue-pr/SKILL.md`, but this change updates `.agents/skills/bb-pr/SKILL.md` instead. The requested skill and its workflow requirements remain unchanged.

From #1361:

Simplify `.agents/skills/github-issue-pr/SKILL.md`.

@ArgoZhang
ArgoZhang merged commit ab58f60 into master Dec 3, 2026
3 checks passed
@ArgoZhang
ArgoZhang deleted the feat-skill branch December 3, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Agents): simplify GitHub Issue/PR skill workflow

1 participant