Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

github-pr-comment-analyzerGitHub PR comment 分析器

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

212

周安装

9

GitHub Stars

52

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-pr-comment-analyzer(GitHub PR comment 分析器)
来源仓库:https://github.com/zenobi-us/dotfiles
仓库路径:skills/github-pr-comment-analyzer
安装命令:
npx skills add https://github.com/zenobi-us/dotfiles --skill github-pr-comment-analyzer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/zenobi-us/dotfiles --skill github-pr-comment-analyzer

简介

用于分析 GitHub PR 评论的情感倾向和内容质量。

  • 识别建设性反馈和潜在争议点。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 支持多轮对话上下文理解。github-pr-comment-analyzer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 帮助维护健康的代码审查文化。
  • 分析结果仅供参考,不能完全替代人工判断。

SKILL.md

GitHub PR Comment Analyzer

Analyze all review comments on a pull request to assess relevance, identify ambiguities, and generate a detailed report with suggested Q&A discussions. Unlike the PR resolver skill, this skill only analyzes and reports without making code changes.

When to Use This Skill

Use this skill when you need to:

  • Analyze comment relevance without immediately acting on them
  • Identify ambiguous feedback that needs clarification
  • Generate reports on PR review status and comment landscape
  • Facilitate discussions about comments through Q&A format
  • Understand outdated comments that may no longer apply to the current code

Prerequisites

# Verify gh CLI is installed and authenticated
gh auth status

# If not authenticated, run:
gh auth login

Token requires repo scope for full repository access.

Workflow Overview

  1. Fetch PR context → Get all review threads with metadata (always fresh from GitHub)
  2. Analyze each comment → Assess relevance, type, intent, and clarity
  3. Identify ambiguities → Flag unclear, contradictory, or potentially outdated comments
  4. Generate report → Structured markdown report with findings
  5. Create Q&A discussions → Suggest discussion prompts for ambiguous items
  6. No code changes → Only analysis, reporting, and discussion generation

KEY PRINCIPLE: This is a read-only analysis skill. No files are modified, no commits are made, no threads are resolved.

Step 1: Fetch PR Context (Always Fresh)

CRITICAL: Always fetch fresh data from GitHub. Never reuse previously fetched context data.

1.1 Get PR Details

# Get PR metadata
gh pr view <PR_NUMBER> --json number,title,state,headRefName,baseRefName,author,url,commits

1.2 Get Review Threads (GraphQL with Pagination)

Use GraphQL to fetch ALL review threads with full metadata. The API returns max 100 items per request, so pagination is required.

# First page (no cursor)
gh api graphql -f query='
query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) {
  repository(owner: $owner, name: $repo) {
    pullRequest(number: $prNumber) {
      reviewThreads(first: 100, after: $cursor) {
        pageInfo {
          hasNextPage
          endCursor
        }
        nodes {
          id
          isResolved
          isOutdated
          path
          line
          comments(first: 100) {
            nodes {
              id
              databaseId
              body
              author { login }
              createdAt
              path
              line
              diffHunk
            }
          }
        }
      }
    }
  }
}' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER

1.3 Get Commit History

# Get commits in the PR to understand code evolution
gh pr view <PR_NUMBER> --json commits --json body | jq '.commits[] | {oid, messageHeadline, committedDate}'

1.4 Collect ALL Threads (With Pagination)

IMPORTANT: Continue fetching pages until hasNextPage is false. Collect ALL threads before analyzing.

# Pseudocode for pagination
ALL_THREADS = []
CURSOR = null

while true:
  RESULT = fetch_with_cursor(CURSOR)
  ALL_THREADS.append(RESULT.nodes)
  if not RESULT.pageInfo.hasNextPage:
    break
  CURSOR = RESULT.pageInfo.endCursor

Step 2: Analyze Each Comment

For every comment in the PR, perform comprehensive analysis:

2.1 Extract Comment Metadata

- Thread ID (for reference)
- File path and line number
- Author and timestamp
- Thread resolution status (resolved/unresolved)
- Thread outdated status
- Full comment text
- Code diff context (diffHunk)

2.2 Assess Relevance

For each comment, determine its current relevance:

Relevance StatusDefinitionIndicators
HIGHLY RELEVANTComment directly addresses current codeLine still exists, code structure matches comment context
POTENTIALLY RELEVANTComment may apply but needs verificationLine is near current line, similar code patterns exist
OUTDATEDComment refers to code no longer in PRFile was deleted, line removed, code completely refactored
UNCLEARCannot determine relevance without more contextVague reference, ambiguous terminology, no clear target
RESOLVEDThread already marked as resolvedisResolved: true (included for completeness)

Analysis Method:

  • Check if file still exists in PR
  • Verify line number still contains relevant code
  • Cross-reference with commit history to see if code was modified/removed
  • Compare diffHunk with current code context

2.3 Classify Comment Type

Identify what type of feedback this is:

