跳到正文
Skillpedia
通用编程21k · #10361

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/NVIDIA/OpenShell/blob/main/.agents/skills/create-github-pr/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为我的分支开启拉取请求,并把它关联到它所修复的议题。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会检查 gh 登录状态和仓库的贡献规则,然后通过命令,按项目的描述格式创建拉取请求。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Create GitHub Pull Request

Create pull requests on GitHub using the gh CLI.

Prerequisites

  • The gh CLI 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 in CONTRIBUTING.md for 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:

  1. You're not on main - Never create PRs directly from main:

    # Should NOT be "main"
    git branch --show-current
    
  2. Branch 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 feature
  • fix - Bug fix
  • docs - Documentation only
  • refactor - Code change that neither fixes a bug nor adds a feature
  • test - Adding or updating tests
  • chore - 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 rubrics
  • fix(jobs): handle timeout errors gracefully
  • docs(sdk): update authentication examples
  • refactor(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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能