copilot-pr-autopilot

Automates iterative Copilot code review loops on GitHub pull requests via gh CLI and GraphQL.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill copilot-pr-autopilot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: copilot-pr-autopilot
Source: https://github.com/github/awesome-copilot/tree/main/skills/copilot-pr-autopilot
Command: npx skills add https://github.com/github/awesome-copilot --skill copilot-pr-autopilot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Copilot code review leaves dozens of comments on a PR, and each fix round triggers more findings, forcing hours of manual fix-reply-resolve-re-request cycles. This Skill runs the entire loop autonomously: it triggers Copilot review, triages every open thread, applies fixes, replies with rationale, and repeats until the PR converges.

Core Features & Use Cases

  • Automated review triggering: Requests Copilot review via GraphQL requestReviewsByLogin and verifies pickup through the copilot_work_started event, with a single-iteration fallback for external PR authors without write permission.
  • Structured triage rubric: Classifies every open thread (Copilot, human, advanced-security) as fix, decline, or escalate-to-user, with oscillation detection and project-convention discovery before applying fixes.
  • Convergence verification with circuit breaker: Computes a deterministic Converged boolean from HEAD-match, no-new-comments, and zero-threads-awaiting-reply, plus a recap gate every 10 rounds to stop runaway drift.
  • Use Case: A developer's PR has 14 Copilot review comments. They invoke the loop, which fixes real bugs, declines style nits with written rationale citing the pushed commit SHA, escalates design tradeoffs to the human, and re-triggers review until Copilot reports no new comments.

Quick Start

Ask the agent to run a Copilot review loop on PR number 123 of the current repository and address all open review comments until it converges.

Frequently Asked Questions about copilot-pr-autopilot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically address Copilot review comments on a GitHub PR?

Run the review loop with gh CLI authenticated: it triggers Copilot review via GraphQL, triages each open thread as fix, decline, or escalate, applies fixes per repo conventions, replies citing the pushed commit SHA, and re-triggers until no threads await a reply.

How to re-request a Copilot code review from the command line?

Use the GraphQL requestReviewsByLogin mutation with botLogins set to copilot-pull-request-reviewer, which requires repo Triage or Write permission. Without that permission, push a substantive commit so the synchronize event auto-triggers Copilot, or click the UI re-request button.

Can external PR authors without write permission use automated Copilot review loops?

External authors cannot trigger Copilot via any public API because requestReviewsByLogin is gated on Triage or Write permission. They can run single-iteration mode to address all current findings once, then re-trigger manually via the UI button or a substantive commit push.

Why does the Copilot review trigger fail with a permission error?

The requestReviewsByLogin mutation returns FORBIDDEN when the authenticated user lacks Triage or Write permission on the repository, or when Copilot Code Review is not enabled on the repo or account. Verify permissions with gh api repos/OWNER/REPO --jq .permissions.

When should I not run an automated PR review loop?

Avoid the loop while the PR is still under active design, since findings churn round-over-round and waste cycles. It also does not replace human reviewer feedback, and it aborts automatically if the PR state becomes CLOSED or MERGED.

How does the loop prevent runaway rounds of bot review fixes?

A recap gate fires deterministically every 10th Copilot review submission, counted from PR history via the API rather than agent memory. The agent then recaps all prior rounds against the original PR scope and chooses CONTINUE, REVERT-AND-SHIP, or HAND-OFF.