Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .agents/skills/bb-pr/SKILL.md
Original file line number Diff line number Diff line change
@@ -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`.

name: bb-pr
description: 根据当前分支的已推送改动复用或创建 GitHub Issue,并复用已有或创建关联 PR。
description: 根据当前分支的已推送改动复用或创建 GitHub Issue,并创建关联的新 PR。
---

# 创建 GitHub Issue 和 PR

遵守根 [AGENTS.md](../../../AGENTS.md) 和 [提交与 PR 指南](../../../docs/agents/pr-guide.md)。直接调用本 skill 即授权为当前分支复用或创建 Issue,并复用关联的未关闭 PR 或创建新 PR。
遵守根 [AGENTS.md](../../../AGENTS.md) 和 [提交与 PR 指南](../../../docs/agents/pr-guide.md)。直接调用本 skill 即授权为当前分支复用或创建 Issue,并创建关联的新 PR。

本 skill 只复用或创建 Issue 和 PR,不修改代码或已有 Issue、PR。复用已有 Issue/PR 时只读核对并返回,不更新其内容。本 skill 不创建或切换分支,不提交、推送、合并,也不运行构建或测试。无法直接创建时停止并说明原因。
本 skill 只创建 Issue 和 PR,不修改代码或现有 Issue、PR,不创建或切换分支,不提交、推送、合并,也不运行构建或测试。无法直接创建时停止并说明原因。

1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
2. 只读核对当前分支相对默认分支的提交和差异,确认有改动可发布。先检查同一 head 和 base 是否已有未关闭的 PR;若有则复用该 PR,不新建或修改 PR。然后搜索是否已有匹配的 Issue;无论 Issue 是否已关闭,匹配时均可复用并记录编号,不要更新已有 Issue。若已有 PR 但没有匹配的 Issue,报告该 PR 并停止,不创建无关联的 Issue;若没有未关闭的 PR 且没有匹配的 Issue,则在步骤 3 创建。
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`.

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`.

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`.

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`.

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/`,但仓库没有该路径;按步骤检查时会遇到不存在的目录,无法完成这项要求。

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

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`.

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 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
Loading