Agent skill

PR Watch

by SethGammon in SethGammon/Citadel

Local PR watcher. An agent skill from SethGammon/Citadel.

MITAuto-check passedDevelopment

Install PR Watch

skills CLI
$ npx skills add SethGammon/Citadel --skill pr-watch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel pr-watch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pr-watch .claude/skills/pr-watch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pr-watch
GitHub stars
922
Token cost
~2.3k tokens
SKILL.md length
949 words
Files
5
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

Local PR watcher. An agent skill from SethGammon/Citadel.

  • Works in 3 steps: Setup → Watch Loop → Merge Offer
  • Development work in your project
  • SKILL.md covers When to Use, Cloud Alternative, Inputs and Execution Protocol, plus 6 more sections
  • Calls git, node and gh

What it does

PR Watch is an agent skill from SethGammon/Citadel. Local PR watcher. Monitors CI status, automatically fixes failing checks by reading failure logs and applying targeted fixes, then optionally merges when all checks pass. Local CLI analog to Claude Code's cloud auto-fix feature.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `__benchmarks__/ci-watch-and-fix.md`, `__benchmarks__/gh-not-available.md` and `__benchmarks__/no-gh-auth.md`).

It sits in Development. It works with GitHub. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/pr-watch”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Setup
  2. Watch Loop
  3. Merge Offer

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • node
    • gh
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PR Watch loads about 2.3k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 949 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 949 words, ~2,281 tokens.

Download SKILL.mdSave it as .claude/skills/pr-watch/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
pr-watch
description
Local PR watcher. Monitors CI status, automatically fixes failing checks by reading failure logs and applying targeted fixes, then optionally merges when all checks pass. Local CLI analog to Claude Code's cloud auto-fix feature.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
watch pr, watch ci, monitor pr, fix ci, ci failing, pr failing, auto-fix, auto fix pr, pr is red, checks failing
effort
high
last-updated
2026-03-26

/pr-watch — Local PR Auto-fix

You are the PR watcher. You monitor a pull request's CI status, fix failing checks by reading failure logs and applying targeted fixes, and optionally merge when green.

This is the local CLI analog to Claude Code's cloud auto-fix feature. Use it when you want CI watch/fix behavior from the terminal without switching to web or mobile.

When to Use

Don't use when: monitoring local file changes (use /watch); reviewing code quality (use /review); triaging multiple issues at once (use /triage).

  • /pr-watch — watch the PR for the current branch
  • /pr-watch 42 — watch PR #42 specifically
  • After /triage creates a fix PR and you want to stay in the terminal
  • When you don't have the Claude GitHub App installed for cloud auto-fix

Cloud Alternative

If you have the Claude GitHub App installed, use cloud auto-fix in Claude Code web or mobile — it survives machine sleep. Toggle Auto fix ON in the PR view. Use /pr-watch for in-terminal sessions.

In Codex, prefer the native PR review and automation surfaces when they fit:

bash
node scripts/codex-pr-review.js plan --repo <owner/repo> --pr <number> --risk medium --write
node scripts/codex-automation.js plan --type pr-watch --command "/pr-watch <number>" --cadence "every 15 minutes" --write

Use @codex review for GitHub-visible review findings, then keep Citadel responsible for local verification, CI log fixes, merge readiness, and .planning/pr-review/ state.

If .planning/ does not exist, create it before writing PR review or automation state.

When Codex has already reviewed the PR, ingest its review output before polling or merging:

bash
node scripts/codex-review-fetch.js --repo <owner/repo> --pr <number> --write

Use --file <review-comments.json> with the same script when working from exported/offline review data.

Inputs

InputSourceRequired
PR numberArgument (e.g., /pr-watch 42)No — auto-detects from current branch
RepoAuto-detected from git remoteYes (auto)
gh CLI"/c/Program Files/GitHub CLI/gh.exe" on Windows, gh otherwiseYes (auto)

Execution Protocol

Phase 0 — Setup
  1. Detect gh CLI path:
    • Windows: "/c/Program Files/GitHub CLI/gh.exe"
    • Other: gh
    • Store as $GH
  2. Detect repo from git remote get-url origin. Extract owner/repo.
  3. Resolve PR number:
    • If argument provided: use it directly
    • Otherwise: $GH pr view --json number --jq '.number' (PR for current branch)
    • If no PR found: stop. Output: "No PR found for current branch. Create one first or pass a PR number."
  4. Fetch PR details:
    $GH pr view <number> --repo <owner/repo> --json number,title,url,headRefName,baseRefName,state,mergeable
  5. Print watch summary:
    Watching PR #<N>: <title>
    Branch: <head> → <base>
    URL: <url>
  6. Initialize: fix_attempts = 0, max_fix_attempts = 3
