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)
Provides expert guidance for GitHub CLI operations, including PR management, Copilot review workflows, and GraphQL patterns. Automatically loads when running `gh` commands or working with pull requests to prevent common pitfalls and ensure reliable GitHub operations.
/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
When users refer to repositories, recognize the owner/repo shorthand format and expand it appropriately.
The pattern owner/repo (e.g., fx/dotfiles, anthropics/claude-code) refers to a GitHub repository. Always expand this to a full URL.
| User says | Interpretation |
|---|---|
| "clone fx/dotfiles" | Clone git@github.com:fx/dotfiles.git |
| "look at anthropics/claude-code" | Repository at github.com/anthropics/claude-code |
| "fork vercel/next.js" | Fork from github.com/vercel/next.js |
When cloning, always try SSH first, then fall back to gh CLI:
# User: "clone fx/dotfiles"
# 1. Try SSH first (preferred)
git clone git@github.com:fx/dotfiles.git
# 2. If SSH fails, use gh CLI (handles auth automatically)
gh repo clone fx/dotfiles
| Shorthand | SSH URL | HTTPS URL |
|---|---|---|
owner/repo | git@github.com:owner/repo.git | https://github.com/owner/repo.git |
fx/dotfiles | git@github.com:fx/dotfiles.git | https://github.com/fx/dotfiles.git |
IMPORTANT: Never prompt the user to clarify owner/repo references - assume GitHub and proceed with cloning.
gh CLIWhen SSH keys aren't configured or GIT_SSH_COMMAND proxying fails, use gh CLI for git operations. The gh CLI handles authentication automatically when logged in.
Before using gh for git operations, verify authentication:
gh auth status
If authenticated, gh can handle cloning, pushing, and other git operations without SSH keys.
Preferred approach when SSH works:
git clone git@github.com:owner/repo.git
Alternative via gh (no SSH required):
gh repo clone owner/repo
This uses HTTPS with automatic token authentication - no SSH key needed.
gh for AuthenticationSet up git to use gh as a credential helper for HTTPS:
gh auth setup-git
This configures git to use gh for HTTPS authentication, allowing standard git commands to work:
git clone https://github.com/owner/repo.git
git push origin main
gh vs SSH| Scenario | Use |
|---|---|
| SSH key configured and working | git clone git@github.com:... |
No SSH key, but gh auth status shows logged in | gh repo clone ... or HTTPS with gh auth setup-git |
Coder workspace with broken GIT_SSH_COMMAND | gh repo clone ... |
CI/CD with GITHUB_TOKEN | HTTPS with token auth |
gh Git Operations# Clone
gh repo clone owner/repo
gh repo clone owner/repo -- --depth 1 # Shallow clone
# Fork and clone
gh repo fork owner/repo --clone
# View repo info
gh repo view owner/repo
# Create repo
gh repo create my-repo --private --clone
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)'
GitHub Copilot can automatically review pull requests. This section covers how to check review status and manage Copilot reviews.
copilot-pull-request-reviewer (GraphQL) or copilot-pull-request-reviewer[bot] (REST API)COMMENTED state reviews, never APPROVED or CHANGES_REQUESTEDThere is no API endpoint to programmatically request a Copilot review. Reviews are triggered by:
Automatic reviews via repository rulesets (recommended)
GitHub UI
Push new commits (if "Review new pushes" ruleset is enabled)
Query review requests for Bot reviewers:
# Replace OWNER, REPO, PR_NUMBER with actual values
gh api graphql -f query='
query {
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: PR_NUMBER) {
reviewRequests(first: 10) {
nodes {
requestedReviewer {
... on Bot { login }
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewRequests.nodes[] | select(.requestedReviewer.login == "copilot-pull-request-reviewer")'
If output is non-empty, Copilot review is pending (in progress).
Query completed reviews via REST API:
gh api repos/OWNER/REPO/pulls/PR_NUMBER/reviews \
--jq '.[] | select(.user.login == "copilot-pull-request-reviewer[bot]") | {state, submitted_at}'
Or via GraphQL:
gh api graphql -f query='
query {
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: PR_NUMBER) {
reviews(first: 20) {
nodes {
author { login }
state
submittedAt
}
}
}
}
}' --jq '.data.repository.pullRequest.reviews.nodes[] | select(.author.login == "copilot-pull-request-reviewer")'
Query all Copilot-related information in one call:
gh api graphql -f query='
query {
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: PR_NUMBER) {
reviewRequests(first: 10) {
nodes {
requestedReviewer {
... on Bot { login }
}
}
}
reviews(first: 20) {
nodes {
author { login }
state
submittedAt
}
}
reviewThreads(first: 100) {
totalCount
nodes {
id
isResolved
comments(first: 1) {
nodes {
author { login }
}
}
}
}
}
}
}'
Then filter for Copilot status:
# Pending review request
jq '.data.repository.pullRequest.reviewRequests.nodes[] | select(.requestedReviewer.login == "copilot-pull-request-reviewer")'
# Completed reviews
jq '.data.repository.pullRequest.reviews.nodes[] | select(.author.login == "copilot-pull-request-reviewer")'
# Unresolved Copilot threads
jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and .comments.nodes[0].author.login == "copilot-pull-request-reviewer")] | length'
| Condition | Meaning |
|---|---|
Review request exists for copilot-pull-request-reviewer | Review in progress |
Review with submittedAt exists, no pending request | Review completed |
| Unresolved threads with Copilot author | Feedback needs attention |
| No request, no reviews | Copilot not configured or not triggered |
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 readingCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.