pr-publish-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePR Publish Agent
PR Publish Agent
Purpose
用途
Publish implementation work by pushing the branch, opening a PR linked to the configured tracker issue, and transitioning the issue to review.
通过推送分支、打开与配置的追踪器工单关联的PR,并将工单状态转换为审核中,来发布已完成的开发工作。
Runtime Configuration
运行时配置
- Read from the repository root before starting.
/orchestra-config.json - Read and use only the configured tracker MCP for ticket operations.
issue_tracker - Use the MCP mapped to in
issue_tracker.orchestra-config.json - If the configured issue tracker MCP is unavailable, stop immediately and do not proceed with the task.
- For every tracker comment/status update, include: .
Skill-Version: pr-publish-agent@1.2.0 - Immediately stop if CLI is unavailable.
gh
- 启动前从仓库根目录读取 文件。
/orchestra-config.json - 读取 配置,仅使用已配置的追踪器MCP执行工单操作。
issue_tracker - 使用 中与
orchestra-config.json对应的MCP。issue_tracker - 如果配置的工单追踪器MCP不可用,立即停止任务,不继续执行。
- 每次更新工单评论/状态时,需包含:。
Skill-Version: pr-publish-agent@1.2.0 - 如果 CLI不可用,立即停止任务。
gh
When to Invoke
调用时机
- After implementation is complete
- When code is ready for review
- 开发工作完成后
- 代码准备好进行审核时
Required Inputs
必需输入
- Parent issue ID
- Parent issue URL
- Parent issue tag (legacy
implementation-doneaccepted during migration)implemented - Current local branch with committed changes
- Repository default base branch (for example )
main
- 父工单ID
- 父工单URL
- 父工单标签 (迁移期间兼容旧标签
implementation-done)implemented - 包含已提交更改的当前本地分支
- 仓库默认基准分支(例如 )
main
Outputs
输出结果
- Branch pushed to remote
- Pull request created and linked to the configured tracker issue
- Parent issue tags:
- when PR is created and linked
pr-published - when publish is blocked
open-pr-publish-questions - Parent issue comment containing PR URL
- Parent issue status moved to
In review - Structured parent handoff comment:
text
Workflow-Handoff:
From: pr-publish-agent
To: pr-review-agent
Status: ready|blocked
Open-Questions: none|<question list>
Skill-Version: pr-publish-agent@1.2.0- 分支已推送到远程仓库
- 已创建PR并与配置的追踪器工单关联
- 父工单标签:
- 当PR创建并关联后
pr-published - 当发布被阻塞时
open-pr-publish-questions - 父工单中包含PR URL的评论
- 父工单状态移至「审核中」
- 结构化的父工单交接评论:
text
Workflow-Handoff:
From: pr-publish-agent
To: pr-review-agent
Status: ready|blocked
Open-Questions: none|<question list>
Skill-Version: pr-publish-agent@1.2.0Procedure
执行流程
- Read from the repository root, set the issue tracker context, and verify the configured tracker MCP is available.
/orchestra-config.json - Validate parent issue has tag (or legacy
implementation-done).implemented - Check only prior-stage open-question signal:
- If tag exists, read only the latest
open-implementation-questionsfromWorkflow-Handoff, then stop.implementation-agent
- Confirm there are committed changes on the current branch.
- Push the current branch to origin.
- Create a PR targeting the repository base branch.
- Link the configured tracker issue in the PR title or PR body using the issue ID and URL.
- Capture the PR URL.
- If publishing is blocked (missing permissions, merge-base uncertainty, missing issue linkage):
- Add .
open-pr-publish-questions - Add with
Workflow-Handoff.Status: blocked - Stop and wait for clarifications.
- If publishing is successful:
- Remove if present.
open-pr-publish-questions - Add tag .
pr-published - Add a concise parent issue comment with PR URL and short review request.
- Move parent issue status to .
In review - Add with
Workflow-HandoffandStatus: ready.Open-Questions: none
- Invoke with the same parent issue ID unless
pr-review-agentis present.open-pr-publish-questions
- 从仓库根目录读取 ,设置工单追踪器上下文,验证配置的追踪器MCP是否可用。
/orchestra-config.json - 验证父工单是否包含标签 (或旧标签
implementation-done)。implemented - 仅检查前一阶段的未解决问题信号:
- 如果存在标签 ,仅读取
open-implementation-questions最新的implementation-agent评论,然后停止任务。Workflow-Handoff
- 确认当前分支存在已提交的更改。
- 将当前分支推送到origin远程仓库。
- 创建以仓库基准分支为目标的PR。
- 在PR标题或正文中使用工单ID和URL关联配置的追踪器工单。
- 记录PR URL。
- 如果发布被阻塞(缺少权限、合并基准不确定、未关联工单等):
- 添加 。
open-pr-publish-questions - 添加状态为 的
blocked评论。Workflow-Handoff - 停止任务并等待问题澄清。
- 如果发布成功:
- 若存在 标签则移除它。
open-pr-publish-questions - 添加标签 。
pr-published - 在父工单中添加包含PR URL和简短审核请求的简洁评论。
- 将父工单状态移至「审核中」。
- 添加状态为 、
ready的Open-Questions: none评论。Workflow-Handoff
- 除非存在 标签,否则自动调用
open-pr-publish-questions并传入相同的父工单ID。pr-review-agent
Suggested Command Pattern
建议命令模板
- Push branch:
git push -u origin <branch> - Create PR:
gh pr create --base <base-branch> --head <branch> --title "<issue-id>: <short title>" --body "Tracker: <issue-url>"
- 推送分支:
git push -u origin <branch> - 创建PR:
gh pr create --base <base-branch> --head <branch> --title "<issue-id>: <short title>" --body "Tracker: <issue-url>"
Guardrails
防护规则
- Do not create a PR if there are no committed changes.
- Do not move issue status to until PR creation succeeds.
In review - Ensure the PR references the correct tracker issue ID and URL.
- Do not run tracker operations unless the MCP for the configured is available.
issue_tracker - Do not include raw build/lint output dumps (for example full or
pnpm listlogs) in PR title/body or issue comments.pnpm build - For open-question checks, do not read full comment history; read only the previous agent's latest comment.
Workflow-Handoff
- 如果没有已提交的更改,请勿创建PR。
- 除非PR创建成功,否则不要将工单状态移至「审核中」。
- 确保PR引用正确的追踪器工单ID和URL。
- 除非配置的 对应的MCP可用,否则不要执行工单操作。
issue_tracker - 请勿在PR标题/正文或工单评论中包含原始构建/检查输出(例如完整的 或
pnpm list日志)。pnpm build - 检查未解决问题时,请勿读取完整的评论历史,仅读取前一个Agent的最新 评论。
Workflow-Handoff
Handoff
交接
Primary consumer: (auto-invoke when unblocked).
pr-review-agent主要接收方:(未被阻塞时自动调用)。
pr-review-agent