Skip to content

Revamp find-reviewable-pr skill: priorities, defaults, and doc fixes#34160

Merged
PureWeen merged 10 commits intomainfrom
feature/find-reviewable-pr-priority-revamp
Feb 20, 2026
Merged

Revamp find-reviewable-pr skill: priorities, defaults, and doc fixes#34160
PureWeen merged 10 commits intomainfrom
feature/find-reviewable-pr-priority-revamp

Conversation

@PureWeen
Copy link
Member

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-pr skill with improved prioritization, better defaults, and documentation accuracy.

Changes

Script improvements (query-reviewable-prs.ps1):

  • Default mode now shows only P/0 + milestoned PRs (most actionable), filtering out changes-requested
  • Added Approved (not merged) and Ready To Review (project board) categories
  • Added Agent Reviewed category with AI summary highlights
  • Added Assignees column to output
  • Removed single-PR review section (will be a separate skill)
  • Limit increased to 20 per category

Documentation fixes (SKILL.md):

  • Fixed priority order: Milestoned (Aloha System.Maui! #4) before Agent Reviewed (Update README.md #5) to match script
  • Added default as valid -Category value with description
  • Fixed -Limit default from 10 to 20 to match script
  • Updated presentation order in Step 3 to match script

Review consensus

These doc fixes were identified by a multi-model review (7 AI models agreed on priority order, 5 agreed on category/limit defaults).

PureWeen and others added 5 commits February 20, 2026 09:14
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>
Copilot AI review requested due to automatic review settings February 20, 2026 15:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md to 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.

Comment on lines 44 to 45
# Find only docs-maui PRs waiting for review
pwsh .github/skills/find-reviewable-pr/scripts/query-reviewable-prs.ps1 -Category docs-maui
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 15 to 17
.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"

Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 60 to 61
[int]$Limit = 20,

Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-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.

Copilot uses AI. Check for mistakes.
}
}
"@
$result = Invoke-GitHubWithRetry -Command "gh api graphql -f query='$($graphqlQuery -replace "`n", " " -replace "'", "'\''")'" -Description "fetch project board items"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
$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"

Copilot uses AI. Check for mistakes.
Comment on lines 165 to 167
items(first: 100) {
nodes {
fieldValueByName(name: "Status") {
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
param([int]$PRNumber)

try {
$result = gh api "repos/dotnet/maui/issues/$PRNumber/comments" --jq '.[] | select(.body | contains("<!-- AI Summary -->")) | .body' 2>&1
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
$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

Copilot uses AI. Check for mistakes.
Comment on lines 684 to 696
# 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
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
# 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
}

Copilot uses AI. Check for mistakes.
"approved" { $processedPRs = $approvedPRs }
"ready-to-review" { $processedPRs = $readyToReviewPRs }
"agent-reviewed" { $processedPRs = $agentReviewedPRList }
"docs-maui" { $processedPRs = @() } # Will be handled separately
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-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).

Suggested change
"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
}

Copilot uses AI. Check for mistakes.
PureWeen and others added 5 commits February 20, 2026 10:06
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>
@PureWeen PureWeen merged commit dea56cb into main Feb 20, 2026
2 of 3 checks passed
@PureWeen PureWeen deleted the feature/find-reviewable-pr-priority-revamp branch February 20, 2026 19:33
@kubaflo kubaflo added area-ai-agents Copilot CLI agents, agent skills, AI-assisted development copilot labels Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai-agents Copilot CLI agents, agent skills, AI-assisted development copilot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants