github-pr-query

Query GitHub pull requests with optional jq filtering and JSON output.

4.9k|489|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/githubnext/gh-aw --skill github-pr-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-pr-query
Source: https://github.com/githubnext/gh-aw/tree/main/skills/github-pr-query
Command: npx skills add https://github.com/githubnext/gh-aw --skill github-pr-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of querying GitHub pull requests by providing efficient jq filtering support, allowing users to quickly retrieve, filter, and transform PR data for analysis or further automation. It helps AI agents and developers automate data collection and analysis from GitHub.

Core Features & Use Cases

  • Flexible Querying: List PRs from the current or any specified repository with options for state (open, closed, merged, all) and limit.
  • Advanced jq Filtering: Use jq expressions to filter by author, labels, changed files, review decisions, and transform output to desired formats.
  • Schema & Size Information: Get schema and data size details when no jq filter is provided, preventing overwhelming responses.
  • Automated Data Extraction: Ideal for AI agents needing specific PR data for decision-making or reporting.
  • Use Case: An AI agent needs to find all open pull requests with more than 10 changed files that are awaiting review. This skill enables the agent to execute a query-prs.sh --jq '.[] | select(.state == "open" and .changedFiles > 10 and .reviewDecision == "REVIEW_REQUIRED")' command.

Quick Start

Use the github-pr-query skill to list the number and title of all open pull requests in the current repository: ./query-prs.sh --jq '.[] | {number, title}'.

Frequently Asked Questions about github-pr-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I filter GitHub pull requests by specific criteria like author or labels?

Filter GitHub pull requests using jq expressions with the `--jq` option. For example, filter by author with `.[] | select(.author == "username")` or by labels with `.[] | select(.labels[] | contains("bug"))`. The skill returns matching PR data including number, title, state, and other fields.

Can I query pull requests from a repository other than the current one?

Yes, specify a different repository using the `--repo` option. The skill queries GitHub pull requests from the current repository by default but supports the `--repo` flag to target any repository you have access to via GitHub CLI.

What do I need installed to use GitHub pull request querying with jq?

You need GitHub CLI and jq installed on your system. The skill requires both tools to function—GitHub CLI connects to your repositories and jq provides the filtering and transformation capabilities for pull request data.

How do I find pull requests with complex conditions like high file changes and pending reviews?

Combine multiple conditions in a single jq filter using logical operators. For example, `.[] | select(.state == "open" and .changedFiles > 10 and .reviewDecision == "REVIEW_REQUIRED")` returns open PRs with more than 10 changed files awaiting review, enabling automated data extraction for decision-making.

What information does the skill return about each pull request?

The skill returns JSON data including PR number, title, state (open, closed, merged), author, creation and merge dates, changed file count, labels, and URL. Run without `--jq` to see the schema and data size before filtering.

Can I use this to automate pull request data collection for analysis or reporting?

Yes, the skill is designed for automated data extraction from GitHub pull requests. AI agents and developers can query, filter, and transform PR data using jq to feed downstream analysis, reporting, or decision-making workflows without manual GitHub interface interaction.