Phase 1 — Watch Loop

Repeat until convergence or circuit break:

Step 1.1 — Fetch CI status
$GH pr checks <number> --repo <owner/repo>

Parse the output to identify check names, states (pass, fail, pending), and detail URLs.

Step 1.2 — Evaluate status
ConditionAction
All checks passing→ Phase 2 (offer merge)
Any checks pendingPrint "Waiting for checks... (N pending)". Wait 60 seconds. Loop.
Any checks failed→ Step 1.3 (investigate and fix)
PR closed or mergedExit. Print "PR #<N> is already closed/merged."
Step 1.3 — Fix failing checks

For each failed check:

1. Get the run ID:

$GH run list --repo <owner/repo> --branch <headRefName> --limit 5 \
  --json databaseId,status,conclusion,workflowName

2. Read failure logs:

$GH run view <run-id> --repo <owner/repo> --log-failed

3. Identify failure class and fix strategy:

Failure classSignal in logsFix strategy
TypeScript errorserror TSFix the specific TS errors in named files
Test failuresFAIL, assertion errors, Expected vs ReceivedFix assertion or the code under test
Lint errorsrule names, @typescript-eslint/, eslintFix the specific violations
Build errorsCannot find module, SyntaxError, missing exportsResolve imports, configs
Missing env / secretsundefined, auth failures in setup stepsSurface to user — not fixable from code
Infrastructure failureStep itself failed (e.g., actions/checkout), networkSurface to user — not fixable from code

4. Apply fix:

  • Implement the minimum change to resolve the failing check
  • Do NOT refactor, expand scope, or fix unrelated issues
  • Run the equivalent check locally when possible to verify before pushing

5. Commit and push:

git add <only changed files>
git commit -m "fix: resolve CI failure — <check-name>"
git push

6. Increment fix_attempts++

7. Check circuit breaker:

If fix_attempts >= max_fix_attempts:

Circuit breaker triggered after 3 fix attempts on PR #<N>.

Last failing check: <check-name>
Log excerpt:
<first 25 lines of failure log>

Next steps:
  • Review the failure above and investigate manually
  • Run /pr-watch again after applying a manual fix
  • Open the PR in Claude Code web/mobile and enable "Auto fix" for cloud-based resolution

Exit.

8. Wait 30 seconds for CI to re-trigger. Print "Fix pushed — waiting for CI to re-run...". Loop to Step 1.1.

Show full SKILL.md (341 more words)Show less
Phase 2 — Merge Offer

When all checks pass:

All checks passing on PR #<N>: <title>

Merge options:
  squash   — squash all commits into one (recommended for fix PRs)
  merge    — standard merge commit
  rebase   — rebase commits onto base branch
  skip     — leave the PR open (merge manually)

Ask the user which to do. If they choose a merge strategy:

$GH pr merge <number> --repo <owner/repo> --<squash|merge|rebase> --delete-branch

If they choose skip: exit. The PR is green and ready.

Circuit Breaker Rules

Trigger the circuit breaker and stop the loop when:

  • fix_attempts >= 3 — three attempts without resolving the failure
  • A fix attempt introduces a new failing check that wasn't failing before
  • The failure is in infrastructure (GitHub Actions setup steps, secrets, network) — not fixable from code
  • The failure log is empty or unreadable — can't determine root cause
  • PR is closed or merged by someone else during the watch

Contextual Gates

Disclosure: "Watching PR [#N]. Will notify on CI changes; may push fix commits if auto-fix is enabled." Reversibility: amber — may push fix commits to the PR branch; undo with git revert <commit> on the pushed commits Trust gates:

  • Any: monitor-only mode (observe CI status without pushing)
  • Familiar (5+ sessions): auto-push fixes; novices should run in monitor-only mode and apply fixes manually

Quality Gates

  • Every fix commit is targeted — only changes what's needed to green the check
  • Fix commit messages are clear: fix: resolve CI failure — <check-name>
  • Never force-push — always regular git push
  • Never merge without asking the user first
  • Circuit breaker fires at exactly 3 attempts
  • Infrastructure and secrets failures surface to user immediately, not silently retried

Anti-Patterns — Do NOT

  • Do NOT refactor or improve code while fixing CI — minimum viable fix only
  • Do NOT merge automatically without user confirmation
  • Do NOT retry the same fix approach after it already failed once
  • Do NOT silently swallow infrastructure failures as if they're code bugs
  • Do NOT push to main or master directly — fixes always go to the PR branch

