Agent skill

PR Greenlight

by UniClipboard in UniClipboard/UniClipboard

Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass.

AGPL-3.0Auto-check passedDevelopment

Install PR Greenlight

skills CLI
$ npx skills add UniClipboard/UniClipboard --skill pr-greenlight -a claude-code

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

GitHub CLI
$ gh skill install UniClipboard/UniClipboard pr-greenlight --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/UniClipboard/UniClipboard.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pr-greenlight .claude/skills/pr-greenlight && 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-greenlight
GitHub stars
1.9k
Token cost
~2.7k tokens
SKILL.md length
845 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass.

  • Works in 4 steps: Perceive: Analyze what changed → Reason & Act: Pre-flight checks → Push & Create PR → …
  • Tasks that involve Pull requests
  • SKILL.md covers Purpose, When to trigger, State file and Phase 1 — Perceive: Analyze…, plus 7 more sections
  • Calls git, gh and bun

What it does

PR Greenlight is an agent skill from UniClipboard/UniClipboard. Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass. Replaces the manual chain of preflight → create-pr → babysit-pr.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Pull requests and Autonomous loops. It works with Rust. The repository describes itself as: Real-time clipboard sync across all your devices — local-first, peer-to-peer, and end-to-end encrypted. No account. No cloud dependency. No central server. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Pull requests
  • Tasks that involve Autonomous loops

Example prompts

  • “/pr-greenlight”

Requirements

  • Node.js

Workflow steps

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

  1. Perceive: Analyze what changed
  2. Reason & Act: Pre-flight checks
  3. Push & Create PR
  4. Monitor CI (Agent Loop)

What it can do on your machine

Read from SKILL.md and the folder at commit 19fc8bc. 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
    • gh
    • bun
    • cargo
    • npx
    • node

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

  • Network

    No URLs in SKILL.md. Its commands use git, gh and npx, 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 Greenlight loads about 2.7k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 845 words of instructions outside code blocks.

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

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 UniClipboard/UniClipboard at commit 19fc8bc, republished under its AGPL-3.0 licence (© UniClipboard). 845 words, ~2,694 tokens.

