This skill should be used when the user asks to "use GitHub CLI", "use gh command", work with "pull requests", "create a PR", "merge pull request", "approve PR", "review PR comments", "check PR status", work with "issues", "triage issues", "list issues", "label issues", work with "GitHub Actions", "check CI status", "fix failing CI", "view workflow runs", "download workflow logs", "rerun workflow", or mentions "gh tool", "gh command", or GitHub automation tasks. Provides comprehensive guidance for autonomously creating and executing GitHub workflows using the official GitHub CLI.
From git-lovelynpx claudepluginhub aaronbassett/agent-foundry --plugin git-lovelyThis skill uses the workspace's default tool permissions.
examples/fix-failing-ci.mdexamples/pr-review-cycle.mdexamples/triage-issues.mdreferences/actions-workflows.mdreferences/api-usage.mdreferences/common-patterns.mdreferences/issue-workflows.mdreferences/pr-workflows.mdreferences/troubleshooting.mdDispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Enable autonomous creation and execution of GitHub workflows using the official GitHub CLI (gh). This skill provides the knowledge and patterns needed to work with pull requests, issues, GitHub Actions, and the GitHub API through command-line operations.
Work autonomously within user-specified boundaries, respecting the current Claude Code mode (accept edits vs plan mode). Design multi-step workflows tailored to specific needs, handle errors intelligently, and always verify context before executing repository operations.
GitHub CLI must be installed. Check with:
gh --version
If not installed, guide the user to https://cli.github.com/ for installation instructions (brew, apt, etc.).
Do not proactively check authentication, but be prepared to recognize and diagnose authentication errors. When auth issues occur, guide the user to resolve them (see references/troubleshooting.md).
--help FirstCRITICAL: Every gh command and subcommand supports --help to display comprehensive usage information, including:
When to use --help:
Examples:
gh --help # List all commands
gh repo --help # Repository commands
gh repo create --help # Specific command details
gh pr create --help # PR creation options
gh api --help # API usage with examples
Pattern: gh <command> <subcommand> --help works at every level. Always check help before guessing command syntax.
Before executing repo-specific commands, verify repository context:
gh repo view
This confirms:
When context is unclear, infer from the current directory unless explicitly specified otherwise. Use -R owner/repo flag to override when working across multiple repositories.
Create, review, comment, merge, and manage pull requests programmatically.
Common operations:
See references/pr-workflows.md for detailed patterns.
Triage, label, comment, and manage issues systematically.
Common operations:
See references/issue-workflows.md for detailed patterns.
Monitor workflow runs, analyze failures, view logs, and trigger reruns.
Common operations:
See references/actions-workflows.md for detailed patterns.
Execute custom operations not covered by core commands using gh api.
Common operations:
--paginate--jqSee references/api-usage.md for detailed patterns and examples.
Many gh commands support --json for structured output and --jq for filtering.
When to use JSON:
When to use human-readable:
Pattern: Fetch with JSON, format for humans in responses:
# Get structured data
gh pr list --json number,title,author,state
# Extract specific fields
gh pr view 123 --json title,body --jq '.title'
# Process and format for user display
Always show users formatted, readable output in responses, even when working with JSON internally.
Always ask user confirmation before executing operations that:
Offer dry-run option when available:
I can perform a dry-run first to show what would happen. Would you like me to:
1. Execute the operation now
2. Perform a dry-run and report the outcome
3. Show you the exact command to review first
Use --dry-run flags where supported (check --help for availability).
When a gh command fails, follow this sequence:
Most errors have clear, actionable messages. Read the error carefully:
Use grep/search tools to find relevant information in references/troubleshooting.md:
# Search for specific error patterns
grep -i "authentication" references/troubleshooting.md
Avoid reading the entire troubleshooting file unless necessary.
--helpCheck that command syntax matches the help documentation:
gh <command> <subcommand> --help
Common issues:
If the error persists after these steps, report detailed diagnostics:
Ask for user guidance on how to proceed.
In accept-edits mode:
In plan mode:
Honor any constraints the user provides:
Fix Failing CI/CD: View run → Download logs → Analyze errors → Suggest fixes → Implement → Push → (Rerun only if workflow won't auto-trigger)
Triage Issues: Execute based on user-specified parameters (which labels to apply, what comments to add, etc.)
Implement PR Feedback: Read comments → Make changes → Commit → Push (respecting current mode)
Create Pull Requests: Verify branch → Push if needed → Create PR with description → Link issues (respecting current mode)
Be as autonomous as possible within established boundaries.
For frequently-used patterns and workflows, see references/common-patterns.md:
Discover available commands at any level:
gh --help # All core commands
gh pr --help # PR subcommands
gh issue --help # Issue subcommands
gh run --help # Actions run commands
gh workflow --help # Workflow commands
gh api --help # API usage (extensive examples)
Each help page includes:
Always show commands before execution so users understand what's running:
Checking repository context with:
$ gh repo view
Creating pull request with:
$ gh pr create --title "feat: Add user authentication" --body "..." --base main
This transparency helps users:
gh commandsDetailed workflows and patterns are documented in references/:
references/pr-workflows.md - Pull request operations: create, review, merge, commentreferences/issue-workflows.md - Issue management: triage, label, comment, closereferences/actions-workflows.md - GitHub Actions: check runs, view logs, rerunreferences/api-usage.md - Direct API calls with gh api for custom operationsreferences/common-patterns.md - Reusable patterns: auth checks, error recovery, batch operationsreferences/troubleshooting.md - Common problems and solutionsReal-world scenarios with expected outputs in examples/:
examples/fix-failing-ci.md - Complete workflow for diagnosing and fixing CI failuresexamples/triage-issues.md - Systematic issue triage with labeling and commentingexamples/pr-review-cycle.md - End-to-end PR creation, review, and merge process--help before guessing command syntaxFor comprehensive workflow details, consult the reference files. For working examples, see the examples directory. Always prioritize using --help to discover current command capabilities.