Agent skill

Gh PR Check

by akiojin in akiojin/unity-cli

Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch.

MITAuto-check passedGame Development

Install Gh PR Check

skills CLI
$ npx skills add akiojin/unity-cli --skill gh-pr-check -a claude-code

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

GitHub CLI
$ gh skill install akiojin/unity-cli gh-pr-check --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/akiojin/unity-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/gh-pr-check .claude/skills/gh-pr-check && 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
gh-pr-check
GitHub stars
108
Token cost
~2.4k tokens
SKILL.md length
530 words
Files
1
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch.

  • Works in 7 steps: Resolve repository, head branch, and… → Optionally collect local working tree… → Fetch latest remote refs before comparing → …
  • Game Development work in your project
  • SKILL.md covers Overview, Decision rules (must follow), Output contract and Workflow (recommended), plus 2 more sections
  • Calls git, jq and gh; reaches github.com

What it does

Gh PR Check is an agent skill from akiojin/unity-cli. Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch.

Its SKILL.md is about 2.4k 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 Game Development. It works with GitHub and Git. The repository describes itself as: Rust CLI for Unity Editor automation over Unity TCP protocol. The licence is MIT.

When your agent uses it

  • Game Development work in your project

Example prompts

  • “/gh-pr-check”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Resolve repository, head branch, and base branch.
  2. Optionally collect local working tree state
  3. Fetch latest remote refs before comparing
  4. List PRs for head branch
  5. Classify
  6. Post-merge commit check (critical when all PRs are merged)
  7. Fallback when merge commit SHA is missing or not an ancestor of HEAD

What it can do on your machine

Read from SKILL.md and the folder at commit 7f45d7a. 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
    • jq
    • gh

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    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

Gh PR Check loads about 2.4k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 530 words of instructions outside code blocks.

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

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 akiojin/unity-cli at commit 7f45d7a, republished under its MIT licence (© akiojin). 530 words, ~2,396 tokens.

