PowerToys PR Review
Review a microsoft/PowerToys pull request the way a maintainer would, given a PR number N. The review has two halves that run in parallel:
- Context & process review (Phase 0) — the checks Copilot code review can never do: is the CLA signed, is there a demo for a user-visible change, did the author validate it, is it original work, a duplicate, in-scope, CI-green, and template-complete? Aimed at community-contributor PRs and often the deciding factor. See references/phase0-context-review.md.
- Code review (Steps 0–10) — mirror the PR to the reviewer's personal fork, iterate GitHub Copilot review to convergence, fix valid issues, build locally, and draft suggested-fix comments.
Never post anything to the original PR without explicit user approval (Step 10).
When to Use This Skill
- "Review PR N" / "review this PowerToys PR" / "continue the review for PR N"
- Self-check your own PowerToys PR before a maintainer sees it
- Draft inline code suggestions (click-to-commit) with severity for a PR
- Decide the process disposition (proceed / ask / align / recommend-close) for a community PR
Review Modes
| Mode | Trigger | What changes |
|---|---|---|
| Standard review | "review PR N" | Phase 0 (context) and Steps 0–10 (code) in parallel. |
| Batch (parallel) | "review PRs N1, N2, N3, …" (2+ numbers) | Review all PRs concurrently, not one-by-one — fan out one background sub-agent per PR (capped at 3–5 in flight), each driving its own fork loop to convergence while their long waits (Copilot review polling, builds) overlap. Launch the dashboard up front as the live tracker. See batch-parallel.md. |
| Self-check | The PR author is the current user (own fork owner) | Skip fork-mirroring (Steps 1–2c) — you already own the branch; review/build in the author's own worktree. Run Phase 0 on yourself to pre-empt what maintainers will demand. |
Prerequisites (verify on first run)
Run scripts/Test-Prerequisites.ps1 to check all four at once. Detail and setup guidance: references/prerequisites.md.
| # | Prerequisite | Quick check |
|---|---|---|
| 1 | Personal fork of microsoft/PowerToys |
gh repo list --fork includes <owner>/PowerToys |
| 2 | Local clone with a remote pointing to the fork | a PowerToys clone with a non-microsoft remote |
| 3 | GitHub Copilot code review enabled on the fork | a requested review produces a Copilot review; requested_reviewers may already be empty when an asynchronous review finishes quickly |
| 4 | Visual Studio 2022 (Desktop C++ + .NET desktop) | vswhere.exe -latest resolves an install |
If a prerequisite is missing, guide the user through setup (references/prerequisites.md) before proceeding. Do not infer that prerequisite 3 is missing solely from an empty requested_reviewers response; check for a review submitted after the request. Prerequisite 3 must be enabled by the user in the fork's settings; for 4, offer to install the tools via winget.
Critical Rules
- Never post comments, suggestions, reviews, approvals, labels, or close actions on the original PR until the user gives explicit written approval in Step 10. This includes
gh pr review,gh pr close,gh pr edit --add-label, or any command targetingmicrosoft/PowerToys. Violating this is a critical failure. - Never approve the original PR — even after user approval. Draft suggestions/requests/dispositions only; the human makes the final call.
- Run Phase 0 in parallel with the code review for community PRs. A perfectly-coded PR can still need a demo, CLA, validation, or a close. Context findings are first-class output.
- Respect author type, and do not over-gate. Skip Phase 0 process nags for members/collaborators/bots; hold community contributors to the gates but stay welcoming. Most well-formed PRs trip no gate — do not invent friction.
- Never use
#<number>format in any fork PR title or description — it notifies the referenced upstream thread. Use plain numbers. - Skip fork-mirroring in self-check mode (author is the fork owner): review and build in the author's own worktree; Steps 1–2c do not apply.
- All code work happens on the fork and locally until final approval.
- The local worktree must build successfully before a deep code review is marked complete.
- Always sync the fork's main before creating or updating the fork PR to prevent diff bloat from a stale base (Step 2c).
- Resume, do not restart (Step 0). Before mirroring, check for a prior interrupted run on PR
Nand pick up from the matching step instead of re-mirroring. Re-mirroring clobbers prior commits and review replies. - The fork Copilot loop (Steps 4–8) is not optional and is independent of the posting decision. "Just show me" / "do not post" changes only Step 10. You must still drive the fork loop to convergence: fix valid issues, commit, push, reply-and-resolve every Copilot thread, and re-request review until a freshly-requested review returns zero new comments and there are zero unresolved Copilot threads. Final suggestions come from the converged net diff, never raw round-1 output.
- For 2+ independent PRs, review them in parallel unless the user explicitly requests sequential execution. Fan out one background worker per PR (cap 3–5 concurrent), with an isolated branch/worktree and independent convergence loop. If sub-agents are unavailable, pipeline all PRs in one agent so their review requests and waits remain concurrently in flight. Sync the base once, serialize local builds, and keep the orchestrator as the single writer of dashboard data. Never leave any PR stranded at round 1. See batch-parallel.md.
- Never mention a fork repository, fork PR, worktree, internal review loop, or private validation provenance in comments posted to the original PR. Store that evidence only under
internalEvidence; public payloads must be self-contained. - Never post prose summaries as inline code suggestions. An inline item must contain one non-empty, apply-ready
suggestionblock targeting an exact current RIGHT-side diff range. Split localized fixes out of broader multi-file findings instead of collapsing every concrete change into companion prose. Use a companion item only for the architectural, coordination, or out-of-diff remainder, and explicitly label companion-only reviews as general notes with no inline suggestions. Omit obsolete findings. - Never publish with ad-hoc
ghcommands. Validate schema-version-2 data withTest-ReviewData.ps1, then publish approved decisions withPublish-ApprovedReview.ps1. The publisher stages a pending review, reads it back, and submits only after exact verification. - Score confidence per finding, but never expose it upstream. Every drafted public item carries a 50–100 confidence score and evidence-based rationale as metadata. Scores below 50 stay internal. Pulse may show the score to maintainers; author-facing review bodies must contain severity and reasoning only.
- Fork pushes are required review work, not upstream publication. Workers may create/update branches and PRs in the configured personal fork, push review fixes, and resolve fork review threads. A coordinator instruction not to commit or push dashboard data must never be interpreted as prohibiting fork-side pushes. Only writes to
microsoft/PowerToysremain approval-gated. - Resolve the writable fork from configuration and clone remotes, not only the active login.
Get-ForkConfig.ps1prefersPOWERTOYS_FORK_REPO, then a non-MicrosoftPowerToysremote in the local clone, and switches to the authenticated fork-owner account when the current account has read-only access. Do not substitute<active-login>/PowerToyswhen the durable review branches live in another configured account. - Use the dashboard terminal-stage contract. Emit a clean current-head
review with zero proposed comments as
stage: review_ready, neverconcluded,complete, or another synonym. A review with findings must instead include a current-headpost_revieworrequest_changesaction. When automation cannot proceed, emitstage: review_blockedonly for a current-head terminal blocker and includeblockers[]entries with non-emptydetailand exactremediation; do not leave it asreview_in_progress.
Phase 0: Context & Process Review
The half Copilot code review cannot do. It reads the PR description, the full conversation timeline, the CI/checks status, and the linked issue, then decides whether the PR clears PowerToys' process bar. Everything Phase 0 produces is drafted only. Full rules, the P1–P9 gate table, the compound-quality close signal, and per-gate reply templates are in references/phase0-context-review.md.
Disposition outcomes (Phase 0 → one of):
- Proceed — no gate tripped (or only Notes). Go to the code-review output.
- Ask — draft the specific request(s); review pauses on the author.
- Align first — duplicate/superseded/out-of-scope: draft a redirect to the canonical PR/issue.
- Recommend close — compound-quality or long-stale-with-author-owing: draft a polite close.
Always recommend, never auto-apply — labels/closes are maintainer actions gated by Step 10.
Code Review Workflow
These steps are the code-review engine. In self-check mode skip Steps 1–2c.
| Step | Action | Reference |
|---|---|---|
| 0 | Resume check — detect a prior interrupted run on PR N and jump to the right step |
setup-and-mirror.md |
| 1 | Mirror the PR to the personal fork (sanitize #refs) |
setup-and-mirror.md |
| 2 / 2b / 2c | Worktree, rebase on latest main, validate the fork diff matches the original scope |
setup-and-mirror.md |
| 3 | Build locally (Debug) so x64/Debug/PowerToys.exe runs the change |
build-and-test.md |
| 4 | Request Copilot review on the fork PR | copilot-review-loop.md |
| 5–6 | The loop — fix, push, reply-and-resolve, re-request until convergence | copilot-review-loop.md |
| 7 / 7b | Final build of the full module chain + end-to-end test instructions | build-and-test.md |
| 8 | Summarize the converged net diff | copilot-review-loop.md |
| 9 | Draft the review — context asks + code suggestions with severity | drafting-and-posting.md |
| 10 | Wait for approval, freshness re-check, then post the approved actions | drafting-and-posting.md |
Convergence (Definition of done for Steps 5–6): the most recent freshly-requested Copilot review returned zero new inline comments, zero unresolved Copilot threads remain, and the worktree builds. Do not draft Step 9 suggestions until this holds.
Fork Configuration
Auto-detect these at the start of each session with scripts/Get-ForkConfig.ps1; verify on first run. The resolver prefers POWERTOYS_FORK_REPO, then the clone's non-Microsoft PowerToys remote, and verifies write permission. It may switch gh to the authenticated fork-owner account so fork branches and review PRs remain writable.
| Placeholder | Meaning | Example |
|---|---|---|
<FORK_OWNER> |
The reviewer's GitHub login | your-username |
<FORK_REPO> |
The reviewer's fork | your-username/PowerToys |
<FORK_REMOTE> |
Git remote pointing at the fork (default fork) |
fork |
<CLONE_PATH> |
Main PowerToys clone directory | C:\PowerToys |
Available Scripts
| Script | Purpose |
|---|---|
| Test-Prerequisites.ps1 | Check fork, clone, Copilot review, and VS build tools |
| Get-ForkConfig.ps1 | Resolve fork owner/repo/remote and clone path |
| Get-PRContext.ps1 | Fetch author, association, size, and labels to calibrate Phase 0 |
| Request-CopilotReview.ps1 | Request Copilot as reviewer and poll until the review posts |
| Get-UnresolvedCopilotThreads.ps1 | Count unresolved Copilot threads (stranded-loop / resume check) |
| Get-ReviewResumeState.ps1 | Discover durable branches, review PRs, worktrees, rounds, and unresolved threads across sessions |
| Sync-ForkMain.ps1 | Fast-forward the clone's main from upstream and push it to the fork |
| Test-ReviewData.ps1 | Validate public payloads, decisions, pinned heads, and current diff ranges |
| Publish-ApprovedReview.ps1 | Idempotently stage, verify, and submit approved GitHub reviews |
| Show-ReviewDashboard.ps1 | Serve a single-window HTML dashboard for a batch of PRs: live status tracker while reviews run (polls /status), then an approval surface capturing per-PR/per-suggestion decisions to a file the agent resumes from |
References
- phase0-context-review.md — the context/process gates, dispositions, and reply templates
- prerequisites.md — fork, clone, Copilot review, and VS build-tool setup
- setup-and-mirror.md — Steps 0–2c: resume, mirror, worktree, rebase, diff validation
- copilot-review-loop.md — Steps 4–8: request, fix/push/resolve loop, summarize
- build-and-test.md — Steps 3, 7, 7b: local build, module chain, end-to-end tests
- migration-and-resume.md — move active reviews from older skill versions and resume durable loop state
- drafting-and-posting.md — Steps 9–10: suggestion format, freshness re-check, posting
- approval-dashboard.md — optional interactive UI for approving/holding/editing drafted actions across a multi-PR session
- batch-parallel.md — how to review 2+ PRs concurrently (sub-agent fan-out, build serialization, single-writer status, aggregation)