draft-pr

A command that drafts pull-request content in a PR.md file from the current branch and its changes. A pull request is a request to review and merge code into another branch.

In plain words
What is it for?
Use it to prepare a pull-request title and description after committing changes, including checks for the correct branch and available commits.
Why use it?
It collects branch, commit, repository, existing-pull-request, template, and project-style information so the draft matches the work and repository.

Command for Claude Code

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/nyatinte/ccexp/draft-pr
Clone the repo
git clone --depth 1 https://github.com/nyatinte/ccexp

Made for: Claude Code.

Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 581 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.00009 $0.00581
Opus 5 $0.00005 $0.00291
Sonnet 5 $0.00002 $0.00116
Haiku 4.5 $0.00001 $0.00058

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

Security

Grade A, and why

draft-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.

.claude/commands/draft-pr.md · 66 lines

How it starts

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

Draft PR content with the following additional instructions: $ARGUMENTS

Context

  • Current branch: !git branch --show-current
  • Remote tracking: !git status -sb
  • Recent commits on this branch: !git log origin/main..HEAD --oneline
  • Repository info: !gh repo view --json owner,name

Your task

Create a PR draft in PR.md file based on the current branch changes.

Steps

  1. Verify branch status:

    • Ensure current branch is not main/master
    • Check if there are commits to create PR for
    • If no commits or on main branch, inform user and exit
  2. Check for existing PR:

    • Check if PR already exists: gh pr list --head $(git branch --show-current)
    • If PR exists, get current PR details for comparison
  3. Analyze repository PR style:

    • Search for past PRs: gh pr list --state merged --limit 10
    • Analyze recent PRs for:
      • Title format and language
      • Description structure
      • Common patterns
  4. Load PR template:

    • Read .github/PULL_REQUEST_TEMPLATE.md if it exists
    • Use template structure as base
  5. Analyze changes:

    • Get all commit messages: git log origin/main..HEAD --pretty=format:"%s"
    • Get detailed diff if needed: git diff origin/main..HEAD --stat
    • Understand the overall purpose of changes
  6. Create PR.md file:

    • Follow the template structure (Summary, Why, Changes with AS-IS/TO-BE)
    • Write clear title (first line)
    • Write comprehensive description (rest of file)
    • Match the repository's PR language and style
    • Include all relevant context
  7. Show draft to user:

    • Display the created PR.md content
    • Inform user they can edit PR.md before creating the PR
    • Suggest using /create-pr command next

Important Notes

  • DO NOT create the actual PR - only draft the content in PR.md
  • Follow the repository's existing PR style and language
  • Ensure PR.md follows the template format (Summary/Why/Changes)
  • Make the description comprehensive but concise

Read the full file on GitHub · 66 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 · 66 lines · 9 tokens per session scan A f311cd92e824

Subscribe to this mod's changes

draft-pr is a command published in the GitHub repository nyatinte/ccexp (271 stars, last pushed 7d ago), licensed MIT. It adds 9 tokens to every session and 581 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.