github/awesome-copilot / skills/copilot-pr-autopilot
copilot-pr-autopilot
VerifiedCopilot left 14 review comments on your PR — half are nits. Hours of fix → reply → resolve → re-request, and each round lands MORE comments. This skill runs loop engineering: auto-triggers Copilot Code Review via GraphQL (no @copilot mention), triages every open thread (Copilot, humans, advanced-security) with a fix / decline / escalate rubric, dispatches parallel fix sub-agents that obey the repo build/test/lint conventions, commits per iteration, replies+resolves citing the pushed SHA, then re-triggers until HEAD is reviewed with zero threads awaiting the agent's reply (remaining open threads are explicit hand-offs to the human — escalated declines, design tradeoffs). You merge a clean PR; the bot runs it. Trigger phrases: "address copilot comments", "run a copilot review loop", "fix this PR", "iterate on copilot feedback". Repo-agnostic, gh CLI + PowerShell. Full autopilot needs repo Triage/Write; external PR authors get single-iteration mode plus manual re-trigger (UI 🔄 or substantive-commit push).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.6 KB |
| references/01-request-review.md | markdown | 1.4 KB |
| references/02-wait.md | markdown | 1.7 KB |
| references/03-list-threads.md | markdown | 1.7 KB |
| references/04-triage.md | markdown | 8.0 KB |
| references/05-fix.md | markdown | 2.4 KB |
| references/06-build-test.md | markdown | 2.1 KB |
| references/07-commit-push.md | markdown | 712 B |
| references/08-reply-resolve.md | markdown | 3.8 KB |
| references/09-convergence.md | markdown | 10.5 KB |
| references/10-cleanup.md | markdown | 707 B |
| references/api-quirks.md | markdown | 8.4 KB |
| references/orchestration.md | markdown | 6.1 KB |
| scripts/01-request-review.ps1 | script | 13.2 KB |
| scripts/02-check-review-status.ps1 | script | 17.4 KB |
| scripts/03-list-open-threads.ps1 | script | 4.0 KB |
| scripts/08-reply-and-resolve.ps1 | script | 3.3 KB |
| scripts/09-review-round.ps1 | script | 5.5 KB |
| scripts/10-cleanup-outdated.ps1 | script | 17.7 KB |
| scripts/_lib.ps1 | script | 15.5 KB |
| templates/reply-decline.md | markdown | 871 B |
| templates/reply-drift.md | markdown | 317 B |
| templates/reply-fix.md | markdown | 839 B |
| templates/reply-partial.md | markdown | 376 B |
scripts/03-list-open-threads.ps1
View on GitHub<#
.SYNOPSIS
List unresolved review threads on a pull request (all reviewers).
.DESCRIPTION
Fetches review threads via GraphQL (paginated) and prints every
thread that is still `isResolved: false`. Threads from all reviewers
(Copilot, humans, other bots) are included; the triage step decides
what to do with each.
Each thread's `comments(first:1)` is the originating review comment
— that's where `path`, `line`, and `body` come from. Reply chains
on the same thread are intentionally not surfaced here; this script
is the input to triage, not to reading conversation history.
.PARAMETER Owner
Optional; auto-resolved from `gh repo view`.
.PARAMETER Repo
Optional; auto-resolved from `gh repo view`.
.PARAMETER PrNumber The pull request number.
.EXAMPLE
pwsh 03-list-open-threads.ps1 -PrNumber 122
.PARAMETER MaxBodyLength
Cap the `Body` column at this many characters (default 500; pass 0 to
disable). Long Copilot comments otherwise dominate stdout and slow
triage; truncated bodies are suffixed with `…`.
#>
[CmdletBinding()]
param(
[string]$Owner,
[string]$Repo,
[Parameter(Mandatory = $true)]
[int]$PrNumber,
[ValidateRange(0, 100000)]
[int]$MaxBodyLength = 500
)
$ErrorActionPreference = 'Stop'
. "$PSScriptRoot/_lib.ps1"
$coords = Resolve-RepoCoords -Owner $Owner -Repo $Repo
$Owner = $coords.Owner
$Repo = $coords.Repo
$query = @'
query($owner: String!, $repo: String!, $pr: Int!, $after: String) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100, after: $after) {
pageInfo {
endCursor
hasNextPage
}
nodes {
id
isResolved
comments(first: 1) {
nodes {
author { login }
body
path
line
createdAt
}
}
}
}
}
}
}
'@
$all = [System.Collections.Generic.List[object]]::new()
$after = $null
do {
$ghArgs = @('-f', "query=$query", '-f', "owner=$Owner", '-f', "repo=$Repo", '-F', "pr=$PrNumber")
if ($after) { $ghArgs = $ghArgs + @('-f', "after=$after") }
$data = Invoke-GhGraphQL -GhArgs $ghArgs -Context "list threads for $Owner/$Repo PR #$PrNumber"
$page = $data.data.repository.pullRequest.reviewThreads
foreach ($n in $page.nodes) { $all.Add($n) }
$after = $page.pageInfo.endCursor
} while ($page.pageInfo.hasNextPage)
$threads = $all.ToArray()
$open = $threads | Where-Object { -not $_.isResolved }
$resultList = [System.Collections.Generic.List[object]]::new()
foreach ($t in $open) {
$c = if ($t.comments -and $t.comments.nodes -and $t.comments.nodes.Count -gt 0) { $t.comments.nodes[0] } else { $null }
if (-not $c) { continue } # malformed thread (no originating comment) — skip rather than crash
$body = ($c.body -replace "`r?`n", ' ')
if ($MaxBodyLength -gt 0 -and $body.Length -gt $MaxBodyLength) {
$body = $body.Substring(0, $MaxBodyLength) + '…'
}
$path = if ($null -ne $c.line) { "$($c.path):$($c.line)" } else { $c.path }
$author = if ($c.author -and $c.author.login) { $c.author.login } else { '(deleted)' }
# Normalise createdAt via the shared helper so the format stays
# identical across 01/02/03 (Format-IsoUtcString in _lib.ps1).
$createdAt = Format-IsoUtcString $c.createdAt
$resultList.Add([pscustomobject]@{
ThreadId = $t.id
Author = $author
Path = $path
CreatedAt = $createdAt
Body = $body
})
}
$result = $resultList.ToArray()
# Single-line JSON output (matches the contract used by 01/02/08/10).
# -Compress so callers can pipe to ConvertFrom-Json or jq directly without
# stripping PowerShell's default Format-List rendering / ANSI escapes.
[pscustomobject]@{
PrNumber = $PrNumber
Owner = $Owner
Repo = $Repo
OpenThreadCount = $result.Count
Threads = $result
} | ConvertTo-Json -Depth 6 -Compress
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |