pr-draft-summary

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Draft Summary

PR草稿摘要

Purpose

用途

Produce the PR-ready summary required in this repository after substantive code work is complete: a concise summary plus a PR-ready title and draft description that begins with "This pull request <verb> ...". The block should be ready to paste into a PR for openai-agents-python.
在完成实质性代码工作后,生成此仓库所需的可直接用于PR的摘要:一份简洁的摘要,加上以"This pull request <动词> ..."开头的PR就绪标题和草稿描述。该摘要块可直接粘贴到openai-agents-python的PR中。

When to Trigger

触发时机

  • The task for this repo is finished (or ready for review) and it touched runtime code, tests, examples, docs with behavior impact, or build/test configuration.
  • You are about to send the "work complete" response and need the PR block included.
  • Skip only for trivial or conversation-only tasks where no PR-style summary is expected.
  • 本仓库的任务已完成(或准备好审核),且涉及运行时代码、测试、示例、影响行为的文档或构建/测试配置的修改。
  • 您即将发送“工作完成”的回复,且需要包含PR摘要块。
  • 仅在无PR风格摘要需求的琐碎任务或仅对话类任务中跳过此步骤。

Inputs to Collect Automatically (do not ask the user)

自动收集的输入(无需询问用户)

  • Current branch:
    git rev-parse --abbrev-ref HEAD
    .
  • Working tree:
    git status -sb
    .
  • Untracked files:
    git ls-files --others --exclude-standard
    (use with
    git status -sb
    to ensure they are surfaced;
    --stat
    does not include them).
  • Changed files:
    git diff --name-only
    (unstaged) and
    git diff --name-only --cached
    (staged); sizes via
    git diff --stat
    and
    git diff --stat --cached
    .
  • Latest release tag (prefer remote-aware lookup):
    LATEST_RELEASE_TAG=$(.agents/skills/final-release-review/scripts/find_latest_release_tag.sh origin 'v*' 2>/dev/null || git tag -l 'v*' --sort=-v:refname | head -n1)
    .
  • Base reference (use the branch's upstream, fallback to
    origin/main
    ):
    • BASE_REF=$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || echo origin/main)
      .
    • BASE_COMMIT=$(git merge-base --fork-point "$BASE_REF" HEAD || git merge-base "$BASE_REF" HEAD || echo "$BASE_REF")
      .
  • Commits ahead of the base fork point:
    git log --oneline --no-merges ${BASE_COMMIT}..HEAD
    .
  • Category signals for this repo: runtime (
    src/agents/
    ), tests (
    tests/
    ), examples (
    examples/
    ), docs (
    docs/
    ,
    mkdocs.yml
    ), build/test config (
    pyproject.toml
    ,
    uv.lock
    ,
    Makefile
    ,
    .github/
    ).
  • 当前分支:
    git rev-parse --abbrev-ref HEAD
  • 工作树状态:
    git status -sb
  • 未跟踪文件:
    git ls-files --others --exclude-standard
    (结合
    git status -sb
    确保显示这些文件;
    --stat
    不包含此类文件)
  • 已变更文件:
    git diff --name-only
    (未暂存)和
    git diff --name-only --cached
    (已暂存);变更大小通过
    git diff --stat
    git diff --stat --cached
    获取
  • 最新发布标签(优先使用远程查询):
    LATEST_RELEASE_TAG=$(.agents/skills/final-release-review/scripts/find_latest_release_tag.sh origin 'v*' 2>/dev/null || git tag -l 'v*' --sort=-v:refname | head -n1)
  • 基准参考(使用分支的上游分支,回退为
    origin/main
    ):
    • BASE_REF=$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || echo origin/main)
    • BASE_COMMIT=$(git merge-base --fork-point "$BASE_REF" HEAD || git merge-base "$BASE_REF" HEAD || echo "$BASE_REF")
  • 基准分叉点之后的提交:
    git log --oneline --no-merges ${BASE_COMMIT}..HEAD
  • 本仓库的分类标识:运行时(
    src/agents/
    )、测试(
    tests/
    )、示例(
    examples/
    )、文档(
    docs/
    mkdocs.yml
    )、构建/测试配置(
    pyproject.toml
    uv.lock
    Makefile
    .github/

Workflow

工作流程

  1. Run the commands above without asking the user; compute
    BASE_REF
    /
    BASE_COMMIT
    first so later commands reuse them.
  2. If there are no staged/unstaged/untracked changes and no commits ahead of
    ${BASE_COMMIT}
    , reply briefly that no code changes were detected and skip emitting the PR block.
  3. Infer change type from the touched paths listed under "Category signals"; classify as feature, fix, refactor, or docs-with-impact, and flag backward-compatibility risk only when the diff changes released public APIs, external config, persisted data, serialized state, or wire protocols. Judge that risk against
    LATEST_RELEASE_TAG
    , not unreleased branch-only churn.
  4. Summarize changes in 1–3 short sentences using the key paths (top 5) and
    git diff --stat
    output; explicitly call out untracked files from
    git status -sb
    /
    git ls-files --others --exclude-standard
    because
    --stat
    does not include them. If the working tree is clean but there are commits ahead of
    ${BASE_COMMIT}
    , summarize using those commit messages.
  5. Choose the lead verb for the description: feature →
    adds
    , bug fix →
    fixes
    , refactor/perf →
    improves
    or
    updates
    , docs-only →
    updates
    .
  6. Suggest a branch name. If already off main, keep it; otherwise propose
    feat/<slug>
    ,
    fix/<slug>
    , or
    docs/<slug>
    based on the primary area (e.g.,
    docs/pr-draft-summary-guidance
    ).
  7. If the current branch matches
    issue-<number>
    (digits only), keep that branch suggestion. Optionally pull light issue context (for example via the GitHub API) when available, but do not block or retry if it is not. When an issue number is present, reference
    https://github.com/openai/openai-agents-python/issues/<number>
    and include an auto-closing line such as
    This pull request resolves #<number>.
    .
  8. Draft the PR title and description using the template below.
  9. Output only the block in "Output Format". Keep any surrounding status note minimal and in English.
  1. 无需询问用户,直接运行上述命令;先计算
    BASE_REF
    /
    BASE_COMMIT
    ,以便后续命令复用。
  2. 如果没有暂存/未暂存/未跟踪的变更,且没有领先于
    ${BASE_COMMIT}
    的提交,则简要回复未检测到代码变更,跳过生成PR摘要块。
  3. 根据“分类标识”中列出的涉及路径推断变更类型;分为功能新增、修复、重构或影响性文档变更,仅当diff修改了已发布的公开API、外部配置、持久化数据、序列化状态或通信协议时,才标记向后兼容性风险。需基于
    LATEST_RELEASE_TAG
    判断该风险,而非未发布的分支内部变更。
  4. 使用关键路径(前5个)和
    git diff --stat
    输出,用1-3个短句总结变更;明确列出
    git status -sb
    /
    git ls-files --others --exclude-standard
    中的未跟踪文件,因为
    --stat
    不包含这些文件。如果工作树干净但存在领先于
    ${BASE_COMMIT}
    的提交,则使用这些提交信息进行总结。
  5. 为描述选择主导动词:功能新增→
    adds
    , bug修复→
    fixes
    ,重构/性能优化→
    improves
    updates
    ,仅文档变更→
    updates
  6. 建议分支名称。如果当前分支已基于main分支,则保留;否则根据主要变更领域提议
    feat/<slug>
    fix/<slug>
    docs/<slug>
    (例如
    docs/pr-draft-summary-guidance
    )。
  7. 如果当前分支符合
    issue-<number>
    格式(仅数字),则保留该分支建议。若可用,可选择性获取简单的issue上下文(例如通过GitHub API),但不可因获取失败而阻塞或重试。当存在issue编号时,引用
    https://github.com/openai/openai-agents-python/issues/<number>
    并添加自动关闭行,例如
    This pull request resolves #<number>.
  8. 使用以下模板草拟PR标题和描述。
  9. 仅输出“输出格式”中的摘要块。保持周围的状态说明简洁且为英文。

Output Format

输出格式

When closing out a task and the summary block is desired, add this concise Markdown block (English only) after any brief status note. If the user says they do not want it, skip this section.
undefined
当完成任务且需要摘要块时,在简短的状态说明后添加此简洁的Markdown块(仅英文)。如果用户表示不需要,则跳过此部分。
undefined

Pull Request Draft

Pull Request Draft

Branch name suggestion

Branch name suggestion

git checkout -b <kebab-case suggestion, e.g., feat/pr-draft-summary-skill>
git checkout -b <kebab-case suggestion, e.g., feat/pr-draft-summary-skill>

Title

Title

<single-line imperative title, which can be a commit message; if a common prefix like chore: and feat: etc., having them is preferred>
<single-line imperative title, which can be a commit message; if a common prefix like chore: and feat: etc., having them is preferred>

Description

Description

<include what you changed plus a draft pull request title and description for your local changes; start the description with prose such as "This pull request resolves/updates/adds ..." using a verb that matches the change (you can use bullets later), explain the change background (for bugs, clearly describe the bug, symptoms, or repro; for features, what is needed and why), any behavior changes or considerations to be aware of, and you do not need to mention tests you ran.>

Keep it tight—no redundant prose around the block, and avoid repeating details between `Changes` and the description. Tests do not need to be listed unless specifically requested.
<include what you changed plus a draft pull request title and description for your local changes; start the description with prose such as "This pull request resolves/updates/adds ..." using a verb that matches the change (you can use bullets later), explain the change background (for bugs, clearly describe the bug, symptoms, or repro; for features, what is needed and why), any behavior changes or considerations to be aware of, and you do not need to mention tests you ran.>

保持内容紧凑——摘要块周围无冗余文字,避免在“变更”和描述之间重复细节。除非特别要求,否则无需列出运行的测试。