Revamp find-reviewable-pr skill: priorities, defaults, and doc fixes#34160
Revamp find-reviewable-pr skill: priorities, defaults, and doc fixes#34160
Conversation
New priority order: 1. P/0 (always on top) 2. Approved but not merged 3. Ready To Review (from MAUI SDK Ongoing project board) 4. Agent Reviewed (with AI Summary highlights) 5. Milestoned, Partner, Community, Recent, docs-maui Changes: - Add query for approved-but-not-merged PRs (review:approved) - Add GraphQL query to MAUI SDK Ongoing project board for 'Ready To Review' status column - Detect agent labels (s/agent-approved, s/agent-reviewed, s/agent-changes-requested) on each PR - Fetch and parse AI Summary comments to extract merge-relevant highlights (verdict, gate results, fix comparison) - Add new -Category filter values: approved, ready-to-review, agent-reviewed - Deduplicate PRs across categories in 'all' view - Refactor output with Write-PREntry helper to reduce repetition - Update SKILL.md with new categories and usage examples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When presenting individual PRs for merge review, the skill now instructs to always include: - Project board status (MAUI SDK Ongoing) - All labels - AI Summary comment analysis (all 4 phases) - CI build status - Clear merge assessment with reasoning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… add assignees - Default category now shows only P/0 and milestoned PRs - Filter out changes-requested PRs in default mode - Milestoned now ranks above agent-reviewed - Add assignees field to every PR entry - Always show agent review status (reviewed/not reviewed) - Fix summary counts to match actual displayed (deduped/filtered) numbers - Increase default limit from 10 to 20 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This skill is focused on finding PRs to review. Individual PR deep-dive analysis will be a separate skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Swap priority order: Milestoned (#4) before Agent Reviewed (#5) - Add 'default' as valid -Category value (P/0 + milestoned only) - Fix -Limit default from 10 to 20 to match script - Update Step 3 presentation order to match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the find-reviewable-pr skill to better surface the most actionable PRs first by adjusting defaults, adding new prioritization categories (approved, project-board “Ready To Review”, agent-reviewed), and aligning user-facing documentation with the script’s intended behavior.
Changes:
- Changed the default category behavior and increased per-category limits.
- Added new PR categories (Approved, Ready To Review via project board, Agent Reviewed) and expanded output fields (e.g., assignees + agent summary highlights).
- Updated
SKILL.mdto document the new categories/parameters and revised ordering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
.github/skills/find-reviewable-pr/scripts/query-reviewable-prs.ps1 |
Adds new query paths/categories, project-board integration, agent-summary extraction, output refactor, and new defaults. |
.github/skills/find-reviewable-pr/SKILL.md |
Updates skill documentation to describe new categories, defaults, and output expectations. |
| # Find only docs-maui PRs waiting for review | ||
| pwsh .github/skills/find-reviewable-pr/scripts/query-reviewable-prs.ps1 -Category docs-maui |
There was a problem hiding this comment.
The Quick Start section still frames the default script invocation as returning "all reviewable PRs" / "top from each category", but the script now defaults to -Category default (P/0 + milestoned only). Please update the Quick Start prose/example to reflect the new default behavior, and add/keep an explicit -Category all example for the previous behavior.
| .PARAMETER Category | ||
| Filter by category: "milestoned", "priority", "recent", "partner", "community", "docs-maui", "all" | ||
| Filter by category: "default" (P/0 + milestoned only), "milestoned", "priority", "recent", "partner", "community", "docs-maui", "approved", "ready-to-review", "agent-reviewed", "all" | ||
|
|
There was a problem hiding this comment.
The comment-based help block at the top (the .DESCRIPTION prioritization list) still describes the old ordering/categories (milestoned first, no approved/ready-to-review/agent-reviewed). Since the script behavior has changed significantly, please update that list so Get-Help reflects the current prioritization and default behavior.
| [int]$Limit = 20, | ||
|
|
There was a problem hiding this comment.
-Limit default was changed to 20, but the comment-based help text above still says the default is 10 (".PARAMETER Limit ... (default: 10)"). Please update the help text to match the actual default so Get-Help output is accurate.
| } | ||
| } | ||
| "@ | ||
| $result = Invoke-GitHubWithRetry -Command "gh api graphql -f query='$($graphqlQuery -replace "`n", " " -replace "'", "'\''")'" -Description "fetch project board items" |
There was a problem hiding this comment.
The GraphQL query string is flattened with -replace "n", " ", but on Windows the here-string will typically contain CRLF, leaving stray \rcharacters in the command. This can causegh api graphqlto fail intermittently. Consider replacing both CRLF/LF (e.g.,-replace "r?n", " "or-replace "r", "" after handling \n).
| $result = Invoke-GitHubWithRetry -Command "gh api graphql -f query='$($graphqlQuery -replace "`n", " " -replace "'", "'\''")'" -Description "fetch project board items" | |
| $result = Invoke-GitHubWithRetry -Command "gh api graphql -f query='$($graphqlQuery -replace "`r?`n", " " -replace "'", "'\''")'" -Description "fetch project board items" |
| items(first: 100) { | ||
| nodes { | ||
| fieldValueByName(name: "Status") { |
There was a problem hiding this comment.
The project board query requests only items(first: 100). If the project contains more than 100 items, PRs beyond the first page will never be considered "Ready To Review". Consider adding pagination (pageInfo/endCursor) to fetch all pages (or at least until no more matching PRs are found).
| param([int]$PRNumber) | ||
|
|
||
| try { | ||
| $result = gh api "repos/dotnet/maui/issues/$PRNumber/comments" --jq '.[] | select(.body | contains("<!-- AI Summary -->")) | .body' 2>&1 |
There was a problem hiding this comment.
Get-AgentSummaryComment calls the issue comments REST endpoint without pagination. GitHub defaults to the first page (typically 30 comments), so the AI Summary marker may be missed on PRs with longer discussions. Consider requesting per_page=100 and paginating (or using GraphQL) to reliably find the comment.
| $result = gh api "repos/dotnet/maui/issues/$PRNumber/comments" --jq '.[] | select(.body | contains("<!-- AI Summary -->")) | .body' 2>&1 | |
| $result = gh api "repos/dotnet/maui/issues/$PRNumber/comments" -F per_page=100 --paginate --jq '.[] | select(.body | contains("<!-- AI Summary -->")) | .body' 2>&1 |
| # Fetch agent summaries for agent-reviewed PRs | ||
| $agentReviewedPRs = $processedPRs | Where-Object { $_.HasAgentReview } | ||
| if ($agentReviewedPRs.Count -gt 0) { | ||
| Write-Host "" | ||
| Write-Host "Fetching agent review summaries..." -ForegroundColor Cyan | ||
| foreach ($pr in $agentReviewedPRs) { | ||
| Write-Host " PR #$($pr.Number)..." -ForegroundColor Gray -NoNewline | ||
| $commentBody = Get-AgentSummaryComment -PRNumber $pr.Number | ||
| if ($commentBody) { | ||
| $pr.AgentSummary = Get-AgentSummaryHighlights -CommentBody $commentBody | ||
| Write-Host " ✓" -ForegroundColor Green | ||
| } else { | ||
| Write-Host " (no AI Summary comment found)" -ForegroundColor Yellow |
There was a problem hiding this comment.
Agent summaries are fetched for all PRs with agent labels immediately after processing, even when -Category default (or other categories) won't display Agent Reviewed results. This can add a lot of extra gh api calls and slow down the default path. Consider fetching summaries only when the output will include agent-reviewed PRs (e.g., -Category agent-reviewed/all, or when OutputFormat is json and you include the summary fields).
| # Fetch agent summaries for agent-reviewed PRs | |
| $agentReviewedPRs = $processedPRs | Where-Object { $_.HasAgentReview } | |
| if ($agentReviewedPRs.Count -gt 0) { | |
| Write-Host "" | |
| Write-Host "Fetching agent review summaries..." -ForegroundColor Cyan | |
| foreach ($pr in $agentReviewedPRs) { | |
| Write-Host " PR #$($pr.Number)..." -ForegroundColor Gray -NoNewline | |
| $commentBody = Get-AgentSummaryComment -PRNumber $pr.Number | |
| if ($commentBody) { | |
| $pr.AgentSummary = Get-AgentSummaryHighlights -CommentBody $commentBody | |
| Write-Host " ✓" -ForegroundColor Green | |
| } else { | |
| Write-Host " (no AI Summary comment found)" -ForegroundColor Yellow | |
| # Decide whether we actually need to fetch agent summaries for this invocation | |
| $shouldFetchAgentSummaries = $false | |
| # Fetch summaries when agent-reviewed PRs will be shown explicitly | |
| if ($Category -eq 'agent-reviewed' -or $Category -eq 'all') { | |
| $shouldFetchAgentSummaries = $true | |
| } | |
| # Or when JSON output is requested and agent-summary-related fields are included | |
| elseif ($OutputFormat -eq 'json' -and $Fields) { | |
| $fieldsText = ($Fields -join ',') | |
| if ($fieldsText -match 'AgentSummary' -or $fieldsText -match 'HasAgentReview') { | |
| $shouldFetchAgentSummaries = $true | |
| } | |
| } | |
| # Fetch agent summaries for agent-reviewed PRs only when needed | |
| if ($shouldFetchAgentSummaries) { | |
| $agentReviewedPRs = $processedPRs | Where-Object { $_.HasAgentReview } | |
| if ($agentReviewedPRs.Count -gt 0) { | |
| Write-Host "" | |
| Write-Host "Fetching agent review summaries..." -ForegroundColor Cyan | |
| foreach ($pr in $agentReviewedPRs) { | |
| Write-Host " PR #$($pr.Number)..." -ForegroundColor Gray -NoNewline | |
| $commentBody = Get-AgentSummaryComment -PRNumber $pr.Number | |
| if ($commentBody) { | |
| $pr.AgentSummary = Get-AgentSummaryHighlights -CommentBody $commentBody | |
| Write-Host " ✓" -ForegroundColor Green | |
| } else { | |
| Write-Host " (no AI Summary comment found)" -ForegroundColor Yellow | |
| } |
| "approved" { $processedPRs = $approvedPRs } | ||
| "ready-to-review" { $processedPRs = $readyToReviewPRs } | ||
| "agent-reviewed" { $processedPRs = $agentReviewedPRList } | ||
| "docs-maui" { $processedPRs = @() } # Will be handled separately |
There was a problem hiding this comment.
-Category default is now the script default, but the category filter switch doesn't handle it. As a result, -OutputFormat table (and the returned $processedPRs for non-review outputs) will include all processed PRs instead of only P/0 + milestoned (and excluding changes-requested) as documented. Add an explicit "default" case that sets $processedPRs to the intended filtered set (and consider de-duping between priority/milestoned).
| "docs-maui" { $processedPRs = @() } # Will be handled separately | |
| "docs-maui" { $processedPRs = @() } # Will be handled separately | |
| "default" { | |
| # Default: P/0 + milestoned, excluding changes-requested, with de-duplication | |
| $defaultPRs = @() | |
| if ($priorityPRs) { $defaultPRs += $priorityPRs } | |
| if ($milestonedPRs) { $defaultPRs += $milestonedPRs } | |
| $processedPRs = $defaultPRs | | |
| Where-Object { $_.ReviewDecision -ne "CHANGES_REQUESTED" } | | |
| Sort-Object Number -Unique | |
| } |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Script .DESCRIPTION: rewrite priority order to match actual output (was: Milestoned→P/0→Recent; now: P/0→Approved→ReadyToReview→Milestoned→...) - Script .DESCRIPTION: fix Limit default from 10 to 100 - SKILL.md Quick Start: fix comment from 'shows top from each category' to 'shows P/0 and milestoned PRs (default)' - SKILL.md Step 1: update SR3/SR4 reference to SR5/SR6 - SKILL.md Step 1: remove -Limit 5 from example (default is now 100) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…fault switch case - Fix CRLF handling in GraphQL query (-replace "`r?`n") for Windows - Defer agent summary fetching until after category filtering, only fetch for PRs that will actually be displayed (5 calls vs ~60) - Add 'default' case to category switch for table/json output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove Get-AgentSummaryComment, Get-AgentSummaryHighlights functions and the deferred summary fetching block (~110 lines). Agent review status is still detected via labels (s/agent-reviewed, s/agent-approved, etc.) at zero extra API cost. Summary comment parsing will be added later as a separate skill for individual PR review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add pagination to project board GraphQL query so projects with >100 items correctly discover all 'Ready To Review' PRs - Add '-Category all' example to SKILL.md Quick Start section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Revamps the
find-reviewable-prskill with improved prioritization, better defaults, and documentation accuracy.Changes
Script improvements (
query-reviewable-prs.ps1):Documentation fixes (
SKILL.md):defaultas valid-Categoryvalue with description-Limitdefault from 10 to 20 to match scriptReview consensus
These doc fixes were identified by a multi-model review (7 AI models agreed on priority order, 5 agreed on category/limit defaults).