Index of every page on this site: llms.txt
All skills
paulrberg avatar

/cli-gh

@c9e5a34
by Paul Bergpaulrberg/agent-skills106 stars
11
Run it yourself

Use for GitHub CLI automation: repository reads, workflow runs, search, codespaces, releases, configuration, or gh command syntax. Use yeet for contribution writes to PRs, issues, comments, or discussions.

Use this Skill: https://skilld.dev/gh/paulrberg/agent-skills/cli-gh

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈53 tokens for metadata: the name and description. ≈1.4k when used: this file. ≈11 more on demand in 1 file.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈214 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

GitHub CLI

This skill is coordination-exempt: skip the ai-coord gate for its declared work.

Routing

Use yeet to author or update a pull request, issue, issue comment, or discussion. yeet owns semantic analysis, repository templates, Paul's writing voice, idempotency, and direct posting. Route repository renames through repo-rename so GitHub and local continuity change together.

Authority

  • Read and inspect without confirmation.
  • Execute reversible or ordinary GitHub writes only when the user explicitly requested that outcome.
  • Never delete repositories, releases/assets, workflow runs/caches, secrets/variables, keys, codespaces, extensions, or gists.
  • Label deletion is the sole destructive exception: show the target repo, exact labels, commands, and issue/PR impact, then require approval in a subsequent message before gh label delete ... --yes.

Workflow

  1. Resolve the repository explicitly when cwd is ambiguous. Let the first required read-only command validate authentication. Run gh auth status only for auth diagnosis.

  2. Use installed gh <command> <subcommand> --help to resolve flags, JSON fields, and command behavior. CLI JSON field names can differ from API fields. Prefer --json with --jq for structured output.

  3. Preview broad writes with the repository, exact targets, commands, and issue/PR impact. An already requested ordinary write does not require a second approval.

GitHub Status

GitHub incidents produce symptoms that look like a local defect. Examples: a run stays queued for minutes with no runner, gh run cancel reports a run as completed while gh run view still shows it queued, the API returns 5xx errors, or a push succeeds while Actions does not start.

Before you tell the user that an error, a stall, or an inconsistent result comes from their setup, workflow, or credentials, check GitHub's status page:

curl -fsS https://www.githubstatus.com/api/v2/summary.json | jq '{status: .status.description,
  incidents: [.incidents[] | {name, status, impact, updated_at}],
  degraded: [.components[] | select(.status != "operational") | {name, status}]}'

If an incident is open or an affected component is not operational, report the incident name, the affected components, and the latest update time. Attribute the symptom to the incident. Do not change the user's workflow, configuration, or credentials to work around it. Wait for mitigation, then retry. If the status page shows no incident, continue with local diagnosis.

CI Failure Triage

Use this workflow when the user asks why CI fails or asks to fix a failing run. Keep each command output bounded.

  1. Find the failing runs for the branch or the commit:

    gh run list --branch <branch> --status failure --limit 5
    gh run list --commit <sha> --status failure --limit 5
  2. Extract only the failed-step lines. Never print the raw log.

    gh run view <run-id> --log-failed | rg --no-config -n 'error|FAIL|panic|✗' | head -80
  3. Check toolchain drift before you change code. Compare the versions pinned in .github/workflows/*.yml with the local --version output. Common cases are Foundry (forge), Bun (bun), Node.js (node), and Rust (rustc).

  4. If the user requested a fix, fix the cause and push the commit.

  5. Get the new run ID with gh run list --commit <new-sha> --limit 5. Then watch that run:

    gh run watch <run-id> --exit-status --compact
  6. Report the run URL from gh run view <run-id> --json url --jq .url and the final run status.

Notable Flags (gh 2.98+)

  • gh pr checkout --worktree <path> and gh issue develop --checkout --worktree <path> check out into a linked git worktree instead of switching the current branch.
  • gh search issues --search-type semantic|hybrid ranks by relevance: issues only, one page, no --sort/--order, not on GitHub Enterprise Server.
  • gh config set api_host <gateway> --host <host> routes that host's API traffic through a gateway. The feature is experimental and is not a security boundary.
  • gh auth login and gh auth refresh copy OAuth device codes to the clipboard by default (2.101+). To opt out, run gh config set clipboard disabled.
  • gh auth login --expiring (2.103+) prefers expiring OAuth tokens that gh refreshes. To prefer them on every sign-in, run gh config set expiring_credentials enabled. Run gh auth token each time you need a token. Never cache its output. GH_TOKEN and GITHUB_TOKEN values never refresh.
  • gh auth status refreshes an expired or near-expiry refreshable token unless you pass --no-refresh. With that flag, 2.103.3+ reports the token as expired, not invalid. To renew it, run the command without the flag. Do not run gh auth refresh for this case.
  • In 2.104.0+, gh auth status prints the underlying rate-limit, server, or network error. Use that error to decide between a GitHub incident and a credential problem. gh skips token refresh when its state directory is not writable.
  • --attach '<file>#<alt>' on issue/PR create, edit, and comment uploads images or videos. Route those writes through yeet. Since 2.103.2, GitHub App installation tokens can attach, and the upload endpoint decides permission.

Completion

Complete when command output verifies the requested GitHub data or state. After a write, fetch the resulting resource. On a partial or ambiguous failure, check whether it changed before retrying. Report the verified state and URL or stable identifier. Include the concrete error and next action when incomplete, and distinguish an unknown result from a confirmed failure.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warnings12d5 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    This skill provides automation for the GitHub CLI, including repository management and CI failure triage. It follows security-conscious patterns by explicitly forbidding the deletion of sensitive resources and providing guidelines for authentication token management. The skill identifies as a surface for indirect prompt injection via CI log ingestion and documents a configuration flag for API gateways that could be misused for data redirection.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: MEDIUM · 1 issue

  • Runlayer9mo

    9/9 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c9e5a34. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 5 days ago
coordination
exempt
skill-dependencies
[
  "repo-rename",
  "yeet"
]
user-invocable
false

README badge

README badge for paulrberg/agent-skills/cli-gh