MUST BE USED when working with GitHub: updating PRs, editing PR descriptions/titles, creating PRs, merging, review threads, `gh` CLI commands, GitHub API, or any pull request operations. Load this skill BEFORE running gh commands or modifying PRs. (plugin:fx-dev@fx-cc)
/plugin marketplace add fx/cc/plugin install fx-dev@fx-ccThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/graphql-patterns.mdreferences/known-issues.mdComprehensive guidance for working with the GitHub CLI (gh) including common pitfalls, GraphQL patterns, and self-improvement workflows.
To provide reliable, tested patterns for GitHub operations and prevent repeating known mistakes with the gh CLI. This skill automatically loads when using gh commands and continuously improves by documenting solutions to new issues.
This skill triggers automatically when:
gh command (pr, api, issue, repo, etc.)gh CLI errors or unexpected behaviorCRITICAL: Many features require a recent gh CLI version. Before using this skill:
Check current version:
gh --version
Compare with latest release:
Upgrade gh CLI:
Preferred method (mise):
mise use -g gh@latest
Alternative (apt):
sudo apt update && sudo apt install -y gh
Why mise is preferred:
Verify upgrade:
gh --version
# Should show version 2.80+ (as of Dec 2025)
Known version issues:
gh < 2.20: Limited GraphQL mutation supportgh < 2.40: Missing --body-file flag on gh pr editgh < 2.50: Incomplete review thread APIsNEVER leave comments directly on GitHub PRs. This is strictly forbidden:
gh pr review --comment - FORBIDDENgh pr comment - FORBIDDENgh api mutations that create new reviews or PR-level comments - FORBIDDENThe ONLY permitted interaction with review threads:
addPullRequestReviewThreadReplyresolveReviewThreadNever respond to or interact with human reviewer comments. Only automated Copilot feedback should be addressed.
Always verify that gh commands produced the expected result:
# After editing PR description
gh pr edit 13 --body-file /tmp/pr-body.md
gh pr view 13 --json body -q .body | head -20 # Verify it worked
# After resolving threads
gh api graphql -f query='mutation { ... }'
gh api graphql -f query='query { ... }' --jq '.data' # Verify resolution
For multi-step operations or data transformations, use gh api graphql directly:
# More reliable than chaining CLI commands
gh api graphql -f query='...' --jq '.data.repository.pullRequest'
Check references/known-issues.md before attempting operations that have failed before. Common issues include:
Be Direct and Concise:
Use Conventional Formats:
feat:, fix:, refactor:, docs:, etc.)feat: add user authentication)feat/user-auth, fix/login-bug)Content Rules:
#123, JIRA-456)Examples:
✅ Good PR Title:
feat: add user authentication with JWT tokens (#123)
❌ Bad PR Title:
feat: add user authentication - Phase 1: Initial Implementation
✅ Good Commit Message:
fix: resolve login timeout issue
- Increase session timeout to 30 minutes
- Add retry logic for failed auth requests
Fixes #456
❌ Bad Commit Message:
fix: resolve login timeout issue - Step 2 of authentication refactor
This is the second phase of our authentication improvements...
✅ Good Branch Name:
feat/jwt-authentication
fix/login-timeout
❌ Bad Branch Name:
feat/authentication-phase-1
fix/login-step-2
CRITICAL - Draft PR Requirement:
ALL pull requests MUST be created as drafts initially. Never create a PR that is immediately ready for review.
Workflow:
--draft flagfx-dev:pr-reviewer agent to review the changesCorrect approach:
# Always include --draft flag
gh pr create --draft --title "feat: add feature" --body "$(cat <<'EOF'
## Summary
...
EOF
)"
After fx-dev:pr-reviewer completes:
gh pr ready <PR_NUMBER>"gh pr ready automaticallyWhy drafts:
Recommended approach (most reliable):
# Write description to file first
cat > /tmp/pr-body.md <<'EOF'
## Summary
...
EOF
# Update via GitHub API
gh api repos/owner/repo/pulls/13 -X PATCH -F body=@/tmp/pr-body.md
See references/known-issues.md for failed approaches and why they don't work.
ONLY resolve threads created by GitHub Copilot. Never interact with human review threads.
Use GraphQL mutations to resolve Copilot threads:
# Get thread ID (must be a Copilot thread)
THREAD_ID="RT_kwDOQipvu86RqL7d"
# Resolve it
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}' -f threadId="$THREAD_ID"
Reminder: gh pr review --comment is FORBIDDEN. See the PR Comments Prohibition section above.
# Simple PR view
gh pr view 13
# Get specific fields as JSON
gh pr view 13 --json title,body,state,reviewThreads
# Filter with jq
gh pr view 13 --json reviewThreads --jq '.reviewThreads[] | select(.isResolved == false)'
Documents solutions to issues encountered during development:
When to read: Encountering errors with gh commands, before attempting complex operations.
Common GraphQL query and mutation patterns:
When to read: Need to query GitHub data, work with review threads, perform batch operations.
When encountering a new gh CLI issue:
Document the problem
Find the solution
Update this skill
references/known-issues.mdUpdate SKILL.md if needed
Problem encountered:
gh pr edit 13 --body "$(cat <<'EOF'
$(cat /tmp/pr-body.md)
EOF
)"
# Result: Literal string "$(cat /tmp/pr-body.md)" in PR description
Solution found:
gh api repos/owner/repo/pulls/13 -X PATCH -F body=@/tmp/pr-body.md
# Result: PR description correctly updated
Documentation added to references/known-issues.md:
This ensures the same mistake is never repeated.
gh commands had the intended effectreferences/known-issues.md when encountering new problems-F over -f for file inputs - Use @filename syntax for reliable file reading