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>.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Revert Rca Loop?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mattbutlerengineering-revert-rca-loop)
---
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.