pr

A command for opening a GitHub pull request from the current branch. A pull request is a proposed code change that others can review before it is merged.

In plain words
What is it for?
Use it to collect the branch changes, review project context, draft the pull-request title and description, and create the request.
Why use it?
It checks that the branch is not `main` or `master` and that it contains commits that are not yet in the main branch, preventing empty or unsafe requests.

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/fockus/skill-memory-bank/pr
Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 616 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00007 $0.00616
Opus 5 $0.00003 $0.00308
Sonnet 5 $0.00001 $0.00123
Haiku 4.5 $0.00001 $0.00062

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

Security

Grade A, and why

pr scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/pr.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

0. Pre-flight checks

# Must NOT be on main / master
BRANCH=$(git rev-parse --abbrev-ref HEAD)
[ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ] && echo "ERROR: refusing to open PR from $BRANCH" && exit 1

# Must have commits ahead of the integration branch
git fetch origin main 2>/dev/null || git fetch origin master 2>/dev/null
AHEAD=$(git rev-list --count origin/main..HEAD 2>/dev/null || git rev-list --count origin/master..HEAD 2>/dev/null || echo 0)
[ "$AHEAD" = "0" ] && echo "WARN: 0 commits ahead of main — nothing to PR" && exit 1

# Surface which workflows will run against the PR
gh workflow list 2>/dev/null | head -10

If on main / master, stop and tell the user to create a feature branch first. If 0 commits ahead, tell the user there is nothing to PR.

1. Gather context

git diff origin/main --stat         # or origin/master
git log origin/main..HEAD --oneline

Read ./.memory-bank/checklist.md and the active plan (if any) to understand what the PR delivers. If .memory-bank/codebase/ is populated, fold its summaries into the PR body for reviewer orientation.

2. Draft the PR content

  • Title — Conventional Commits format, ≤70 chars. Use $ARGUMENTS if provided.
  • Body — Markdown with:
    • ## Summary — 1-3 bullets on what changed and why
    • ## Test plan — checklist items the reviewer can run
    • ## Codebase context (optional, if .memory-bank/codebase/ is populated) — one line summary pulled from each of STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md (whichever exist); use grep -m1 -v '^#' to get the first non-heading line per file
    • ## Related issuesCloses #N, Refs #M if applicable

3. Show preview → confirm

Print the full title + body as it will appear on GitHub. Ask:

Create PR with this title and body? (y/N)

Default = No. Only proceed on explicit y.

4. Create the PR

gh pr create --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"

5. Show result

Read the full file on GitHub · 65 lines

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 · 65 lines · 7 tokens per session scan A 93d140a53956

Subscribe to this mod's changes

pr is a command published in the GitHub repository fockus/skill-memory-bank (25 stars, last pushed 1mo ago), licensed MIT. It adds 7 tokens to every session and 616 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.