|
| 1 | +--- |
| 2 | +name: github-pr-comments |
| 3 | +description: Helps the agent fetch and interpret GitHub CLI / GraphQL queries for pull request review comments with line numbers and resolution status. |
| 4 | +--- |
| 5 | + |
| 6 | +# GitHub PR review comments skill |
| 7 | + |
| 8 | +This skill guides the agent to use GitHub CLI and GraphQL to fetch pull request review comments with detailed context including line numbers and resolution status. |
| 9 | + |
| 10 | +## When to use |
| 11 | + |
| 12 | +- When the goal is to examine PR review threads, comments, and their status (resolved/outdated). |
| 13 | +- When you need to analyze or summarize PR feedback tied to specific files/lines. |
| 14 | +- When building tools or scripts that process GitHub PR comments programmatically. |
| 15 | + |
| 16 | +## Instructions |
| 17 | + |
| 18 | +1. Prefer the GitHub CLI GraphQL query shown below to get full review‑thread context, including resolution status and line numbers. |
| 19 | +2. Substitute `OWNER`, `REPO`, and `PR_NUMBER` with the correct values before running. |
| 20 | +3. If the response is paginated, use `endCursor` from `pageInfo` to iterate the next page until `hasNextPage` is `false`. |
| 21 | + |
| 22 | +### Primary command (GraphQL – full‑featured) |
| 23 | + |
| 24 | +Run this command in the terminal to fetch review threads with comments, paths, line numbers, and resolution status: |
| 25 | + |
| 26 | +```bash |
| 27 | +gh api graphql -f query=' |
| 28 | + query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) { |
| 29 | + repository(owner: $owner, name: $repo) { |
| 30 | + pullRequest(number: $prNumber) { |
| 31 | + reviewThreads(first: 100, after: $cursor) { |
| 32 | + pageInfo { |
| 33 | + hasNextPage |
| 34 | + endCursor |
| 35 | + } |
| 36 | + nodes { |
| 37 | + isResolved |
| 38 | + isOutdated |
| 39 | + comments(first: 20) { |
| 40 | + nodes { |
| 41 | + author { |
| 42 | + login |
| 43 | + } |
| 44 | + body |
| 45 | + path |
| 46 | + line |
| 47 | + startLine |
| 48 | + originalLine |
| 49 | + originalStartLine |
| 50 | + diffHunk |
| 51 | + createdAt |
| 52 | + updatedAt |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | +' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER |
| 61 | +--- |
| 62 | +name: github-pr-comments |
| 63 | +description: Helps the agent fetch and interpret GitHub CLI / GraphQL queries for pull request review comments with line numbers and resolution status. |
| 64 | +--- |
| 65 | + |
| 66 | +# GitHub PR review comments skill |
| 67 | + |
| 68 | +This skill guides the agent to use GitHub CLI and GraphQL to fetch pull request review comments with detailed context including line numbers and resolution status. |
| 69 | + |
| 70 | +## When to use |
| 71 | + |
| 72 | +- When the goal is to examine PR review threads, comments, and their status (resolved/outdated). |
| 73 | +- When you need to analyze or summarize PR feedback tied to specific files/lines. |
| 74 | +- When building tools or scripts that process GitHub PR comments programmatically. |
| 75 | + |
| 76 | +## Instructions |
| 77 | + |
| 78 | +1. Prefer the GitHub CLI GraphQL query shown below to get full review‑thread context, including resolution status and line numbers. |
| 79 | +2. Substitute `OWNER`, `REPO`, and `PR_NUMBER` with the correct values before running. |
| 80 | +3. If the response is paginated, use `endCursor` from `pageInfo` to iterate the next page until `hasNextPage` is `false`. |
| 81 | + |
| 82 | +### Primary command (GraphQL – full‑featured) |
| 83 | + |
| 84 | +Run this command in the terminal to fetch review threads with comments, paths, line numbers, and resolution status: |
| 85 | + |
| 86 | +```bash |
| 87 | +gh api graphql -f query=' |
| 88 | + query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) { |
| 89 | + repository(owner: $owner, name: $repo) { |
| 90 | + pullRequest(number: $prNumber) { |
| 91 | + reviewThreads(first: 100, after: $cursor) { |
| 92 | + pageInfo { |
| 93 | + hasNextPage |
| 94 | + endCursor |
| 95 | + } |
| 96 | + nodes { |
| 97 | + isResolved |
| 98 | + isOutdated |
| 99 | + comments(first: 20) { |
| 100 | + nodes { |
| 101 | + author { |
| 102 | + login |
| 103 | + } |
| 104 | + body |
| 105 | + path |
| 106 | + line |
| 107 | + startLine |
| 108 | + originalLine |
| 109 | + originalStartLine |
| 110 | + diffHunk |
| 111 | + createdAt |
| 112 | + updatedAt |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + } |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | +' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER |
0 commit comments