Download SKILL.mdSave it as .claude/skills/gh-pr-check/SKILL.md (or your agent's skills folder).
name
gh-pr-check
description
Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch.

GH PR Check

Overview

Check PR status for the current branch with gh and report a recommended next action.

This skill is check-only:

  • Do not create/switch branches
  • Do not push
  • Do not create/edit PRs

Decision rules (must follow)

  1. Resolve repository, head branch, and base branch.
    • head: current branch (git rev-parse --abbrev-ref HEAD)
    • base: default develop unless user specifies
  2. Optionally collect local working tree state:
    • git status --porcelain
    • Report as context only; do not mutate files.
  3. Fetch latest remote refs before comparing:
    • git fetch origin
  4. List PRs for head branch:
    • gh pr list --head <head> --state all --json
    • number,state,mergedAt,updatedAt,url,title,mergeCommit,baseRefName,headRefName
  5. Classify:
    • No PR found -> NO_PR + recommended action CREATE_PR
    • Any PR where mergedAt == null -> UNMERGED_PR_EXISTS + recommended action PUSH_ONLY
    • All PRs merged -> perform post-merge commit check
  6. Post-merge commit check (critical when all PRs are merged):
    • Select latest merged PR by mergedAt
    • Get merge commit SHA from mergeCommit.oid
    • Verify merge commit ancestry before counting:
      • git merge-base --is-ancestor <merge_commit> HEAD
    • If merge commit is ancestor of HEAD, count commits after merge:
      • git rev-list --count <merge_commit>..HEAD
    • If count > 0 -> ALL_MERGED_WITH_NEW_COMMITS + CREATE_PR
    • If count == 0 -> ALL_MERGED_NO_NEW_COMMITS + NO_ACTION
  7. Fallback when merge commit SHA is missing or not an ancestor of HEAD:
    • First compare against branch upstream (preferred):
      • git rev-list --count origin/<head>..HEAD
    • Count > 0 -> ALL_MERGED_WITH_NEW_COMMITS + CREATE_PR (fallback)
    • Count == 0 -> ALL_MERGED_NO_NEW_COMMITS + NO_ACTION (fallback)
    • If upstream comparison fails, compare against base:
      • git rev-list --count origin/<base>..HEAD
    • If base comparison fails -> CHECK_FAILED + MANUAL_CHECK

Output contract

Return a human-readable summary by default.

Do not return raw JSON as the default output. If JSON is explicitly requested by the user, append it after the human summary.

Recommended status values:

  • NO_PR
  • UNMERGED_PR_EXISTS
  • ALL_MERGED_WITH_NEW_COMMITS
  • ALL_MERGED_NO_NEW_COMMITS
  • CHECK_FAILED

Recommended action values:

  • CREATE_PR
  • PUSH_ONLY
  • NO_ACTION
  • MANUAL_CHECK
Language rule
  • Follow the user's input language for all headings and messages.
  • If the language is ambiguous, use English.
Show full SKILL.md (268 more words)Show less
Default output template

Output 1-3 lines using a signal prefix + action keyword on line 1.

PrefixActionMeaning
>>CREATE PRCreate a new PR
>PUSH ONLYPush to existing PR
--NO ACTIONNothing to do
!!MANUAL CHECKManual check required

Per-status format:

  • NO_PR: >> CREATE PR — No PR exists for <head> -> <base>.

  • UNMERGED_PR_EXISTS (2 lines):

    text
    > PUSH ONLY — Unmerged PR open for `<head>`.
       PR: #<number> <url>
  • ALL_MERGED_WITH_NEW_COMMITS (2 lines):

    text
    >> CREATE PR — <N> new commit(s) after last merge (#<pr_number>).
       head: <head> -> base: <base>
  • ALL_MERGED_NO_NEW_COMMITS: -- NO ACTION — All PRs merged, no new commits on <head>.

  • CHECK_FAILED (2 lines):

    text
    !! MANUAL CHECK — Could not determine PR status.
       Reason: <reason>
       head: <head> -> base: <base>

Append the following line only when the worktree is dirty:

text
   (!) Worktree has uncommitted changes.
Status-to-action mapping (must use)
StatusPrefixActionTemplate
NO_PR>>CREATE PRNo PR exists
UNMERGED_PR_EXISTS>PUSH ONLYUnmerged PR open
ALL_MERGED_WITH_NEW_COMMITS>>CREATE PRN new commit(s)
ALL_MERGED_NO_NEW_COMMITS--NO ACTIONAll PRs merged
CHECK_FAILED!!MANUAL CHECKCould not determine
Example outputs

NO_PR:

text
>> CREATE PR — No PR exists for `feature/my-branch` -> `develop`.

UNMERGED_PR_EXISTS:

text
> PUSH ONLY — Unmerged PR open for `feature/my-branch`.
   PR: #456 https://github.com/org/repo/pull/456

ALL_MERGED_WITH_NEW_COMMITS:

text
>> CREATE PR — 3 new commit(s) after last merge (#123).
   head: feature/my-branch -> base: develop

ALL_MERGED_NO_NEW_COMMITS:

text
-- NO ACTION — All PRs merged, no new commits on `feature/my-branch`.

CHECK_FAILED:

text
!! MANUAL CHECK — Could not determine PR status.
   Reason: Could not resolve merge commit and fallback comparison failed
   head: feature/my-branch -> base: develop

With dirty worktree (appended to any status):

text
>> CREATE PR — 3 new commit(s) after last merge (#123).
   head: feature/my-branch -> base: develop
   (!) Worktree has uncommitted changes.
  1. Verify repo context:
    • git rev-parse --show-toplevel
    • git rev-parse --abbrev-ref HEAD
  2. Confirm auth:
    • gh auth status
  3. Collect context:
    • git status --porcelain
    • git fetch origin
  4. List PRs for head branch and classify using rules above.
  5. When all PRs are merged, validate merge commit ancestry before counting commits.
  6. If merge commit is not usable, fallback to origin/<head>..HEAD first.
  7. Print human-readable result using the default template.
  8. Append JSON only if the user explicitly asks for machine-readable output.

Command snippet (bash)

bash
head="${HEAD_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}"
base="${BASE_BRANCH:-develop}"

dirty=0
if [ -n "$(git status --porcelain)" ]; then
  dirty=1
fi

git fetch origin

pr_json="$(gh pr list --head "$head" --state all --json number,state,mergedAt,updatedAt,url,title,mergeCommit)"
pr_count="$(echo "$pr_json" | jq 'length')"
unmerged_count="$(echo "$pr_json" | jq 'map(select(.mergedAt == null)) | length')"

if [ "$pr_count" -eq 0 ]; then
  status="NO_PR"
  action="CREATE_PR"
  reason="No PR found for head branch"
elif [ "$unmerged_count" -gt 0 ]; then
  status="UNMERGED_PR_EXISTS"
  action="PUSH_ONLY"
  reason="At least one PR for the head branch is not merged"
else
  merge_commit="$(echo "$pr_json" | jq -r 'sort_by(.mergedAt) | last | .mergeCommit.oid')"
  merge_commit_ancestor=0
  if [ -n "$merge_commit" ] && [ "$merge_commit" != "null" ] && \
     git merge-base --is-ancestor "$merge_commit" HEAD 2>/dev/null; then
    merge_commit_ancestor=1
    new_commits="$(
      git rev-list --count "$merge_commit"..HEAD 2>/dev/null || echo ""
    )"
  else
    new_commits=""
  fi

  if [ -n "$new_commits" ]; then
    if [ "$new_commits" -gt 0 ]; then
      status="ALL_MERGED_WITH_NEW_COMMITS"
      action="CREATE_PR"
      reason="$new_commits commits found after last merge"
    else
      status="ALL_MERGED_NO_NEW_COMMITS"
      action="NO_ACTION"
      reason="No commits found after last merge"
    fi
  else
    upstream_commits="$(
      git rev-list --count "origin/$head"..HEAD 2>/dev/null || echo ""
    )"
    if [ -n "$upstream_commits" ]; then
      if [ "$upstream_commits" -gt 0 ]; then
        status="ALL_MERGED_WITH_NEW_COMMITS"
        action="CREATE_PR"
        reason="Fallback check found commits ahead of origin/$head"
      else
        status="ALL_MERGED_NO_NEW_COMMITS"
        action="NO_ACTION"
        reason="Fallback check found no commits ahead of origin/$head"
      fi
    else
    fallback_commits="$(
      git rev-list --count "origin/$base"..HEAD 2>/dev/null || echo ""
    )"
    if [ -n "$fallback_commits" ]; then
      if [ "$fallback_commits" -gt 0 ]; then
        status="ALL_MERGED_WITH_NEW_COMMITS"
        action="CREATE_PR"
        reason="Fallback check found commits ahead of origin/$base"
      else
        status="ALL_MERGED_NO_NEW_COMMITS"
        action="NO_ACTION"
        reason="Fallback check found no commits ahead of origin/$base"
      fi
    else
      status="CHECK_FAILED"
      action="MANUAL_CHECK"
      reason="Could not resolve merge commit and fallback comparison failed"
    fi
    fi
  fi
fi

latest_merged_pr="$(
  echo "$pr_json" \
    | jq -r 'sort_by(.mergedAt) | last | .number // empty'
)"
unmerged_pr="$(
  echo "$pr_json" \
    | jq -r 'map(select(.mergedAt == null)) | first | .number // empty'
)"
unmerged_pr_url="$(
  echo "$pr_json" \
    | jq -r 'map(select(.mergedAt == null)) | first | .url // empty'
)"

