create-pr

GitHub

在 git-push 后创建或更新 GitHub PR,执行本地差异审查、同步基础分支、构建元数据并调用 gh CLI 操作,确保 PR 准备就绪。

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

Trigger Scenarios

用户要求创建 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 review-ready GitHub pull request from the current branch."
}

create-pr

Use this after git-push when the user asks to create, update, or open a pull request. It prepares PR metadata; it does not implement code, commit, push, or modify issues.

Prepare

Inspect the current branch, worktree, and repository default PR base. A dirty worktree must be intentionally excluded before continuing. Review the complete base-to-head diff for accidental files, secrets, conflict markers, generated churn, and missing validation. Sync the base into the branch when needed; if that creates conflicts, resolve, validate, commit, and push the resolution.

Build a concise title and body from the issue, branch, commits, or user request. Include summary, validation, and a known issue link (Closes, Fixes, or Refs). Never invent an issue ID.

Create or update

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:

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

If an open PR exists, read its current body, preserve manual content, and update it:

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

Otherwise create a new PR. A merged or closed PR with the same branch name is not reusable:

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

Pass generated values as separate quoted arguments; never interpolate untrusted text into shell syntax. If gh is unavailable or unauthenticated, report the exact base, head, title, and body for manual creation.

Report the PR URL, base/head, title, validation, and whether the base was synced.

Version History

  • d3fef11 Current 2026-09-03 03:51

    精简了本地开发与 spec 工作流指引,优化了技能描述结构。

  • e53c5ac 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
d3fef11
Hash
f0b495ec
Indexed
2026-07-24 11:35

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-03 19:22
浙ICP备14020137号-1 $bản đồ khách truy cập$