AgentSkillsCN

github-copilot-pr-comments

通过`gh` CLI,从拉取请求中提取GitHub Copilot的代码评审意见,并生成结构化的Markdown报告,其中包含所有建议、内联注释以及评审摘要。当用户希望:(1) 查看Copilot对某条拉取请求的评价;(2) 从拉取请求中提取Copilot的建议;(3) 生成Copilot评审反馈的报告;(4) 将AI代码评审意见汇总至文档中时,可使用此功能。可通过提及“Copilot评论”“Copilot评审”“Copilot建议”“Copilot对拉取请求的评审”,或任何关于获取/提取/总结GitHub Copilot对拉取请求反馈的请求来触发。

SKILL.md
--- frontmatter
name: github-copilot-pr-comments
description: Fetch GitHub Copilot code review comments from a pull request and generate a structured markdown report with all suggestions, inline comments, and review summaries using the `gh` CLI. Use when the user wants to: (1) see what Copilot said about a PR, (2) extract Copilot suggestions from a pull request, (3) generate a report of Copilot review feedback, (4) collect AI code review comments into a document. Triggers on mentions of "Copilot comments", "Copilot review", "Copilot suggestions", "PR review by Copilot", or any request to get/extract/summarize GitHub Copilot feedback on a pull request.

GitHub Copilot PR Comments Skill

Extract GitHub Copilot review comments from a PR and produce a markdown report using gh CLI.

Prerequisites

  • gh CLI installed and authenticated (gh auth login)
  • jq installed for JSON processing

Usage

bash
./scripts/fetch_copilot_comments.sh <owner/repo> <pr_number> [output_file]

Parameters

ParamRequiredDescription
owner/repoYesFull repo identifier, e.g. microsoft/vscode
pr_numberYesPR number
output_fileNoOutput markdown path (default: copilot_review.md)

Workflow

  1. Ask the user for repo and PR number if not provided.
  2. Verify gh is authenticated (gh auth status). If not, instruct the user to run gh auth login.
  3. Run: bash scripts/fetch_copilot_comments.sh <owner/repo> <pr_number> /home/claude/copilot_review.md
  4. Copy output to /mnt/user-data/outputs/copilot_review.md and present to the user.

Output Format

The generated markdown includes:

  • PR metadata — title, author, link, creation date
  • Summary — total Copilot comments by type, files reviewed, suggestion count
  • Review summaries — top-level Copilot review bodies with approval state
  • Inline code comments — grouped by file with diff context, line numbers, and suggestion blocks
  • General comments — issue-level comments from Copilot

Copilot Detection

Comments are attributed to Copilot if the author login matches: copilot, copilot[bot], github-copilot, github-copilot[bot], github-advanced-security[bot], or any bot user with "copilot" in the login.