create-pr
Note: If you have
mcporterinstalled 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.
Create PR via Gitee MCP
Generate a well-structured Pull Request description based on the current changes and submit it to 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
Steps
Step 1: Gather Information
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)
Step 2: Analyze the Changes
Use compare_branches_tags to fetch the diff between the source branch and target branch:
base: target branch (e.g.,mainormaster)head: source branch
Analyze the returned diff to determine:
- Which core files were changed
- What functionality was added or modified
- Whether there are any breaking changes
Step 3: Generate PR Title
Follow the Conventional Commits format:
<type>(<scope>): <subject>
Available types:
feat: New featurefix: Bug fixrefactor: Code refactoringdocs: Documentation updatetest: Test-related changeschore: Build / dependency / toolchain changes
Example: feat(auth): add OAuth2 login support
Step 4: Generate PR Description
Use the following template for a structured description:
## Summary
[Clear description of the purpose of this PR and the problem it solves]
## Changes
- [Change 1]
- [Change 2]
- [Change 3]
## Testing
- [ ] Unit tests pass
- [ ] Functional tests pass
- [x] [Completed test item]
## Related Issue
closes #[issue number] (if applicable)
## Notes
[Breaking changes, dependency upgrades, deployment considerations, etc. (if any)]
Step 5: Create the PR
Use create_pull to create the PR with these parameters:
title: title generated in Step 3body: description generated in Step 4head: source branchbase: target branch
After successful creation, output the PR link for the user.
Notes
- If the user specifies a linked Issue, append
closes #Nto the description so the Issue is automatically closed when the PR is merged - 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
More from oschina/gitee-agent-skills
repo-explorer
Use this skill when the user asks to explore a repository, get familiar with a project, "repo explorer", "tell me about this repo", "repo-explorer", "what does this repository do", or wants an overview of a Gitee repository. Requires Gitee MCP Server to be configured.
75daily-digest
Use this skill when the user asks for a daily summary, today's to-dos, "what's on my plate today", "daily digest", "daily-digest", "show my notifications", "pending PRs and issues". Requires Gitee MCP Server to be configured.
72review-pr
Use this skill when the user asks to review a PR, do a code review, check a pull request, "review this PR", "review-pr", or "look at this pull request". Requires Gitee MCP Server to be configured.
65close-issue-flow
Use this skill when the user asks to close an issue, wrap up an issue, "close issue", "close-issue-flow", or finish up after a fix has been merged. Requires Gitee MCP Server to be configured.
58search-and-fork
Use this skill when the user asks to search for and fork an open source repository, "find me an open source project", "search and fork", "search-and-fork", "find a similar project on Gitee", or "fork a repository". Requires Gitee MCP Server to be configured.
57merge-pr-check
Use this skill when the user asks to merge a PR, check if a PR is ready to merge, "merge PR", "can this PR be merged", "merge-pr-check". Requires Gitee MCP Server to be configured.
47