AgentSkillsCN

pr

当用户说“/pr”“打开 pr”“创建 pr”“更新 pr”“请求创建或编辑拉取请求”,或需要为发布做准备时,使用此方法。

SKILL.md
--- frontmatter
name: pr
description: Use when user says "/pr", "open pr", "create pr", "update pr", asks to create or edit a pull request, or needs to prepare a release.
allowed-tools: Bash(gh:*), Bash(git:*), Read, Grep, Glob, AskUserQuestion, Task(Explore)
user-invocable: true
context: fork
argument-hint: [view|edit|release|issue-number] [pr-number|version]

Pull Request Skill

Create, view, and edit PRs following project conventions. Supports four modes:

ModeTriggerPurpose
View/pr view [pr-number]Display PR details and CI status
Create/pr [issue-number], "create pr"Create PR for features, bugs, tasks
Edit/pr edit [pr-number], "update pr"Regenerate PR body from current commits
Release/pr release <version>, "release prep"Verify release readiness

Mode Detection

When this skill is invoked, arguments follow the skill name (e.g., /pr view 218 passes "view 218" as arguments).

IMPORTANT: Before doing anything else, identify the mode from the invocation arguments:

ArgumentsModeInstructions
view [pr-number]ViewRead view.md
edit [pr-number]EditRead edit.md
release <version>ReleaseRead release.md
#<number> or just a numberCreate (from issue)Read create.md
(none) on release branchReleaseRead release.md
(none) or otherCreateRead create.md

Pattern for release branches: ^release/v?[0-9]+\.[0-9]+\.[0-9]+$

First action: Read the appropriate .md file for your detected mode, then follow those instructions exactly.

Release Branch Workflow

Non-release PRs target the release branch matching their milestone:

  1. Get milestone from issue (e.g., v0.5.0)
  2. Check if release/0.5.0 branch exists
  3. If exists → PR targets release/0.5.0 instead of main
  4. If not exists → PR targets main (do not ask)

This ensures feature work flows into release branches, which then merge to main via release prep PRs.

code
feature-branch → release/0.5.0 → main
                      ↑
              (release prep PR)

Reference Files