create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNote: If you haveinstalled locally, you should usemcporterto invoke the MCP tool instead of directly calling the MCP tool. ThemcporterCLI provides a more convenient interface and better error handling.mcporter
注意:如果您本地安装了,应使用mcporter调用MCP工具,而非直接调用MCP工具。mcporterCLI提供了更便捷的界面和更完善的错误处理。mcporter
Create PR via Gitee MCP
通过Gitee MCP创建PR
Generate a well-structured Pull Request description based on the current changes and submit it to Gitee.
基于当前变更生成结构清晰的Pull Request描述,并提交至Gitee。
Prerequisites
前提条件
- Gitee MCP Server configured (tools: ,
create_pull,get_file_content,list_repo_issues)compare_branches_tags - User must provide: repository owner, repository name, source branch, target branch (usually main/master)
- Optional: linked Issue number
- 已配置Gitee MCP Server(工具:、
create_pull、get_file_content、list_repo_issues)compare_branches_tags - 用户必须提供:仓库所有者、仓库名称、源分支、目标分支(通常为main/master)
- 可选:关联的Issue编号
Steps
步骤
Step 1: Gather Information
步骤1:收集信息
Confirm with the user or infer from context:
- Source branch (head branch)
- Target branch (base branch, default: master or main)
- Core purpose of this PR (if not stated, infer from commit messages or file changes)
- Whether to link an Issue (optional)
与用户确认或从上下文推断:
- 源分支(head分支)
- 目标分支(base分支,默认:master或main)
- 此PR的核心目的(如果未说明,从提交信息或文件变更中推断)
- 是否关联Issue(可选)
Step 2: Analyze the Changes
步骤2:分析变更
Use to fetch the diff between the source branch and target branch:
compare_branches_tags- : target branch (e.g.,
baseormain)master - : source branch
head
Analyze the returned diff to determine:
- Which core files were changed
- What functionality was added or modified
- Whether there are any breaking changes
使用获取源分支与目标分支之间的差异:
compare_branches_tags- :目标分支(例如:
base或main)master - :源分支
head
分析返回的差异以确定:
- 哪些核心文件被修改
- 添加或修改了哪些功能
- 是否存在破坏性变更
Step 3: Generate PR Title
步骤3:生成PR标题
Follow the Conventional Commits format:
<type>(<scope>): <subject>Available types:
- : New feature
feat - : Bug fix
fix - : Code refactoring
refactor - : Documentation update
docs - : Test-related changes
test - : Build / dependency / toolchain changes
chore
Example:
feat(auth): add OAuth2 login support遵循Conventional Commits格式:
<type>(<scope>): <subject>可用类型:
- :新功能
feat - :修复Bug
fix - :代码重构
refactor - :文档更新
docs - :测试相关变更
test - :构建/依赖/工具链变更
chore
示例:
feat(auth): add OAuth2 login supportStep 4: Generate PR Description
步骤4:生成PR描述
Use the following template for a structured description:
markdown
undefined使用以下模板生成结构化描述:
markdown
undefinedSummary
Summary
[Clear description of the purpose of this PR and the problem it solves]
[Clear description of the purpose of this PR and the problem it solves]
Changes
Changes
- [Change 1]
- [Change 2]
- [Change 3]
- [Change 1]
- [Change 2]
- [Change 3]
Testing
Testing
- Unit tests pass
- Functional tests pass
- [Completed test item]
- Unit tests pass
- Functional tests pass
- [Completed test item]
Related Issue
Related Issue
closes #[issue number] (if applicable)
closes #[issue number] (if applicable)
Notes
Notes
[Breaking changes, dependency upgrades, deployment considerations, etc. (if any)]
undefined[Breaking changes, dependency upgrades, deployment considerations, etc. (if any)]
undefinedStep 5: Create the PR
步骤5:创建PR
Use to create the PR with these parameters:
create_pull- : title generated in Step 3
title - : description generated in Step 4
body - : source branch
head - : target branch
base
After successful creation, output the PR link for the user.
使用工具,传入以下参数创建PR:
create_pull- :步骤3生成的标题
title - :步骤4生成的描述
body - :源分支
head - :目标分支
base
创建成功后,向用户输出PR链接。
Notes
注意事项
- If the user specifies a linked Issue, append to the description so the Issue is automatically closed when the PR is merged
closes #N - Keep the PR title concise (under 50 characters) — put details in the description
- If the user hasn't provided enough information, ask before creating, to avoid opening a PR with an empty description
- 如果用户指定了关联的Issue,在描述中添加,这样PR合并后Issue会自动关闭
closes #N - PR标题需简洁(50字符以内)——详细信息放在描述中
- 如果用户未提供足够信息,创建前先询问,避免创建描述为空的PR