Agent skill

Gh PR

by akiojin in 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.

MITAuto-check passedDevelopment

Install Gh PR

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

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

GitHub CLI
$ gh skill install akiojin/unity-cli gh-pr --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 .claude/skills/gh-pr && 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
GitHub stars
107
Token cost
~2.7k tokens
SKILL.md length
1,050 words
Files
2 (incl. references)
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 7 steps: Do not create or switch branches. Always… → Check local working tree state before… → Check for an existing PR for the current… → …
  • The user asks to open/create/edit a PR
  • SKILL.md covers Overview, Decision rules (must follow), Post-merge commit check… and PR title rules (must follow), plus 6 more sections
  • Calls git, gh and jq

What it does

Gh PR is an agent skill from 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. Use when the user asks to open/create/edit a PR, generate a PR body/template, or says 'PRを出して/PR作成/gh pr'. Defaults: base=develop, head=current branch (same-branch only; never create/switch branches).

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/pr-body-template.md`).

It sits in Development, covering Pull requests. 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

  • The user asks to open/create/edit a PR
  • Generate a PR body/template
  • Says PRを出して/PR作成/gh pr

Example prompts

  • “PRを出して/PR作成/gh pr”
  • “/gh-pr”

Workflow steps

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

  1. Do not create or switch branches. Always use the current branch as the PR head.
  2. Check local working tree state before push/PR operations.
  3. Check for an existing PR for the current head branch.
  4. If no PR exists → create a new PR.
  5. If any PR exists and is NOT merged (mergedAt is null) → push only and finish (do not create a new PR).
  6. If all PRs for the head are merged → check for post-merge commits (see below).
  7. If multiple PRs exist for the head → use the most recently updated PR for reporting, but the create vs push decision is based on mergedAt.

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
    • gh
    • jq

    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

Gh PR loads about 2.7k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 1,050 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

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). 1,050 words, ~2,698 tokens.

Download SKILL.mdSave it as .claude/skills/gh-pr/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
gh-pr
description
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. Use when the user asks to open/create/edit a PR, generate a PR body/template, or says 'PRを出して/PR作成/gh pr'. Defaults: base=develop, head=current branch (same-branch only; never create/switch branches).

GH PR

Overview

Create or update GitHub Pull Requests with the gh CLI using a detailed body template and strict same-branch rules.

Decision rules (must follow)

  1. Do not create or switch branches. Always use the current branch as the PR head.
  2. Check local working tree state before push/PR operations.
    • git status --porcelain
    • If output is non-empty (tracked or untracked changes), pause and ask the user what to do.
    • Present 3 options: continue as-is, abort, or manual cleanup then rerun.
    • Do not run git stash, git commit, or git clean automatically unless explicitly requested.
  3. Check for an existing PR for the current head branch.
    • gh pr list --head <head> --state all --json number,state,mergedAt,updatedAt,url,title,mergeCommit
  4. If no PR exists → create a new PR.
  5. If any PR exists and is NOT merged (mergedAt is null) → push only and finish (do not create a new PR).
    • This applies to OPEN or CLOSED (unmerged) PRs.
    • Only update title/body/labels if the user explicitly requests changes.
  6. If all PRs for the head are merged → check for post-merge commits (see below).
  7. If multiple PRs exist for the head → use the most recently updated PR for reporting, but the create vs push decision is based on mergedAt.

Post-merge commit check (critical)

When all PRs for the head branch are merged, you must check whether there are new commits after the merge:

  1. Get the merge commit SHA of the most recent merged PR.
  2. Count commits after the merge: git rev-list --count <merge_commit>..HEAD
  3. Decision:
    • If new commits exist → create a new PR (these changes are not in the base branch)
    • If no new commits → report "No changes since last merge" and finish (do not create an empty PR)
Why this matters
  • Scenario A: PR merged → user makes local changes → pushes → changes are NOT in the merged PR
    • Without this check, the changes would be lost or require manual intervention
  • Scenario B: PR merged → user says "create PR" without new changes → would create empty/duplicate PR
    • This check prevents unnecessary PR creation

PR title rules (must follow)

  1. Format: <type>(<scope>): <subject> — Conventional Commits 形式に準拠する。
  2. type: feat / fix / docs / chore / refactor / test / ci / perf のいずれか。
  3. scope: 省略可。変更の影響範囲を端的に示す(例: gui, core, pty)。
  4. subject: 70文字以内。命令形(imperative mood)で書く(例: "add …" / "fix …")。先頭大文字禁止、末尾ピリオド禁止。
  5. ブランチ名にプレフィックス(feat/, fix/ など)がある場合、タイトルの type と一致させる。

PR body rules (must follow)

Section classification
SectionRequiredNotes
SummaryYES1-3 bullet points。"what" と "why" を両方含める
ChangesYESファイル/モジュール単位で変更内容を列挙
TestingYES実行したコマンドまたは手動テスト手順を具体的に記載
Closing IssuesYESCloses #N または None のみ。gwt-spec issues may appear in Closing Issues for release PRs
Related Issues / LinksYES参照用の Issue番号、SPEC、または "None" を明記
ChecklistYES全項目を確認してチェック/N-A を付ける
ContextConditional3ファイル以上の変更、または非自明な変更理由がある場合は必須
Risk / ImpactConditional破壊的変更・パフォーマンス影響・ロールバック手順がある場合は必須
ScreenshotsConditionalUI 変更がある場合のみ必須
DeploymentOptionalデプロイ手順がある場合のみ記載
NotesOptionalレビュアーへの補足がある場合のみ記載
Validation (agent must check before creating PR)
  1. Required セクションに TODO が残っていたら PR を作成してはならない。
  2. Conditional セクションが該当しない場合は、セクション自体を削除する(空の TODO を残さない)。
  3. Summary の各 bullet は 1文で完結 させる。曖昧な表現("いくつかの変更", "various fixes")を禁止する。
  4. Changes は 変更ファイルまたはモジュール名を含む 具体的な記述にする。
  5. Testing は 再現可能な手順 を書く("テスト済み" のような曖昧な記述を禁止)。
  6. Closing Issues は Closes #123 または None のみを許可する。bare #123 は禁止する。
  7. gwt-spec issues may appear in Closing Issues for release PRs when they should auto-close on release. develop PR で Related Issues / Links にだけ置かれた gwt-spec も release tooling が release PR の Closing Issues に昇格する。通常 Issue は Related Issues / Links にだけ置いた場合、参照専用として扱う。
  8. Checklist の未チェック項目には理由コメントを付ける(例: - [ ] Docs updated — N/A: no user-facing change)。
  9. Related Issues は #123 形式または URL で記載する。該当なしの場合は "None" と明記する。

Issue/PR Comment Formatting (must follow)

  • Final comment text must not contain escaped newline literals such as \n.
  • Use real line breaks in comment bodies. Do not rely on escaped sequences for formatting.
  • Before posting, verify the final body does not accidentally include escaped control sequences (\n, \t).
  • If a raw escape sequence must be shown for explanation, include it only inside a fenced code block and clarify it is intentional.
Show full SKILL.md (421 more words)Show less

Issue Progress Comment Template (required for issue-based work)

When work is tracked in GitHub Issues, progress updates must use this template:

markdown
Progress
- ...

Done
- ...

Next
- ...
  • Post updates at least when starting work, after meaningful progress, and when blocked/unblocked.
  • In Next, explicitly state blockers or the immediate next action.
  1. Confirm repo + branches

    • Repo root: git rev-parse --show-toplevel
    • Current branch (head): git rev-parse --abbrev-ref HEAD
    • Base branch defaults to develop unless user specifies.
  2. Check local working tree state (preflight)

    • Run git status --porcelain.
    • If empty, continue.
    • If non-empty, show detected files and ask the user to choose:
      • Continue as-is
      • Abort
      • Manual cleanup first (git commit / git stash / git clean) and rerun
    • Proceed only when the user explicitly chooses continue.
  3. Fetch latest remote state

    • git fetch origin to ensure accurate comparison
  4. Check existing PR for head branch

    • Use decision rules above to pick action.
    • Treat mergedAt as the source of truth for "merged".
  5. If all PRs are merged, perform post-merge commit check

    • Get merge commit: gh pr list --head <head> --state merged --json mergeCommit -q '.[0].mergeCommit.oid'
    • Count new commits: git rev-list --count <merge_commit>..HEAD
    • If 0 → finish with message "No new changes since merge"
    • If >0 → proceed to create new PR
  6. Ensure the head branch is pushed

    • If no upstream: git push -u origin <head>
    • Otherwise: git push
  7. Collect PR inputs (for new PR or explicit update)

    • Title, Summary, Context, Changes, Testing, Closing Issues, Risk/Impact, Deployment, Screenshots, Related Links, Notes
    • Optional: labels, reviewers, assignees, draft
  8. Build PR body from template

  • Read the template from the gh-pr skill path (not the current project path):
    • GH_PR_SKILL_DIR="${GH_PR_SKILL_DIR:-$HOME/.codex/skills/gh-pr}"
    • PR_BODY_TEMPLATE="${GH_PR_SKILL_DIR}/references/pr-body-template.md"
  • Read ${PR_BODY_TEMPLATE} and fill all required placeholders.
  • Conditional セクションが該当しない場合はセクションごと削除する。
  • テンプレート内の <!-- GUIDE: ... --> コメントは最終出力から削除する。
  • Required セクションに TODO が残っている場合は PR を作成せず、ユーザーに不足情報を確認する。
  • Closing Issues は Closes #N か None のみを許可する。release PR で auto-close したい gwt-spec は Closing Issues に記載する。develop PR の Related Issues にある gwt-spec は release tooling で Closing Issues に昇格される。
  1. Create or update the PR

    • Create: gh pr create -B <base> -H <head> --title "<title>" --body-file <file>
    • Update (only if user asked): gh pr edit <number> --title "<title>" --body-file <file>
  2. Return PR URL

  • gh pr view <number> --json url -q .url
  1. Post-PR CI/merge check (automatic).
  • After PR creation or push, load github/skills/gh-fix-ci/SKILL.md and follow its workflow to inspect CI status, merge state, and review feedback.
  • If all CI checks are still pending, poll (30s interval) until complete.
  • If conflicts, review issues, or CI failures are detected, proceed with the gh-fix-ci workflow to diagnose and fix.

Command snippets (bash)

bash
head=$(git rev-parse --abbrev-ref HEAD)
base=develop
GH_PR_SKILL_DIR="${GH_PR_SKILL_DIR:-$HOME/.codex/skills/gh-pr}"
PR_BODY_TEMPLATE="${GH_PR_SKILL_DIR}/references/pr-body-template.md"

if [ ! -f "$PR_BODY_TEMPLATE" ]; then
  echo "PR template not found: $PR_BODY_TEMPLATE" >&2
  exit 1
fi

# Preflight: local working tree state
status_lines=$(git status --porcelain)
if [ -n "$status_lines" ] && [ "${ALLOW_DIRTY_WORKTREE:-0}" != "1" ]; then
  echo "Detected local uncommitted/untracked changes:" >&2
  echo "$status_lines" >&2
  echo "Choose one before continuing: continue as-is, abort, or manual cleanup then rerun." >&2
  echo "Set ALLOW_DIRTY_WORKTREE=1 only after explicit user confirmation to continue." >&2
  exit 1
fi

# Fetch latest remote state
git fetch origin

# Check existing PRs for the head branch
pr_json=$(gh pr list --head "$head" --state all --json number,state,mergedAt,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
  action=create
elif [ "$unmerged_count" -gt 0 ]; then
  action=push_only
else
  # All PRs are merged - check for post-merge commits
  merge_commit=$(echo "$pr_json" | jq -r 'sort_by(.mergedAt) | last | .mergeCommit.oid')

  if [ -n "$merge_commit" ] && [ "$merge_commit" != "null" ]; then
    new_commits=$(git rev-list --count "$merge_commit"..HEAD 2>/dev/null || echo "0")

    if [ "$new_commits" -gt 0 ]; then
      echo "Found $new_commits commit(s) after merge - creating new PR"
      action=create
    else
      echo "No new commits since merge - nothing to do"
      action=none
    fi
  else
    # Fallback: check against base branch
    new_commits=$(git rev-list --count "origin/$base"..HEAD 2>/dev/null || echo "0")

    if [ "$new_commits" -gt 0 ]; then
      action=create
    else
      action=none
    fi
  fi
fi

# Execute action
case "$action" in
  create)
    cp "$PR_BODY_TEMPLATE" /tmp/pr-body.md

    git push -u origin "$head"
    gh pr create -B "$base" -H "$head" --title "..." --body-file /tmp/pr-body.md
    ;;
  push_only)
    echo "Existing unmerged PR found - pushing changes only"
    git push
    gh pr list --head "$head" --state open --json url -q '.[0].url'
    ;;
  none)
    echo "No action needed - no new changes since last merge"
    ;;
esac

References

  • ${GH_PR_SKILL_DIR}/references/pr-body-template.md: PR body template

© 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

SKILL.md and 1 other file (references) in .agents/skills/gh-pr of akiojin/unity-cli.

  • SKILL.md
  • references/pr-body-template.md

Open the folder on GitHubat commit 7f45d7a

Compare with similar skills

Gh PR 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 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gh PR this skillakiojin/unity-cli107—~2.7kAutomated safety check: PassMIT
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
PR Review State Fetchprisma/orm48k—~767Automated safety check: PassApache-2.0
Creating Description For Gh PRredis/jedis12k—~838Automated safety check: PassMIT

Similar skills

  • 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
  • Official

    Fetches a pull request's canonical review state as JSON, validates it, and renders markdown, a text summary and triage target files from it using bundled scripts.

    48k GitHub stars~767 tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Generate a clear, concise GitHub PR title and description from the diff between two local git branches, and save it to prDescription.md in the repo root.

    12k GitHub stars~838 tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a pull request for the current branch using the repo's template, a work item ID in the title and a description filled in from the actual diff.

    61k GitHub stars~824 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from akiojin/unity-cli

All 28 skills in this repo
  • Gh Skills Sync

    akiojin/unity-cli

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

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

    akiojin/unity-cli

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

    107 GitHub stars~1.6k tokensUpdated 4 days ago
    Auto-check passed
  • Unity Addressables

    akiojin/unity-cli

    Manage Unity Addressables groups and content with unity-cli.

    107 GitHub stars~700 tokensUpdated 4 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.

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

    akiojin/unity-cli

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

    107 GitHub stars~1.4k tokensUpdated 4 days ago
    Auto-check passed
  • Unity Csharp Edit

    akiojin/unity-cli

    Implement, fix, and refactor Unity C code with unity-cli write tools.

    107 GitHub stars~979 tokensUpdated 4 days ago
    Auto-check passed

Works with

Categories

Questions about Gh PR

What does Gh PR do?

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. Gh PR is an agent skill from 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.

When should I use Gh PR?

Gh PR fits situations like: the user asks to open/create/edit a PR; generate a PR body/template; says PRを出して/PR作成/gh pr.

How do I install Gh PR in Claude Code?

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

How do I install Gh PR in Codex?

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

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

What does Gh PR need to run?

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

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

Gh PR 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 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. Its references folder adds about 829 tokens, read only when the agent opens those files.

What are the alternatives to Gh PR?

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

Who maintains Gh PR?

akiojin (a GitHub user) maintains it in akiojin/unity-cli, which has 107 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 5, 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.