agentleFS
ROCmROCm/rocprofiler-systems-skills/skills/analyze-pr-comments/SKILL.md

analyze-pr-comments

Skill5 starsChanged 17 days agoMITView on GitHub

Use when user wants to list, analyze, review, or summarize GitHub PR comments on a pull request number or URL

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If PR number/URL not provided, detect from current branch:

    line 19
  2. Very specific:

    Use {owner} and {repo} from gh repo view --json nameWithOwner.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analyze PR Comments

Fetch every comment on a GitHub PR, format them uniformly, distill reviewer intent, and provide a code-backed fix for each.

Triggering

  • "analyze PR comments", "list comments on PR #N", "summarize PR feedback"
  • User shares a PR URL or number and asks to review what reviewers said

Workflow

Step 1 — Resolve PR target

If PR number/URL not provided, detect from current branch:

gh pr view --json number,url

Step 2 — Fetch ALL comment types

GitHub has three distinct comment sources. Fetch all three:

# 1. Inline review comments (attached to code lines)
gh api repos/{owner}/{repo}/pulls/{PR}/comments \
  --jq '.[] | {id, author: .user.login, body, path, line}'

# 2. PR conversation comments (not attached to code)
gh api repos/{owner}/{repo}/issues/{PR}/comments \
  --jq '.[] | {id, author: .user.login, body}'

# 3. Review-level summary comments (review body text)
gh api repos/{owner}/{repo}/pulls/{PR}/reviews \
  --jq '.[] | select(.body != "") | {id, author: .user.login, body, state}'

Use {owner} and {repo} from gh repo view --json nameWithOwner.

Step 3 — Merge and number

Combine all three sets. Sort by created_at ascending. Assign sequential #N starting at 1. Skip bot accounts (e.g. github-actions[bot], dependabot[bot]).

Step 4 — Format each comment

Output exactly this structure for every comment:

#<N> <Author>

#<Original Comment>
<verbatim text — do NOT paraphrase, trim, or reformat>

#<Comment simplified>
<1-2 sentences: what the reviewer actually wants, not what they said>

#<Proposed fix with proof>
<code block that demonstrates the fix>
<if reviewer already included a code suggestion: propose a DIFFERENT valid implementation>

Inline comments: prepend file context before the block:

File: path/to/file.go (line 42)

Rules — DO NOT VIOLATE

RuleViolation
Quote original comment verbatimParaphrasing, trimming, summarizing
Proposed fix = actual code"You should rename the function" (no code)
Alternative fix if reviewer proposed oneCopying or slightly rewording their suggestion
All 3 comment sourcesOnly fetching gh pr view --comments
Skip botsIncluding CI/bot noise in the numbered list

Red Flags (stop and correct)

  • Writing "The reviewer suggests X" in the Original Comment section — that is paraphrase
  • Proposed fix that contains no code block
  • Less comments than expected — you likely missed inline review threads
  • Proposed fix mirrors the reviewer's own code sample word-for-word

Example Output

File: internal/auth/session.go (line 87)

#1 alice

#Original Comment
This function is doing too much. It handles both validation and persistence in the same call which makes it hard to unit test.

#Comment simplified
Split the function into separate validation and save steps so each can be tested in isolation.

#Proposed fix with proof
```go
// Before
func saveSession(s Session) error {
    if s.Token == "" {
        return errors.New("token required")
    }
    return db.Save(s)
}

// After — two responsibilities, two functions
func validateSession(s Session) error {
    if s.Token == "" {
        return errors.New("token required")
    }
    return nil
}

func persistSession(s Session) error {
    return db.Save(s)
}

// Caller composes them
func handleSave(s Session) error {
    if err := validateSession(s); err != nil {
        return err
    }
    return persistSession(s)
}

## Required Background

Uses `gh` CLI — if unavailable, invoke **git-gh-client** first to verify installation and authentication.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.