revert-pr

revert-pr is a command for Claude Code from openshift-eng/ai-helpers. It costs 13 tokens per session (1,536 once invoked), scanned A, original, Apache-2.0.

A command for undoing a merged GitHub pull request that is breaking continuous integration or nightly builds. It creates a revert branch and pull request, then prepares CI override commands where needed.

In plain words
What is it for?
Use it with a merged pull-request URL and JIRA ticket to create the revert pull request in the required format.
Why use it?
It provides a quick, traceable way to restore failing CI or blocked nightly builds while the original change is investigated and fixed.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Part of the ci plugin — 37 skills, 21 commands, 2 agents shipped together

Good fit Use it with a merged pull-request URL and JIRA ticket to create the revert pull request in the required format.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/openshift-eng/ai-helpers/revert-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/openshift-eng/ai-helpers

Made for: Claude Code.

Or install ci, the plugin that ships this one along with the rest of its 37 skills, 21 commands, 2 agents.

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 revert-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/openshift-eng/ai-helpers/revert-pr/github.svg)](https://agentmods.dev/commands/openshift-eng/ai-helpers/revert-pr)
Your own site
<a href="https://agentmods.dev/commands/openshift-eng/ai-helpers/revert-pr"><img src="https://agentmods.dev/badge/commands/openshift-eng/ai-helpers/revert-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 revert-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/openshift-eng/ai-helpers/revert-pr"><img src="https://agentmods.dev/badge/commands/openshift-eng/ai-helpers/revert-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 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,536 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.00013 $0.01536
Opus 5.5 $0.00005 $0.00614
Sonnet 5.5 $0.00003 $0.00307
Haiku 4.5 $0.00001 $0.00154

Measured 3mo ago against content hash 96ec47c4cc1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

revert-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 3mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • revert-pr — 94% identical, 6 lines differ
plugins/ci/commands/revert-pr.md · 129 lines

How it starts

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

Name

ci:revert-pr

Synopsis

/ci:revert-pr <pr-url> <jira-ticket>

Description

The ci:revert-pr command reverts a merged pull request that is breaking CI or nightly payloads. It follows the OpenShift quick-revert policy to restore CI signal.

This command:

  • Extracts the original PR details (title, author, merge commit SHA, base branch)
  • Ensures the user has a fork of the repository
  • Creates a revert branch and performs git revert -m1 of the merge commit
  • Pushes the revert branch to the user's fork
  • Creates a revert PR using the Revertomatic template format
  • Generates a list of CI override commands (/override) for jobs that may need to be bypassed on the revert PR

This command is useful when:

  • A merged PR is causing CI job failures
  • Nightly payloads are blocked by a breaking change
  • Quick reversion is needed to restore CI signal while the original author fixes the issue

Implementation

  1. Parse Arguments: Extract the PR URL, JIRA ticket, and flags

    • PR URL format: https://github.com/{owner}/{repo}/pull/{number}
    • JIRA ticket: e.g., TRT-1234 or OCPBUGS-56789
    • If the user provides additional context about why the revert is needed, capture it for the PR body
    • If the user provides verification details (jobs to run before unrevert), capture those too
  2. Gather Context: Use the JIRA ticket to automatically determine what broke and what needs verification

    • Look up the JIRA ticket using the fetch-jira-issue skill (plugins/ci/skills/fetch-jira-issue/fetch_jira_issue.py) with --format json
    • Extract context from the JIRA issue: Use the issue summary, description, and comments to determine:
      • What broke: Which CI jobs or payloads are failing (e.g., "e2e-aws jobs failing on 4.18 nightly payload")
      • Verification jobs: Which jobs should pass before the original change can be re-landed (e.g., "e2e-aws, e2e-gcp")
    • Compose the context for the revert PR body from the JIRA issue details. Include links to failing jobs or payloads if mentioned in the ticket.
    • Fall back to asking the user only if:
      • The JIRA lookup fails (token not set, network error, ticket not found)
      • The JIRA issue doesn't contain enough information to determine what broke or which jobs to verify
    • If the user provided additional context as inline arguments, combine it with the JIRA-derived context

Read the full file on GitHub · 129 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. 3mo ago First seen · 129 lines · 13 tokens per session scan A 96ec47c4cc1d

Subscribe to this mod's changes

revert-pr is a command published in the GitHub repository openshift-eng/ai-helpers (123 stars, last pushed 4d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,536 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.

Related

revert-pr compared with commands from other repositories

revert-pr next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
revert-propenshift-eng/ai-helpersCommand1234d agoApache-2.0A13Claude Code
AGENTSmax-sixty/worktrunkCommand13ktodayApache-2.0A0Claude Code
barista-fixfrappe/frappe-uiCommand1.1ktodayMITA17Claude Code
fix-issueyonatangross/orchestkitCommand312todayMITA54Claude Code, Cursor
unbloatathola/claude-night-marketCommand358yesterdayMITA27Claude Code
fix-issueintellegix/intellegix-code-agent-toolkitCommand577d agoMITA0Claude Code
fix-issuefltman/project-scaffolderCommand911mo agoMITA0Claude Code