.agents/skills/gh-cli/SKILL.md
Official GitHub CLI (gh) automation for PRs, Issues, Actions, and Repos.
npx skillsauth add thesammykins/dotfiles gh-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert GitHub automation using the official gh CLI tool.
Enforces machine-readable outputs (--json) and safe, atomic operations for Pull Requests, Issues, Repositories, and Actions.
<context_gathering> Execute these commands IN PARALLEL to establish ground truth:
# Verify installation and check version
gh --version || echo "NOT_INSTALLED"
# Check authentication status
gh auth status || echo "NOT_AUTHENTICATED"
# Check current repo context (if applicable)
gh repo view --json name,owner,url || echo "NO_REPO_CONTEXT"
Capture these data points:
gh installed? (If "NOT_INSTALLED", STOP and ask user to install it: brew install gh or equivalent).gh auth login).pr create).
</context_gathering>| Condition | Strategy |
|-----------|----------|
| User wants to read data (list PRs, view issue) | Read-Only: Use list/view with --json flag. Parse output strictly. |
| User wants to modify state (create PR, merge) | Transactional: Check prerequisites -> Execute -> Verify. |
| User wants to checkout code | Context-Switch: Verify clean working directory -> gh pr checkout. |
| User wants to run/watch CI/CD | Observability: gh run list -> gh run watch. |
You MUST output this block before proceeding. NO EXCEPTIONS.
ANALYSIS RESULT
===============
Target Repo: [owner/repo]
Operation: [Read | Write | Context-Switch | CI]
Command Chain:
1. [Validation Step]
2. [Primary Action]
3. [Verification Step]
Required Scopes: [e.g. repo, read:org]
</analysis>
NEVER parse the default tabular text output. It is intended for humans, not agents.
# Correct: Get specific fields as JSON
gh pr list --json number,title,url,state
# Correct: View specific issue details
gh issue view 123 --json body,comments
# 1. Push current branch
git push -u origin HEAD
# 2. Create PR with explicit title/body
gh pr create --title "feat: new feature" --body "Detailed description..." --web
# Note: --web is optional, usually we want non-interactive:
gh pr create --title "..." --body "..." --base main
# List recent runs
gh run list --limit 5 --json databaseId,status,conclusion,workflowName
# Watch a run
gh run watch <run-id> --exit-status
Pre-Flight Check:
gh is authenticated.Action Execution:
gh command with appropriate flags.--body "...").Error Handling:
gh returns exit code 1, check stderr.--json <fields> when retrieving information.--yes, --public, --fill) or pass inputs explicitly.gh auth refresh -s <scope>).
</execution>
# Example: Verify PR creation
gh pr view <pr-number> --json state,url
# Example: Verify Issue closure
gh issue view <issue-number> --json state
Final Report: Output a summary of the action, including relevant URLs (PR link, Issue link, Run link). </verification>
<anti_patterns>
gh pr list default output. ALWAYS USE --json.gh pr create without flags, causing the process to hang waiting for user input.--head).gh auth status first (in Phase 0).url is needed. Be specific with --json.
</anti_patterns>development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Autonomous feature development - setup and execution. Triggers on: ralph, set up ralph, run ralph, run the loop, implement tasks. Two phases: (1) Setup - chat through feature, create tasks with dependencies (2) Loop - pick ready tasks, implement, commit, repeat until done.
tools
Enforces the 2025 Python stack. Replaces legacy tools (pip, flake8, isort) with modern, fast equivalents (uv, ruff). Mandates strict type hints.
documentation
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.