case "$status" in
  NO_PR)
    echo ">> CREATE PR — No PR exists for \`$head\` -> \`$base\`."
    ;;
  UNMERGED_PR_EXISTS)
    echo "> PUSH ONLY — Unmerged PR open for \`$head\`."
    echo "   PR: #$unmerged_pr $unmerged_pr_url"
    ;;
  ALL_MERGED_WITH_NEW_COMMITS)
    n="${new_commits:-$upstream_commits}"
    echo ">> CREATE PR — $n new commit(s) after last merge (#$latest_merged_pr)."
    echo "   head: $head -> base: $base"
    ;;
  ALL_MERGED_NO_NEW_COMMITS)
    echo "-- NO ACTION — All PRs merged, no new commits on \`$head\`."
    ;;
  *)
    echo "!! MANUAL CHECK — Could not determine PR status."
    echo "   Reason: $reason"
    echo "   head: $head -> base: $base"
    ;;
esac

if [ "$dirty" -eq 1 ]; then
  echo "   (!) Worktree has uncommitted changes."
fi
  • gh-pr: creates/updates PRs
  • gh-pr-check: inspects PR status only

© akiojin, MIT. 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/gh-pr-check of akiojin/unity-cli.

Open the folder on GitHubat commit 7f45d7a

Compare with similar skills

