Borrowing it
Nothing to install: this file belongs to swarm-ai-research/swarm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/swarm-ai-research/swarm/main/.claude/commands/fix_pr.mdgit clone --depth 1 https://github.com/swarm-ai-research/swarmWrote 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.
[](https://agentmods.dev/commands/swarm-ai-research/swarm/fix_pr)<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/fix_pr"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/fix_pr.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02317 |
| Opus 5 | $0.00000 | $0.01158 |
| Sonnet 5 | $0.00000 | $0.00463 |
| Haiku 4.5 | $0.00000 | $0.00232 |
Grade C, and why
fix_pr scanned grade C 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 8d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- If a `/tmp/fix-pr-*` clone was created, remove it: `rm -rf /tmp/fix-pr-<pr_number>`. How it starts
The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/fix_pr
Multi-mode PR operations: create a PR from local changes, resolve merge conflicts on an existing PR, or run quality gates on an external PR. Consolidates the former /review_external_pr command (now /fix_pr --review).
Usage
/fix_pr [branch-name] # Mode A: create PR from local changes
/fix_pr <pr-number-or-url> [fix|merge] # Mode B: resolve conflicts / merge existing PR
/fix_pr --review <pr-number> # Mode C: run quality gates on a PR
Examples:
/fix_pr(auto-generates branch name from changes)/fix_pr fix/circuit-breaker-reset/fix_pr 239(resolve conflicts on PR #239)/fix_pr https://github.com/swarm-ai-research/swarm/pull/239 merge(resolve conflicts and merge)/fix_pr 239 merge(resolve + merge)/fix_pr --review 220(check out PR, run quality gates, auto-fix, report)
Argument parsing
Parse $ARGUMENTS to extract:
--review: Quality gate review mode (Mode C)- If first non-flag arg is a number or GitHub PR URL → Mode B (conflict resolution)
- Otherwise → Mode A (create PR from local changes)
Mode A: Create PR from Local Changes
Unlike /pr which expects you to describe what changed, this mode is for when you've already made edits and just want to ship them on a clean branch.
Behavior
-
Sanity check:
- Run
git statusto identify modified and untracked files. - If there are no changes, abort with a message.
- Run
-
Identify relevant files:
- Show the user the list of modified/untracked files.
- Ask which files to include if it's ambiguous (e.g. mix of unrelated changes).
- Exclude:
.DS_Store,*.db,.env*,credentials*.
-
Create a clean branch:
- Stash all changes:
git stash push --include-untracked -m "fix_pr: temp stash". - Ensure main is up to date:
git checkout main && git pull origin main(skip if in a session worktree — usegit fetch origin mainand branch fromorigin/maininstead). - Create the feature branch:
git checkout -b <branch-name>(orgit checkout -b <branch-name> origin/mainin a worktree). - Pop the stash:
git stash pop.
- Stash all 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.
- 8d ago First seen · 205 lines · 0 tokens per session scan C f5872774dc34
fix_pr is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,317 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
eval-merge
Use the Read tool to load .skill-compass/{skill-name}/manifest.json. Verify.
speckit.git.feature
Create a feature branch with sequential or timestamp numbering.
speckit.git.commit
Auto-commit changes after a Spec Kit command completes.
speckit.git.validate
Validate current branch follows feature branch naming conventions.
speckit.git.initialize
Initialize a Git repository with an initial commit.
speckit.git.remote
Detect Git remote URL for GitHub integration.