Download SKILL.mdSave it as .claude/skills/pr-greenlight/SKILL.md (or your agent's skills folder).
name
pr-greenlight
description
Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass. Replaces the manual chain of preflight → create-pr → babysit-pr.

pr-greenlight

Purpose

A single Agent Loop that takes uncommitted or committed work on a feature branch all the way to a green PR. It replaces the manual chain of:

  1. (forgotten) local checks → push → CI fails → new session to fix → repeat
  2. $create-pr → wait → $babysit-pr → wait → fix → push → wait

The loop runs: Pre-flight → Auto-fix → Push/PR → Monitor CI → Fix CI → Loop until green.

When to trigger

  • $pr-greenlight - full loop: preflight + create PR + monitor
  • $pr-greenlight preflight - only run local pre-flight checks, no push
  • User says "帮我把这个 PR 搞绿", "run preflight", "pre-flight checks", "搞定 PR"

State file

/tmp/codex-pr-greenlight-state.json:

json
{
  "phase": "preflight|pushed|monitoring",
  "pr_number": null,
  "round": 0,
  "max_rounds": 4,
  "preflight_passed": false,
  "checks_run": [],
  "fixes_applied": [],
  "processed_comment_ids": [],
  "started_at": "ISO timestamp"
}

Lock file: /tmp/codex-pr-greenlight.lock

Phase 1 — Perceive: Analyze what changed

bash
touch /tmp/codex-pr-greenlight.lock

Run in parallel:

bash
git rev-parse --abbrev-ref HEAD
git status --short
git diff main...HEAD --stat
git diff main...HEAD --name-only
git log main..HEAD --format="%h %s"

From the file list, classify what changed into categories:

CategoryDetection pattern
rust*.rs, Cargo.toml, Cargo.lock
frontendsrc/**/*.{ts,tsx,js,jsx,css}, package.json, bun.lockb
api-endpoints*.rs files containing #[utoipa::path] changes
openapischema/openapi.json, files with #[utoipa::path]
docs-sitedocs-site/**
markdown*.md (outside docs-site)
generatedapps/gui/src/api/generated/**

Store the categories in state as change_categories.

Refuse conditions (same as create-pr):

  • On main → refuse
  • git log main..HEAD empty → refuse (nothing to PR)
  • gh auth status fails → ask user to auth

Phase 2 — Reason & Act: Pre-flight checks

Run ONLY the checks relevant to change_categories. Each check follows: run → detect failure → auto-fix → re-run → confirm.

2a — Format (always run)
bash
# Rust format (if rust changed)
cargo fmt --all --check 2>&1
# If fails:
cargo fmt --all
git add -u '*.rs'

# Frontend format (if frontend/markdown/docs changed)
bun run format 2>&1
# Prettier auto-fixes; stage changed files
git add -u
2b — Code generation drift (the #1 CI failure cause)

Only if rust or api-endpoints changed:

bash
# 1. OpenAPI schema
bun run gen:openapi 2>&1
git diff --exit-code schema/openapi.json
# If diff: stage it
git add schema/openapi.json

# 2. API client (if openapi.json changed in step 1 or was already changed)
bun run gen:client 2>&1
git diff --exit-code apps/gui/src/api/generated/
# If diff: stage it
git add apps/gui/src/api/generated/
2c — Lint (scoped to changed files)
bash
# Frontend lint — scope to changed files only (full repo has baseline debt)
CHANGED_TS=$(git diff main...HEAD --name-only --diff-filter=d -- '*.ts' '*.tsx' '*.js' '*.jsx' | head -50)
if [ -n "$CHANGED_TS" ]; then
  bun run lint --fix -- $CHANGED_TS 2>&1
  git add -u
fi
2d — Compilation & type check
bash
# Rust check (if rust changed)
cargo check --workspace --locked 2>&1 | tail -40

# Frontend build = tsc + vite (if frontend changed)
bun run build 2>&1 | tail -40

If either fails, do NOT auto-fix — these are real errors. Report to user with the error output and ask how to proceed.

2e — Tests (if relevant code changed)
bash
# Frontend tests (if frontend changed)
bun run test -- --run 2>&1 | tail -40

# Rust tests are slow — only run focused tests for changed crates
# Detect changed crates from file paths
CHANGED_CRATES=$(git diff main...HEAD --name-only -- 'crates/*/src' 'apps/*/src' 'tools/*/src' | sed 's|.*/\(crates/[^/]*\)/.*|\1|;s|.*/\(apps/[^/]*\)/.*|\1|' | sort -u)
for crate_path in $CHANGED_CRATES; do
  crate_name=$(basename $crate_path)
  cargo test -p $crate_name --lib 2>&1 | tail -20
done
2f — Markdown lint-staged simulation (if markdown changed)
bash
# Only for non-docs-site markdown
CHANGED_MD=$(git diff main...HEAD --name-only --diff-filter=d -- '*.md' ':!docs-site/**' | head -20)
if [ -n "$CHANGED_MD" ]; then
  for f in $CHANGED_MD; do
    node scripts/fix-md-cjk-emphasis.mjs "$f" 2>/dev/null
    npx autocorrect --fix "$f" 2>/dev/null
    npx prettier --write "$f" 2>/dev/null
  done
  git add -u '*.md'
fi
2g — Commit pre-flight fixes

If any files were staged by auto-fix steps:

bash
git diff --cached --stat

If there are staged changes, commit them:

bash
git commit -m "$(cat <<'EOF'
chore: pre-flight auto-fix (format, codegen, lint)
EOF
)"

Update state: preflight_passed = true.

Pre-flight summary

Print a table:

text
Pre-flight results:
  ✓ cargo fmt
  ✓ prettier
  ✓ OpenAPI schema (regenerated, +12 -3)
  ✓ IPC bindings (no drift)
  ✓ API client (regenerated)
  ✓ ESLint (2 auto-fixed)
  ✓ cargo check
  ✓ tsc + vite build
  ✓ vitest (14 passed)
  ✓ cargo test uc-core (23 passed)
  — cargo test uc-daemon (skipped, no changes)

If the user only asked for $pr-greenlight preflight, stop here. Clean up the lock file and report results.

Phase 3 — Push & Create PR

If pre-flight passed, proceed to push and create PR.

Delegate to the create-pr skill logic:

  1. Branch name review (propose rename if needed)
  2. docs-site impact scan
  3. Push and gh pr create

Key points:

  • Follow all create-pr conventions (title format, body format, branch name check)
  • Record the PR number in state

After PR is created, immediately proceed to Phase 4.

Phase 4 — Monitor CI (Agent Loop)

This is the core monitoring loop, similar to babysit-pr but integrated.

4a — Wait for CI to start
bash
# Give CI 30s to register checks
sleep 30
gh pr checks --json name,state,conclusion 2>/dev/null

If no checks have registered, keep the current turn active, wait with the available command/session wait mechanism, and check again. Do not end the task merely because CI has not appeared yet.

4b — Check status
bash
gh pr checks --json name,state,conclusion,link 2>/dev/null

Classify:

  • All passed → go to 4c (check for review comments before declaring victory)
  • Some pending -> continue monitoring in the same turn
  • Some failed → proceed to 4d
4c — Check for bot review comments

