fetch-milestone-prs
Skill996 starsChanged 37 days agoMITView on GitHub
Fetches all merged pull requests for a given GitHub milestone and saves their metadata as individual JSON files. Use this skill when asked to retrieve PRs for a milestone, gather PR data for release notes, or collect milestone PR metadata.
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 125
If the milestone is not found, the script prints available milestones and exits.
- Very specific: line 126
If gh is not authenticated, the script will fail with an auth error.
- Distinctive: line 127
If a specific PR detail fetch fails, the script exits.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
This skill retrieves all merged pull requests associated with a GitHub milestone and saves each PR's metadata as a separate JSON file for downstream processing (e.g., release notes generation, changelog creation).
When to Use This Skill
- User asks to fetch or retrieve PRs for a milestone
- User wants to gather PR data before generating release notes
- User needs milestone PR metadata for analysis or categorization
- User mentions a milestone name and wants to see what PRs were included
- As a prerequisite step before invoking the
release-notesprompt
Prerequisites
- The
ghCLI must be installed and authenticated (gh auth login) - Python 3.8+ must be available
Instructions
- Identify the milestone name from the user's request. This is typically a version string like
7.0.0-preview4,6.1.5, etc. - Identify the repository (optional). Defaults to
dotnet/SqlClient. If the user specifies a different repo, pass it via--repo. Run the fetch script located in this skill's directory:
python .github/skills/fetch-milestone-prs/fetch-milestone-prs.py <milestone> [--repo OWNER/REPO] [--output-dir DIR]Examples:
# Default: outputs to .milestone-prs/<milestone>/ python .github/skills/fetch-milestone-prs/fetch-milestone-prs.py 7.0.0-preview4 # Custom output directory python .github/skills/fetch-milestone-prs/fetch-milestone-prs.py 7.0.0-preview4 --output-dir ./my-prs # Different repo python .github/skills/fetch-milestone-prs/fetch-milestone-prs.py 7.0.0-preview4 --repo dotnet/efcore- Verify the output by checking the generated
_index.jsonfile in the output directory. It contains a summary of all fetched PRs. - Report results to the user:
- Total merged PRs found
- Total skipped (closed but not merged)
- Output directory path
- Mention that each PR is in a separate
<number>.jsonfile and the index is at_index.json
Output Format
Directory structure
.milestone-prs/<milestone>/
├── _index.json # Summary index of all PRs
├── 1234.json # Individual PR metadata
├── 1235.json
└── ...Individual PR file (<number>.json)
Each file contains:
{
"number": 1234,
"title": "PR title",
"author": "github-username",
"author_association": "MEMBER",
"labels": ["label1", "label2"],
"assignees": ["user1"],
"state": "closed",
"merged": true,
"merged_at": "2026-01-15T12:00:00Z",
"merge_commit_sha": "abc123...",
"created_at": "2026-01-10T10:00:00Z",
"closed_at": "2026-01-15T12:00:00Z",
"html_url": "https://github.com/dotnet/SqlClient/pull/1234",
"body": "Full PR description markdown...",
"comments_count": 5,
"is_merged_pr": true,
"has_public_api_label": false,
"has_engineering_label": false,
"has_test_label": true
}Index file (_index.json)
{
"milestone": "7.0.0-preview4",
"repo": "dotnet/SqlClient",
"total_closed": 76,
"total_merged": 74,
"total_skipped": 2,
"prs": [
{
"number": 1234,
"title": "PR title",
"author": "github-username",
"labels": ["label1"],
"merged_at": "2026-01-15T12:00:00Z",
"has_public_api_label": false,
"has_engineering_label": false,
"has_test_label": true
}
]
}Derived Fields
The script computes these boolean flags for easy categorization:
| Field | Logic |
has_public_api_label | Any label contains "Public API :new:" |
has_engineering_label | Any label contains "Engineering" |
has_test_label | Any label contains "Test" |
Error Handling
- If the milestone is not found, the script prints available milestones and exits. Ask the user to verify the milestone name.
- If
ghis not authenticated, the script will fail with an auth error. Instruct the user to rungh auth login. - If a specific PR detail fetch fails, the script exits. This is rare but can happen with API rate limits — suggest waiting and retrying.
- On Windows, if encoding errors occur, the script uses
errors="replace"to handle non-UTF-8 characters gracefully.
Using Output with Other Workflows
The output files are designed to be consumed by:
- The
release-notesprompt — tag the output directory (e.g.,@.milestone-prs/7.0.0-preview4/*) when invoking it - Manual analysis — read
_index.jsonfor a quick overview, individual files for PR details - Any script or agent that needs structured PR metadata
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agentic-workflowsSkill
- generate-mstest-filterSkill
- review-pr-feedbackSkill
- sqlclient-code-reviewSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

