CommunityCoding & Developmentgithub.com

github

GitHub CLI for issues, PRs, CI/check logs, comments, reviews, releases, repos, and gh api queries.

What is github?

github is a Claude Code agent skill that gitHub CLI for issues, PRs, CI/check logs, comments, reviews, releases, repos, and gh api queries.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/github

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does github do?

Use gh for GitHub. Use git for local commits/branches/push/pull. Use code-reading tools for deep reviews.

Auth

gh auth status
gh auth login

Gateway HOME can differ from operator HOME. If gh auth exists elsewhere, set GH_CONFIG_DIR in the gateway service env and restart.

PRs

gh pr list --repo owner/repo --json number,title,state,author,url
gh pr view 55 --repo owner/repo --json title,body,author,files,commits,reviews,reviewDecision
gh pr checks 55 --repo owner/repo
gh pr diff 55 --repo owner/repo
gh pr create --repo owner/repo --title "feat: title" --body-file /tmp/pr.md

When creating or refreshing a PR body, append this final footer only when the Runtime line supplies sessionUrl=<exact-url>. Replace <sessionUrl> with that URL verbatim; do not construct or modify it. sessionUrl is supplied only for an explicitly public session. Omit the footer when it is absent; never substitute a private chat URL or enable sharing to obtain one. Preserve any publication marker before exactly one footer, and keep the footer final:

