prs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill: GitHub PR & Git Management

Skill: GitHub PR & Git Management

Goal

目标

Standardize how the Gemini CLI Bot stages its changes, generates Pull Request descriptions, and manages the lifecycle of both new and existing PRs.
规范Gemini CLI Bot的变更暂存方式、Pull Request(PR)描述生成流程,以及新PR和已有PR的生命周期管理。

Staging & Patch Preparation (MANDATORY)

暂存与补丁准备(强制要求)

If you are proposing fixes and PR creation is enabled (per the System Directive):
  1. Surgical Changes: Only propose a single improvement or fix per PR.
    • No Bundling: You are STRICTLY FORBIDDEN from bundling unrelated changes. Changes are unrelated if they address different root causes.
    • Examples: Do not combine a script fix with a documentation update, an unrelated refactor, or a metrics script update. Metrics and fixes MUST be in separate PRs.
  2. Generate PR Description: Use the
    write_file
    tool to create
    pr-description.md
    .
    • Title: The very first line MUST be a concise, conventional title.
    • Body: The rest should be the markdown body explaining the change, why it is recommended, and the expected impact.
  3. Stage Fixes: You MUST explicitly stage your fixes using the
    git add <files>
    command.
  4. Internal File Protection (CRITICAL): You are STRICTLY FORBIDDEN from staging internal bot management files. If they are accidentally staged, you MUST unstage them using
    git reset <file>
    .
    • NEVER STAGE:
      pr-description.md
      ,
      lessons-learned.md
      ,
      branch-name.txt
      ,
      pr-comment.md
      ,
      pr-number.txt
      ,
      issue-comment.md
      , or anything in
      history/
      .
如果您计划提交修复且PR创建功能已启用(遵循系统指令):
  1. 精准变更:每个PR仅提交一项改进或修复
    • 禁止捆绑:严格禁止将无关变更捆绑在一起。若变更针对不同根本原因,则视为无关。
    • 示例:请勿将脚本修复与文档更新、无关重构或指标脚本更新合并。指标调整与修复必须分属不同PR。
  2. 生成PR描述:使用
    write_file
    工具创建
    pr-description.md
    文件。
    • 标题:第一行必须是简洁的符合规范的标题。
    • 正文:其余部分为Markdown格式的正文,说明变更内容、推荐原因以及预期影响。
  3. 暂存修复内容:必须使用
    git add <files>
    命令明确暂存您的修复内容。
  4. 内部文件保护(关键要求):严格禁止暂存机器人内部管理文件。若意外暂存,必须使用
    git reset <file>
    命令取消暂存。
    • 绝对禁止暂存
      pr-description.md
      lessons-learned.md
      branch-name.txt
      pr-comment.md
      pr-number.txt
      issue-comment.md
      ,以及
      history/
      目录下的所有文件。

Unblocking & PR Updates (Recovery)

解除阻塞与PR更新(恢复操作)

If you are continuing work on an existing Task or responding to a comment on an existing bot PR:
  1. Target Existing Branch: Use
    write_file
    to generate
    branch-name.txt
    containing the current branch name (e.g.,
    bot/task-BT-01
    ).
  2. Track PR ID: Use
    write_file
    to generate
    pr-number.txt
    containing the numeric PR ID.
  3. Respond to Maintainers:
    • For general responses, write your markdown comment to
      issue-comment.md
      .
    • For specific PR feedback, write your markdown response to
      pr-comment.md
      .
  4. Handle CI Failures: Diagnose failing checks using
    gh run view
    . Your priority must be generating a new patch and staging it with
    git add
    to fix the failure.
如果您正在继续处理现有任务或回复已有机器人PR的评论:
  1. 定位现有分支:使用
    write_file
    工具生成包含当前分支名称的
    branch-name.txt
    文件(例如:
    bot/task-BT-01
    )。
  2. 跟踪PR编号:使用
    write_file
    工具生成包含PR数字编号的
    pr-number.txt
    文件。
  3. 回复维护者
    • 对于一般性回复,将Markdown格式的评论写入
      issue-comment.md
    • 针对特定PR反馈,将Markdown格式的回复写入
      pr-comment.md
  4. 处理CI失败:使用
    gh run view
    诊断失败的检查任务。您的首要任务是生成新补丁并使用
    git add
    暂存以修复失败问题。