ds-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Open one real PR whose title and description a busy reviewer can read in ten seconds.
创建一个真实的 PR,让忙碌的审阅者能在十秒内读完其标题和描述。

Steps

步骤

  1. Check if a PR already exists for this branch (
    gh pr list --head <branch>
    ). If it does, update it.
  2. Diff the branch against its base, usually
    origin/main
    . Confirm the diff matches the goal and holds nothing unrelated.
  3. Read the titles of a few recently merged PRs and copy their format.
  4. Write a title that says what changed for the user and why it matters, not which function moved. Example: "Cut websocket frames by 70% with compression" beats "Negotiate permessage-deflate".
  5. Write the description in this order:
    • The problem, in one or two plain sentences taken from the user's request.
    • The fix, in one or two sentences.
    • One line on how it was proven, if you have proof.
    • A closing line:
      Created with <model> in <harness>.
      Use the model name the harness reports. If it reports none, name only the harness.
  6. Scan the title, body and any attachments for secrets, tokens, private paths and personal data. Remove them.
  7. Create the PR as ready for review, not a draft, so review bots run.
  8. Print the PR URL that GitHub returned.
  1. 检查当前分支是否已有 PR(
    gh pr list --head <branch>
    )。如果已有,则更新它。
  2. 将分支与其目标分支进行 diff 比较,通常目标分支为
    origin/main
    。确认 diff 符合本次目标,且不包含任何无关改动。
  3. 阅读近期已合并 PR 的标题,并仿照其格式。
  4. 标题应说明用户端发生了什么变化以及为什么重要,而不是说明哪个函数被移动。例如,“通过压缩将 WebSocket 帧减少 70%”优于“协商 permessage-deflate”。
  5. 按以下顺序编写描述:
    • 用一两句通俗的话说明问题,内容取自用户请求。
    • 用一两句话说明修复方案。
    • 如果有证据,用一行说明验证方式。
    • 最后一行写为:
      Created with <model> in <harness>.
      使用 harness 报告的 model 名称;如果没有报告 model,则仅写 harness 名称。
  6. 扫描标题、正文和所有附件,检查是否包含 secrets、tokens、私有路径或个人数据,并将其移除。
  7. 将 PR 创建为可供审查(ready for review)状态,而不是草稿状态,以便审查 bots 正常运行。
  8. 输出 GitHub 返回的 PR URL。

Stop when

停止条件

  • GitHub returned a PR URL. Hand off to
    ds-watch-pr
    if the user asked for watching.
  • gh pr create
    fails twice. If the error is a GraphQL rate limit, retry once through REST:
    gh api repos/<owner>/<repo>/pulls -f title=... -f head=... -f base=... -F body=@body.md
    . If that fails too, report the error.
  • GitHub 已返回 PR URL。如果用户要求持续关注,则移交给
    ds-watch-pr
    。
  • gh pr create
    连续两次失败。如果错误是 GraphQL 速率限制,则通过 REST 重试一次:
    gh api repos/<owner>/<repo>/pulls -f title=... -f head=... -f base=... -F body=@body.md
    。如果仍然失败,则报告错误。

Rules

规则

  • No file-by-file change lists in the description.
  • Do not post follow-up comments unless the request needs one. Use
    ds-pr-comments
    when it does.
  • Never guess a model name.
  • 描述中不要逐文件列出改动。
  • 除非请求确实需要,否则不要发布后续评论;需要时使用
    ds-pr-comments
    。
  • 绝不要猜测 model 名称。