pull-requests

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pull Request Workflows

拉取请求(PR)工作流

This skill handles the complete PR lifecycle. Based on context and user intent, follow the appropriate workflow.
此技能可处理完整的PR生命周期。根据上下文和用户意图,选择合适的工作流执行。

Context

上下文信息

  • Current git status: !
    git status
  • Current branch: !
    git branch --show-current
  • PR state (if exists): !
    GH_PAGER= gh pr view --json number,title,state 2>/dev/null || echo "No PR for current branch"
  • Arguments: $ARGUMENTS
  • 当前git状态:!
    git status
  • 当前分支:!
    git branch --show-current
  • PR状态(若存在):!
    GH_PAGER= gh pr view --json number,title,state 2>/dev/null || echo "当前分支无对应PR"
  • 参数:$ARGUMENTS

Workflow Selection

工作流选择

Determine which workflow to use based on context:
根据上下文确定要使用的工作流:

Use Creating Workflow when:

当满足以下条件时,使用创建工作流:

  • User asks to "create a PR", "open a PR", "push for review"
  • On a feature branch with uncommitted or unpushed changes
  • No PR exists for the current branch
→ See
./references/creating-workflow.md
  • 用户要求“create a PR”、“open a PR”、“push for review”
  • 当前处于功能分支,且存在未提交或未推送的变更
  • 当前分支无对应PR
→ 详见
./references/creating-workflow.md

Use Reviewing Workflow when:

当满足以下条件时,使用评审工作流:

  • User asks to "review PR", "check code quality", "run review"
  • PR exists and is open
  • Want to run code review agents before merge
→ See
./references/reviewing-workflow.md
  • 用户要求“review PR”、“check code quality”、“run review”
  • PR已存在且处于开启状态
  • 希望在合并前运行代码评审代理
→ 详见
./references/reviewing-workflow.md

Use Merging Workflow when:

当满足以下条件时,使用合并工作流:

  • User asks to "merge PR", "complete PR", "finalize changes"
  • PR exists, is reviewed, and ready for merge
  • Need to run final CI checks and merge
→ See
./references/merging-workflow.md
  • 用户要求“merge PR”、“complete PR”、“finalize changes”
  • PR已存在、已评审完成且准备好合并
  • 需要运行最终CI检查并执行合并
→ 详见
./references/merging-workflow.md

Quick Reference

快速参考

IntentWorkflowKey Actions
"Create PR"CreatingBranch → Commit → Push →
gh pr create
"Review PR"ReviewingIdentify PR → Run review agents → Fix issues → Update state
"Merge PR"MergingCI checks → Confirm ready →
gh pr merge
→ Checkout main
意图工作流关键操作
"Create PR"创建分支 → 提交 → 推送 →
gh pr create
"Review PR"评审识别PR → 运行评审代理 → 修复问题 → 更新状态
"Merge PR"合并CI检查 → 确认就绪 →
gh pr merge
→ 切换到主分支