GitHub Skill
gh CLI for all operations. Always --repo owner/repo outside a git directory.
Security (always)
- Auth:
gh auth login --weborGITHUB_TOKENenv var - Secrets:
gh secret set NAME --repo owner/repo(interactive, never--body) - Never print/log tokens.
gh auth statusto verify.
Quick Reference
| Task | Command |
|---|---|
| Auth check | gh auth status |
| List PRs | gh pr list --repo o/r |
| Create PR | gh pr create --repo o/r --title "..." --base develop --head branch |
| PR checks | gh pr checks <n> --repo o/r |
| Merge (squash) | gh pr merge <n> --squash --delete-branch --repo o/r |
| Failed CI logs | gh run view <id> --log-failed --repo o/r |
| Re-run failed | gh run rerun <id> --failed-only --repo o/r |
| Create issue | gh issue create --repo o/r --title "..." --body "..." |
| Create release | gh release create vX.Y.Z --repo o/r --title "..." --notes "..." |
| Set secret | gh secret set KEY --repo o/r |
| Branch protect | gh api --method PUT repos/o/r/branches/main/protection ... |
Branching Model
main ← production, protected
develop ← integration
feature/* ← from develop
fix/* ← from develop (reference issue: fix/123-desc)
hotfix/* ← from main (emergency)
release/* ← from develop (prep)
Commit convention: feat: description (#42) / fix: description (#42)
PR merge: --squash for features, --merge for releases.
Semver: MAJOR.MINOR.PATCH — breaking/feature/fix.
When to read reference files
Load only what you need for the current task:
| Task | Read |
|---|---|
| Setting up a new repo, branch protection | references/repo-setup.md |
| PRs, reviews, merge strategies | references/pull-requests.md |
| CI runs, GitHub Actions | references/ci-actions.md |
| Releases, versioning, tags | references/releases.md |
| Secrets, environments | references/secrets-envs.md |
| JSON queries, audit, search | references/api-queries.md |