Automates GitHub CLI operations: repo info/browsing, PR management, issue tracking, workflow triggers, GitHub search, and codespaces.
How this skill is triggered — by the user, by Claude, or both
Slash command
/paulrberg-agent-skills:cli-ghThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Expert guidance for GitHub CLI (gh) operations and workflows. Use this skill for command-line GitHub operations including pull request management, issue tracking, repository operations, workflow automation, and codespace management.
agents/openai.yamlexamples/auto-pr-create.shexamples/issue-triage.shexamples/release-automation.shexamples/workflow-monitor.shreferences/advanced-features.mdreferences/automation-workflows.mdreferences/codespaces.mdreferences/discussions.mdreferences/gists.mdreferences/json-output.mdreferences/labels.mdreferences/releases.mdreferences/search.mdreferences/troubleshooting.mdreferences/version.txtreferences/workflows-actions.mdExpert guidance for GitHub CLI (gh) operations and workflows. Use this skill for command-line GitHub operations including pull request management, issue tracking, repository operations, workflow automation, and codespace management.
Key capabilities:
CRITICAL: This skill forbids destructive gh CLI operations except the controlled label-deletion workflow below.
This skill focuses on safe, read-only, or reversible GitHub operations. Treat destructive operations as prohibited unless this file explicitly defines an exception.
Controlled destructive exception:
gh label delete may be used only when every condition is met:
gh label delete <name> --repo OWNER/REPO --yes commands. If the repository, labels, or commands change, stop and present a revised plan for approval.The following commands are PROHIBITED and must NEVER be used:
Permanently destructive commands:
gh repo delete - Repository deletiongh repo archive - Repository archivalgh release delete - Release deletiongh release delete-asset - Asset deletiongh run delete - Workflow run deletiongh cache delete - Cache deletiongh secret delete - Secret deletiongh variable delete - Variable deletiongh ssh-key delete - SSH key deletion (can lock out users)gh gpg-key delete - GPG key deletiongh codespace delete - Codespace deletiongh extension remove - Extension removalgh gist delete - Gist deletionxargs with any destructive commandsrm -rf (except for temporary file cleanup)Allowed operations:
git status, git log, git diff)# Login to GitHub
gh auth login
# Login and copy OAuth code to clipboard automatically
gh auth login --clipboard
# Check authentication status
gh auth status
# Check auth status with JSON output
gh auth status --json
# Configure git to use gh as credential helper
gh auth setup-git
# Create PR interactively
gh pr create
# Create PR with title and body
gh pr create --title "Add feature" --body "Description"
# Create PR to specific branch
gh pr create --base main --head feature-branch
# Create draft PR
gh pr create --draft
# Create PR from current branch
gh pr create --fill # Uses commit messages
# Create PR with Copilot Code Review
gh pr create --reviewer @copilot
# List PRs
gh pr list
# List my PRs
gh pr list --author @me
# View PR details
gh pr view 123
# View PR in browser
gh pr view 123 --web
# View PR diff
gh pr diff 123
# View PR diff excluding specific files
gh pr diff 123 --exclude "*.lock"
# Check PR status
gh pr status
# Checkout PR locally
gh pr checkout 123
# Review PR
gh pr review 123 --approve
gh pr review 123 --comment --body "Looks good!"
gh pr review 123 --request-changes --body "Please fix X"
# Request Copilot Code Review
gh pr edit 123 --add-reviewer @copilot
# Merge PR
gh pr merge 123
gh pr merge 123 --squash
gh pr merge 123 --rebase
gh pr merge 123 --merge
# Close PR
gh pr close 123
# Reopen PR
gh pr reopen 123
# Ready draft PR
gh pr ready 123
# Update PR branch with base branch
gh pr update-branch 123
# Revert a merged PR (creates a new revert PR)
gh pr revert 123
# View PR checks
gh pr checks 123
# Watch PR checks
gh pr checks 123 --watch
# Create issue interactively
gh issue create
# Create issue with title and body
gh issue create --title "Bug report" --body "Description"
# Use a Markdown issue template as interactive/editor starting body text
gh issue create --template "Bug Report"
# Create issue with labels
gh issue create --title "Bug" --label bug,critical
# Assign issue
gh issue create --title "Task" --assignee @me
# Set the issue type (GitHub.com and GHES 3.17+)
gh issue create --type Bug
--template cannot be combined with --body or --body-file; use it with prompts, --editor, or --web. For YAML issue forms, fetch and render the form fields yourself for non-interactive automation, or finish in the browser.
# List issues
gh issue list
# List my issues
gh issue list --assignee @me
# List by label
gh issue list --label bug
# Filter by issue type
gh issue list --type Bug
# Advanced issue search
gh issue list --search "is:open label:bug sort:created-desc"
# View issue details
gh issue view 456
# View in browser
gh issue view 456 --web
# Close issue
gh issue close 456
# Close as duplicate, linking to the original issue
gh issue close 123 --duplicate-of 456
# Reopen issue
gh issue reopen 456
# Edit issue
gh issue edit 456 --title "New title"
gh issue edit 456 --add-label bug
gh issue edit 456 --add-assignee @user
# Comment on issue
gh issue comment 456 --body "Update"
# Create branch to work on issue
gh issue develop 456 --checkout
When the user asks to list, view, create, edit, or comment on GitHub Discussions, see references/discussions.md. The gh discussion command set is in preview and subject to change.
# View repository
gh repo view
# View in browser
gh repo view --web
# Clone repository
gh repo clone owner/repo
# Clone without adding upstream remote
gh repo clone owner/repo --no-upstream
# Fork repository
gh repo fork owner/repo
# List repositories
gh repo list owner
# Create repository
gh repo create my-repo --public
gh repo create my-repo --private
# Sync fork
gh repo sync owner/repo
# Set default repository
gh repo set-default
# Configure the squash-merge commit message default
gh repo edit --squash-merge-commit-message COMMIT_MESSAGES
When the user asks to trigger, monitor, cancel, rerun, or download artifacts from GitHub Actions workflows and runs, see references/workflows-actions.md.
When the user asks to search GitHub repositories, issues, or pull requests, see references/search.md.
When the user asks to list, create, edit, delete, or clone repository labels, see references/labels.md.
When the user asks to list, create, connect to, or manage files within GitHub Codespaces, see references/codespaces.md.
Open repositories, files, and resources in the browser.
# Open current repo in browser
gh browse
# Open specific file
gh browse src/main.go
# Open file at specific line
gh browse src/main.go:42
# Open blame view for a file
gh browse --blame src/main.go
# Open Actions tab
gh browse --actions
# Open specific branch
gh browse --branch feature
When the user asks to create, list, view, or download GitHub releases, see references/releases.md.
When the user asks to create, list, view, or edit GitHub gists, see references/gists.md.
# Set default editor
gh config set editor vim
# Set default git protocol
gh config set git_protocol ssh
# View configuration
gh config list
# Set browser
gh config set browser firefox
When the user needs aliases, direct API access, extensions, secrets/variables, SSH/GPG keys, organization or project management, repository rulesets, attestations, Copilot Agent Tasks, gh skill management, reading repo file/directory contents without cloning, or issue types/sub-issues/blocking relationships, see references/advanced-features.md.
When the user wants ready-made gh CLI automation patterns — code review workflows, issue triage, daily/weekly reports, bulk operations, CI monitoring, or team collaboration scripts, see references/automation-workflows.md.
When gh fails with auth/permission/rate-limit errors, or hits command errors, installation/config issues, or network problems, see references/troubleshooting.md.
Practical automation scripts (see examples/ directory):
auto-pr-create.sh - Automated PR creation workflowissue-triage.sh - Bulk issue labeling and assignmentworkflow-monitor.sh - Watch and notify on workflow completionrelease-automation.sh - Complete release workflow automationWhen the user wants to use --json flags or needs the correct gh CLI JSON field names, see references/json-output.md.
gh repo create --template to scaffold from template repositoriesgh pr merge --auto for PRs that pass checksnpx claudepluginhub paulrberg/agent-skillsReference for GitHub CLI (gh) commands covering repos, issues, PRs, Actions, projects, releases, gists, codespaces, search, secrets, and API operations.
GitHub issues, pull requests, repos, code search, and Actions via the gh CLI. Use when the user mentions GitHub, an issue/PR number, a repo, a commit, or code review.
Provides GitHub operations via gh CLI and API: pull requests, issues, repositories, workflows, and API queries.