Agent Skillsareal-project/AReaL › create-pr

create-pr

GitHub

用于在当前分支创建或更新 GitHub PR。流程包括预检、Rebase、Squash提交、生成符合规范的Commit和PR描述,最后推送并调用gh命令创建或编辑PR,支持Draft模式。

.agents/skills/create-pr/SKILL.md areal-project/AReaL

Trigger Scenarios

用户要求为当前分支创建 Pull Request 用户要求更新现有的 Pull Request

Install

npx skills add areal-project/AReaL --skill create-pr -g -y
More Options

Non-standard path

npx skills add https://github.com/areal-project/AReaL/tree/main/.agents/skills/create-pr -g -y

Use without installing

npx skills use areal-project/AReaL@create-pr

指定 Agent (Claude Code)

npx skills add areal-project/AReaL --skill create-pr -a claude-code -g -y

安装 repo 全部 skill

npx skills add areal-project/AReaL --all -g -y

预览 repo 内 skill

npx skills add areal-project/AReaL --list

SKILL.md

Frontmatter
{
    "name": "create-pr",
    "description": "Rebase the current branch onto the latest base branch, squash local commits, generate a Conventional Commit message, and create or update the GitHub pull request."
}

Create Pull Request

Use this skill when the user asks to create or update a PR for the current branch.

Inputs

  • Optional --draft
  • Optional --base <branch> (default: main)

Preconditions

  1. Verify the current branch is not main or master.
  2. Check for uncommitted changes with git status --short.
  3. Ensure gh is available.
  4. If there are uncommitted changes, stop and ask the user whether to commit or stash them first.

Workflow

Step 1: Check for an existing PR

  • Run gh pr view --json number,title,url,state,isDraft.
  • If a PR already exists, tell the user before rewriting history or force-pushing.

Step 2: Fetch and rebase

git fetch origin <base>
git rebase origin/<base>
  • If rebase conflicts occur, abort the rebase and stop.
  • Tell the user which files conflicted and ask them to resolve manually.

Step 3: Squash into one commit

git reset --soft origin/<base>
  • Load the commit-conventions skill before generating the commit message.
  • Infer type and scope from the staged diff.
  • Keep the commit subject imperative and under about 72 characters.

Step 4: Generate PR title and body

  • Use the squashed commit message style for the PR title.
  • Follow the repository PR template at .github/PULL_REQUEST_TEMPLATE.md.
  • Summarize user-facing changes, risk areas, test commands run, and skipped suites with reasons.

Step 5: Push and create or update the PR

  • Push the branch.
  • If history was rewritten, confirm before force-pushing.
  • Create or update the PR with gh pr create or gh pr edit.
  • Respect --draft when requested.

Guardrails

  • Never create a PR from main or master.
  • Never silently force-push over an existing PR branch.
  • Never bypass commit-conventions for the squashed commit.
  • If gh authentication or remote permissions fail, stop and report the exact blocker.

Output

Report:

  • Base branch used
  • Final commit message
  • PR title
  • PR URL, if creation or update succeeded
  • Any steps that were skipped or require user follow-up

Version History

  • d99124e Current 2026-07-05 09:13

Same Skill Collection

.agents/skills/add-archon-model/SKILL.md
.agents/skills/add-dataset/SKILL.md
.agents/skills/add-reward/SKILL.md
.agents/skills/add-unit-tests/SKILL.md
.agents/skills/add-workflow/SKILL.md
.agents/skills/commit-conventions/SKILL.md
.agents/skills/debug-distributed/SKILL.md
.agents/skills/review-pr/SKILL.md
.agents/skills/translate-doc-zh/SKILL.md
.agents/skills/upgrade-deps/SKILL.md
.claude/skills/add-archon-model/SKILL.md
.claude/skills/add-dataset/SKILL.md
.claude/skills/add-reward/SKILL.md
.claude/skills/add-unit-tests/SKILL.md
.claude/skills/add-workflow/SKILL.md
.claude/skills/commit-conventions/SKILL.md
.claude/skills/debug-distributed/SKILL.md
.opencode/skills/add-archon-model/SKILL.md
.opencode/skills/add-dataset/SKILL.md
.opencode/skills/add-reward/SKILL.md
.opencode/skills/add-unit-tests/SKILL.md
.opencode/skills/add-workflow/SKILL.md
.opencode/skills/commit-conventions/SKILL.md
.opencode/skills/debug-distributed/SKILL.md

Metadata

Files
0
Version
d99124e
Hash
48f10dad
Indexed
2026-07-05 09:13

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-05 19:27
浙ICP备14020137号-1 $방문자$