xiaohongshu
xiaohongshu
gh-pr-handling
Expert GitHub CLI and PR handling. Use when working with pull requests, GitHub issues, reviews, CI checks, or any gh command operations.
Full skill instructions
Expert guidance for GitHub CLI (gh) operations and pull request management.
Activate this skill when the user:
gh# Create PR with proper formatting (use HEREDOC for body)
gh pr create --title "feat: add feature X" --body "$(cat <<'EOF'
## Summary
- Brief description of changes
## Test plan
- [ ] Unit tests pass
- [ ] Manual testing completed
EOF
)"
# Create draft PR
gh pr create --draft --title "WIP: feature X"
# Create PR with labels
gh pr create --title "fix: bug" --label "bug,priority:high"
# View current PR
gh pr view
# Get PR number
gh pr view --json number -q '.number'
# Get PR state (OPEN, MERGED, CLOSED)
gh pr view --json state -q '.state'
# List open PRs
gh pr list --state open
# List PRs for specific branch pattern
gh pr list --state open --json headRefName,number \
-q '.[] | select(.headRefName | test("^feature/")) | "\(.number):\(.headRefName)"'
# View all checks
gh pr checks
# Get check conclusions
gh pr checks --json conclusion -q '.[].conclusion'
# Get failed checks with details
gh pr checks --json name,conclusion,detailsUrl \
-q '.[] | select(.conclusion == "FAILURE")'
# Wait for checks to complete
gh pr checks --watch
# Get all reviews
gh pr view --json reviews -q '.reviews'
# Get Copilot review state
gh pr view --json reviews -q '
[.reviews[] | select(.author.login | test("copilot"; "i"))]
| sort_by(.submittedAt) | .[-1].state // ""
'
# Get latest Copilot comment
gh pr view --json comments,reviews -q '
(
[.comments[] | select(.author.login | test("copilot"; "i"))] +
[.reviews[] | select(.author.login | test("copilot"; "i"))]
) | sort_by(.createdAt) | .[-1]
'
# Add comment to PR
gh pr comment --body "Comment text here"
# Request review
gh pr edit --add-reviewer username
# Squash merge and delete branch
gh pr merge --squash --delete-branch
# Merge with auto-merge when checks pass
gh pr merge --auto --squash
# Rebase merge
gh pr merge --rebase --delete-branch
When branch protection requires:
copilot[bot] APPROVED state# Check if PR is mergeable
gh pr view --json mergeable -q '.mergeable'
# Get merge state status
gh pr view --json mergeStateStatus -q '.mergeStateStatus'
if gh pr view >/dev/null 2>&1; then
echo "PR exists"
else
echo "No PR for this branch"
fi
pr_info="$(gh pr view --json number,state 2>/dev/null || echo "")"
if [ -n "$pr_info" ]; then
pr_number="$(echo "$pr_info" | jq -r '.number')"
pr_state="$(echo "$pr_info" | jq -r '.state')"
fi
for i in $(seq 1 60); do
conclusions="$(gh pr checks --json conclusion -q '.[].conclusion')"
if echo "$conclusions" | grep -iq "failure"; then
echo "CI failed"
break
fi
if ! echo "$conclusions" | grep -iq "pending"; then
echo "CI passed"
break
fi
sleep 30
done
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) {
nodes { body author { login } }
}
}
}
}
}
}
' -F owner="OWNER" -F repo="REPO" -F pr=123
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { isResolved }
}
}
' -F threadId="THREAD_NODE_ID"
gh api repos/{owner}/{repo}/pulls/{pr}/comments/{comment_id}/replies -f body="Fixed in latest commit"
The auto-approve.yml GitHub workflow automates PR approval with strict conditions.
Approval conditions (ALL must be met):
Flow:
Manual trigger (fallback):
gh workflow run auto-approve.yml -f pr_number=123
Check workflow status:
# List recent runs
gh run list --workflow=auto-approve.yml
# Watch current run
gh run watch
# View run details
gh run view <run-id>
Why auto-approve exists:
Critical: Fix issues before approval:
When autopilot should NOT wait:
--json for scripting - Parse structured output with jqxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience