pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGather Context
收集上下文信息
Run the following commands to understand the current state:
- — check current branch
git branch --show-current - — detect default branch
git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo main - — list commits on this branch
git log --oneline main..HEAD 2>/dev/null || git log --oneline -10 - — list changed files
git diff main...HEAD --stat 2>/dev/null || echo "Could not determine diff" - — reference recent PR title style
gh pr list --state merged --limit 5 --json number,title,headRefName --jq '.[] | "#\(.number) \(.title) (\(.headRefName))"' 2>/dev/null || echo "Could not fetch PR history"
运行以下命令了解当前状态:
- — 检查当前分支
git branch --show-current - — 检测默认分支
git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo main - — 列出当前分支的提交记录
git log --oneline main..HEAD 2>/dev/null || git log --oneline -10 - — 列出已修改的文件
git diff main...HEAD --stat 2>/dev/null || echo "Could not determine diff" - — 参考近期PR的标题风格
gh pr list --state merged --limit 5 --json number,title,headRefName --jq '.[] | "#\(.number) \(.title) (\(.headRefName))"' 2>/dev/null || echo "Could not fetch PR history"
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)
类型前缀(首字母大写,与提交消息不同)
| Type | Purpose |
|---|---|
| New feature |
| Bug fix |
| Code restructuring |
| Performance improvement |
| Documentation |
| Test changes |
| Maintenance |
| Urgent fix |
| Release integration (e.g., |
Write the description in the language configured in the project's CLAUDE.md.
If no language is configured, follow the user's conversational language.
| 类型 | 用途 |
|---|---|
| 新功能 |
| 修复Bug |
| 代码重构 |
| 性能优化 |
| 文档更新 |
| 测试变更 |
| 维护工作 |
| 紧急修复 |
| 发布集成(例如: |
描述部分需使用项目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. {变更类别标题}
{...}
{...}
📁 파일 변경 요약
📁 文件变更摘要
| 구분 | 파일 |
|---|---|
| 추가 | |
| 수정 | |
| 삭제 | |
| 分类 | 文件 |
|---|---|
| 新增 | |
| 修改 | |
| 删除 | |
🧪 테스트
🧪 测试
- {Test item 1}
- {Test item 2}
- {测试项1}
- {测试项2}
📌 관련 이슈/PR
📌 相关问题/PR
Release PR Template
发布PR模板
Apply this template when contains "release". Typically used for integration.
$ARGUMENTSdev → mainCollect 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当包含"release"时使用此模板。通常用于分支的合并。
$ARGUMENTSdev → 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编号})
{...}
{...}
📁 변경된 파일
📁 变更文件
| 파일 | 변경 내용 |
|---|---|
| {description} |
| 文件 | 变更内容 |
|---|---|
| {描述} |
🔍 테스트
🔍 测试
- {Test checklist item}
- {测试检查项}
📌 관련 PR
📌 相关PR
- #{number1}
- #{number2}
- #{编号1}
- #{编号2}
🚀 배포 정보
🚀 发布信息
Task
任务步骤
- Analyze all commits on the current branch (vs. base branch) to understand the full scope.
- Determine PR type: Release (if contains "release") or Individual.
$ARGUMENTS - Draft the PR title and body using the appropriate template above.
- Present the proposed title and body to the user and wait for approval.
- 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)"
- Push the branch if not already pushed:
- 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.
- 分析当前分支(与基准分支对比)的所有提交,了解完整范围。
- 确定PR类型:如果包含"release"则为发布PR,否则为普通PR。
$ARGUMENTS - 使用上述对应模板草拟PR标题和正文。
- 将拟议的标题和正文呈现给用户并等待批准。
- 获得批准后:
- 如果分支尚未推送,则推送分支:
git push -u origin {branch-name} - 创建PR:
gh pr create --title "..." --body "$(cat <<'EOF' ... EOF)"
- 如果分支尚未推送,则推送分支:
- 返回PR链接。
重要提示:
- 未经用户明确批准,请勿推送分支或创建PR。
- 对于发布PR,自动从合并历史中收集所有包含的PR。
- 根据项目CLAUDE.md中的语言设置调整章节标题和内容语言。
- 文件变更表应根据实际diff生成,而非猜测。