AGENT SKILL

pr-comments

Fetch unresolved GitHub PR review comments, analyze each for relevance, present categorized summary, ask which to fix, then apply minimal code changes. Trigger - any GitHub PR URL or request to review/fix PR comments.

License 许可
GPL-3.0
所属仓库
Artawower/kaizen
最近更新
2026-11-10
Stars
★ 2
Forks
0

01 前言 Front Matter

name
pr-comments
description
Fetch unresolved GitHub PR review comments, analyze each for relevance, present categorized summary, ask which to fix, then apply minimal code changes. Trigger - any GitHub PR URL or request to review/fix PR comments.

02 资源文件 1

03 SKILL.md 正文

What I do

Process GitHub Pull Request review feedback end-to-end:

  1. Fetch unresolved review threads via a bundled Python script
  2. Classify each comment: actionable, question, outdated, nitpick, or invalid
  3. Present a structured summary grouped by category
  4. Ask which comments to fix
  5. Apply minimal targeted fixes
  6. Report results with diagnostics

When to use me

  • User shares a GitHub PR URL and wants to address review comments
  • User asks to "fix PR review", "check PR comments", "handle review feedback"
  • User wants a summary of what reviewers requested

WORKFLOW

STEP 1: Fetch unresolved threads

Run the bundled script. It handles URL parsing, GraphQL query, and filters to unresolved only:

python3 ~/.config/ai/skills/pr-comments/fetch-pr-comments.py <PR_REFERENCE>

Supported input formats:

  • https://github.com/owner/repo/pull/123
  • owner/repo#123
  • owner/repo 123
  • Just 123 (infers owner/repo from current git repo)

The script outputs JSON:

{
  "pr_title": "Fix auth flow",
  "pr_url": "https://github.com/...",
  "total_threads": 12,
  "unresolved_count": 5,
  "unresolved_threads": [
    {
      "id": "PRRT_...",
      "isOutdated": false,
      "path": "src/auth.ts",
      "line": 42,
      "comments": {
        "nodes": [
          {
            "author": { "login": "reviewer" },
            "body": "Add null check here",
            "url": "https://github.com/...",
            "diffHunk": "@@ -40,6 +40,8 @@..."
          }
        ]
      }
    }
  ]
}

If unresolved_count is 0, tell the user and stop. If the script fails with auth error, tell the user to run gh auth login.

STEP 2: Classify each unresolved comment

For each thread:

  1. Actionable? — requests a specific code change vs question/praise/discussion
  2. Outdated? — check isOutdated flag AND compare diffHunk with current file content. If code already changed, mark as already-fixed
  3. Relevant? — real issue or bike-shedding?

Categories:

  • ACTIONABLE — requires a code change
  • QUESTION — reviewer asks for clarification, no code change
  • OUTDATED — code already changed or references deleted code
  • NITPICK — style preference, not a real problem
  • INVALID — suggestion is incorrect or would introduce a bug

STEP 3: Present summary

## PR Review Summary: {PR_TITLE}
**URL**: {PR_URL}
**Unresolved threads**: {TOTAL} ({ACTIONABLE_COUNT} actionable)

### Actionable

#### [1] {FILE_PATH}:{LINE} — @{AUTHOR}
> {COMMENT_BODY}
**Assessment**: {why actionable — 1 sentence}

### Questions (need response, not code)
- [N] {FILE_PATH}:{LINE} — @{AUTHOR}: {short summary}

### Can be dismissed
- [N] {FILE_PATH}:{LINE} — {OUTDATED|NITPICK|INVALID}: {reason}

STEP 4: Ask what to fix

Which comments should I fix?
- "all" — fix all actionable
- Comma-separated numbers (e.g. "1, 3, 5") — specific ones
- "none" — summary only

Wait for user response. Do NOT proceed without explicit instruction.

STEP 5: Apply fixes

For each selected comment:

  1. Read the file from path field
  2. Study diffHunk for context
  3. Read the FULL comment thread (all replies) to understand complete discussion
  4. Make the minimal change addressing the reviewer's concern
  5. Run lsp_diagnostics on the changed file

Rules:

  • Minimal changes only — exactly what the reviewer asks
  • Never refactor surrounding code
  • Preserve file's existing code style
  • If fix is ambiguous — ask the user
  • If fix would break other code — warn and ask for confirmation

STEP 6: Report

## Fixes Applied

| # | File | Line | Status | What changed |
|---|------|------|--------|-------------|
| 1 | src/foo.ts | 42 | Fixed | Renamed variable per reviewer |
| 3 | src/bar.ts | 15 | Fixed | Added null check |

**Files changed**: {list}
**Diagnostics**: {clean / N warnings}

Do NOT commit. User reviews and commits manually.

Hard rules

  • NEVER resolve review threads on GitHub
  • NEVER push changes
  • NEVER modify files not mentioned in review comments
  • If gh is not authenticated — tell user to run gh auth login and stop
  • Answer in the same language the user uses

04 同仓库更多 Skills

Artawower
Artawower/kaizen

yt-analyze

Fetch YouTrack task + comments via MCP, critically analyze relevance and requirements, produce concise summary of what to implement, and build an implementation plan mapped to codebase. Trigger - YouTrack issue ID or request to "analyze task", "plan task", "break down YT issue".

Skill与智能体开发
★ 2
Artawower
Artawower/kaizen

youtrack-task

Analyzes a YouTrack issue, reviews comments and attachments, and proposes or creates actionable subtasks. Use when the user gives a YouTrack issue ID and wants synthesis, decomposition, or follow-up tasks.

★ 2
Artawower
Artawower/kaizen

youtrack-search

Searches YouTrack from natural language or native query syntax and returns a concise report with the most relevant issues. Use when the user wants to find issues, triage work, or translate a plain-language query into YouTrack search.

★ 2
Artawower
Artawower/kaizen

writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

内容创作者写作与文案
★ 2
Artawower
Artawower/kaizen

write-a-prd

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

产品经理
★ 2
Artawower
Artawower/kaizen

vitest

Plan and write Vitest tests for changed code. Analyses git diff, checks existing tests, produces a concrete test plan using flat test structure (no describe/it blocks). Use when adding tests for new/changed code, improving Vitest coverage, or asking what to test after a change.

★ 2