Gh PR Check 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.

Gh PR Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gh PR Check this skillakiojin/unity-cli108—~2.4kAutomated safety check: PassMIT
ReleaseBloom-Engine/engine135—~1.4kAutomated safety check: NotesMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Pull Request Title and Body Writeropeninterpreter/openinterpreter69k2 repos~1.1kAutomated safety check: PassApache-2.0
Draft Release Notesjamiepine/voicebox57k—~941Automated safety check: PassMIT

Similar skills

  • Release

    Bloom-Engine/engine

    Cut a new Bloom Engine release — bump package.json if requested, commit, tag, push, create GitHub Release, and watch the gated release pipeline

    135 GitHub stars~1.4k tokensUpdated 29 days ago
    Game DevelopmentAuto-check: notes
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Pull Request Title and Body Writer

    openinterpreter/openinterpreter

    Rewrites the title and body of one or more pull requests with gh, leading with why the change was made, then what changed, and describing only the net result.

    69k GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Draft Release Notes

    jamiepine/voicebox

    Writes or refreshes the Unreleased section of CHANGELOG.md as a themed narrative built from the commits, PRs and diff since the last version tag.

    57k GitHub stars~941 tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Runs a spec-driven workflow from PRD to epic to GitHub issues to parallel agents, with status, standup and blocked-work reports from bundled scripts.

    8.4k GitHub stars~1.1k tokensUpdated 6 mo ago
    Product & Project ManagementAuto-check passed

More from akiojin/unity-cli

All 28 skills in this repo
  • Gh PR

    akiojin/unity-cli

    Create or update GitHub Pull Requests with the gh CLI, including deciding whether to create a new PR or only push based on existing PR merge status.

    108 GitHub stars~2.7k tokensUpdated 2 days ago
    Auto-check passed
  • Gh Skills Sync

    akiojin/unity-cli

    Sync the gh- automation skills from the upstream skills repository into Codex and project skill directories.

    108 GitHub stars~680 tokensUpdated 2 days ago
    Auto-check: notes
  • Unity 2D Sprite Tilemap

    akiojin/unity-cli

    Build and verify a 2D sprite and Tilemap scene with unity-cli.

    108 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Unity Addressables

    akiojin/unity-cli

    Manage Unity Addressables groups and content with unity-cli.

    108 GitHub stars~700 tokensUpdated 2 days ago
    Auto-check passed
  • Unity Asset Management

    akiojin/unity-cli

    Manage Unity assets and import metadata with unity-cli. An agent skill from akiojin/unity-cli.

    108 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Unity Audio Setup

    akiojin/unity-cli

    Configure Unity audio with unity-cli. An agent skill from akiojin/unity-cli.

    108 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Gh PR Check

What does Gh PR Check do?

Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch. Gh PR Check is an agent skill from akiojin/unity-cli. Check GitHub PR status with the gh CLI, including unmerged PR detection and post-merge new-commit detection for the current branch.

When should I use Gh PR Check?

Gh PR Check fits situations like: game Development work in your project.

How do I install Gh PR Check in Claude Code?

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

How do I install Gh PR Check in Codex?

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

Can I use Gh PR Check 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 akiojin/unity-cli --skill gh-pr-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gh-pr-check, .gemini/skills/gh-pr-check, .github/skills/gh-pr-check and .opencode/skills/gh-pr-check in your project.

What does Gh PR Check need to run?

Going by SKILL.md and its folder, Gh PR Check needs the command-line tools its instructions call (git, jq and gh).

Does Gh PR Check access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

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

Gh PR Check is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gh PR Check use?

About 2.4k tokens (SKILL.md is roughly 9.6k 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 Gh PR Check?

Skills that share tags, products or a category with Gh PR Check: Release (Bloom-Engine/engine, 135 stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Create Pull Request (cline/cline, 70k stars) and Pull Request Title and Body Writer (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gh PR Check?

akiojin (a GitHub user) maintains it in akiojin/unity-cli, which has 108 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 9, 2026.

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