一键导入
pr
Create a pull request with an auto-generated description
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a pull request with an auto-generated description
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pr |
| description | Create a pull request with an auto-generated description |
| allowed-tools | Bash, Read, Grep, Glob |
Determine the base branch by running:
git remote show origin
Look for the "HEAD branch" line to identify whether the default branch is master or main. Use that as the base branch.
Ensure the current branch is pushed to origin. If it does not already track a remote branch, push with:
git push -u origin HEAD
Gather context for the PR description:
Get all commit messages on this branch:
git log <base>..HEAD --oneline
Get the full diff of changes:
git diff <base>...HEAD
Extract a ticket ID from the current branch name using the pattern [A-Z]+-[0-9]+ (e.g. MCB-29 from ben/MCB-29-add-admin-tool). If a ticket ID is found, prepare a Linear link: https://linear.app/issue/<TICKET>.
Generate a PR title — a concise summary of the changes, under 70 characters.
Generate a PR description in this format:
## Summary
<1-3 bullet points describing what changed and why>
## Test plan
<bulleted checklist of how to verify the changes>
<Linear ticket link if a ticket ID was found, otherwise omit>
Create the PR using gh pr create targeting the detected base branch. Use a HEREDOC for the body to preserve formatting:
gh pr create --base <base> --title "the pr title" --body "$(cat <<'EOF'
## Summary
...
## Test plan
...
https://linear.app/issue/TICKET-123
EOF
)"
Enable auto-merge (unless the user passed --no-auto-merge or no-auto-merge as an argument):
gh pr merge --auto --merge
Output the PR URL returned by gh pr create.
gh pr create fails because a PR already exists, inform the user and show the existing PR URL.--no-auto-merge to skip it.