---
[View the OpenClaw team session](https://raw.githubusercontent.com/clawdbot/clawdbot/main/<sessionUrl>)

URLs work directly: gh pr view https://github.com/owner/repo/pull/55.

Async merges

Use the repository's native landing workflow when provided. For authorized programmatic merges elsewhere, use GitHub's async merge API through gh api; gh pr merge does not select this API. Supply the reviewed head SHA, preserve required reviews/checks, and check stack membership first: submitting a stacked PR also merges or queues its open downstack PRs, which need their own review and authorization.

gh api -H 'X-Octopool-Require: merge-async-v1' \
  --method PUT repos/owner/repo/pulls/55/merge-async \
  -H 'X-GitHub-Api-Version: 2026-03-10' \
  -f sha=REVIEWED_HEAD_SHA -f merge_method=squash -f merge_action=direct_merge
gh api -H 'X-Octopool-Require: merge-async-v1' \
  repos/owner/repo/pulls/55/merge-async/REQUEST_UUID \
  -H 'X-GitHub-Api-Version: 2026-03-10' -H 'Cache-Control: max-age=0'

Keep the Octopool guard header first after api. Protected older wrappers reject it before they can rewrite merge authority; use an Octopool build containing the async guard if it is refused. The supported wrapper preserves SHA/method/action/bypass and only rewrites commit text. Native gh can pass the header through. Do not remove it, disable policy, or select a raw binary to work around a rejection.

Retain details.uuid from a 202 response before polling. pending means wait; merged includes details.sha, which still needs final PR/head verification. enqueued means queued, not merged: monitor the PR itself. To honor a configured queue, use merge_action=default (or merge_queue to explicitly enqueue), omitting direct-only method/title/message fields. Never enable bypass_rules without authorization.

On failed, report details.message. A 409 identifies an existing request; inspect its UUID and options without resubmitting. Lost replies, polling errors, and result expiry after 24 hours require reconciliation, never a blind retry or synchronous fallback. Poll with bounded waits and fresh reads. Async processing does not arm auto-merge for unmet checks; use the native workflow or gh pr merge --auto when that behavior is authorized.

Landing ownership

When the user asks to land or merge a PR, the terminal outcome is the PR's verified GitHub state, not the end of a review, worker turn, or CI observation.

  • Keep the job active until gh pr view ... --json state,mergedAt,mergeCommit proves state is MERGED.
  • Treat review findings, merge conflicts, failed checks, and requested changes as continuation work when they are in scope. Patch them, rerun the required gates, and re-evaluate the exact updated head.
  • A pending check is a wait state, not completion. Use the repository's supported wait or merge workflow; do not claim success from partial green checks.
  • If work was delegated to a persistent session and that run stops before merge, continue the same session rather than treating its report as the final result.
  • Stop as blocked only when continuing requires new authority, unavailable credentials, or a product decision that cannot be inferred safely. Report the exact blocker and leave the PR unmerged.

Issues

gh issue list --repo owner/repo --state open --json number,title,labels,url
gh issue view 42 --repo owner/repo --json title,body,comments,labels,state
gh issue create --repo owner/repo --title "Bug: ..." --body-file /tmp/issue.md
gh issue comment 42 --repo owner/repo --body-file /tmp/comment.md
gh issue close 42 --repo owner/repo --comment "Fixed in ..."

CI/runs

gh run list --repo owner/repo --limit 10
gh run view <run-id> --repo owner/repo --json status,conclusion,headSha,url
gh run view <run-id> --repo owner/repo --log-failed
gh run rerun <run-id> --repo owner/repo --failed

Wait for CI

Run the waiter below as a single background exec (background: true, timeoutSeconds above the expected CI time). When its running result says the exit wakes this conversation, end the turn: the wake carries the exit code and the output tail. Otherwise, collect it with process poll. Do not start a second waiter for the same checks. Polling loops and one-shot automations cost a model turn per check (#199122).

Pin the commit you pushed. A waiter that reads the PR head live can see the old head as settled right after a push and exit at once; gh pr checks --watch has this race (#199663).

# Exit 0: every check passed. 1: a check failed. 11: the PR head moved. 12: no check ran.
# 2: GitHub API reads failed 5 times in a row.
pr=55 repo=owner/repo sha=$(git rev-parse HEAD) # the exact commit you pushed
seen=0 n=0 e=0
while :; do
  head=$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)
  if [ "$head" = "$sha" ]; then
    seen=1
    if ! runs=$(gh api --paginate "repos/$repo/commits/$sha/check-runs" \
      --jq '.check_runs[] | "\(.status) \(.conclusion) \(.name)"') ||
      ! st=$(gh api "repos/$repo/commits/$sha/status" --jq 'select(.total_count > 0) | .state'); then
      e=$((e + 1)); [ "$e" -ge 5 ] && { echo "API-ERROR $sha"; exit 2; }
      n=$((n + 1)); sleep 30; continue
    fi
    e=0
    bad=$(printf '%s\n' "$runs" | grep -E '^completed (failure|timed_out|action_required|startup_failure) ')
    [ -n "$bad" ] && { echo "FAIL $sha"; echo "$bad"; exit 1; }
    case "$st" in failure | error) echo "FAIL $sha commit status: $st"; exit 1 ;; esac
    if [ "$st" != pending ] && { [ -z "$runs" ] ||
      ! printf '%s\n' "$runs" | grep -Eqv '^completed (success|skipped|neutral|cancelled) '; }; then
      { [ "$st" = success ] || printf '%s\n' "$runs" | grep -q '^completed success '; } &&
        { echo "PASS $sha"; exit 0; }
      [ "$n" -ge 4 ] && { echo "NO-RUN $sha"; exit 12; }
    fi
  elif [ -n "$head" ] && { [ "$seen" = 1 ] || [ "$n" -ge 4 ]; }; then
    echo "HEAD-MOVED expected=$sha actual=$head"; exit 11
  fi
  n=$((n + 1)); sleep 30
done

The loop gives GitHub about 2 minutes to show the new head. It waits on queued, running and stale runs, and ignores cancelled runs, because concurrency groups cancel superseded runs. It also reads commit statuses, which some aggregate gates use. It exits 12 when no run succeeded, for example when every run was skipped or none started, because draft PRs skip CI. For one known run, gh run watch <run-id> --repo owner/repo --exit-status exits non-zero when the run fails.

API

gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
gh api repos/owner/repo/labels --jq '.[].name'
gh api --cache 1h repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count}'

Use --json + --jq for structured output. Use --body-file for comments/bodies containing backticks, shell snippets, env names, or user text.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

Related Skills