create-pull-request-with-reviewers
Skill13 starsChanged 7 months agoApache-2.0View on GitHub
Create a pull request with automatically recommended reviewers based on git history. Use this skill when the user wants to create a PR with reviewers, open a pull request, or submit changes for review with the right people assigned.
- Commits and pushes
In this repository8 other files it gives its agents.
- ai-harness-setupSkill
- ai-native-assessmentSkill
- code-reviewSkill
- commit-and-push-changesSkill
- gh-pr-comment-resolutionSkill
- pr-follow-upSkill
- python-best-practicesSkill
- reflect-on-changesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Before using this skill, check if any metadata fields are empty strings.
- Very specific: line 20
Update the SKILL.md frontmatter with the provided values so they don't need to configure again
- Distinctive: line 40
Run this for each file from Step 1 to build per-file reviewer data.
- Distinctive: line 148
After user confirms, create the PR with reviewers in one command:
- Distinctive: line 162
After creating the PR, display the URL as a clickable hyperlink so the user can easily navigate to it.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Pull Request with Reviewers
Setup
Before using this skill, check if any metadata fields are empty strings. If any are empty:
- Prompt the user to provide the missing values (only prompt for fields that are empty):
repository: GitHub repository in format "org/repo"defaultReviewer: Default reviewer GitHub username to use if no reviewers found
- Update the SKILL.md frontmatter with the provided values so they don't need to configure again
Instructions
- Get Changed Files
Get files changed between current branch and main:
git diff --name-only origin/main...HEAD- Analyze Git History for Reviewers
For each changed file, find contributors with commit counts and recency:
git log --format='%an|%ar' -- <file> | sort | uniq -c | sort -rn | head -10Run this for each file from Step 1 to build per-file reviewer data.
- Get Eligible Collaborators
Get collaborators who can review:
gh api /repos/<metadata.repository>/collaborators --jq '.[].login'Omit generic/service accounts (usernames matching common bot or service-account patterns).
- Get Current User
Get the current git user to exclude from reviewers:
git config user.name- Rank Reviewers
- Match git history contributors with GitHub collaborators
- Exclude the current user (PR author) from recommendations
- Rank by number of commits to the affected files
- Select up to 3 reviewers (default to metadata.defaultReviewer if none found)
- Analyze Changes for PR Content
Understand the changes to generate PR details:
git log main..HEAD --oneline
git diff main...HEAD --stat
git diff main...HEAD- Generate PR Details
Generate PR title using format: JIRA-KEY - Verb + description
Extract Jira keys from commit messages or branch name.
Generate description using this template:
## 🚀 Description, Motivation, and Context
<summary of changes>
## 📖 Issues and Related PRs
- [JIRA-KEY](<metadata.jiraBaseUrl>/browse/JIRA-KEY)
## 🌮 Required Items Complete:
- [ ] Unit tests written
- [ ] Integration tests written
- [ ] Coverage verified
- [ ] Functionally tested
- [ ] Deployable to production
- [ ] Uses feature flags
- [ ] README updated
- [ ] Build passes- Present for Confirmation
Present both the PR details and reviewer recommendations:
🚀 **Ready to Create PR**
**Title:** EADL-1234 - Add circuit breaker retry logic
**Description:**
## 🚀 Description, Motivation, and Context
Adds circuit breaker pattern with configurable retry logic for LLM calls.
## 📖 Issues and Related PRs
- [EADL-1234](<metadata.jiraBaseUrl>/browse/EADL-1234)
---
🎯 **Recommended Reviewers (based on git history):**
**alice** (3/3 files, 33 total commits)
| File | Commits | Last Active |
|------|---------|-------------|
| circuit.py | 23 | 1 week ago |
| llm_factory.py | 6 | 1 month ago |
| test_circuit.py | 4 | 3 months ago |
**bob** (2/3 files, 23 total commits)
| File | Commits | Last Active |
|------|---------|-------------|
| llm_factory.py | 15 | 3 weeks ago |
| circuit.py | 8 | 2 months ago |
**carol** (1/3 files, 12 total commits)
| File | Commits | Last Active |
|------|---------|-------------|
| test_circuit.py | 12 | 2 weeks ago |
---
Create PR with these reviewers? [Y/n]- Create PR with Reviewers
After user confirms, create the PR with reviewers in one command:
gh pr create \
--repo <metadata.repository> \
--base main \
--head "$(git branch --show-current)" \
--title "TITLE" \
--body "BODY" \
--reviewer <reviewer1>,<reviewer2>,<reviewer3>- Display PR Link
After creating the PR, display the URL as a clickable hyperlink so the user can easily navigate to it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

