agentleFS
cisco-opencisco-open/ai-harness-toolkit/skills/create-pull-request-with-reviewers/SKILL.md

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

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
  1. Distinctive:

    Before using this skill, check if any metadata fields are empty strings.

    line 16
  2. Very specific:

    Update the SKILL.md frontmatter with the provided values so they don't need to configure again

    line 20
  3. Distinctive:

    Run this for each file from Step 1 to build per-file reviewer data.

    line 40
  4. Distinctive:

    After user confirms, create the PR with reviewers in one command:

    line 148
  5. Distinctive:

    After creating the PR, display the URL as a clickable hyperlink so the user can easily navigate to it.

    line 162

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Pull Request with Reviewers

Setup

Before using this skill, check if any metadata fields are empty strings. If any are empty:

  1. 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
  2. Update the SKILL.md frontmatter with the provided values so they don't need to configure again

Instructions

  1. Get Changed Files

Get files changed between current branch and main:

git diff --name-only origin/main...HEAD
  1. 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 -10

Run this for each file from Step 1 to build per-file reviewer data.

  1. 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).

  1. Get Current User

Get the current git user to exclude from reviewers:

git config user.name
  1. 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)
  1. 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
  1. 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
  1. 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]
  1. 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>
  1. Display PR Link

After creating the PR, display the URL as a clickable hyperlink so the user can easily navigate to it.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.