pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gather Context

收集上下文信息

Run the following commands to understand the current state:
  1. git branch --show-current
    — check current branch
  2. git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo main
    — detect default branch
  3. git log --oneline main..HEAD 2>/dev/null || git log --oneline -10
    — list commits on this branch
  4. git diff main...HEAD --stat 2>/dev/null || echo "Could not determine diff"
    — list changed files
  5. gh pr list --state merged --limit 5 --json number,title,headRefName --jq '.[] | "#\(.number) \(.title) (\(.headRefName))"' 2>/dev/null || echo "Could not fetch PR history"
    — reference recent PR title style
运行以下命令了解当前状态:
  1. git branch --show-current
    — 检查当前分支
  2. git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo main
    — 检测默认分支
  3. git log --oneline main..HEAD 2>/dev/null || git log --oneline -10
    — 列出当前分支的提交记录
  4. git diff main...HEAD --stat 2>/dev/null || echo "Could not determine diff"
    — 列出已修改的文件
  5. gh pr list --state merged --limit 5 --json number,title,headRefName --jq '.[] | "#\(.number) \(.title) (\(.headRefName))"' 2>/dev/null || echo "Could not fetch PR history"
    — 参考近期PR的标题风格

Determine PR Type

确定PR类型

Parse
$ARGUMENTS
:
  • If it contains "release" → use the Release PR Template below.
  • Otherwise → use the Individual PR Template.

解析
$ARGUMENTS
参数:
  • 如果包含**"release"** → 使用下方的发布PR模板
  • 否则 → 使用普通PR模板

PR Title Convention

PR标题规范

Format:
{Type}: {description}
格式:
{Type}: {description}

Type Prefixes (capitalize first letter — differs from commit messages)

类型前缀(首字母大写,与提交消息不同)

TypePurpose
Feat:
New feature
Fix:
Bug fix
Refactor:
Code restructuring
Perf:
Performance improvement
Docs:
Documentation
Test:
Test changes
Chore:
Maintenance
Hotfix:
Urgent fix
Release:
Release integration (e.g.,
Release: dev → main 통합 (v0.5.0)
)
Write the description in the language configured in the project's CLAUDE.md. If no language is configured, follow the user's conversational language.

