create-github-pr
它能做什么
这项技能让 AI 从你已推送的分支在 GitHub 上开启拉取请求。适合希望代码被审查并合并的贡献者。
适用场景
- ✓你在某个分支上完成修改,想在 GitHub 上提交审查的时候。
- ✓你需要一个关联其所解决议题的拉取请求的时候。
- ✓你想让 AI 在开启拉取请求之前检查你的访问权限和议题批准情况的时候。
技能链接
https://github.com/NVIDIA/OpenShell/blob/main/.agents/skills/create-github-pr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的分支开启拉取请求,并把它关联到它所修复的议题。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会检查 gh 登录状态和仓库的贡献规则,然后通过命令,按项目的描述格式创建拉取请求。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Create GitHub Pull Request
Create pull requests on GitHub using the gh CLI.
Prerequisites
- The
ghCLI must be authenticated (gh auth status) - You must have commits on a branch that's pushed to the remote
- Every PR must close an existing issue, except automated dependency updates and build or flaky-test fixes from authors with write access, as described in
CONTRIBUTING.md. Follow Branch Names inCONTRIBUTING.mdfor contributor branch names.
Before Creating a PR
Verify Contributor Access and Issue Acceptance
Before pushing or creating a PR (including a draft), verify the author's access
to the target repository, not their fork. For the authenticated gh user:
gh repo view OWNER/REPO --json nameWithOwner,viewerPermission
gh issue view ISSUE_NUMBER --repo OWNER/REPO --json number,url,labels
Authors with verified WRITE, MAINTAIN, or ADMIN access may proceed without
state:accepted; keep the issue link and note the missing label. Everyone else
must link at least one target-repository issue and have state:accepted on each.
Otherwise, preserve local work and report which issue needs acceptance. A direct
request, roadmap placement, other labels, or vouch status does not bypass this gate.
When acting for another author, verify their permissions. Resolve failed lookups before proceeding; retry sandbox network failures outside the sandbox before reporting an authentication problem. Vouch requirements still apply separately.
Check Config Documentation
If the branch changes gateway TOML parsing, [openshell.gateway] fields,
[openshell.drivers.<name>] fields, driver config defaults, or Helm rendering
of gateway.toml, verify that docs/how-it-works/gateways/configuration.mdx is updated
in the same branch. If the change affects user-facing compute-driver setup,
also update docs/how-it-works/sandboxes/runtimes.mdx or the relevant
deployment docs.
Check Agent Infrastructure
Use the sync-agent-infra skill's maintenance map to identify related skill updates when the branch changes behavior, commands, or development workflows. Run its full consistency check when the branch adds, removes, or renames skills or crates; changes workflow relationships or skill coverage; modifies issue or PR templates; or changes agent cross-references. Resolve any drift before creating the PR.
Verify the Affected Areas
Use the verification guidance in CONTRIBUTING.md to select checks for the changed files and behavior. Guidance, skills, and template changes need applicable Markdown, YAML, link, and consistency checks. Run Rust or SDK suites when those components or their dependencies can be affected. Shared APIs, schemas, dependencies, and build changes may require broader checks even when component source files are unchanged.
mise run ci and mise run pre-commit are broad convenience tasks, not blanket PR prerequisites. Broaden validation only for a concrete remaining risk or failed check, and report what actually ran.
Verify Branch State
Before creating a PR, verify:
You're not on main - Never create PRs directly from main:
# Should NOT be "main" git branch --show-currentBranch follows naming convention - Follow Branch Names in
CONTRIBUTING.md, including the exceptions for generated branches and private security work.# Example: feat/1234-add-pagination/octocat git branch --show-current
Push Your Branch
Ensure your branch is pushed to the remote:
git push -u origin HEAD
Creating a PR
Basic PR creation (opens editor for description):
gh pr create
With title and body:
gh pr create --title "PR title" --body "PR description"
PR Title Format
PR titles must follow the conventional commit format:
<type>(<scope>): <description>
Types:
feat- New featurefix- Bug fixdocs- Documentation onlyrefactor- Code change that neither fixes a bug nor adds a featuretest- Adding or updating testschore- Maintenance tasks (CI, build, dependencies)perf- Performance improvement
Scope is typically the component name (e.g., evaluator, cli, sdk, jobs).
Examples:
feat(evaluator): add support for custom rubricsfix(jobs): handle timeout errors gracefullydocs(sdk): update authentication examplesrefactor(models): simplify deployment logic- `chore(ci): update Python version in pip
常见问题
我的分支需要先推送吗?
需要。提交必须位于远程仓库上已存在的分支上,才能创建拉取请求。
每个拉取请求都需要议题吗?
通常需要。技能说明每个拉取请求都必须关闭一个已存在的议题,自动化或维护性更新除外。
如果我没有仓库的写入权限怎么办?
技能会先检查你的访问权限。没有写入权限的贡献者需要关联一个已带有 accepted 标签的议题。
详情
作者的原始描述
Create GitHub pull requests using the gh CLI. Use when the user wants to create a new PR, submit code for review, or open a pull request. Trigger keywords - create PR, pull request, new PR, submit for review, code review.
repo: NVIDIA/OpenShell
热度
- GitHub 星标
- 21k
- 排名
- #10361
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-github-issue
21k帮你的智能体使用 gh 命令行工具和项目模板,为错误、功能请求或任务创建 GitHub 议题。
review-github-pr
21k教你的智能体阅读 GitHub 拉取请求,并用通俗的语言解释其中的修改、关键设计选择和值得注意的代码。
watch-github-actions
21k让你的智能体查看 GitHub Actions 运行情况,持续跟踪直到运行结束,并阅读任何失败作业的日志。
openshell-policy-advisor
21k帮你的智能体在沙盒阻止网络请求时恢复运行:请求一个范围尽量小的权限,并在获得批准后重试。