agentleFS
phntm7phntm7/skills/skills/github-ops/SKILL.md

github-ops

Skill1 starsChanged 6 months agoMITView on GitHub

Use when working with remote GitHub repositories, Actions, PRs, issues, releases, or code search via gh. Use local tools for a checkout, the `web-search-router` skill for open-web research, and a browser for GitHub UI.

23 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use gh for remote GitHub data.

    line 13
  2. Distinctive:

    Read commands do not mutate remote GitHub state.

    line 41
  3. Very specific:

    Write multiline bodies with --body-file or a heredoc.

    line 109

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Operations via gh CLI

Last verified: 2026-09-03 (gh 2.99.0)

Use gh for remote GitHub data. Use local tools for a checked-out repository and the web-search-router skill for open-web research. Clone only when many remote files make it cheaper. gh is authenticated and returns structured JSON — do not fetch github.com HTML or raw.githubusercontent.com. Use a browser tool for the github.com UI.

Preflight

  • gh auth status once per session if unsure (never gh auth token or --show-token — no tokens in the transcript). If auth fails, tell the user to run gh auth login. Missing scopes (INSUFFICIENT_SCOPES, common: project for Projects V2): report the missing scope and hand gh auth refresh -h github.com -s <scope> to the user — it needs interactive browser approval; never run it as an autonomous fix. Only when gh is unavailable or unauthenticated and the data is public may you fall back to unauthenticated api.github.com requests — label the result as a degraded read; never web-scrape private repo pages.
  • Commands that need repository context (pr, issue, run, workflow, release) take -R owner/repo outside a checkout. gh repo view and gh repo clone take OWNER/REPO positionally. gh api takes no -R: its {owner}/{repo} placeholders resolve from the local checkout or GH_REPO=owner/repo; explicit paths (repos/owner/repo/...) and gh search need neither.
  • For scripted use, prefix commands that might page or prompt: GH_PAGER=cat GH_PROMPT_DISABLED=1 gh ...

Reads vs writes

Read commands do not mutate remote GitHub state; downloads may write locally. Anything that mutates GitHub state — commenting, reviewing, creating or closing issues, rerunning or dispatching workflows, enabling/disabling workflows, creating releases — is an external side effect visible to other people: run it only when the user's request clearly asks for that specific mutation; otherwise confirm first.

Context economy

Request only the fields needed: --json field1,field2 --jq '...'. Avoid dumping raw responses. Bare --json lists fields. --jq is embedded; on normal commands it requires --json, on gh api it works directly.

Task → command map

TaskCommand
Read a repo's READMEgh repo view owner/repo
Read one file from a remote repogh api 'repos/owner/repo/contents/PATH?ref=BRANCH' -H 'Accept: application/vnd.github.raw+json'
List a remote directorygh api repos/owner/repo/contents/DIR --jq '.[].path'
Search code across GitHubgh search code QUERY --language go -L 20
Search code in one repogh search code QUERY -R owner/repo (checked out locally? use rg instead)
Search issues / PRs / repos / commitsgh search issues|prs|repos|commits ...
CI status of a PRgh pr checks N --json name,state,bucket,link
Why did CI failgh run list -b BRANCH -s failure -L 5 --json databaseId,displayTitle,url then gh run view ID --log-failed
Read PR + conversation commentsgh pr view N --json title,body,state,reviewDecision,comments
Read inline code-review commentsgh api repos/{owner}/{repo}/pulls/N/comments (NOT available via --json)
Comment on a PR / issuegh pr comment N --body-file f.md / gh issue comment N -b "..."
Approve / request changesgh pr review N --approve / --request-changes -b "..."
PR diffgh pr diff N [--name-only]
Issuesgh issue list -R owner/repo -s open --json number,title,labels, gh issue view N --comments
Releasesgh release list, gh release view TAG --json body,assets, gh release download TAG -p '*.tgz'
Anything elsegh api <REST path> or gh api graphql -f query='...' — see references/api.md

Without the raw Accept header the contents endpoint returns base64 JSON. Skip raw.githubusercontent.com (404s on private repos) and download_url (temporary token). Many files: gh repo clone owner/repo -- --depth 1.

Searching GitHub

Raw qualifiers mix into the query (gh search code panic path:pkg language:go). Negated qualifiers must go after --: gh search issues -- "crash -label:bug". --search-type, qualifier cheat sheet, query limits, and search vs list: references/search.md.

Actions / CI failures

gh pr checks 123 --json name,state,bucket,link          # bucket: pass|fail|pending|skipping|cancel
gh run list -b my-branch -s failure -L 5 --json databaseId,displayTitle,url
gh run view <run-id> --log-failed                        # only the failed steps' logs
gh run view <run-id> --json jobs --jq '.jobs[] | {name, databaseId, conclusion}'
gh run view --job <job-databaseId> --log-failed          # narrow to one job

Job IDs, log association, reruns, watch, artifacts, workflow dispatch: references/actions.md.

PR comments and reviews

A PR has three distinct comment surfaces; gh pr view --json only covers two:

SurfaceReadWrite
Conversation commentsgh pr view N --json commentsgh pr comment N --body-file f.md
Reviews (approve / request changes)gh pr view N --json reviews,reviewDecisiongh pr review N --approve / --request-changes / --comment -b "..."
Inline code comments (diff-anchored)gh api repos/{owner}/{repo}/pulls/N/commentsreply: gh api -X POST repos/{owner}/{repo}/pulls/N/comments/<id>/replies -f body='...'

Write multiline bodies with --body-file or a heredoc; \n in -b renders literally. For idempotent bot comments, use gh pr comment N --edit-last --create-if-none -F f.md. Inline comments, thread resolution, and creating reviews: references/pr-reviews.md.

Done

Done means the target repo/PR/run is identified and only requested fields are returned; a CI diagnosis names the run, job, failing step, and URL/log evidence; auth, scope, and degraded-read failures are stated explicitly.

Sources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.