pr-publish-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR 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
    /orchestra-config.json
    from the repository root before starting.
  • Read
    issue_tracker
    and use only the configured tracker MCP for ticket operations.
  • Use the MCP mapped to
    issue_tracker
    in
    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
    gh
    CLI is unavailable.
  • 启动前从仓库根目录读取
    /orchestra-config.json
    文件。
  • 读取
    issue_tracker
    配置,仅使用已配置的追踪器MCP执行工单操作。
  • 使用
    orchestra-config.json
    中与
    issue_tracker
    对应的MCP。
  • 如果配置的工单追踪器MCP不可用,立即停止任务,不继续执行。
  • 每次更新工单评论/状态时,需包含:
    Skill-Version: pr-publish-agent@1.2.0
  • 如果
    gh
    CLI不可用,立即停止任务。

When to Invoke

调用时机

  • After implementation is complete
  • When code is ready for review
  • 开发工作完成后
  • 代码准备好进行审核时

Required Inputs

必需输入

  • Parent issue ID
  • Parent issue URL
  • Parent issue tag
    implementation-done
    (legacy
    implemented
    accepted during migration)
  • 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:
  • pr-published
    when PR is created and linked
  • open-pr-publish-questions
    when publish is blocked
  • 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-published
    当PR创建并关联后
  • 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.0

Procedure

执行流程

  1. Read
    /orchestra-config.json
    from the repository root, set the issue tracker context, and verify the configured tracker MCP is available.
  2. Validate parent issue has tag
    implementation-done
    (or legacy
    implemented
    ).
  3. Check only prior-stage open-question signal:
  • If tag
    open-implementation-questions
    exists, read only the latest
    Workflow-Handoff
    from
    implementation-agent
    , then stop.
  1. Confirm there are committed changes on the current branch.
  2. Push the current branch to origin.
  3. Create a PR targeting the repository base branch.
  4. Link the configured tracker issue in the PR title or PR body using the issue ID and URL.
  5. Capture the PR URL.
  6. If publishing is blocked (missing permissions, merge-base uncertainty, missing issue linkage):
  • Add
    open-pr-publish-questions
    .
  • Add
    Workflow-Handoff
    with
    Status: blocked
    .
  • Stop and wait for clarifications.
  1. If publishing is successful:
  • Remove
    open-pr-publish-questions
    if present.
  • 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
    Workflow-Handoff
    with
    Status: ready
    and
    Open-Questions: none
    .
  1. Invoke
    pr-review-agent
    with the same parent issue ID unless
    open-pr-publish-questions
    is present.
  1. 从仓库根目录读取
    /orchestra-config.json
    ,设置工单追踪器上下文,验证配置的追踪器MCP是否可用。
  2. 验证父工单是否包含标签
    implementation-done
    (或旧标签
    implemented
    )。
  3. 仅检查前一阶段的未解决问题信号:
  • 如果存在标签
    open-implementation-questions
    ,仅读取
    implementation-agent
    最新的
    Workflow-Handoff
    评论,然后停止任务。
  1. 确认当前分支存在已提交的更改。
  2. 将当前分支推送到origin远程仓库。
  3. 创建以仓库基准分支为目标的PR。
  4. 在PR标题或正文中使用工单ID和URL关联配置的追踪器工单。
  5. 记录PR URL。
  6. 如果发布被阻塞(缺少权限、合并基准不确定、未关联工单等):
  • 添加
    open-pr-publish-questions
  • 添加状态为
    blocked
    Workflow-Handoff
    评论。
  • 停止任务并等待问题澄清。
  1. 如果发布成功:
  • 若存在
    open-pr-publish-questions
    标签则移除它。
  • 添加标签
    pr-published
  • 在父工单中添加包含PR URL和简短审核请求的简洁评论。
  • 将父工单状态移至「审核中」。
  • 添加状态为
    ready
    Open-Questions: none
    Workflow-Handoff
    评论。
  1. 除非存在
    open-pr-publish-questions
    标签,否则自动调用
    pr-review-agent
    并传入相同的父工单ID。

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
    In review
    until PR creation succeeds.
  • Ensure the PR references the correct tracker issue ID and URL.
  • Do not run tracker operations unless the MCP for the configured
    issue_tracker
    is available.
  • Do not include raw build/lint output dumps (for example full
    pnpm list
    or
    pnpm build
    logs) in PR title/body or issue comments.
  • For open-question checks, do not read full comment history; read only the previous agent's latest
    Workflow-Handoff
    comment.
  • 如果没有已提交的更改,请勿创建PR。
  • 除非PR创建成功,否则不要将工单状态移至「审核中」。
  • 确保PR引用正确的追踪器工单ID和URL。
  • 除非配置的
    issue_tracker
    对应的MCP可用,否则不要执行工单操作。
  • 请勿在PR标题/正文或工单评论中包含原始构建/检查输出(例如完整的
    pnpm list
    pnpm build
    日志)。
  • 检查未解决问题时,请勿读取完整的评论历史,仅读取前一个Agent的最新
    Workflow-Handoff
    评论。

Handoff

交接

Primary consumer:
pr-review-agent
(auto-invoke when unblocked).
主要接收方:
pr-review-agent
(未被阻塞时自动调用)。