一键导入
bmsdraft-pr
Create a draft pull request for the current branch. Summarises the diff, fills in any PR templates, and opens the PR via the gh CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a draft pull request for the current branch. Summarises the diff, fills in any PR templates, and opens the PR via the gh CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Performs a harsh but constructive code review of a file or set of files. Use when asked to review, critique, or give feedback on code quality.
Evaluates whether a GitHub repository (tool, library, or framework) is worth adopting for the current project. Use when given a GitHub repo URL to assess as a potential dependency or tool.
Analyzes a GitHub issue by fetching its details and exploring the relevant codebase to identify the root cause and suggest solutions. Use when given a GitHub issue URL to investigate.
Creates a proof of concept implementation. Provides the smallest working solution to validate an idea, with no tests and minimal production concerns.
Proofreads a blog post for clarity, balance, and general quality. Use when asked to proofread, review, or critique a blog post or article.
Summarize diary entries for a given time period
| name | bms:draft-pr |
| description | Create a draft pull request for the current branch. Summarises the diff, fills in any PR templates, and opens the PR via the gh CLI. |
Create a draft pull request for the current branch with a well-written summary and completed PR template.
main or master. If it is, stop and tell the user they need to be on a feature branch.git log main..HEAD --oneline (try master if main does not exist) to check. If there are no commits, stop and tell the user.main or master) for later use.Run the following commands to understand the changes:
git log <base>..HEAD --pretty=format:"%h %s"
git diff <base>..HEAD --stat
git diff <base>..HEAD
Read through the full diff carefully. Understand what changed and, where possible, why it changed.
Look for a pull request template in the repository. Search for files in these locations (in order of priority):
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE.mddocs/pull_request_template.mdpull_request_template.md.github/PULL_REQUEST_TEMPLATE/*.md (multiple templates directory)If a template is found, use it as the structure for the PR body and fill in each section thoughtfully based on the diff analysis. Do not leave template sections empty; if a section is not applicable, write "N/A" with a brief reason.
If no template is found, use the default format described below.
If no template was found, use this structure:
## Summary
<2-5 sentences describing what this PR does and why>
## Changes
<Bulleted list of the key changes, grouped logically>
## Notes
<Any additional context, migration steps, or things reviewers should pay attention to. Remove this section if not needed.>
When writing the body:
Check if the branch has been pushed to the remote:
git status
If the branch has not been pushed or is behind, push it:
git push -u origin HEAD
Use the gh CLI to create the PR as a draft. Use a heredoc for the body to preserve formatting:
gh pr create --draft --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"
Provide the user with:
gh pr create.gh is not installed or not authenticated, tell the user and provide the PR title and body so they can create it manually.