GitHub CLI (gh) Skill
This skill provides comprehensive GitHub CLI integration for managing repositories, issues, pull requests, workflows, releases, and API interactions (both REST and GraphQL).
Prerequisites
- GitHub CLI (
gh) must be installed and authenticated gh auth loginsuccessfully completed- Active internet connection for GitHub API access
- Appropriate repository permissions for target operations
Usage Instructions
This skill has a broad command surface and supports powerful API interactions. DO NOT GUESS COMMAND FLAGS OR GRAPHQL QUERIES.
Whenever you need to perform complex operations with the GitHub CLI (e.g. advanced PR management, workflows, or raw API calls), you must first read the detailed reference documentation to see the exact syntax:
- Use the
readtool to loadreferences/github-cli-reference.md.
- Use the
The reference files contain instructions for:
- Repository, Issue, and Pull Request operations
- Advanced PR operations: marking as draft, adding comments with context
- GitHub Actions workflow triggering and monitoring
- Advanced REST API calls via
gh api - Complex GraphQL queries and mutations via
gh api graphql - Issue Hierarchy (Parent/Child): See
references/issue-hierarchy.guide.md - Team Management Operations: See
references/github-team-management.md - PI Epic Issues: See
references/epic-issue-template.md— template, labels, body structure, and the safe issue-rewrite pattern - Common developer workflow examples
Team Management Best Practices:
- Always verify user has admin/maintain permissions before adding teams to repositories
- Handle repository redirects (renamed repos) gracefully
- Test operations on a single repository before bulk operations
- Use appropriate permission levels (prefer
pushfor most teams)
Whenever possible, use built-in
ghcommands rather than writing rawcurlcommands or custom Python scripts for GitHub integration.