create-pr

GitHub

在 git push 后创建或更新 GitHub PR,准备元数据、校验正文并生成标准标题。

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

Trigger Scenarios

用户要求创建或更新 Pull Request Git push 完成后需要提交代码审查

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. Use a Conventional Commit title for the PR: <type>[(scope)]: <description>. Choose the type from the actual change (for example, feat, fix, docs, refactor, test, or chore); include a scope only when it clarifies the change. Keep the description in the repository's prose language, for example fix(ci): 修复审查分发. When updating a PR, keep an existing title if it follows this format and still describes the complete diff; otherwise revise it. Include ## Summary, ## Testing, ## Risk, and ## How to revert, plus a known issue link (Closes, Fixes, or Refs). State actual test results, the relevant risk and a concrete rollback action; never invent results or an issue ID. Preserve any manually written sections when updating an open PR. Before submitting, save the exact body and run python3 .github/scripts/validate_pr_body.py <body-file>.

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

  • 93c4bdd Current 2026-11-02 18:56

    新增 Conventional Commit 标题规范、测试与风险评估章节及 CI 脚本校验。

  • d3fef11 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-existing-code/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
93c4bdd
Hash
4b35529e
Indexed
2026-07-24 11:35

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 06:49
浙ICP备14020137号-1