agentsclimarketplace

Run3 github api paginated search

Skill cxcscmu/SkillLearnBench/skills/b3-teacher-feedback-gemini-3-flash-preview/github-repo-analytics/run3_github_api_paginated_search

Fetch data from GitHub's Search API using the GitHub CLI (gh) while correctly handling pagination and merging results. Use this when you need to retrieve more than 100 items or ensure full dataset coverage for a specific period.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run3_github_api_paginated_search

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.2 KB, 247 tokens by cl100k_base, as published. Nobody here has run it

To fetch all items from a GitHub search query across multiple pages:

  1. Use the gh api command with the --paginate flag.
  2. Target the search/issues endpoint (which covers both Issues and Pull Requests).
  3. Append your query using the -f q="..." parameter.
  4. Use jq with the -s (slurp) flag to combine the separate JSON objects returned for each page into a single array of items.

Example for fetching all PRs created in a specific month:

gh api --paginate "search/issues" -f q="repo:cli/cli is:pr created:2024-12-01..2024-12-31" | jq -s 'map(.items) | add' > prs.json

Key considerations:

  • Pagination: Without -s 'map(.items) | add', jq will only process the first page's object or encounter errors when trying to treat multiple JSON objects as a single stream.
  • Separate Queries: Use distinct queries for "created" and "closed" events to ensure accuracy, as an item created in one month might be closed in another.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.