create-pr

GitHub

在git-push后创建或更新GitHub PR。流程包括:检查并选择基准分支,本地审查差异并同步;构建标题、正文及Issue链接;优先复用现有开放PR以避免重复,否则新建。确保内容安全、引用准确,并提供PR URL报告。

.agents/skills/create-pr/SKILL.md Terry-Mao/AICodingFlow

Trigger Scenarios

用户要求创建Pull Request 用户要求更新现有的Pull Request 用户要求打开一个Pull Request

Install

npx skills add Terry-Mao/AICodingFlow --skill create-pr -g -y
More Options

Non-standard path

npx skills add https://github.com/Terry-Mao/AICodingFlow/tree/main/.agents/skills/create-pr -g -y

Use without installing

npx skills use Terry-Mao/AICodingFlow@create-pr

指定 Agent (Claude Code)

npx skills add Terry-Mao/AICodingFlow --skill create-pr -a claude-code -g -y

安装 repo 全部 skill

npx skills add Terry-Mao/AICodingFlow --all -g -y

预览 repo 内 skill

npx skills add Terry-Mao/AICodingFlow --list

SKILL.md

Frontmatter
{
    "name": "create-pr",
    "description": "Create or update a GitHub pull request from a pushed branch after local review, base-branch sync, validation, and issue linking."
}

create-pr

Use this after git-push when the user asks to create, update, or open a GitHub pull request.

Goal

Create or update a review-ready PR from the current branch after syncing the base branch, reviewing the diff locally, and linking the related task.

Workflow

  1. Inspect and choose base Run:

    git status --short
    git branch --show-current
    git status -sb
    

    Prefer the repo's default PR base. If repo guidance names a different base, use that. If the worktree is dirty, pause unless the changes are intentionally excluded from the PR.

  2. Review and sync locally Run:

    git diff --stat <base>...HEAD
    git diff <base>...HEAD
    

    Review the diff for accidental files, secrets, conflict markers, generated churn, and missing tests or docs. Fetch the base branch and make sure it has been merged or rebased into the current branch before creating or updating the PR. If conflicts occur, resolve them locally, rerun relevant validation, commit the resolution, and push through git-push so any configured pre-push hook runs.

  3. Build title, body, and issue link Default the title from the issue title or the main commit subject. Infer issue links from the user request, branch name, or commits. Do not invent issue IDs. Keep the body concise and include:

    • summary
    • validation performed
    • issue link such as Closes #123, Fixes #123, or Refs #123 when known
  4. Create or update PR Use GitHub CLI when available. First check only for an open PR from the current branch. Do not use gh pr view as the existence check because it may resolve a previously merged or closed PR for the same branch name:

    pr_url="$(gh pr list --state open --head "$branch" --json url --jq '.[0].url' --limit 1)"
    

    If pr_url is not empty, update that open PR instead of creating a duplicate:

    gh pr edit "$pr_url" --title "$title" --body-file "$body_file"
    

    Before editing an open existing PR, read the current body and preserve user-authored content that is not clearly generated by this workflow. Do not overwrite manual notes, review context, checklist items, or release details just to apply the generated summary. If there is no open PR, create one. A merged or closed PR with the same branch name is not reusable and must not block creation of a new PR:

    gh pr create --base "$base" --head "$branch" --title "$title" --body-file "$body_file"
    

    Pass generated title/body/base/head values as separate argv-style arguments. Do not paste user-, issue-, branch-, or commit-derived text directly into a shell command line; if using shell variables, populate them without eval or command substitution and always quote expansions.

If gh is unavailable or not authenticated, report the exact title/body/base/head needed to create or update the PR manually.

Reporting

After creating or finding a PR, report:

  • PR URL
  • base branch
  • head branch
  • title
  • validation included in the body
  • whether the base branch was merged or rebased locally
  • remind the user to watch CI, respond to review comments, and keep the PR current by regularly merging or rebasing the base branch

Version History

  • e53c5ac Current 2026-07-24 11:35

Same Skill Collection

.agents/skills/bootstrap-issue-config/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/diagnose-ci-failures/SKILL.md
.agents/skills/git-branch/SKILL.md
.agents/skills/git-commit/SKILL.md
.agents/skills/git-push/SKILL.md
.agents/skills/git-worktree/SKILL.md
.agents/skills/pr-walkthrough/SKILL.md
.agents/skills/resolve-merge-conflicts/SKILL.md
.agents/skills/review-pr-local/SKILL.md
.agents/skills/review-spec-local/SKILL.md
.agents/skills/spec-driven-implementation/SKILL.md
.agents/skills/write-product-spec/SKILL.md
.agents/skills/write-tech-spec/SKILL.md
.github/skills/check-impl-against-spec/SKILL.md
.github/skills/create-product-spec/SKILL.md
.github/skills/create-tech-spec/SKILL.md
.github/skills/dedupe-issue-repo/SKILL.md
.github/skills/dedupe-issue/SKILL.md
.github/skills/implement-issue/SKILL.md
.github/skills/implement-specs/SKILL.md
.github/skills/product-change-report/SKILL.md
.github/skills/product-docs-sync/SKILL.md
.github/skills/product-wiki/SKILL.md
.github/skills/review-pr-repo/SKILL.md
.github/skills/review-pr/SKILL.md
.github/skills/review-spec-repo/SKILL.md
.github/skills/review-spec/SKILL.md
.github/skills/security-review-pr/SKILL.md
.github/skills/security-review-spec/SKILL.md
.github/skills/triage-issue-repo/SKILL.md
.github/skills/triage-issue/SKILL.md
.github/skills/update-dedupe/SKILL.md
.github/skills/update-pr-review/SKILL.md
.github/skills/update-triage/SKILL.md

Metadata

Files
0
Version
e53c5ac
Hash
e19aa1b6
Indexed
2026-07-24 11:35

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-06 18:38
浙ICP备14020137号-1 $Гость$