git%3Acreate-pr by neolabhq/context-engineering-kit
npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:create-pr本指南解释了如何在我们项目中使用 GitHub CLI 创建拉取请求。
重要提示:所有 PR 标题和描述都应使用英文撰写。
检查 gh 是否已安装,如果未安装,请按照以下说明进行安装:
如果尚未安装 GitHub CLI,请先安装:
brew install gh
# Windows
winget install --id GitHub.cli
# Linux
# 请按照 https://github.com/cli/cli/blob/trunk/docs/install_linux.md 上的说明操作
2. 向 GitHub 进行身份验证:
gh auth login
在创建 PR 之前,请检查是否有未提交的更改:
运行 git status 以检查未提交的更改(已暂存、未暂存或未跟踪的文件)
如果存在未提交的更改,请先使用 Skill 工具运行 命令:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
git:commitSkill: git:commit
这确保在创建 PR 之前,您所有的工作都已提交
首先,按照 @.github/pull_request_template.md 中的模板准备您的 PR 描述
使用 gh pr create --draft 命令创建新的拉取请求:
gh pr create --draft --title "✨(scope): Your descriptive title" --body "Your PR description" --base main
对于需要正确格式的更复杂的 PR 描述,请使用 --body-file 选项并遵循确切的 PR 模板结构:
# 使用正确的模板结构创建 PR
gh pr create --draft --title "✨(scope): Your descriptive title" --body-file .github/pull_request_template.md --base main
语言:PR 标题和描述应始终使用英文
PR 标题格式:使用带有表情符号的约定式提交格式
:sparkles: 这样的代码表示形式)✨(supabase): Add staging remote configuration🐛(auth): Fix login redirect issue📝(readme): Update installation instructions描述模板:始终使用 @.github/pull_request_template.md 中的 PR 模板结构:
模板准确性:确保您的 PR 描述精确遵循模板结构:
pr_agent:summary 和 pr_agent:walkthrough)草稿 PR:当工作仍在进行中时,以草稿形式开始
--draft 标志gh pr ready 转换为可供审查状态始终包含所有模板章节,即使某些章节标记为“N/A”或“None”
以下是一些用于管理 PR 的其他有用的 GitHub CLI 命令:
# 列出您打开的拉取请求
gh pr list --author "@me"
# 检查 PR 状态
gh pr status
# 查看特定的 PR
gh pr view <PR-NUMBER>
# 在本地检出 PR 分支
gh pr checkout <PR-NUMBER>
# 将草稿 PR 转换为可供审查状态
gh pr ready <PR-NUMBER>
# 向 PR 添加审查者
gh pr edit <PR-NUMBER> --add-reviewer username1,username2
# 合并 PR
gh pr merge <PR-NUMBER> --squash
为了简化 PR 创建并保持描述的一致性,您可以创建一个模板文件:
pr-template.md 的文件,其中包含您的 PR 模板gh pr create --draft --title "feat(scope): Your title" --body-file pr-template.md --base main
每周安装量
219
代码库
GitHub 星标数
699
首次出现
2026年2月19日
安装于
opencode211
codex210
github-copilot210
gemini-cli209
kimi-cli207
amp207
This guide explains how to create pull requests using GitHub CLI in our project.
Important : All PR titles and descriptions should be written in English.
Check if gh is installed, if not follow this instruction to install it:
Install GitHub CLI if you haven't already:
brew install gh
# Windows
winget install --id GitHub.cli
# Linux
# Follow instructions at https://github.com/cli/cli/blob/trunk/docs/install_linux.md
2. Authenticate with GitHub:
gh auth login
Before creating a PR, check for uncommitted changes:
Run git status to check for uncommitted changes (staged, unstaged, or untracked files)
If uncommitted changes exist, use the Skill tool to run the git:commit command first:
Skill: git:commit
This ensures all your work is committed before creating the PR
First, prepare your PR description following the template in @.github/pull_request_template.md
Use the gh pr create --draft command to create a new pull request:
gh pr create --draft --title "✨(scope): Your descriptive title" --body "Your PR description" --base main
For more complex PR descriptions with proper formatting, use the --body-file option with the exact PR template structure:
# Create PR with proper template structure
gh pr create --draft --title "✨(scope): Your descriptive title" --body-file .github/pull_request_template.md --base main
Language : Always use English for PR titles and descriptions
PR Title Format : Use conventional commit format with emojis
:sparkles:)✨(supabase): Add staging remote configuration🐛(auth): Fix login redirect issue📝(readme): Update installation instructionsDescription Template : Always use our PR template structure from @.github/pull_request_template.md:
Template Accuracy : Ensure your PR description precisely follows the template structure:
pr_agent:summary and )Always include all template sections, even if some are marked as "N/A" or "None"
Here are some additional useful GitHub CLI commands for managing PRs:
# List your open pull requests
gh pr list --author "@me"
# Check PR status
gh pr status
# View a specific PR
gh pr view <PR-NUMBER>
# Check out a PR branch locally
gh pr checkout <PR-NUMBER>
# Convert a draft PR to ready for review
gh pr ready <PR-NUMBER>
# Add reviewers to a PR
gh pr edit <PR-NUMBER> --add-reviewer username1,username2
# Merge a PR
gh pr merge <PR-NUMBER> --squash
To simplify PR creation with consistent descriptions, you can create a template file:
pr-template.md with your PR templategh pr create --draft --title "feat(scope): Your title" --body-file pr-template.md --base main
Weekly Installs
219
Repository
GitHub Stars
699
First Seen
Feb 19, 2026
Installed on
opencode211
codex210
github-copilot210
gemini-cli209
kimi-cli207
amp207
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装
pr_agent:walkthroughDraft PRs : Start as draft when the work is in progress
--draft flag in the commandgh pr ready