| description | Create a pull request with a release note style description, appropriate title, and labels based on the change type. |
|---|
The user input to you can be provided directly by the agent or as a command argument - you MUST consider it before proceeding with the prompt (if not empty).
$ARGUMENTS
Purpose: Create or update a pull request with a release note style description and title, automatically applying the appropriate labels based on the change type specified.
| Type | Icon | Labels | Description |
|---|---|---|---|
| Major | 🌟 | Major |
Breaking changes that affect compatibility |
| Minor | 🚀 | Minor |
New features or enhancements |
| Patch | 🩹 | Patch |
Small fixes or improvements |
| Fix | 🪲 | Fix, Patch |
Bug fixes |
| Docs | 📖 | Docs |
Documentation changes only |
-
Detect repository mode:
- Run
git remote -vto check configured remotes. - If
upstreamremote exists: Fork mode- Use
upstreamowner/repo for all GitHub operations (PRs, Issues, labels) - Use
originfor all git operations (push, fetch)
- Use
- If only
originremote exists: Origin mode- Use
originowner/repo for all operations (both git push and GitHub operations)
- Use
- Parse the URLs to extract owner and repo name:
https://github.com/<owner>/<repository>.git. - If in doubt, ask the user to clarify which repository to target.
- Run
-
Determine the change type:
- Parse the user input to identify the change type (Major, Minor, Patch, Fix, or Docs)
- If nothing is provided, analyze ALL changes in the branch to infer the type:
- Run
git diff origin/main...HEAD --name-onlyto get all changed files in the branch - Read the diff content using
git diff origin/main...HEADto understand the nature of changes - Categorize based on ALL changes combined, not just recent commits:
- Docs: ONLY if ALL changes are to documentation files (*.md, docs/, .github/prompts/, etc.) with no code/functionality changes
- Fix: If changes specifically fix bugs without adding new features
- Patch: Small fixes or improvements that do not add new features
- Minor: New features or enhancements that do not break existing functionality
- Major: Changes that break backward compatibility (e.g., removing public APIs, changing method signatures)
- Important: If the branch contains BOTH code changes AND documentation changes, classify based on the code changes, not the documentation
- Important: Check the entire branch diff, not just uncommitted changes or the last commit
- Run
-
Stage, commit, and push all changes:
- ALWAYS run these commands before creating/updating the PR:
git add .- Stage all changes (tracked and untracked files)- Check if there are staged changes with
git diff --cached --quiet - If there are staged changes, commit with:
git commit -m "Update for PR" git push origin <branch-name>- Push to origin remote (even in fork mode)
- This ensures the PR reflects all local changes
- Get the current branch name for the push command
- ALWAYS run these commands before creating/updating the PR:
-
Retrieve linked issue information (if available):
- Attempt to find the GitHub issue number associated with the current branch
- If found, retrieve the issue title from the target repository (upstream in fork mode, origin otherwise)
- Use the issue title as the PR title (with appropriate icon prefix)
- If no issue is found, ask the user to provide one of the following:
- the number of the issue to link to the PR
- if a new issue should be raised for this PR
- Stop if the user cannot provide either of these.
-
Generate PR title:
- If issue title retrieved: Use format
<Icon> <Issue Title> - Examples:
🚀 Add support for custom module templates🪲 [Fix]: Resolve null reference in parameter validation📖 [Docs]: Update installation guide with prerequisites
- If issue title retrieved: Use format
-
Generate release note style description:
- Start with a concise summary paragraph describing what changes for the user of the code
- Focus on user-facing impact, not implementation details
- Use present tense and active voice
- Structure:
- Leading paragraph: Clear summary of the change and its benefit to users
- If issue linked: Add
- Fixes #<issue-number>after the leading paragraph - Optional additional context: Briefly explain why this change was needed
- What's Changed: Bullet points of key changes (user-facing)
- Keep it concise - this should read like a release note entry
- DO NOT add a title or heading before the leading paragraph
- Avoid implementation details unless necessary for understanding
-
Create or update the pull request:
- Check if PR already exists for this branch in the target repository (upstream in fork mode, origin otherwise)
- If PR exists: Update the title, description, and labels
- If PR does not exist: Create a new PR from your fork's branch to the target repository's default branch
- In fork mode, the PR will be from
<fork-owner>:<branch>to<upstream-owner>:<default-branch> - Set PR to target the default branch (main/master) of the target repository
- Open as a draft PR (or keep as draft if updating)
- Use GitHub MCP tools to perform these operations in the target repository:
# Create PR (if not exists) - owner/repo should be target repository mcp_github_github_create_pull_request # Update PR (if exists) - owner/repo should be target repository mcp_github_github_update_pull_request # Add labels to PR - owner/repo should be target repository mcp_github_github_add_labels_to_issue (PRs are issues in GitHub API)
-
Apply labels to the PR:
- Add the change type label based on the type specified (Major, Minor, Patch, Fix, or Docs)
- For Fix type, add both
FixandPatchlabels - If currently in a feature workflow phase (e.g., Planning, Implementation), also apply that phase label
- Use GitHub MCP to add labels in the target repository (upstream in fork mode, origin otherwise)
-
Confirm completion:
- Display the PR URL to the user
- Summarize the PR title, type, and labels applied
- If in fork mode, remind the user that the PR was created in the upstream repository
Example Usage:
/PR- Create a PR for the current changes/PR Minor- Create a PR for a new feature/PR Fix- Create a PR for a bug fix/PR Docs- Create a PR for documentation changes/PR Major- Create a PR for breaking changes/PR Patch- Create a PR for small improvements
Notes:
- This command always stages all changes (
git add .), commits if needed, and pushes to origin before creating/updating the PR - Changes are always pushed to
originremote - In fork mode, PRs and Issue operations are performed on the
upstreamrepository - In origin mode, all operations use the
originrepository - The PR is always created as a draft to allow for review before marking as ready
- Labels can be manually adjusted after PR creation if needed
- The description should be written from the user's perspective, focusing on impact not implementation