Skip to content
Back to skills

Revert Rca Loop

ASecurity

Run the revert root-cause analysis for a reverted PR: delegates to scripts/revert-rca.mjs. Use when a revert merged and no RCA issue exists. Invoke with /revert-rca-loop <PR>.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 22, 2026
developmentrustgobashnodegit

Works with

  • cli

Security analysis

A100/100

Scanned November 20, 2026

npx -y skills add mattbutlerengineering/mattbutlerengineering --skill revert-rca-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Revert Rca Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Revert Rca Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattbutlerengineering-revert-rca-loop/badge)](https://www.skillsdirectory.com/skills/mattbutlerengineering-revert-rca-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: revert-rca-loop
description: "Run the revert root-cause analysis for a reverted PR: delegates to scripts/revert-rca.mjs. Use when a revert merged and no RCA issue exists. Invoke with /revert-rca-loop <PR>."
user-invocable: true
---

# Revert RCA Loop

Files a Root Cause Analysis task when a merged PR has been reverted. All logic lives in `scripts/revert-rca.mjs`; this skill is only the manual entry point.

## Usage

```bash
node scripts/revert-rca.mjs --pr <N>   # N = the ORIGINAL (reverted) PR number
```

The script independently re-derives the merged revert PR and sha for `<N>` (never trusting a caller-supplied sha, #3583), classifies the original PR as agent-authored by label (`has-pr`), bot author, or branch prefix (`agent-`, `worktree-agent-`), de-duplicates against an existing RCA issue, and files the RCA issue. Reflections land in `.claude/reflections/RCA-PR-<N>.md`. Needs `GITHUB_TOKEN` and a built `@mbe/gh-client` (`pnpm build --filter @mbe/gh-client...`).

## What covers what

| Path                                    | Trigger                | Covers                                                                                                     |
| --------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------- |
| `.github/workflows/revert-watchdog.yml` | push to main breaks CI | Opens the revert PR titled `revert: #N (fixes broken main)` plus a broken-main issue; files no RCA itself. |
| This skill (manual)                     | `/revert-rca-loop <N>` | Running the script for any merged `revert: #N` PR; no workflow files an RCA automatically.                 |

The PR _title_ is what the script matches (`revert:` prefix, `#N` in the title); the squash commit subject (`Revert "..." (#5960)`) is irrelevant. GitHub's default `Revert "..."` PR titles from the UI button do not match, so such a revert gets no RCA until the PR is retitled `revert: #N ...`. The script files an RCA for non-agent PRs too (the agent check only logs).

The retired `revert-rca-detection.yml` (hourly, gated on a `Generated by @mbe/agent-core` PR-body marker nobody emits, case-sensitive `^Revert` grep) covered nothing and was removed.

## Next steps after an RCA

1. Fix the root cause or file a follow-up issue if systemic.
2. Add the pattern to `.claude/rules/gotchas.md` or the relevant skill.
3. Add a regression test.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.