Fringe Cases

  • gh not authenticated: "Run gh auth login and follow the prompts." Exit.
  • PR already merged/closed: "PR #<N> is already closed/merged." Exit cleanly.
  • No CI checks: Note absence; offer to merge if user confirms.
  • gh CLI not installed: Output install instructions (cli.github.com / brew install gh).
  • PR branch deleted: Exit cleanly; note branch is gone and auto-fix is unavailable.

Exit Protocol

---HANDOFF---
- Watched PR #<N>: <title>
- Fix attempts: <count> / 3
- Final status: green | circuit-break | user-exited | already-merged
- Checks resolved: <list of check names that went from failing to passing>
- Checks still failing: <list, if circuit-break>
- Reversibility: amber — fix commits pushed to PR branch; undo with `git revert <commit>` per fix commit
---

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in skills/pr-watch of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/ci-watch-and-fix.md
  • __benchmarks__/gh-not-available.md
  • __benchmarks__/no-gh-auth.md
  • __benchmarks__/no-pr-number.md

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

PR Watch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PR Watch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR Watch this skillSethGammon/Citadel922—~2.3kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Merge Dependabot PRsonyx-dot-app/onyx32k1 repos~2.2kAutomated safety check: PassMIT
Android UI Visual Reviewpermissionlesstech/bitchat-android7.8k—~2.6kAutomated safety check: PassGPL-3.0
Issue Fixmono/SkiaSharp5.6k—~5.1kAutomated safety check: PassMIT
Bug Report TriageOrchestratorInc/agent-orchestrator13k—~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Merge Dependabot PRs

    onyx-dot-app/onyx

    Triages and lands a batch of open Dependabot PRs in the Onyx repo, where main is gated exclusively by GitHub's merge queue: approves and enqueues green PRs, closes superseded duplicates, fixes…

    32k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Android UI Visual Review

    permissionlesstech/bitchat-android

    Analyze an Android pull request, branch, commit, or patch for user-visible changes and produce reproducible before/after screenshots from isolated builds.

    7.8k GitHub stars~2.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Issue Fix

    mono/SkiaSharp

    Fix bugs in SkiaSharp C bindings. An agent skill from mono/SkiaSharp.

    5.6k GitHub stars~5.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Bug Report Triage

    OrchestratorInc/agent-orchestrator

    Helps a reporter describe a bug, searches for duplicates and gathers diagnostic evidence kept separate from a short, human-worded issue draft.

    13k GitHub stars~1.8k tokensUpdated today
    DevelopmentAuto-check passed
  • React Router Bug Fix Workflow

    remix-run/react-router

    Fixes a React Router bug reported in a GitHub issue end to end: fetching the issue, validating the reproduction, writing a failing test and implementing the fix on a new branch.

    57k GitHub stars~1.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 7 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    922 GitHub stars~2.9k tokensUpdated 7 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 7 days ago
    Auto-check passed

Works with

Questions about PR Watch

What does PR Watch do?

Local PR watcher. An agent skill from SethGammon/Citadel. PR Watch is an agent skill from SethGammon/Citadel. Local PR watcher.

When should I use PR Watch?

PR Watch fits situations like: development work in your project.

How do I install PR Watch in Claude Code?

Run `npx skills add SethGammon/Citadel --skill pr-watch -a claude-code`. Or copy the skill folder (skills/pr-watch in SethGammon/Citadel) into .claude/skills/pr-watch in your project. Claude Code loads it when a task matches its description.

How do I install PR Watch in Codex?

Run `npx skills add SethGammon/Citadel --skill pr-watch -a codex`. Or copy the skill folder (skills/pr-watch in SethGammon/Citadel) into .agents/skills/pr-watch in your project. Codex loads it when a task matches its description.

Can I use PR Watch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill pr-watch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr-watch, .gemini/skills/pr-watch, .github/skills/pr-watch and .opencode/skills/pr-watch in your project.

What does PR Watch need to run?

Going by SKILL.md and its folder, PR Watch needs the command-line tools its instructions call (git, node, gh and brew).

Does PR Watch access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is PR Watch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PR Watch use?

PR Watch is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PR Watch use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PR Watch?

Skills that share tags, products or a category with PR Watch: PR Babysitter (openinterpreter/openinterpreter, 69k stars), Merge Dependabot PRs (onyx-dot-app/onyx, 32k stars), Android UI Visual Review (permissionlesstech/bitchat-android, 7.8k stars) and Issue Fix (mono/SkiaSharp, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR Watch?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.