Pr

From Kevin-Liu-01/Agent-Machines · View interactive version

Pr is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Create a pull request using the Dedalus PR template. Injects git state, commit history, and diff stats automatically.

How to use this skill

Skill file

Context (auto-detected from HEAD)

PR Template

Read .github/PULL_REQUEST_TEMPLATE.md and fill every section. The template is mandatory.

Do not free-form the PR body.

Rules

commands instead of HEAD. This is needed when the PR branch lives in a different worktree

or the main repo checkout.

and suggest splitting into stacked PRs

Reviewer Resolution

Before filling the Reviewers section, resolve ownership from CODEOWNERS and git history.

Step 1: CODEOWNERS lookup

Run this to find owners for every changed file:

git diff --name-only upstream/dev..<source-branch> | while read -r file; do
  owner=""
  while IFS= read -r line; do
    line="${line%%#*}"                      # strip comments
    [ -z "$(echo "$line" | tr -d '[:space:]')" ] && continue
    pattern=$(echo "$line" | awk '{print $1}')
    owners=$(echo "$line" | awk '{$1=""; print $0}' | xargs)
    # convert CODEOWNERS glob to regex: /foo/ matches foo/anything, *.rs matches *.rs
    case "$file" in
      ${pattern#/}*) owner="$owners" ;;
    esac
  done < .github/CODEOWNERS
  echo "$owner"
done | tr ' ' '\n' | grep '^@' | sort | uniq -c | sort -rn

The top results are the CODEOWNERS-designated reviewers.

Step 2: blame-based context reviewers

Run this to find who recently touched the changed files (excluding the PR author):

author=$(git config user.name)
git diff --name-only upstream/dev..<source-branch> | head -20 | while read -r file; do
  [ -f "$file" ] && git log --format='%aN' --since='3 months' -- "$file"
done | sort | uniq -c | sort -rn | grep -v "$author" | head -5

Step 3: fill reviewers

Map names to GitHub handles using AGENTS.md:

| Name | Handle |

|------------------|-----------------|

| Windsor Nguyen | @windsornguyen |

| Anny Zhou | @annyzhou |

| Tsion Kergo | @tsiongk |

| Kevin Liu | @Kevin-Liu-01 |

| Aryan Mahajan | @aryanma |

| Shengming Liang | @AgentWings |

| Catherine Di | @cathydi |

| Misty | @super-misty |

and NOT the PR author. If no one qualifies, pick a second CODEOWNERS match.

Task

  1. Determine the source branch: use --branch value if provided, otherwise current HEAD
  2. Gather context by running:
  1. Resolve reviewers per the Reviewer Resolution steps above
  2. Push the branch if needed
  3. Read the PR template
  4. Create the PR with every template section filled, including resolved reviewers
  5. Return the PR URL
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.