Claude-skill-registry gh-cli-ops
GitHub CLI (gh) operations for repos, PRs/issues, workflows/runs, secrets/variables, releases/tags, and deployment-related automation. Use when a request involves gh commands, GitHub Actions workflows/runs, secrets or variables, releases, deployments/environments, or coordinating git with GitHub.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gh-cli-ops" ~/.claude/skills/majiayu000-claude-skill-registry-gh-cli-ops && rm -rf "$T"
manifest:
skills/data/gh-cli-ops/SKILL.mdsource content
Gh Cli Ops
Overview
Use gh + git to manage GitHub repositories, automation, and releases with repeatable, safe workflows.
Quick start (context)
- Use the wrapper so commands are logged:
,scripts/ghx auth status
,scripts/ghx repo view
.git status -sb - Identify the task category and use the matching section or the command map in
.references/gh-command-map.md - Prefer JSON output (
) for scripted reads; ask before destructive changes (delete, merge, release delete, secret overwrite).--json ... --jq ... - Review
to adapt based on recent successes/failures.references/auto-summary.md
Automation wrapper (required)
- Use
for all gh commands to log outcomes toscripts/ghx
.references/usage-log.jsonl - The wrapper auto-updates
after each command to capture what worked or failed.references/auto-summary.md - If you must run
directly (e.g., debugging), rungh
afterward with the same args.scripts/track_command.sh gh ...
Task map
See
references/gh-command-map.md for a task-to-command mapping and safe defaults.
Workflows & runs
- Use
to inspect or trigger workflows. Ensure the workflow supportsgh workflow list/view/run
before running.on: workflow_dispatch - Provide inputs via
/-f
or-F
when needed; confirm expected inputs from the workflow file.--json - Use
to monitor or re-run jobs; usegh run list/view/watch/rerun/download
for logs.gh run view --log/--log-failed - For deploys, identify the deploy workflow and trigger it via
with the correctgh workflow run
and inputs.--ref - If
fails withgh workflow run
andHTTP 403
, check forResource not accessible by integration
orGITHUB_TOKEN
in the environment. Unset them or replace with a PAT that has workflow permissions, then retry.GH_TOKEN - Quick fix for local shells:
(clears the env var for that command).GITHUB_TOKEN= gh workflow run "<workflow>" -f key=value - In GitHub Actions, prefer
set to a PAT or GitHub App token when you need to trigger workflows; the defaultGH_TOKEN
can be too limited for dispatching other workflows.GITHUB_TOKEN
Secrets & variables
- Use
for Actions/Dependabot/Codespaces secrets; usegh secret
for Actions/Dependabot variables.gh variable - Scope to repo/org/environment as needed; check
andgh secret set --help
for scope flags.gh variable set --help - Prefer stdin or
to avoid shell history; confirm overwrite and scope with the user.--body
Releases & tags
- Use
.gh release list/view/create/download/delete - Prefer
for release notes when appropriate; confirm tag names and target commits.--generate-notes
Deployments & environments
- For deployment environments, use environment-scoped secrets/variables (
).-e <env> - For deployment history or custom deploy APIs, use
withgh api
and--paginate
as needed.--jq
PRs, issues, and repo admin
- Use
andgh pr
for everyday collaboration.gh issue - Use
for repo operations.gh repo view/fork/clone/sync - Keep git operations (branching, rebasing, pushing) explicit and separate from gh steps.
API & advanced
- Use
for endpoints not covered by built-in commands.gh api - Capture JSON with
orgh api ... --jq
for large lists.--paginate
Troubleshooting auth
usually means the CLI is using an integration token (oftenResource not accessible by integration
) that cannot dispatch workflows. Prefer a PAT stored viaGITHUB_TOKEN
or setgh auth login --with-token
to a PAT with workflow permissions; avoid leavingGH_TOKEN
exported in local shells.GITHUB_TOKEN
/GH_TOKEN
environment variables override stored gh auth. If you see unexpected 403s, unset them or replace with a PAT/GitHub App token that has Actions/workflow permissions before retrying.GITHUB_TOKEN
Self-improving loop (automated + manual)
Automated (always on when using
scripts/ghx):
- Command outcomes are logged to
.references/usage-log.jsonl
updatesscripts/auto_improve.py
and can append repeatable learnings toreferences/auto-summary.md
.references/gh-ops-notes.md
Manual (when new patterns are discovered):
- Append new command patterns, flags, or pitfalls to
.references/gh-ops-notes.md - If a command/flag is missing or changed, update
.references/gh-command-map.md - Run
to refreshscripts/refresh_gh_reference.sh
from the locally installedreferences/gh-help.md
.gh
Resources
scripts/
: wrapper that logs gh command outcomes and triggers auto-summary updates.scripts/ghx
: logs command outcomes toscripts/track_command.sh
.references/usage-log.jsonl
: generatesscripts/auto_improve.py
and auto-notes.references/auto-summary.md
: regeneratescripts/refresh_gh_reference.sh
from local gh help output.references/gh-help.md
references/
: task-to-command map and safe defaults.references/gh-command-map.md
: auto-generated help snapshot from the local gh version.references/gh-help.md
: living notes for patterns, pitfalls, and team conventions.references/gh-ops-notes.md
: auto-generated success/failure summary for recent commands.references/auto-summary.md
: append-only command log (redacted).references/usage-log.jsonl