TypePatternExamples
Bug FixIdentifies issue, suggests fix"This will crash if X is null"
Feature RequestSuggests new functionality"Consider adding retry logic"
Code QualityStyle, refactoring, best practices"This could be simplified with a helper function"
DocumentationComments, documentation, clarity"Add JSDoc for this function"
PerformanceOptimization, efficiency"This loop could be parallelized"
TestingTest coverage, assertions"Add test case for this scenario"
ArchitectureDesign patterns, structure"This should use dependency injection"
Question/DiscussionClarification, discussion points"Why did you choose this approach?"
Suggestion/NitMinor preference, non-blocking"Nit: prefer const over let here"

2.4 Assess Intent Clarity

Determine how clearly the comment communicates intent:

Clarity LevelDefinitionExamples
EXPLICITClear action requested with specific guidance"Add this validation: if (!user) throw new Error(...)"
IMPLICITIntent clear but specific action undefined"This needs better error handling"
AMBIGUOUSMultiple interpretations possible"Simplify this code" (unclear what aspect)
UNCLEARDifficult to understand what's neededDomain-specific jargon without context, typos, incomplete thoughts

2.5 Check for Contradictions

Identify comments that contradict each other:

  • Different reviewers suggesting opposite approaches
  • Multiple solutions proposed for same issue
  • Conflicting coding standards referenced

2.6 Outdated Status Analysis

Determine if comment is outdated:

StatusWhenIndicators
NOT OUTDATEDComment still appliesCode at line/path unchanged or similar
POSSIBLY OUTDATEDNeeds verificationCode modified near the commented line
LIKELY OUTDATEDComment obsoleteFile deleted, entire function removed, massive refactor
EXPLICITLY MARKEDAlready resolved/outdatedisOutdated: true from API

Step 3: Identify Ambiguities

Flag comments that need clarification:

3.1 Ambiguity Categories

1. UNCLEAR INTENT
   - What exactly needs to change?
   - What's the success criterion?
   - Examples: "Simplify this", "Make it better", "Consider X"

2. CONTRADICTORY
   - Multiple comments suggest opposite solutions
   - Conflicting coding standards or approaches

3. OUTDATED BUT UNRESOLVED
   - Comment likely refers to old code
   - But thread remains unresolved
   - Needs clarification: still relevant?

4. DOMAIN-SPECIFIC
   - Uses terminology without context
   - References external docs/standards
   - Requires subject matter expertise

5. ASSUMED CONTEXT
   - References previous discussions
   - Assumes knowledge of system architecture
   - Missing background information

6. MULTIPLE VALID SOLUTIONS
   - Comment mentions several approaches
   - Unclear which is preferred
   - No decision guidance provided

3.2 Severity Scoring

Score each ambiguity for impact:

  • CRITICAL: Blocks understanding or implementation
  • HIGH: Significant confusion, multiple interpretations
  • MEDIUM: Some clarity needed, but intent somewhat clear
  • LOW: Minor ambiguity, intent is mostly clear

Step 4: Generate Analysis Report

Create a comprehensive markdown report with findings:

4.1 Report Structure

# PR Comment Analysis Report

**PR:** #<number> - <title>
**Author:** <author>
**Branch:** <branch>
**Analysis Date:** <timestamp>

## Summary Statistics

- Total Comments: N
- Comments Analyzed: N
- Highly Relevant: N
- Potentially Relevant: N
- Outdated: N
- Ambiguous: N
- Resolved: N

## Comments by Relevance

### Highly Relevant Comments (N)
[List each with metadata]

### Potentially Relevant Comments (N)
[List with verification notes]

### Outdated Comments (N)
[List with reason marked outdated]

### Ambiguous Comments (N)
[List with ambiguity type and severity]

### Already Resolved Comments (N)
[List for reference]

## Identified Issues

### Contradictions (if any)
[List conflicting comments]

### High-Impact Ambiguities
[Prioritized list needing clarification]

### Comments Needing Verification
[List potentially outdated but unresolved]

## Recommendations

[Summary of key findings and suggested Q&A discussions]

4.2 Comment Entry Format

For each comment in the report, include:

**Comment ID:** <thread_id>
**File:** <path> (line <number>)
**Author:** <author> (<date>)
**Status:** <relevance_status> | <clarity_level> | <type>
**Resolved:** <yes/no>

**Text:**
> <comment_body>

**Analysis:**
- Intent: <description>
- Ambiguities: <list or "None">
- Relevance: <explanation>
- Recommended Q&A: [see Q&A section]

Step 5: Generate Q&A Discussion Prompts

For each ambiguous or high-impact comment, create discussion prompts:

5.1 Q&A Format

For each flagged item:

### Discussion: [Thread ID]

**Comment:** > [quote]

**Clarification Questions:**
1. [Question 1 - specific, focused]
2. [Question 2 - alternative interpretation]
3. [Question 3 - implementation details]

**Suggested Response Approaches:**
- [ ] Approach A: [Option with tradeoffs]
- [ ] Approach B: [Option with tradeoffs]
- [ ] Ask for: [Additional information needed]

