pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Context

上下文信息

  • Current branch: !
    git branch --show-current
  • Uncommitted changes: !
    git status --short
  • Remote tracking status: !
    git status -sb | head -1
  • Existing PR: !
    gh pr view --json number,title,url 2>/dev/null || echo "none"
  • Commits since main: !
    git log main..HEAD --oneline
  • Full commit details: !
    git log main..HEAD --format="- %h: %s"
  • Changes summary: !
    git diff main...HEAD --stat | tail -5
  • 当前分支: !
    git branch --show-current
  • 未提交的变更: !
    git status --short
  • 远程跟踪状态: !
    git status -sb | head -1
  • 已存在的PR: !
    gh pr view --json number,title,url 2>/dev/null || echo "none"
  • 相对于main分支的提交: !
    git log main..HEAD --oneline
  • 完整提交详情: !
    git log main..HEAD --format="- %h: %s"
  • 变更摘要: !
    git diff main...HEAD --stat | tail -5

Your task

你的任务

Create a new PR or update an existing PR for the current branch.
为当前分支创建新的PR或更新已有的PR。

Pre-checks

前置检查

  1. Uncommitted changes: If there are uncommitted changes, warn the user and ask if they want to commit first
  2. Push status: If the branch is not pushed or behind remote, push it first with
    git push -u origin <branch>
  1. 未提交的变更:如果存在未提交的变更,需向用户发出警告,并询问是否要先提交变更
  2. 推送状态:如果分支尚未推送到远程或落后于远程分支,先使用
    git push -u origin <branch>
    命令推送分支

Behavior

执行逻辑

If NO existing PR → Create new PR

如果不存在已有的PR → 创建新PR

Use
gh pr create
with title, body, and assignee.
使用
gh pr create
命令,指定标题、正文和经办人。

If PR already exists → Update PR body only

如果PR已存在 → 仅更新PR正文

Use
gh pr edit
to update the body with the latest commit list. Do NOT change the title.
使用
gh pr edit
命令,用最新的提交列表更新PR正文。请勿修改标题。

PR Format

PR格式

Title (for new PRs only)

标题(仅适用于新PR)

Rules:
  • English only - Never use Korean in titles
  • 40 chars max (excluding prefix) - Be extremely concise
  • Use short verbs: Add, Fix, Update, Remove, Refactor
  • Ticket prefix: If the branch name contains a ticket identifier (pattern:
    ABC-123
    , i.e., uppercase letters + hyphen + numbers), extract it and prepend as
    [ABC-123]
    prefix to the title
Format:
  • With ticket:
    [TASK-123] Concise description
  • Without ticket:
    Concise description
Ticket detection examples:
  • Branch
    TASK-123
    [TASK-123]
  • Branch
    TASK-123-add-feature
    [TASK-123]
  • Branch
    feature/JIRA-456-fix-bug
    [JIRA-456]
  • Branch
    add-new-feature
    → no prefix
Examples:
  • [TASK-123] Add proposal management
  • [FE-42] Fix auth flow
  • Update Claude Code config
    (no ticket in branch)
规则:
  • 仅使用英文 - 标题中禁止使用韩语
  • 最多40个字符(不含前缀)- 务必极其简洁
  • 使用简短动词:Add、Fix、Update、Remove、Refactor
  • 工单前缀:如果分支名称包含工单标识(格式:
    ABC-123
    ,即大写字母+连字符+数字),请提取该标识并以
    [ABC-123]
    的形式作为前缀添加到标题前
格式:
  • 包含工单:
    [TASK-123] Concise description
  • 不包含工单:
    Concise description
工单识别示例:
  • 分支
    TASK-123
    [TASK-123]
  • 分支
    TASK-123-add-feature
    [TASK-123]
  • 分支
    feature/JIRA-456-fix-bug
    [JIRA-456]
  • 分支
    add-new-feature
    → 无前缀
示例:
  • [TASK-123] Add proposal management
  • [FE-42] Fix auth flow
  • Update Claude Code config
    (分支中无工单标识)

Body

正文

한국어로 작성. Use this format with HEREDOC:
Creating new PR:
bash
gh pr create --title "[TASK-123] Description" --assignee @me --body "$(cat <<'EOF'
请使用韩语撰写。使用以下HEREDOC格式:
创建新PR时:
bash
gh pr create --title "[TASK-123] Description" --assignee @me --body "$(cat <<'EOF'

요약

요약

<이 PR이 하는 일을 간략히 설명>
<이 PR이 하는 일을 간략히 설명>

변경사항

변경사항

<커밋 해시와 함께 목록으로 작성>
🤖 Generated with Claude Code EOF )"

**Updating existing PR:**
```bash
gh pr edit --body "$(cat <<'EOF'
<커밋 해시와 함께 목록으로 작성>
🤖 Generated with Claude Code EOF )"

**更新已有PR时:**
```bash
gh pr edit --body "$(cat <<'EOF'

요약

요약

<이 PR이 하는 일을 간략히 설명 - 기존 요약 유지 또는 확장>
<이 PR이 하는 일을 간략히 설명 - 기존 요약 유지 또는 확장>

변경사항

변경사항

<모든 커밋 해시와 함께 목록으로 작성 - 전체 목록>
🤖 Generated with Claude Code EOF )"
undefined
<모든 커밋 해시와 함께 목록으로 작성 - 전체 목록>
🤖 Generated with Claude Code EOF )"
undefined

Guidelines

指导原则

  • Analyze ALL commits in the branch (not just the latest) to understand the full scope
  • Title은 영어로, Body는 한국어로 작성
  • Include all commit hashes in the body for traceability
  • When updating, preserve the intent of the original summary while incorporating new changes
  • 分析分支中的所有提交(不仅是最新的),以了解完整的变更范围
  • 标题使用英文,正文使用韩语
  • 在正文中包含所有提交哈希,以便追溯
  • 更新PR时,在保留原有摘要核心意图的基础上,整合新的变更内容