一键导入
pr
Create or update pull requests following best practices. Use when opening a PR, updating an existing PR, preparing changes for review, or running gh pr create.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update pull requests following best practices. Use when opening a PR, updating an existing PR, preparing changes for review, or running gh pr create.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Watch a PR's CI checks and iteratively fix failures until green. Use after opening or pushing to a PR, or when CI is failing and you want autonomous fix-push cycles.
Fix bugs using the two-commit structure with failing test first. Use when fixing bugs, addressing issues, or correcting incorrect behavior.
Review pull requests against best practices. Use when reviewing PRs, checking code quality, or providing feedback on changes.
| name | pr |
| description | Create or update pull requests following best practices. Use when opening a PR, updating an existing PR, preparing changes for review, or running gh pr create. |
| user-invocable | true |
Follow these standards when creating or updating PRs.
Run your project's standard checks:
# Examples - adapt to your project
npm test # JavaScript/TypeScript
cargo test # Rust
pytest # Python
go test ./... # Go
git status
git diff main...HEAD
git log main..HEAD --oneline
Before drafting the PR, review the commit history for reviewability:
git log main..HEAD --oneline
Check whether commits are:
If the history is messy (e.g. "WIP", fixup commits scattered around, unrelated changes lumped together), suggest reworking it before creating the PR. Ask the user if they'd like you to do an interactive rebase to clean things up.
Do:
feat:, fix:, etc.)Don't:
.github/PULL_REQUEST_TEMPLATE.md (or .github/PULL_REQUEST_TEMPLATE/ directory) in the current repo. If present, read it and use it as the structure.~/.claude/skills/pr/PULL_REQUEST_TEMPLATE.md and use it as the structure.You MUST read the template file and use its exact sections. Do not hardcode or guess the format — always read the file. Populate each section based on the actual changes — never leave placeholder text.
If the PR has multiple commits organized for reviewability, add this callout at the top of the description (before the Summary):
> **Note:** This PR is best reviewed commit-by-commit.
Never mention in PR descriptions:
These are enforced by CI and mentioning them adds zero value.
This section is ONLY for manual verification steps reviewers can follow:
Good:
## Validation Steps
1. Run `npm start` and navigate to /settings
2. Click the "Dark Mode" toggle
3. Verify the theme changes immediately
Bad:
## Validation Steps
- All tests pass
- Ran eslint with no warnings
Always create PRs as drafts by default. Only create a ready-for-review PR if the user explicitly asks.
git push -u origin trevor/your-branch-name
# Use the template sections you read — pass body via HEREDOC
gh pr create --draft \
--title "your descriptive title" \
--body "$(cat <<'EOF'
...populated template sections...
EOF
)"
Do NOT hardcode the PR body format — always read and follow the template.
When the user asks to update an existing PR, use gh pr edit to modify the title and/or body. Push any new commits first.
# Push new commits
git push
# Update the PR title and/or body
gh pr edit --title "updated title" --body "$(cat <<'EOF'
...updated body...
EOF
)"
If only the description needs updating, omit --title. If only the title needs updating, omit --body.