5.2 Question Categories

Design questions for different ambiguity types:

For UNCLEAR INTENT:

  • "Could you clarify what 'X' means in this context?"
  • "Are you suggesting [specific change] or [alternative]?"
  • "What's the success criterion for this change?"

For OUTDATED COMMENTS:

  • "This code has changed since your comment. Is this feedback still relevant?"
  • "The file/line structure differs. Did you intend to comment on [new location]?"
  • "Should we consider this for [other file/approach]?"

For CONTRADICTIONS:

  • "I notice [Comment A] and [Comment B] suggest different approaches. Which is preferred?"
  • "Can you help reconcile the difference between [Solution 1] and [Solution 2]?"

For DOMAIN-SPECIFIC:

  • "Could you provide a brief example of what you mean by [term]?"
  • "Is there a reference or doc I should review for context?"

Step 6: Output Only (No Code Changes)

6.1 Save Report

# Save markdown report to file
cat > "pr-${PR_NUMBER}-analysis.md" << 'EOF'
[Generated report]
EOF

# Print to stdout as well
cat "pr-${PR_NUMBER}-analysis.md"

6.2 Verification Checklist

Before finalizing report, verify:

  • All threads fetched (checked pagination)
  • No threads were skipped
  • All ambiguities identified and documented
  • Q&A discussions generated for flagged items
  • Report is current (fresh GitHub fetch)
  • No code modifications made
  • No threads resolved
  • All files remain unchanged

Complete Example Script

#!/bin/bash
# Complete workflow for PR comment analysis

PR_NUMBER=$1
REPO="owner/repo"  # Or extract from current git remote
OWNER=${REPO%/*}
REPO_NAME=${REPO#*/}

# 1. Fetch fresh context from GitHub
echo "Fetching PR #$PR_NUMBER..."
PR_INFO=$(gh pr view $PR_NUMBER --json number,title,headRefName,author)
echo "PR: $(echo $PR_INFO | jq -r '.title')"
echo "Author: $(echo $PR_INFO | jq -r '.author.login')"

# 2. Fetch ALL review threads with pagination
echo "Fetching all review comments..."
ALL_THREADS="[]"
CURSOR=""
HAS_NEXT=true

while [ "$HAS_NEXT" = "true" ]; do
  if [ -z "$CURSOR" ]; then
    CURSOR_ARG=""
  else
    CURSOR_ARG="-f cursor=\"$CURSOR\""
  fi

  RESULT=$(gh api graphql -f query='
query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) {
  repository(owner: $owner, name: $repo) {
    pullRequest(number: $prNumber) {
      reviewThreads(first: 100, after: $cursor) {
        pageInfo {
          hasNextPage
          endCursor
        }
        nodes {
          id
          isResolved
          isOutdated
          path
          line
          comments(first: 100) {
            nodes {
              body
              author { login }
              createdAt
              path
              line
            }
          }
        }
      }
    }
  }
}' -f owner=$OWNER -f repo=$REPO_NAME -F prNumber=$PR_NUMBER $CURSOR_ARG)

  # Process results
  PAGE_THREADS=$(echo $RESULT | jq '.data.repository.pullRequest.reviewThreads.nodes')
  ALL_THREADS=$(echo "$ALL_THREADS $PAGE_THREADS" | jq -s 'add')

  HAS_NEXT=$(echo $RESULT | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.hasNextPage')
  CURSOR=$(echo $RESULT | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.endCursor')
done

# 3. Analyze comments (Claude does this part)
TOTAL=$(echo $ALL_THREADS | jq 'length')
RESOLVED=$(echo $ALL_THREADS | jq '[.[] | select(.isResolved == true)] | length')
UNRESOLVED=$(echo $ALL_THREADS | jq '[.[] | select(.isResolved == false)] | length')
OUTDATED=$(echo $ALL_THREADS | jq '[.[] | select(.isOutdated == true)] | length')

echo "Total threads: $TOTAL"
echo "Unresolved: $UNRESOLVED"
echo "Resolved: $RESOLVED"
echo "Outdated: $OUTDATED"

# 4. Generate report and Q&A discussions
# (Analysis performed interactively by Claude)

echo ""
echo "✅ Analysis complete. Report saved to: pr-${PR_NUMBER}-analysis.md"

Key Differences from PR Resolver

AspectPR ResolverPR Comment Analyzer
ActionFixes codeAnalyzes and reports
CommitsCreates commitsNo commits
Thread ResolutionResolves threadsNo thread changes
OutputModified PRAnalysis report + Q&A
GoalComplete feedbackUnderstand feedback
Use CaseAddressing reviewUnderstanding review landscape

Reference

See references/github_api_reference.md for:

  • Detailed GitHub API pagination patterns
  • GraphQL query templates
  • API rate limits and error handling
  • Comment intent patterns and classification

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.78%
按下载量换算26

Claude

29.94%
按下载量换算22

Cursor

17.22%
按下载量换算13

Gemini CLI

9.81%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills