What I do
- Detect the current git branch and repository
- Analyze git commits and code changes compared to the base branch (defaults to
main) - Read and follow the
.github/PULL_REQUEST_TEMPLATE.mdor.github/pull_request_template.mdif it exists - Generate a suggested PR title based on the changes
- Generate a PR description following the template structure (if available)
- Construct and open the GitHub PR comparison URL with pre-filled title and description
When to use me
Use this skill when you're ready to propose a pull request but want AI assistance with:
- Writing a comprehensive PR description
- Following the repository's PR template
- Generating an appropriate PR title
I will NOT actually create or submit the PR - I only open the GitHub page with suggestions so you can review and submit it yourself.
Instructions
Get repository information:
- Run
git remote get-url originto get the repository URL - Parse owner and repo name from the URL
- Get current branch with
git branch --show-current
- Run
Verify branch is pushed to origin:
- Run
git fetch originto ensure remote refs are up to date - Run
git rev-parse --verify origin/<branch>to check if the branch exists on the remote - If the branch is not pushed, notify the user and ask if they want you to push it with
git push -u origin <branch> - Do NOT proceed to open the PR URL until the branch exists on origin
- Run
Check for PR template:
- Look for
.github/PULL_REQUEST_TEMPLATE.mdor.github/pull_request_template.md - If found, read the template file carefully
- Look for
Analyze changes:
- Run
git log main..HEAD --oneline(or appropriate base branch) to see commits - Run
git diff main...HEADto see the actual code changes - Understand what the PR is accomplishing
- Run
Generate PR content:
- Create a concise, descriptive PR title (one line summary)
- Write a PR description:
- If a PR template exists: You MUST follow the template exactly and fill in each section appropriately. If a section does not apply, feel free to omit it.
- If no template exists: Write a description that summarizes what changed and why, includes relevant context from commits and diffs, and uses proper markdown formatting.
Build and open URL:
- Use the bundled script (relative to this skill's base directory) to construct the URL:
<skill-base>/scripts/build-url.sh <owner> <repo> <base> <head> "<title>" "<body>" - The script handles URL-encoding and outputs the full GitHub compare URL
- Open with:
open "$(<skill-base>/scripts/build-url.sh ...)"
- Use the bundled script (relative to this skill's base directory) to construct the URL:
Dependencies
Before generating PR content, load the writing-voice skill and follow its guidelines.
Notes
- If the base branch is not
main, ask the user or try to detect it withgit symbolic-ref refs/remotes/origin/HEAD - Keep the PR title under 72 characters if possible
- Ensure the description is well-formatted markdown
- If there are no commits on the current branch vs base, notify the user
Converted and distributed by TomeVault — claim your Tome and manage your conversions.