Skip to content

Commit 5e30e2b

Browse files
committed
feat(skills): add pr-review skill for line-by-line feedback verification
1 parent 1c92691 commit 5e30e2b

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

skills/pr-review/SKILL.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: pr-review
3+
description: Line-by-line verification workflow for GitHub Pull Request feedback and automated bot reviews. Enforces mandatory local code inspection, N-item checklist creation, and empirical evidence validation before accepting or rejecting comments. Use when reviewing PR feedback, triaging linter or CodeRabbit comments, or preparing a PR for merge.
4+
owner: bcgov
5+
tags: [pr-review, github, code-review, ci, devops, bcgov, quality]
6+
---
7+
8+
# GitHub PR Feedback & Line-by-Line Review
9+
10+
Structured verification workflow for processing PR feedback, inline code review comments, and automated review bot outputs (e.g. CodeRabbit, Dependabot, ESLint) without taking shortcuts or making unverified assumptions.
11+
12+
## Use When
13+
- Asked to "review PR feedback", "check PR comments", "triage review comments", or "evaluate CodeRabbit feedback".
14+
- Resolving inline PR comments before merging a pull request.
15+
- Verifying code changes against reviewer feedback on GitHub PRs.
16+
17+
## Don't Use When
18+
- Authoring or hardening GitHub Actions workflow YAML files — use [`github-actions`](../github-actions/SKILL.md).
19+
- Running repository maturity scorecards or compliance reviews — use [`github-repo-setup`](../github-repo-setup/SKILL.md).
20+
- Performing high-level security architecture reviews without an active PR.
21+
22+
## Workflow
23+
24+
1. **Fetch Inline Comments**: Query GitHub API for inline review comments on the target PR:
25+
```bash
26+
unset GITHUB_TOKEN && gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
27+
```
28+
Also check general PR review status:
29+
```bash
30+
unset GITHUB_TOKEN && gh pr view {pr_number} --comments
31+
```
32+
33+
2. **Inventory and Count ($N$)**: Extract all inline comments from the API payload. Count the total number of feedback items ($N$).
34+
- If $N = 0$, verify there are no unresolved review threads and report clean PR status.
35+
- If $N > 0$, enumerate items from $1$ to $N$.
36+
37+
3. **Inspect Local Files at Target Lines**: For every item $1..N$, read the local file around the target line number ($L \pm 5$) using file viewing tools.
38+
- NEVER evaluate or reject a comment without loading the target local file lines into active context.
39+
- Compare the reviewer's suggested code against the current local implementation.
40+
41+
4. **Build the Verification Matrix**: Construct a Markdown verification table listing all $1..N$ items:
42+
43+
| Index | File & Line | Author | Feedback Summary | Local Code Snippet | Status & Action |
44+
| :---: | :--- | :--- | :--- | :--- | :--- |
45+
| **1** | `src/foo.ts:42` | `@coderabbitai` | Null check missing on query output | `const res = query();` | **FIXED** — Added `if (!res) throw ...` |
46+
47+
5. **Validate and Apply Fixes**:
48+
- **Valid Feedback:** Implement minimal, clean code fixes targeting only the specified logic path.
49+
- **Invalid / False Positive Feedback:** Refute the comment using explicit, line-level code evidence. Never dismiss a comment based solely on sender identity or automated bot status.
50+
51+
6. **Verify and Re-test**: Run local tests, builds, or linting to verify that fixes compile cleanly without introducing regressions:
52+
```bash
53+
npm test && npm run build
54+
```
55+
Commit and push resolved changes cleanly with Conventional Commits.
56+
57+
## Rules
58+
59+
- **Zero Unverified Dismissals**: Never reject or dismiss a review comment based on author identity or automated bot status. Every decision must be justified by code evidence.
60+
- **Mandatory Local Context**: Must view the target local file around line $L \pm 5$ before forming an evaluation.
61+
- **Minimal Scoped Fixes**: Limit code changes strictly to the active PR feedback items. Do not bundle unrequested refactors or style overhauls.
62+
- **Fail Fast on Ambiguity**: If a review comment or test failure is ambiguous, stop and report the exact diff/log to the maintainer before mutating code.
63+
64+
## Examples
65+
66+
### Example 1: Triaging CodeRabbit Bot Comments
67+
**Prompt**: "Review PR #20 feedback"
68+
**Process**: Run `gh api` → find 3 comments on `config/ai/instructions.md` → load local lines via `view_file` → build 3-item matrix → patch valid logic errors → commit & push.
69+
**Output**: 3-item verification table with explicit code receipts for each item.
70+
71+
### Example 2: Clean PR Verification
72+
**Prompt**: "Check PR #15 review status"
73+
**Process**: Query `gh api` → $N = 0$ inline comments → run `gh pr view 15 --comments` → confirm all checks green → report PR ready for merge.
74+
**Output**: Clean PR verification summary.
75+
76+
## Edge Cases
77+
78+
- **Large PRs ($N > 20$ comments)**: Process in batches of 5 items. Complete verification tables per batch before applying code changes.
79+
- **Outdated Comments**: Comments targeting deleted lines or older commits — verify current line contents; if already resolved, mark as **RESOLVED IN PREVIOUS COMMIT** with commit SHA evidence.
80+
- **GitHub API Unavailable / Unauthenticated**: Run `unset GITHUB_TOKEN` to fall back to local keychain credentials. If still unauthorized, prompt for `gh auth login`.
81+
82+
## References
83+
84+
- [GitHub API Pull Requests Reference](https://docs.github.com/en/rest/pulls/comments) — REST API endpoints for PR review comments.
85+
- [GitHub CLI Manual](https://cli.github.com/manual/gh_api)`gh api` usage and authentication options.
86+
- [github-actions SKILL](../github-actions/SKILL.md) — CI status checks and workflow verification rules.

0 commit comments

Comments
 (0)