pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePull Request Skill
Pull Request 技能
Create a draft pull request with a clear title and explicit description of changes.
创建一个带有清晰标题和明确变更描述的草稿拉取请求(PR)。
Instructions
操作说明
- Analyze branch changes: Understand all commits since diverging from main
- Push to remote: Ensure all commits are pushed
- Create draft PR: Always open as draft for review before merging
- 分析分支变更:了解从main分支分叉以来的所有提交
- 推送到远程仓库:确保所有提交已推送至远程
- 创建草稿PR:在合并前始终以草稿形式创建以便审核
PR Title Format
PR标题格式
Follow conventional commit format for the PR title:
<type>: <description>PR标题需遵循规范提交格式:
<type>: <description>Types
类型
- : New feature or capability
feat - : Bug fix
fix - : Code restructuring
refactor - : Documentation changes
docs - : Maintenance tasks
chore - : Performance improvements
perf
- : 新功能或能力
feat - : Bug修复
fix - : 代码重构
refactor - : 文档变更
docs - : 维护任务
chore - : 性能优化
perf
Title Rules
标题规则
- Keep under 70 characters
- Use lowercase, imperative mood
- No period at the end
- 长度不超过70个字符
- 使用小写、祈使语气
- 结尾不加句号
PR Body Format
PR正文格式
The body MUST be explicit about what changed. Structure:
markdown
undefined正文必须明确说明变更内容,结构如下:
markdown
undefinedSummary
Summary
<Clear description of what this PR does and why>
<清晰描述此PR的作用及原因>
Changes
Changes
- <Specific change 1>
- <Specific change 2>
- <Specific change 3>
- <具体变更1>
- <具体变更2>
- <具体变更3>
Test plan
Test plan
Execution Steps
执行步骤
- Run to check for uncommitted changes
git status - Run to see all commits in this branch
git log main..HEAD --oneline - Run to see the full diff against main
git diff main...HEAD - Check if remote branch exists and is up to date:
bash
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "no upstream" - Push to remote if needed:
git push -u origin HEAD - Create draft PR using gh CLI:
bash
gh pr create --draft --title "<type>: <description>" --body "$(cat <<'EOF' ## Summary <description> ## Changes - <change 1> - <change 2> ## Test plan - [ ] <test 1> - [ ] <test 2> --- Generated with [Claude Code](https://claude.com/claude-code) EOF )" - Return the PR URL to the user
- 运行 检查未提交的变更
git status - 运行 查看当前分支的所有提交
git log main..HEAD --oneline - 运行 查看与main分支的完整差异
git diff main...HEAD - 检查远程分支是否存在且为最新版本:
bash
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "no upstream" - 如有需要,推送到远程仓库:
git push -u origin HEAD - 使用gh CLI创建草稿PR:
bash
gh pr create --draft --title "<type>: <description>" --body "$(cat <<'EOF' ## Summary <描述> ## Changes - <变更1> - <变更2> ## Test plan - [ ] <测试1> - [ ] <测试2> --- Generated with [Claude Code](https://claude.com/claude-code) EOF )" - 将PR链接返回给用户