GitHub CLI Best Practices
<metadata>- Load if: Using GitHub CLI commands
- Prerequisites:
@smith-git/SKILL.md,@smith-gh-pr/SKILL.md
CRITICAL: Avoid GitHub MCP (Primacy Zone)
<forbidden>- GitHub MCP tools - hard to control pagination (25k token truncation), less complete than CLI, requires personal token
Use instead: gh pr-review extension, gh api, or GraphQL queries
Token Efficiency
<required>Safe perPage limits:
list_pull_requests: perPage 20-30get_review_comments: perPage 10 (bot reviews are massive)get_files: perPage 30search_repositories: minimal_output: true
Common Pitfalls
<required>- ALWAYS assign yourself:
--assignee @me - Draft PRs: Use
--draftwith#WIPin title for work-in-progress - Ensure gh installed: If
ghnot found, prompt user/agent to install
Issue Linking
In PR descriptions:
Closes #123- Auto-closes on mergeFixes #123- Same as ClosesRelates to #123- Links without closing
@smith-gh-pr/SKILL.md- PR workflows, review comment fetching@smith-git/SKILL.md- Git operations