Agent skill
gh-cli
Standardize all GitHub interactions via the GitHub CLI (`gh`) instead of ad-hoc URLs, UI clicks, or direct REST API calls. Use when you need to read or change GitHub state (repos, issues, pull requests, reviews, check status, Actions workflows/runs, releases, labels, milestones, discussions, gists) and want deterministic output (prefer `--json` + `--jq`). Also use when the user provides a GitHub URL, including deep links like `https://github.com/OWNER/REPO/pull/123`, `.../issues/123`, `.../pull/123/files`, or comment permalinks like `#issuecomment-...`, and you need to fetch the underlying PR/issue/thread and reply. Fall back to `gh api` only when there is no first-class `gh NOUN VERB` command.
Install this agent skill to your Project
npx add-skill https://github.com/strantalis/agent-skills/tree/main/skills/gh-cli
SKILL.md
GitHub gh CLI
Overview
Use gh for GitHub operations with explicit repo targeting, JSON output, and command help-driven discovery of flags/fields. Avoid scraping human-readable output and avoid raw REST calls unless you must (use gh api as the controlled fallback).
Quick start
- Verify
ghis installed and authenticated:
gh --version
gh auth status
- Set explicit repo context (preferred patterns):
# One-off: target a repo explicitly
gh issue list -R OWNER/REPO --json number,title,url -q '.[] | "\(.number)\t\(.title)\t\(.url)"'
# Repeated work: set a default repo for this shell + directory context
gh repo set-default OWNER/REPO
Operating rules (do not skip)
-
Prefer first-class commands over APIs.
- Use
gh issue,gh pr,gh repo,gh run,gh workflow,gh release, etc. - Use
gh apionly when the CLI lacks a dedicated command (document the endpoint and why).
- Use
-
Avoid guessing flags/fields; discover them.
- Use
gh <command> --helpto find flags and supported--jsonfields. - Use
gh help formattingfor--json,--jq, and--templatepatterns.
- Use
-
Prefer machine-readable output.
- Use
--json <fields> -q '<jq>'instead of parsing table output. - When you need just one value, return only that value (not the full blob).
- Use
-
Make repo targeting explicit.
- Prefer
-R OWNER/REPOwhen not operating in a known local checkout. - If you infer repo from the current directory, confirm it via
gh repo view --json nameWithOwner -q .nameWithOwner.
- Prefer
-
Treat state changes as production-impacting.
- Ask for confirmation before creating/closing/merging/deleting.
- When modifying settings (branch protections, permissions), make changes small and reversible.
Common tasks (command-first)
Use skills/gh-cli/references/gh-commands.md for a categorized command reference with examples for:
- Repos (view/clone/fork/create, defaults, settings)
- Issues (list/view/create/edit/comment/close/reopen)
- PRs (list/view/create/checkout/review/merge/status/checks, review threads/comments, reply workflows)
- Actions (workflows/runs: list/view/watch/rerun/cancel)
- Releases (list/view/create/download)
- Search patterns and deterministic selection
gh apifallback patterns (REST + GraphQL) when required
Tooling
Run a quick environment/context capture when debugging auth/repo targeting problems:
./skills/gh-cli/scripts/gh_context.sh
This prints gh version/auth status and tries to identify the active repo (when run inside a checkout).
Fetch a PR’s review feedback (reviews + PR comments + inline review comments + review threads) as JSON:
./skills/gh-cli/scripts/pr_feedback.sh -R OWNER/REPO 123
Reply back to review feedback:
# Reply to an inline review comment (REST)
./skills/gh-cli/scripts/pr_review_comment_reply.sh -R OWNER/REPO 123 987654321 --body "Thanks — fixed in 8c0ffee."
# Reply to a review thread (GraphQL)
./skills/gh-cli/scripts/pr_review_thread_reply.sh PRRT_kwDO... --body "Good catch — updated to handle nil."
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
debug-mode
Run an iterative, hypothesis-driven “debug mode” loop to diagnose and fix a bug using targeted instrumentation and log capture. Use when the user wants an interactive debug loop, when you need to quickly narrow a failure via added debug statements, or when you need a lightweight way to centralize logs from a repro run (via `agent-skills debug` server + SSE UI).
crypto-expert
Crypto best-practices guidance and review across languages and domains. Use whenever cryptography, encryption, hashing, signatures, key/nonce/IV handling, randomness, password storage, TLS/PKI, secure channels, token formats, or "roll your own crypto" is mentioned, including high-level questions or code/design reviews. Trigger broadly to prevent subtle security mistakes.
context7-cli
Use the local Context7 CLI in this repo to search libraries and fetch Context7 context for skills or documentation tasks. Trigger when you need to run `c7 search`/`c7 context`, resolve library IDs, or retrieve text/json outputs from Context7 via the CLI.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?