Same as babysit-pr Step 2b — check all three GitHub comment endpoints:

bash
BOT_FILTER='select(.user.login | test("coderabbitai|github-actions|codecov"))'

# Inline review comments
gh api repos/UniClipboard/UniClipboard/pulls/<PR>/comments \
  --jq "[.[] | ${BOT_FILTER} | {id, user: .user.login, body, path, line}]"

# Review bodies
gh api repos/UniClipboard/UniClipboard/pulls/<PR>/reviews \
  --jq "[.[] | ${BOT_FILTER} | {id, user: .user.login, body, state}]"

# Issue comments (CodeRabbit walkthrough lives here)
gh api repos/UniClipboard/UniClipboard/issues/<PR>/comments \
  --jq "[.[] | ${BOT_FILTER} | {id, user: .user.login, body: (.body | .[0:2000])}]"

Filter out processed_comment_ids. If zero unprocessed actionable comments AND all checks pass → Success. Clean up.

Show full SKILL.md (354 more words)Show less
4d — Fix failures

For each failed check or new review comment:

  1. Diagnose: Fetch logs (gh run view <run_id> --log-failed | tail -100), read relevant code
  2. Classify:
    • Format/lint failure → auto-fix (same as pre-flight 2a-2c)
    • Code generation drift → re-run gen commands (same as 2b)
    • Compilation error → fix the code
    • Test failure → fix the code
    • CodeRabbit comment → evaluate: must-fix (correctness/security) vs nit (skip)
  3. Fix: Edit files surgically
  4. Validate locally: Run the same check that failed to confirm fix works
  5. Commit and push:
bash
git add <specific files>
git commit -m "$(cat <<'EOF'
fix: address CI feedback (pr-greenlight round N)
EOF
)"
git push

Increment round in state. If round >= max_rounds → clean up with warning.

4e - Loop back

After pushing a fix, prefer gh pr checks --watch --interval 30 and poll its command session in bounded intervals. Re-enter at Phase 4b when the checks finish. Keep the current Codex turn alive and continue reporting useful status while waiting.

Cleanup

On success:

bash
rm -f /tmp/codex-pr-greenlight.lock /tmp/codex-pr-greenlight-state.json
text
✅ PR #<N> is green. All CI checks passed after <round> round(s).
   URL: <pr_url>
   Pre-flight caught: <list of issues auto-fixed before push>
   CI rounds: <N>

On max rounds (4):

bash
rm -f /tmp/codex-pr-greenlight.lock /tmp/codex-pr-greenlight-state.json
text
⚠️ PR #<N> still has failures after 4 rounds. Manual review needed.
   Remaining failures: <list>
   URL: <pr_url>

On timeout (90 min):

bash
rm -f /tmp/codex-pr-greenlight.lock /tmp/codex-pr-greenlight-state.json

Safety guardrails

  • Max 4 rounds of CI fix cycles (round only increments on push)
  • 90-minute hard timeout
  • Lock file prevents re-entrant triggering
  • Never --force push
  • Never amend existing commits
  • If a fix breaks something else (cargo check / tsc fails after edit), revert the fix and report
  • Skip CodeRabbit style nits — only fix correctness/security/performance issues
  • Pre-flight auto-fixes go in a dedicated commit, not mixed with feature work
  • Scoped lint: only lint changed files (repo has baseline ESLint debt)
  • processed_comment_ids prevents duplicate processing

Interaction with existing skills

  • Supersedes manual $create-pr + $babysit-pr chain for the common case
  • $create-pr and $babysit-pr remain available for standalone use
  • If a PR already exists for the branch, skip Phase 3 (push only, no gh pr create)
  • If the user invokes $pr-greenlight preflight, only Phase 1-2 execute (no push, no PR)

