From git-tools
This skill should be used when working with GitHub CLI (gh) for pull requests, issues, releases, and GitHub automation. Use when users mention gh commands, GitHub workflows, PR operations, issue management, or GitHub API access. Essential for understanding gh's mental model, command structure, and integration with git workflows.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-tools:ghThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
GitHub CLI (`gh`) is the official command-line tool for GitHub that brings pull requests, issues, releases, and other GitHub concepts to the terminal. This skill provides comprehensive guidance for using `gh` to streamline GitHub workflows, including PR management, issue tracking, repository operations, and API access.
GitHub CLI (gh) is the official command-line tool for GitHub that brings pull requests, issues, releases, and other GitHub concepts to the terminal. This skill provides comprehensive guidance for using gh to streamline GitHub workflows, including PR management, issue tracking, repository operations, and API access.
Invoke this skill when users:
gh) commands or workflowsBefore providing guidance, understand these key concepts:
Three-Layer Architecture:
gh pr, gh issue, gh repo - user-friendly workflowsgh api - direct REST/GraphQL access with built-in authContext Resolution:
gh automatically detects repository from git remotesMental Model:
Think of gh as "GitHub workflows made CLI-native" - each command maps to a common GitHub workflow optimized for terminal use.
When providing gh guidance, load the comprehensive reference documentation:
references/gh.md
This reference contains:
Loading Strategy:
references/gh.md when user asks gh-related questionsgh pr - Pull request commandsgh issue - Issue management commandsgh repo - Repository operationsgh api - API access patternsPattern [0-9]: - Workflow patternsAuthentication - Auth setuperk Integration - Integration with erkWhen users ask for help with gh, guide them using these patterns:
gh --versiongh auth login (interactive) or gh auth status (check current)gh config set <key> <value>gh repo view (in a git repo)Load references/gh.md and search for "gh pr" section to provide:
gh pr create (interactive or with flags)gh pr view, gh pr listgh pr checkout <number>gh pr review, gh pr diffgh pr mergegh pr checksLoad references/gh.md and search for "gh issue" section to provide:
gh issue creategh issue list (with filters)gh issue view <number>gh issue edit, gh issue closeLoad references/gh.md and search for "gh repo" section to provide:
gh repo viewgh repo clonegh repo creategh repo forkLoad references/gh.md and search for "gh api" section to provide:
gh api <endpoint>gh api graphql -f query='...'--jqFor advanced GraphQL use cases, load references/graphql.md:
Load references/gh.md and search for "gh release" section to provide:
gh release creategh release listgh release downloadgh release uploadWhen users describe their workflow needs, map them to patterns in the reference:
Pattern 1: Daily PR Workflow - Create, review, merge PRs Pattern 2: Issue Triage - List, filter, and manage issues Pattern 3: Release Automation - Script release creation and asset management Pattern 4: PR Checks and Status - Monitor CI/CD and review status Pattern 5: Multi-Repo Operations - Work across multiple repositories Pattern 6: GitHub API Scripting - Automate complex GitHub workflows Pattern 7: Code Review Workflow - Review PRs from command line
Load the appropriate pattern sections from references/gh.md based on user needs.
When users need to parse or format gh output:
references/gh.md--json, --jq, --templategh pr list --json number,title,stategh api /repos/{owner}/{repo}/pulls | jq '.[] | select(.draft==false)'When users need auth or config help:
references/gh.mdgh auth login, token managementgh config set, per-command defaultsgit_protocol, editor, pagerWhen users mention erk or worktree workflows:
references/gh.md--repo flag when neededWhen users need to understand gh + git workflows:
references/gh.mdWhen users want to integrate gh with CI/CD:
references/gh.mdGH_TOKENWhen users want to script GitHub workflows:
references/gh.mdgh in shell scripts--jq, exit codesWhen users need advanced capabilities:
gh alias setgh workflowLoad the relevant sections from references/gh.md for each advanced feature.
When standard gh commands are insufficient, use GraphQL via gh api graphql. Load references/graphql.md for comprehensive GraphQL guidance.
When to Use GraphQL:
Use GraphQL when the porcelain commands (gh pr, gh issue, etc.) cannot accomplish the task:
Projects V2: No REST API exists - all operations require GraphQL
Discussions: No porcelain commands available
Batch Operations: Query multiple resources in one API call
Complex Queries: Fetch nested data efficiently
Advanced Search: Complex filtering beyond basic commands
Custom Fields: Precise field selection
GraphQL Resources:
references/graphql.md - Complete GraphQL guide including:
references/graphql-schema-core.md - Core schema types (load only when needed):
Loading Strategy:
references/graphql.md for use cases and patternsreferences/graphql-schema-core.md only when detailed schema info is neededProjects V2 - Project automation examplesDiscussion - Discussion API examplesBatch - Batch query patternsPagination - Cursor-based paginationExample [0-9] - Complete working examplesWhen users encounter rate limit issues or need to optimize API usage:
references/api-backend-audit.md for complete command-to-API mappinggh api rate_limit --jq '.resources'When users encounter issues:
gh auth statusgh repo viewgh api usergh config listgh api rate_limitGH_DEBUG=api gh <command>Load the Troubleshooting section from references/gh.md for specific error patterns.
When users ask "what can gh do?":
pr, issue, repo, release, workflowgh <command> --helpgh api for anything not covered by porcelain commandsreferences/gh.mdgh.md - Comprehensive GitHub CLI mental model and command reference (~1480 lines)
graphql.md - GitHub GraphQL API comprehensive guide (~1000 lines)
graphql-schema-core.md - Core GraphQL schema types (~500 lines)
api-backend-audit.md - REST vs GraphQL API backend audit (~850 lines)
These references should be loaded as needed to ensure accurate, detailed information. Use progressive disclosure: start with the main reference, then load specialized GraphQL docs when needed.
npx claudepluginhub j2h4u/oh-my-claude-plugins --plugin git-toolsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.