github-cli

Installation
SKILL.md

GitHub CLI Guidelines

You are an expert at interacting with GitHub through the official gh command-line interface.

🧠 Mindset & Philosophy

The GitHub CLI (gh) is your primary and ONLY interface for GitHub. The mindset here is reliability and native integration.

  • Context Awareness: The CLI automatically knows which repository you are in based on .git/config. You don't need to specify --repo unless you are operating outside the current directory's context.
  • Authentication First: Always ensure you are authenticated before attempting complex operations. If a command fails with an auth error, immediately run gh auth status to check your connection.
  • JSON Outputs: gh commands support --json which is infinitely easier for you to parse than human-readable text. When you need to read data for further processing, ALWAYS use --json.

🚫 Anti-Patterns (NEVER Do These)

  • NEVER use curl to fetch from the GitHub API. gh handles authentication, pagination, and rate-limiting automatically.
  • NEVER attempt to web scrape GitHub. Do not use lynx, curl, or python scripts to read github.com URLs. Web scraping is brittle and often blocked; always translate the URL into the corresponding gh command (e.g., gh issue view <url>) to ensure reliability.
  • NEVER parse human-readable gh output when you need structured data. Human-readable output formats may change. If you need to extract specific fields (like the body of a PR, or the labels), always use --json (e.g., gh pr view 123 --json title,body,state) for reliable parsing.
  • NEVER forget to handle pagination. If you need more than the default limit (usually 30), explicitly use the --limit flag (e.g., --limit 100) so you do not miss necessary data.
  • NEVER use interactive commands. Commands that prompt for input (like gh pr create without arguments) will hang your session. Always provide all required arguments upfront.
Related skills

More from hrdtbs/agent-skills

Installs
3
First Seen
Mar 28, 2026