PR Fix
Purpose
Fix issues identified in PR reviews, addressing both blocking and minor concerns systematically.
When to Use
- After receiving PR review feedback
- When PR has requested changes
- To address review comments before merge
Task-Specific Rules
Based on files changed in the PR, load appropriate rules before fixing:
Always also load: Base rules (workflow, github, linear)
Fix Process
Phase 1: Gather Review Context
Fetch PR details:
mcp__github__get_pull_request(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
Get review comments:
mcp__github__get_pull_request_reviews(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
mcp__github__get_pull_request_comments(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
Get changed files:
mcp__github__get_pull_request_files(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
Phase 2: Categorize Issues
Extract all issues from reviews:
- Inline comments (file:line specific)
- General review comments
- Review verdicts and reasons
Categorize by severity:
| Category |
Indicator |
Priority |
| Blocking ❌ |
"must", "required", "blocking", REQUEST_CHANGES |
Fix first |
| Minor ⚠️ |
"consider", "suggestion", "nit", COMMENT |
Fix second |
Create fix plan with TodoWrite:
- [ ] Fix: {blocking issue 1}
- [ ] Fix: {blocking issue 2}
- [ ] Fix: {minor issue 1}
- [ ] Verify all fixes
WAIT for user confirmation before proceeding
Phase 3: Load Context
Read each affected file (full content, not just diff)
Load relevant rules based on file paths
Understand the original intent from PR description
Phase 4: Fix Issues
Work through todos one at a time:
- Mark todo as
in_progress before starting
- Mark as
completed immediately after finishing
For each fix:
- Read the specific comment/issue
- Understand what's being asked
- Make the change following loaded rules
- Summarize what was changed
After each fix:
- Provide summary with code snippets
- Include file:line references
- WAIT for user confirmation
Phase 5: Verify Fixes
Run checks:
yarn typecheck
yarn lint
yarn test
Review against original comments:
- Does each fix address the feedback?
- Any unintended side effects?
Fix any new issues introduced
Output Format
After all fixes are complete:
## ✅ PR Fixes Complete
### PR: #{pr_number} - {title}
### Issues Addressed
| Issue | File | Status |
| ------------------- | ------------------ | -------- |
| {issue description} | `path/file.tsx:42` | ✅ Fixed |
| {issue description} | `path/file.tsx:78` | ✅ Fixed |
### Changes Made
| File | Change |
| ------------------ | ------------- |
| `path/to/file.tsx` | {description} |
### Key Code Changes
{Relevant code snippets with file:line references}
### Verification
- [ ] TypeScript: ✅ No errors
- [ ] Lint: ✅ No warnings
- [ ] Tests: ✅ All passing
- [ ] All review comments addressed: ✅
### Next Steps
{Commit and push, or any remaining items}
Principles to Follow
- Address the actual feedback — Don't assume, read carefully
- Follow loaded rules — Rules files are source of truth
- One fix at a time — Don't batch changes, fix incrementally
- Verify each fix — Ensure it actually addresses the comment
- Don't over-fix — Only change what was requested
1---2name: pr-fix3description: Fix issues identified in PR reviews, addressing blocking and minor concerns. Use after receiving PR review feedback or when PR has requested changes.4---5
6# PR Fix
7
8## Purpose
9
10Fix issues identified in PR reviews, addressing both blocking and minor concerns systematically.
11
12## When to Use
13
14- After receiving PR review feedback
15- When PR has requested changes
16- To address review comments before merge
17
18## Task-Specific Rules
19
20Based on files changed in the PR, load appropriate rules **before fixing**:
21
22| Files Changed | Rules to Load |
23| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
24| `packages/react/src/components/` | [components.md](../../rules/components.md), [testing.md](../../rules/testing.md), [storybook.md](../../rules/storybook.md) |
25| `packages/react/src/hooks/` | [testing.md](../../rules/testing.md) |
26| `packages/core/`, `packages/tailwind/` | [tokens.md](../../rules/tokens.md) |
27| `packages/context-engine/` | [context-engine.md](../../rules/context-engine.md) |
28
29**Always also load:** Base rules (workflow, github, linear)
30
31## Fix Process
32
33### Phase 1: Gather Review Context
34
351. **Fetch PR details:**
36
37 ```
38 mcp__github__get_pull_request(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
39 ```
40
412. **Get review comments:**
42
43 ```
44 mcp__github__get_pull_request_reviews(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
45 mcp__github__get_pull_request_comments(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
46 ```
47
483. **Get changed files:**
49 ```
50 mcp__github__get_pull_request_files(owner: "{owner}", repo: "{repo}", pull_number: {pr_number})
51 ```
52
53### Phase 2: Categorize Issues
54
551. **Extract all issues from reviews:**
56 - Inline comments (file:line specific)
57 - General review comments
58 - Review verdicts and reasons
59
602. **Categorize by severity:**
61
62 | Category | Indicator | Priority |
63 | ----------- | ----------------------------------------------- | ---------- |
64 | Blocking ❌ | "must", "required", "blocking", REQUEST_CHANGES | Fix first |
65 | Minor ⚠️ | "consider", "suggestion", "nit", COMMENT | Fix second |
66
673. **Create fix plan with TodoWrite:**
68
69 ```
70 - [ ] Fix: {blocking issue 1}
71 - [ ] Fix: {blocking issue 2}
72 - [ ] Fix: {minor issue 1}
73 - [ ] Verify all fixes
74 ```
75
764. **WAIT for user confirmation before proceeding**
77
78### Phase 3: Load Context
79
801. **Read each affected file** (full content, not just diff)
81
822. **Load relevant rules** based on file paths
83
843. **Understand the original intent** from PR description
85
86### Phase 4: Fix Issues
87
881. **Work through todos one at a time:**
89 - Mark todo as `in_progress` before starting
90 - Mark as `completed` immediately after finishing
91
922. **For each fix:**
93 - Read the specific comment/issue
94 - Understand what's being asked
95 - Make the change following loaded rules
96 - Summarize what was changed
97
983. **After each fix:**
99 - Provide summary with code snippets
100 - Include file:line references
101 - WAIT for user confirmation
102
103### Phase 5: Verify Fixes
104
1051. **Run checks:**
106
107 ```bash
108 yarn typecheck
109 yarn lint
110 yarn test
111 ```
112
1132. **Review against original comments:**
114 - Does each fix address the feedback?
115 - Any unintended side effects?
116
1173. **Fix any new issues introduced**
118
119## Output Format
120
121After all fixes are complete:
122
123```markdown
124## ✅ PR Fixes Complete
125
126### PR: #{pr_number} - {title}
127
128### Issues Addressed
129
130| Issue | File | Status |
131| ------------------- | ------------------ | -------- |
132| {issue description} | `path/file.tsx:42` | ✅ Fixed |
133| {issue description} | `path/file.tsx:78` | ✅ Fixed |
134
135### Changes Made
136
137| File | Change |
138| ------------------ | ------------- |
139| `path/to/file.tsx` | {description} |
140
141### Key Code Changes
142
143{Relevant code snippets with file:line references}
144
145### Verification
146
147- [ ] TypeScript: ✅ No errors
148- [ ] Lint: ✅ No warnings
149- [ ] Tests: ✅ All passing
150- [ ] All review comments addressed: ✅
151
152### Next Steps
153
154{Commit and push, or any remaining items}
155```
156
157## Principles to Follow
158
1591. **Address the actual feedback** — Don't assume, read carefully
1602. **Follow loaded rules** — Rules files are source of truth
1613. **One fix at a time** — Don't batch changes, fix incrementally
1624. **Verify each fix** — Ensure it actually addresses the comment
1635. **Don't over-fix** — Only change what was requested