
github-pr-query
Query GitHub pull requests with jq filtering and reusable selectors.
- Installs
- 64
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/github/gh-aw --skill github-pr-query- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads github-pr-query automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
GitHub Pull Request Query Skill
Query GitHub pull requests efficiently with built-in jq filtering.
Important: jq Parameter is Optional
The --jq parameter is optional. Without --jq, this skill returns schema and data size information instead of full data.
Use this to avoid oversized responses and inspect structure before targeted queries.
Use --jq '.' to get all data, or use a more specific filter for targeted results.
Usage
Use this skill to query pull requests from the current repository or any specified repository.
Basic Query (Returns Schema Only)
To list pull requests from the current repository:
./query-prs.sh
# Returns schema and data size, not full data
Get All Data
To get all PR data:
./query-prs.sh --jq '.'
With Repository
To query a specific repository:
./query-prs.sh --repo owner/repo
With jq Filtering
Use the --jq argument to filter and transform the output:
# Get only open PRs
./query-prs.sh --jq '.[] | select(.state == "open")'
# Get PR numbers and titles
./query-prs.sh --jq '.[] | {number, title}'
# Get PRs by a specific author
./query-prs.sh --jq '.[] | select(.author.login == "username")'
# Get merged PRs from last week
./query-prs.sh --jq '.[] | select(.mergedAt != null)'
# Count PRs by state
./query-prs.sh --jq 'group_by(.state) | map({state: .[0].state, count: length})'
Common Options
--state: Filter by state (open, closed, merged, all). Default: open--limit: Maximum number of PRs to fetch. Default: 30--repo: Repository in owner/repo format. Default: current repo--author: Filter PRs by author login--app: Filter PRs by GitHub App author--search: Apply GitHub issue/PR search syntax--jq: (Optional) jq expression for filtering/transforming output. If omitted, returns schema info
Example Queries
Find large PRs (many changed files):
./query-prs.sh --jq '.[] | select(.changedFiles > 10) | {number, title, changedFiles}'
Get PRs awaiting review:
./query-prs.sh --jq '.[] | select(.reviewDecision == "REVIEW_REQUIRED") | {number, title, author: .author.login}'
Get PRs authored by GitHub Actions app activity context:
./query-prs.sh --app github-actions --jq '.[] | {number, title, author: .author.login}'
Find in-scope review feedback (team/collaborator + trusted automation):
# Trusted automation is matched by login; humans are matched by association.
./query-prs.sh --jq \
'.[] | {number, title, reviews: [.reviews[]? | select(.author.login == "github-actions[bot]" or .author.login == "app/github-copilot" or .authorAssociation == "MEMBER" or .authorAssociation == "OWNER" or .authorAssociation == "COLLABORATOR")] }'
Ignore external review feedback:
./query-prs.sh --jq \
'.[] | {number, title, external_reviews: [.reviews[]? | select(.authorAssociation == "CONTRIBUTOR" or .authorAssociation == "FIRST_TIME_CONTRIBUTOR" or .authorAssociation == "FIRST_TIMER" or .authorAssociation == "NONE")] }'
List PRs with their labels:
./query-prs.sh --jq '.[] | {number, title, labels: [.labels[].name]}'
Output Format
The script outputs JSON by default, making it easy to pipe through jq for additional processing.
Requirements
- GitHub CLI (
gh) authenticated jqfor filtering (installed by default on most systems)
FAQ
What does the github-pr-query skill do?
Query GitHub pull requests with jq filtering and reusable selectors.
How do I install github-pr-query?
Run npx skills add https://github.com/github/gh-aw --skill github-pr-query in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/github-pr-query/ (personal) or .claude/skills/github-pr-query/ (project).
Which AI agents can use github-pr-query?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is github-pr-query safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains github-pr-query?
It is published by github in github/gh-aw, and it is an official skill from the maker of the technology it covers. It has 64 recorded installs.
More from github/gh-aw
github-mcp-server
github/gh-aw
Open the skill to read its SKILL.md instructions.
javascript-refactoring
github/gh-aw
Split large JavaScript files into maintainable modules safely.
developer
github/gh-aw
Core developer rules and coding conventions for gh-aw changes.
debugging-workflows
github/gh-aw
Diagnose gh-aw failures using the canonical debugging strategy and evidence reference.
agentic-workflows
github/gh-aw
Open the skill to read its SKILL.md instructions.
documentation
github/gh-aw
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.