conventional-pull-requests
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConventional Pull Requests
规范式拉取请求(Conventional Pull Requests)
Goal
目标
Create pull requests with:
- a Conventional Commits style title
- a body that follows the repository PR template
- concise, accurate change context derived from the actual diff
创建具备以下特点的拉取请求:
- 符合Conventional Commits风格的标题
- 遵循仓库PR模板的正文内容
- 从实际代码差异中提炼出简洁、准确的变更背景
Workflow
工作流程
- Inspect branch and commit context.
- Run ,
git status --short, and identify the current branch.git log --oneline --decorate -n 20 - Determine the default base branch with .
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name' - Review diff scope with .
git diff --name-status origin/<base>...HEAD
- Run
- Confirm there is meaningful committed work for a PR.
- If there are only uncommitted changes, ask whether to create commits first.
- Find and read the PR template before drafting.
- Check ,
.github/pull_request_template.md, and.github/PULL_REQUEST_TEMPLATE.md..github/PULL_REQUEST_TEMPLATE/*.md
- Check
- Draft a conventional title.
- Format:
<type>[optional-scope]: <description> - Use standard types: ,
feat,fix,docs,refactor,test,chore,build,ci,perf,style.revert - Keep description imperative and specific.
- Format:
- Draft the PR body from the template.
- Fill all required sections with concrete details from the diff.
- Include testing notes and risk notes when relevant.
- Generate a comprehensive PR body with a summary, key changes, architecture benefits if necessary, technical details, and testing information.
- Push the branch if needed.
- Run when the branch has no upstream or local commits are not yet pushed.
git push -u origin <branch>
- Run
- Create the PR with GitHub CLI.
- Use .
gh pr create --base <base> --head <branch> --title "<title>" --body-file <file> - Use only when explicitly requested.
--draft
- Use
- Return the PR URL and a short summary of title/body decisions.
- 检查分支和提交上下文。
- 运行、
git status --short,并确定当前分支。git log --oneline --decorate -n 20 - 通过确定默认基准分支。
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name' - 通过查看代码差异范围。
git diff --name-status origin/<base>...HEAD
- 运行
- 确认存在可用于PR的有效提交工作。
- 如果只有未提交的变更,询问是否先创建提交。
- 在草拟PR前查找并阅读PR模板。
- 检查、
.github/pull_request_template.md和.github/PULL_REQUEST_TEMPLATE.md文件。.github/PULL_REQUEST_TEMPLATE/*.md
- 检查
- 草拟符合规范的标题。
- 格式:
<type>[可选范围]: <描述> - 使用标准类型:、
feat、fix、docs、refactor、test、chore、build、ci、perf、style。revert - 描述部分使用祈使语气且具体明确。
- 格式:
- 根据模板草拟PR正文。
- 用代码差异中的具体细节填充所有必填部分。
- 相关时包含测试说明和风险提示。
- 生成包含摘要、关键变更、架构优势(如有必要)、技术细节和测试信息的完整PR正文。
- 必要时推送分支。
- 当分支没有上游分支或本地提交尚未推送时,运行。
git push -u origin <branch>
- 当分支没有上游分支或本地提交尚未推送时,运行
- 使用GitHub CLI创建PR。
- 使用命令。
gh pr create --base <base> --head <branch> --title "<title>" --body-file <file> - 仅在明确要求时使用参数。
--draft
- 使用命令
- 返回PR链接以及关于标题/正文决策的简短总结。
Rules
规则
- Do not invent changes; use only facts from the branch diff and commits.
- Ask one focused clarification when required template fields cannot be inferred.
- Prefer a small, clear PR description over verbose narrative.
- 不得虚构变更内容;仅使用分支差异和提交中的事实信息。
- 当无法推断必填模板字段时,提出一个聚焦的澄清问题。
- 优先选择简洁清晰的PR描述,而非冗长的叙述。