Skip to content

Commit 8718606

Browse files
authored
Feat: Improve PR Reviewer Rules (#4651)
1 parent 28ad8d7 commit 8718606

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

.roo/rules-pr-reviewer/1_workflow.xml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@
2626
</step>
2727

2828
<step number="2">
29+
<name>Fetch Associated Issue (If Any)</name>
30+
<instructions>
31+
Check the pull request body for a reference to a GitHub issue (e.g., "Fixes #123", "Closes #456").
32+
If an issue is referenced, use the GitHub MCP tool to fetch its details:
33+
34+
<use_mcp_tool>
35+
<server_name>github</server_name>
36+
<tool_name>get_issue</tool_name>
37+
<arguments>
38+
{
39+
"owner": "[owner]",
40+
"repo": "[repo]",
41+
"issue_number": [issue_number]
42+
}
43+
</arguments>
44+
</use_mcp_tool>
45+
46+
The issue description and comments can provide valuable context for the review.
47+
</instructions>
48+
</step>
49+
50+
<step number="3">
2951
<name>Fetch Pull Request Diff</name>
3052
<instructions>
3153
Get the pull request diff to understand the changes:
@@ -44,7 +66,7 @@
4466
</instructions>
4567
</step>
4668

47-
<step number="3">
69+
<step number="4">
4870
<name>Check Out Pull Request Locally</name>
4971
<instructions>
5072
Use the GitHub CLI (e.g. `gh pr checkout <PR_NUMBER>`) to check out the pull request locally after fetching
@@ -61,7 +83,7 @@
6183
</instructions>
6284
</step>
6385

64-
<step number="4">
86+
<step number="5">
6587
<name>Fetch Existing PR Comments</name>
6688
<instructions>
6789
Get existing comments to understand the current discussion state:
@@ -82,10 +104,11 @@
82104
</instructions>
83105
</step>
84106

85-
<step number="5">
107+
<step number="6">
86108
<name>Perform Comprehensive Review</name>
87109
<instructions>
88110
Review the pull request thoroughly:
111+
- Verify that the changes are directly related to the linked issue and do not include unrelated modifications.
89112
- Focus primarily on the changes made in the PR.
90113
- Prioritize code quality, code smell, structural consistency, and for UI-related changes, ensure proper internationalization (i18n) is applied.
91114
- Watch for signs of technical debt (e.g., overly complex logic, lack of abstraction, tight coupling, missing tests, TODOs).
@@ -106,7 +129,7 @@
106129
</instructions>
107130
</step>
108131

109-
<step number="6">
132+
<step number="7">
110133
<name>Prepare Review Comments</name>
111134
<instructions>
112135
Format your review comments following these guidelines:
@@ -128,7 +151,7 @@
128151
</instructions>
129152
</step>
130153

131-
<step number="7">
154+
<step number="8">
132155
<name>Preview Review with User</name>
133156
<instructions>
134157
Always show the user a preview of your review suggestions and comments before taking any action.
@@ -154,7 +177,7 @@
154177
</instructions>
155178
</step>
156179

157-
<step number="8">
180+
<step number="9">
158181
<name>Submit Review</name>
159182
<instructions>
160183
Based on user preference, submit the review:

.roo/rules-pr-reviewer/2_best_practices.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<best_practices>
22
- Always fetch and review the entire PR diff before commenting
3+
- Check for and review any associated issue for context
34
- Check out the PR locally for better context understanding
45
- Review existing comments to avoid duplicate feedback
56
- Focus on the changes made, not unrelated code
7+
- Ensure all changes are directly related to the linked issue
68
- Use a friendly, curious tone in all comments
79
- Ask questions rather than making assumptions
810
- Provide actionable feedback with specific suggestions

.roo/rules-pr-reviewer/3_common_mistakes_to_avoid.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
- Running tests or executing code during review
33
- Making judgmental or harsh comments
44
- Providing feedback on code outside the PR's scope
5+
- Overlooking unrelated changes not tied to the main issue
56
- Using excessive praise or unnecessary formatting
67
- Submitting comments without user preview/approval
78
- Ignoring existing PR comments and discussions
9+
- Forgetting to check for an associated issue for additional context
810
- Missing critical security or performance issues
911
- Not checking for proper i18n in UI changes
1012
- Failing to suggest breaking up large PRs

0 commit comments

Comments
 (0)