pr

A command that creates a pull request, which is a request to review and merge code into another branch.

In plain words
What is it for?
It is for opening a pull request from the current Git branch after checking its commits, remote, and target branch.
Why use it?
It gathers branch and change information and generates the pull request description, reducing manual preparation.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rileyhilliard/agentrc/pr
Clone the repo
git clone --depth 1 https://github.com/rileyhilliard/agentrc
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 749 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00749
Opus 5 $0.00004 $0.00375
Sonnet 5 $0.00002 $0.00150
Haiku 4.5 $0.00001 $0.00075

Measured 2d ago against content hash e08552d4e2c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

pr scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

**DELEGATION ONLY**: Do NOT run any commands or investigate the codebase yourself. Your only job is to immediately invoke the `ce:haiku` agent via Task tool, passing the prompt template below with `$ARGUMENTS` substitute
.agentrc/commands/pr.md · 94 lines

What it actually says

DELEGATION ONLY: Do NOT run any commands or investigate the codebase yourself. Your only job is to immediately invoke the ce:haiku agent via Task tool, passing the prompt template below with $ARGUMENTS substituted.

Task Prompt for Haiku Agent

Create a pull request for the current branch.

User arguments: $ARGUMENTS
(If provided, use as the base branch. Otherwise, default to main or master.)

**Step 1: Check Prerequisites**
- Run `git status` to check for uncommitted changes
- If there are uncommitted changes, STOP and report: "Please commit your changes first before creating a PR"
- Run `git remote -v` to verify remote exists
- Check if branch is pushed: `git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null`
- If not pushed, push with: `git push -u origin $(git branch --show-current)`

**Step 2: Determine Base Branch**
- If user provided a base branch in arguments, use that
- Otherwise, detect default: check for `main` first, fall back to `master`
- Run: `git rev-parse --verify origin/main 2>/dev/null && echo main || echo master`

**Step 3: Gather Context**
- Get merge base: `BASE_BRANCH=<detected>; MERGE_BASE=$(git merge-base HEAD origin/$BASE_BRANCH)`
- List commits: `git log $MERGE_BASE..HEAD --oneline`
- Get diff stats: `git diff $MERGE_BASE..HEAD --stat`
- Get full diff for analysis: `git diff $MERGE_BASE..HEAD`

**Step 4: Analyze & Generate PR Content**

Follow **The Contributor** persona from `Skill(ce:writer)` for PR conventions.

Analyze the commits and diff to determine:
- The type of change (feat, fix, refactor, docs, etc.)
- The primary purpose/intent of the changes
- Key modifications worth highlighting

Generate a **Title** using conventional format (50 chars max, imperative mood):
- `feat: add user authentication flow`
- `fix: resolve race condition in data sync`
- `refactor: simplify payment processing logic`

Generate a PR **Body** using this template:

<template>

## Summary

[2-3 sentences explaining what this PR does and why]

## Changes

- [Bullet list of key changes]

## Testing

- [ ] Tests added/updated

## Notes

[Any additional context for reviewers, or "None" if not applicable]

</template>

**Step 5: Create the PR**
Execute:
`gh pr create --title "<title>" --body "<body>" --base <base-branch>`

Use a heredoc for the body to preserve formatting:
```bash
gh pr create --title "<title>" --base <base-branch> --body "$(cat <<'EOF'
<body content here>
EOF
)"
```

**Step 6: Report Results**

- Print the PR URL returned by `gh pr create`
- Note any warnings (e.g., draft status, failing checks visible in output)

**Failure Handling**

- If `gh` is not installed: Report "GitHub CLI (gh) is required. Install with: brew install gh"
- If not authenticated: Report "Please authenticate with: gh auth login"
- If PR creation fails: Report the error message from gh
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 94 lines · 8 tokens per session scan B e08552d4e2c2

Subscribe to this mod's changes

pr is a command published in the GitHub repository rileyhilliard/agentrc (3 stars, last pushed 6mo ago), licensed MIT. It adds 8 tokens to every session and 749 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.