Anti-patterns

  • Running all checks regardless of what changed (wastes time on unrelated failures)
  • Auto-fixing compilation errors without understanding them
  • Pushing broken code because "CI will catch it"
  • Running bun run lint on entire repo (33 baseline errors will confuse the loop)
  • Treating cargo fmt failures as real bugs (they're always auto-fixable)
  • Skipping the local validation step after fixing a CI failure (leads to ping-pong)
  • Processing old/already-addressed CodeRabbit comments
  • Applying every CodeRabbit nit blindly

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

Files

Just SKILL.md in .agents/skills/pr-greenlight of UniClipboard/UniClipboard.

Open the folder on GitHubat commit 19fc8bc

Compare with similar skills

PR Greenlight 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 Greenlight compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR Greenlight this skillUniClipboard/UniClipboard1.9k—~2.7kAutomated safety check: PassAGPL-3.0
PR Cyclejaemk/cached2.1k—~4.8kAutomated safety check: NotesMIT
PR Reviewjaemk/self_update961—~1.5kAutomated safety check: NotesMIT
Firewood Reviewava-labs/firewood153—~2.1kAutomated safety check: NotesCustom licence
Planetscale Schema Recommendations Agent Loopplanetscale/skills133—~979Automated safety check: PassMIT
SeekDB Code Reviewoceanbase/seekdb3.1k—~2.1kAutomated safety check: PassApache-2.0

Similar skills

  • PR Cycle

    jaemk/cached

    PR review-and-update cycle — the orchestrator that takes a PR from review to resolved.

    2.1k GitHub stars~4.8k tokensUpdated 8 days ago
    DevelopmentAuto-check: notes
  • PR Review

    jaemk/self_update

    Targeted, read-only review of a PR or checked-out branch. An agent skill from jaemk/self_update.

    961 GitHub stars~1.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Firewood Review

    ava-labs/firewood

    A skill your agent uses when reviewing ava-labs/firewood code changes — pull request or local workspace.

    153 GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check: notes
  • Safely triage PlanetScale schema recommendations and turn them into reviewed branches, migrations, issues, or pull requests without applying production changes.

    133 GitHub stars~979 tokensUpdated today
    DevelopmentAuto-check passed
  • SeekDB Code Review

    oceanbase/seekdb

    Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.

    3.1k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Commit Scope

    Devolutions/IronRDP

    Derive and validate the canonical scope for IronRDP Conventional Commit and pull-request titles.

    3.2k GitHub stars~854 tokensUpdated today
    DevelopmentAuto-check passed

More from UniClipboard/UniClipboard

All 24 skills in this repo
  • Beui

    UniClipboard/UniClipboard

    Pick and install beUI (@beui) animated React components from the shadcn registry.

    1.9k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Create PR

    UniClipboard/UniClipboard

    Push the current branch and open a GitHub pull request against main.

    1.9k GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Design Audit

    UniClipboard/UniClipboard

    定期审计代码库的工程设计问题(高心智复杂度、单一真相源被破坏、catch-all 胖接口、死代码、散落魔法字面量、泄漏抽象、资源生命周期靠环形缓冲)与可优化点,范围限定为自上次审计以来的 git churn,每条发现都落到 file:line 并对照本项目自己的 VISION.md / 各级 AGENTS.md / memory…

    1.9k GitHub stars~554 tokensUpdated today
    Auto-check passed
  • Dual Side Debug

    UniClipboard/UniClipboard

    Inspect uniclipboard logs from BOTH the macOS host and the mounted Windows peer when debugging cross-platform sync, pairing, transfer, or daemon issues.

    1.9k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • E2E Test Thinker

    UniClipboard/UniClipboard

    Analyze the current branch's diff against main and determine which changes are testable via CLI-based end-to-end tests.

    1.9k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • iOS Log Diagnose

    UniClipboard/UniClipboard

    Drive the UniClipboard iOS app in a simulator and read its OSLog yourself to diagnose a mobile-sync bug, instead of asking the user to paste logs.

    1.9k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Questions about PR Greenlight

What does PR Greenlight do?

Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass. PR Greenlight is an agent skill from UniClipboard/UniClipboard. Agent Loop that runs local pre-flight CI checks, auto-fixes issues, creates/pushes the PR, monitors CI, and loops until all checks pass.

When should I use PR Greenlight?

PR Greenlight fits situations like: tasks that involve Pull requests; tasks that involve Autonomous loops.

How do I install PR Greenlight in Claude Code?

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

How do I install PR Greenlight in Codex?

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

Can I use PR Greenlight 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 UniClipboard/UniClipboard --skill pr-greenlight -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-greenlight, .gemini/skills/pr-greenlight, .github/skills/pr-greenlight and .opencode/skills/pr-greenlight in your project.

What does PR Greenlight need to run?

Going by SKILL.md and its folder, PR Greenlight needs the command-line tools its instructions call (git, gh, bun, cargo, npx and node). Our summary lists: Node.js.

Does PR Greenlight access the network?

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

Is PR Greenlight 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 Greenlight use?

PR Greenlight is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PR Greenlight use?

About 2.7k tokens (SKILL.md is roughly 11k 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 Greenlight?

Skills that share tags, products or a category with PR Greenlight: PR Cycle (jaemk/cached, 2.1k stars), PR Review (jaemk/self_update, 961 stars), Firewood Review (ava-labs/firewood, 153 stars) and Planetscale Schema Recommendations Agent Loop (planetscale/skills, 133 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR Greenlight?

UniClipboard (a GitHub organization) maintains it in UniClipboard/UniClipboard, which has 1,860 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 9, 2026.

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