类型用途
Feat:
新功能
Fix:
修复Bug
Refactor:
代码重构
Perf:
性能优化
Docs:
文档更新
Test:
测试变更
Chore:
维护工作
Hotfix:
紧急修复
Release:
发布集成(例如:
Release: dev → main 合并 (v0.5.0)
描述部分需使用项目CLAUDE.md中配置的语言。如果未配置语言,则遵循用户的会话语言。

Individual PR Template

普通PR模板

Apply this template for feature, fix, refactor, and other non-release PRs.
markdown
undefined
适用于功能开发、Bug修复、代码重构等非发布类PR。
markdown
undefined

📌 개요

📌 概述

{1-3 sentences: background, problem, and solution}
⚠️ Breaking Change: {only if applicable — describe migration needed}
{1-3句话:背景、问题及解决方案}
⚠️ 破坏性变更: {仅在适用时填写 — 描述所需的迁移步骤}

✅ 변경 사항

✅ 变更内容

1. {Change category title}

1. {变更类别标题}

{Detailed description. Include before/after comparisons, code snippets, or diagrams where helpful.}
{详细描述。如有帮助,可包含前后对比、代码片段或图表。}

2. {Change category title}

2. {变更类别标题}

{...}
{...}

📁 파일 변경 요약

📁 文件变更摘要

구분파일
추가
path/to/new/file.py
수정
path/to/modified/file.py
삭제
path/to/deleted/file.py
分类文件
新增
path/to/new/file.py
修改
path/to/modified/file.py
删除
path/to/deleted/file.py

🧪 테스트

🧪 测试

  • {Test item 1}
  • {Test item 2}
  • {测试项1}
  • {测试项2}

📌 관련 이슈/PR

📌 相关问题/PR

  • #{number}
🤖 Generated with Claude Code

---
  • #{编号}
🤖 由Claude Code生成

---

Release PR Template

发布PR模板

Apply this template when
$ARGUMENTS
contains "release". Typically used for
dev → main
integration.
Collect all merged PRs since the last release:
gh pr list --state merged --base dev --limit 30 --json number,title --jq '.[] | "- #\(.number) \(.title)"'
Title format:
Release: dev → main 통합 (vX.Y.Z)
markdown
undefined
$ARGUMENTS
包含"release"时使用此模板。通常用于
dev → main
分支的合并。
收集上一版本以来所有已合并的PR:
gh pr list --state merged --base dev --limit 30 --json number,title --jq '.[] | "- #\(.number) \(.title)"'
标题格式:
Release: dev → main 合并 (vX.Y.Z)
markdown
undefined

📝 개요

📝 概述

{Release summary — what this release includes}
⚠️ 배포 공지: {Deployment impact notice — which servers are affected, migration steps if any}
{发布摘要 — 此版本包含的内容}
⚠️ 发布通知: {部署影响说明 — 涉及哪些服务器,如有迁移步骤请说明}

✨ 주요 변경사항

✨ 主要变更内容

1. {Feature/Fix name} (#{PR number})

1. {功能/修复名称} (#{PR编号})

{Brief summary of this PR's changes}
{该PR变更的简要摘要}

2. {Feature/Fix name} (#{PR number})

2. {功能/修复名称} (#{PR编号})

{...}
{...}

📁 변경된 파일

📁 变更文件

파일변경 내용
file.py
{description}
文件变更内容
file.py
{描述}

🔍 테스트

🔍 测试

  • {Test checklist item}
  • {测试检查项}

📌 관련 PR

📌 相关PR

  • #{number1}
  • #{number2}
  • #{编号1}
  • #{编号2}

🚀 배포 정보

🚀 发布信息

환경서버브랜치
개발{dev server}dev
운영{prod server}main
🤖 Generated with Claude Code

---
环境服务器分支
开发{开发服务器}dev
生产{生产服务器}main
🤖 由Claude Code生成

---

Task

任务步骤

  1. Analyze all commits on the current branch (vs. base branch) to understand the full scope.
  2. Determine PR type: Release (if
    $ARGUMENTS
    contains "release") or Individual.
  3. Draft the PR title and body using the appropriate template above.
  4. Present the proposed title and body to the user and wait for approval.
  5. Once approved:
    • Push the branch if not already pushed:
      git push -u origin {branch-name}
    • Create the PR:
      gh pr create --title "..." --body "$(cat <<'EOF' ... EOF)"
  6. Return the PR URL.
Important:
  • Do NOT push or create a PR without explicit user approval.
  • For Release PRs, automatically collect all included PRs from the merge history.
  • Adapt section headers and content language to the project's CLAUDE.md language setting.
  • The file change table should be generated from the actual diff, not guessed.
  1. 分析当前分支(与基准分支对比)的所有提交,了解完整范围。
  2. 确定PR类型:如果
    $ARGUMENTS
    包含"release"则为发布PR,否则为普通PR。
  3. 使用上述对应模板草拟PR标题和正文。
  4. 将拟议的标题和正文呈现给用户并等待批准
  5. 获得批准后:
    • 如果分支尚未推送,则推送分支:
      git push -u origin {branch-name}
    • 创建PR:
      gh pr create --title "..." --body "$(cat <<'EOF' ... EOF)"
  6. 返回PR链接。
重要提示:
  • 未经用户明确批准,请勿推送分支或创建PR。
  • 对于发布PR,自动从合并历史中收集所有包含的PR。
  • 根据项目CLAUDE.md中的语言设置调整章节标题和内容语言。
  • 文件变更表应根据实际diff生成,而非猜测。