create-pr

create-pr is a command for Claude Code from desplega-ai/agent-swarm. It costs 19 tokens per session (1,021 once invoked), scanned A, original, MIT.

A command that opens a GitHub pull request or GitLab merge request from your current branch. It checks the repository, runs required pre-request checks, pushes the branch, and writes the request text.

In plain words
What is it for?
Use it when your code is ready to propose merging into another branch, usually main. It supports an optional target branch and detects whether the repository uses GitHub or GitLab.
Why use it?
It removes the repetitive work of checking your branch, running project checks, pushing changes, and preparing a request summary. It stops before opening the request if required checks fail.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the agent-swarm plugin — 30 skills, 11 commands, 5 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it when your code is ready to propose merging into another branch, usually main. It supports an optional target branch and detects whether the repository uses GitHub or GitLab.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/desplega-ai/agent-swarm/create-pr
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.

Clone the repo
git clone --depth 1 https://github.com/desplega-ai/agent-swarm

Made for: Claude Code.

Or install agent-swarm, the plugin that ships this one along with the rest of its 30 skills, 11 commands, 5 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/desplega-ai/agent-swarm/create-pr/github.svg)](https://agentmods.dev/commands/desplega-ai/agent-swarm/create-pr)
Your own site
<a href="https://agentmods.dev/commands/desplega-ai/agent-swarm/create-pr"><img src="https://agentmods.dev/badge/commands/desplega-ai/agent-swarm/create-pr/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for create-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/desplega-ai/agent-swarm/create-pr"><img src="https://agentmods.dev/badge/commands/desplega-ai/agent-swarm/create-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,021 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00019 $0.01021
Opus 5.5 $0.00008 $0.00408
Sonnet 5.5 $0.00004 $0.00204
Haiku 4.5 $0.00002 $0.00102

Measured 13d ago against content hash ea2470d201e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

create-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 13d 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.

plugin/commands/create-pr.md · 46 lines

How it starts

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

Create Pull Request / Merge Request

Create a PR (GitHub) or MR (GitLab) from the current branch with an auto-generated title and description.

Provider detection: Check the remote URL:

  • If github.com → use gh CLI
  • If gitlab.com or gitlab. → use glab CLI

Arguments

  • base-branch (optional): Branch to merge into (defaults to main or repo default)

Prerequisites

You should be working in a repository cloned to /workspace/personal/<repo-name>.

Workflow

  1. Verify state — confirm you're in a git repo, not on main/master, and have commits to push.
  2. Run PR checks (MANDATORY) — Run ALL checks listed in the "PR Checks" section of your Repository Guidelines. Run each command/task sequentially. If ANY check fails, fix the issue and re-run until all pass. If no guidelines are defined, check the project's CLAUDE.md for a pre-PR checklist and run those. Do NOT proceed until all checks pass.
  3. Push the branch — git push -u origin HEAD
  4. Gather context — review commit messages and changed files since diverging from base.
  5. Generate title and description. Follow the conventions of the repository you are working in, not a fixed format:
    • Title: Concise summary (conventional commit style if the repo uses it)
    • Description: If the repo has a PR/MR template, use its headings as the structure and fill every section. GitHub looks for pull_request_template.md in .github/, docs/, or the repo root (plus an optional PULL_REQUEST_TEMPLATE/ directory), and falls back to the org's .github repo. GitLab uses .gitlab/merge_request_templates/. Also follow any PR rules in the repo's CLAUDE.md, AGENTS.md, or CONTRIBUTING.md. If the repo defines none, include: summary of changes, notable items, testing done, related issues.
    • Show the change, do not narrate it. Aim for about 250 prose words; code blocks, mermaid, tables and <details> do not count. No file-by-file changelog: that belongs in your task output.
    • Review map: build it from git diff --stat <base>...HEAD. One row per area, biggest risk first, with (+N/-M), a depth (🔍 deep, 👀 skim, ⏭ skip for tests and generated files) and what could break.
    • Change outline: 1 or 2 views of the shape of the change. Pseudocode with +/- lines for logic, mermaid for flow, a tree with paths on the nodes for structure.
    • Swarm provenance (when you run in the swarm): fill it from your task context. Link the task ($APP_URL/tasks/<taskId>) and its tree ($APP_URL/sessions/<rootTaskId>), the Slack permalink of the ask if the task came from Slack, any workflow run, and the plan or research as an agent-fs share-create link plus its durable live.agent-fs.dev path. These auth-gated links go in this section only.
    • Media: images and mp4s as GitHub user attachments (github-attach skill), docs as agent-fs share-create links. Never a presigned agent-fs URL for docs or videos.
  6. Create the PR/MR using gh pr create or glab mr create. gh pr create --body does not apply the repo template, so write the filled description to a file and pass it with --body-file <file>.
  7. Check CI status — After creating the PR, wait ~30 seconds, then check CI with gh pr checks <pr-number> (GitHub) or glab mr view --json pipelines (GitLab). If any check is failing, investigate the failure, fix it, push the fix, and re-check. Repeat until CI is green.
  8. Report the PR/MR URL and CI status.

Read the full file on GitHub · 46 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. 13d ago Changed · +6 lines ea2470d201e6
  2. 26d ago Changed 6bd228870975
  3. 1mo ago First seen · 40 lines · 19 tokens per session scan A cd55ee31c8f3

Subscribe to this mod's changes

create-pr is a command published in the GitHub repository desplega-ai/agent-swarm (910 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 1,021 once invoked, about $0.0001 per session on Opus 5.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.