--- name: github description: 'GitHub via gh CLI: PRs, issues, reviews, repos, auth.' version: 1.0.0 author: Ben Barclay (benbarclay), Hermes Agent license: MIT source: https://github.com/NousResearch/hermes-agent/tree/main/skills/software-development/github adapted_from: https://github.com/NousResearch/hermes-agent/tree/main/skills/software-development/github (HamaratLabs eklemeleriyle uyarlandı) platforms: - linux - macos - windows metadata: hermes: tags: - github - gh - git - pull-requests - issues - code-review - repos - auth - ci category: software-development related_skills: - codebase-inspection - requesting-code-review --- # GitHub Work GitHub end to end with the `gh` CLI (REST fallback where noted): auth, issues, the PR lifecycle, issue-to-PR delivery, code review, and repo management. This skill consolidates six former skills; each workflow lives complete in its reference file — ALWAYS read the matching reference before starting that workflow, the body below only routes. ## Routing | Task | Read first | |---|---| | Auth broken / new machine / token or SSH setup / gh login | `references/auth.md` | | Create, triage, label, assign, close issues | `references/issues.md` | | Branch, commit, open PR, watch CI, merge | `references/pr-workflow.md` | | Carry an ISSUE to a verified PR (full delivery loop) | `references/issue-to-pr.md` | | Review someone's PR: diffs, inline comments, verdict | `references/code-review.md` | | Clone/create/fork repos, remotes, releases | `references/repo-management.md` | Supporting assets: `scripts/gh-env.sh` + `scripts/git-credential-token.py` (auth helpers), `templates/` (PR bodies, bug report, feature request), `references/ci-troubleshooting.md`, `references/conventional-commits.md`, `references/github-api-cheatsheet.md`, `references/review-output-template.md`. ## Local setup notes (example) - Check `gh --version` and `gh auth status` once per session; note which account is logged in. - Repos under `/` can be a mix of your own and other-org remotes (e.g. a client/shared org), and new ones get added between sessions — don't trust a hardcoded name list, rediscover it live: `for d in /*/; do u=$(git -C "$d" remote get-url origin 2>/dev/null) && echo "$d -> $u"; done`. The Obsidian vault has its own separate repo — see the `obsidian` skill, and never put project code there. - `push`, PR creation, `merge` and any delete need the user's explicit approval each time. Read-only `gh` inspection does not. This default applies to repos that share history/branches with the user's other work; a brand-new, independent repo created for a fresh standalone project does not inherit it automatically — confirm scope with the user once per new repo rather than assuming either way. - A private repo is not a secret store: `.gitignore` does not scrub an already-tracked file or its history, and auditing the tip of `main` is not auditing the history. - When creating a new repo that wraps or depends on a third-party model/library the user previously accessed through a DIFFERENT tool (a GUI, a server, another project's integration), check the dependency's OWN license and OWN standalone install path before writing any code — do not copy code from the tool you happened to use for access. The access path and the underlying library can carry different licenses (e.g. a permissive Apache-2.0 model served through an AGPL-3.0 GUI); depend on the library's own package/release directly so the new repo doesn't inherit copyleft obligations it doesn't need. ## Core discipline (applies to every workflow) - Preflight once per session: `gh auth status` — if it fails, go to `references/auth.md` before anything else. - Before pushing to (or periodically auditing) a repo meant to be public, scan for leaked internal artifacts: dot-prefixed agent task-brief files (`.{agent}-task-*.md`, find with `git ls-files | grep -E "^\.[a-z]+-task-"`), QA/debug screenshot folders whose images embed the local machine's absolute home path or username, accidentally-tracked `node_modules`/build output (`git ls-files | grep -c '^node_modules/'`), and superseded exploration assets (e.g. unused icon/design concept variants) left behind after one was chosen. `git rm --cached ` + add the pattern to `.gitignore` removes it from HEAD without touching history; a full purge needs `git filter-repo`/BFG and is a separate, much bigger decision — don't do it without being asked. Also check a brand-new repo's remote before assuming anything has shipped: `git ls-remote origin` empty means nothing has ever been pushed, so even "old" leftover files are free to clean before the first push. - When cleaning "superseded exploration assets" (e.g. N icon/design concepts down to 1 chosen), confirm WHICH one shipped before deleting any — grep the actual build/install config (CI workflow, packaging script) for the exact filename it references, not just the folder names. If that reference points to a file that doesn't exist anywhere in the repo (a stale/broken config, not a resolved choice), do not guess and delete N-1 candidates — leave all of them untouched and flag the ambiguity to the user instead; deleting the wrong variant silently breaks a future build that nobody tests until release day. - Prefer `gh` over raw REST; drop to `gh api` only for endpoints the porcelain lacks (the cheatsheet lists them). - Never report CI green without checking `gh pr checks` yourself; never claim merged without verifying `state,mergedAt`. - A green run on a tag-gated release workflow does not prove a release/asset exists — many such workflows only publish on an actual `v*` tag push and silently no-op (or only dry-run) on branch/manual runs. Before trusting a README's download link, check `gh api repos///releases` returns a non-empty array with the expected asset name, and `curl -sI -L ` for a real 200, not just that some workflow run somewhere says "success". - Read full context before writing: `gh issue view --comments` / `gh pr view --comments` — decisions live in threads, not titles. - Sweep for duplicates before creating anything: `gh pr list --search` / `gh issue list --search`. ## Verification - The workflow's own reference file defines done for that task. - Cross-cutting: every claim about remote state (CI, merge, release, issue state) is backed by a fresh `gh` read, never memory.