Skip to content

Commit 7c4fc55

Browse files
authored
PR-Reviewer improvements (#5406)
* feat: add Issue Fixer Orchestrator mode * feat: enhance PR Reviewer mode as orchestrator with critical review capabilities - Transform PR Reviewer into an orchestrator mode that delegates analysis tasks - Add comprehensive rule files for workflow, guidelines, and patterns - Implement file-based context management system in .roo/temp/pr-*/ - Add GitHub MCP tool integration with CLI fallback strategy - Include critical review guidelines for pattern consistency and redundancy detection - Update file permissions to support temporary context files
1 parent 6982b19 commit 7c4fc55

File tree

9 files changed

+1250
-337
lines changed

9 files changed

+1250
-337
lines changed
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<orchestrator_workflow>
2+
<overview>
3+
This workflow orchestrates a comprehensive pull request review process by delegating
4+
specialized analysis tasks to appropriate modes while maintaining context through
5+
structured report files. The orchestrator ensures critical review coverage while
6+
avoiding redundant feedback.
7+
</overview>
8+
9+
<initialization>
10+
<step number="1">
11+
<name>Parse PR Information and Initialize Context</name>
12+
<description>
13+
Extract PR information from user input (URL or PR number).
14+
Create context directory and tracking files.
15+
If called by another mode (Issue Fixer, PR Fixer), set calledByMode field.
16+
</description>
17+
<actions>
18+
- Parse PR URL or number from user input
19+
- Create directory: .roo/temp/pr-[PR_NUMBER]/
20+
- Initialize review-context.json with PR metadata
21+
- Check if called by another mode and record it
22+
</actions>
23+
</step>
24+
</initialization>
25+
26+
<github_operations>
27+
<step number="2">
28+
<name>Fetch PR Details and Context</name>
29+
<description>
30+
Try using GitHub MCP tools first. If unavailable or failing, fall back to GitHub CLI.
31+
</description>
32+
<mcp_approach>
33+
Use get_pull_request tool to fetch PR details
34+
</mcp_approach>
35+
<cli_fallback>
36+
gh pr view [PR_NUMBER] --repo [owner]/[repo] --json number,title,author,state,body,url,headRefName,baseRefName,files,additions,deletions,changedFiles
37+
</cli_fallback>
38+
</step>
39+
40+
<step number="3">
41+
<name>Fetch Linked Issue</name>
42+
<description>
43+
If PR references an issue, fetch its details for context.
44+
</description>
45+
<mcp_approach>
46+
Use get_issue tool if issue is referenced
47+
</mcp_approach>
48+
<cli_fallback>
49+
gh issue view [issue_number] --repo [owner]/[repo] --json number,title,body,author,state
50+
</cli_fallback>
51+
</step>
52+
53+
<step number="4">
54+
<name>Fetch Existing Comments and Reviews</name>
55+
<description>
56+
CRITICAL: Get all existing feedback to avoid redundancy.
57+
</description>
58+
<mcp_approach>
59+
Use get_pull_request_comments and get_pull_request_reviews
60+
</mcp_approach>
61+
<cli_fallback>
62+
gh pr review [PR_NUMBER] --repo [owner]/[repo] --json comments,reviews
63+
</cli_fallback>
64+
<save_to>.roo/temp/pr-[PR_NUMBER]/existing-feedback.json</save_to>
65+
</step>
66+
67+
<step number="5">
68+
<name>Check Out PR Locally</name>
69+
<command>gh pr checkout [PR_NUMBER] --repo [owner]/[repo]</command>
70+
<purpose>Enable local code analysis and pattern comparison</purpose>
71+
</step>
72+
</github_operations>
73+
74+
<delegated_analysis>
75+
<step number="6">
76+
<name>Delegate Pattern Analysis</name>
77+
<description>
78+
Create a subtask to analyze code patterns and organization.
79+
</description>
80+
<delegation>
81+
<mode>code</mode>
82+
<focus_areas>
83+
- Identifying similar existing features/components
84+
- Checking if implementations follow established patterns
85+
- Finding potential code redundancy
86+
- Verifying test organization
87+
- Checking file/directory structure consistency
88+
</focus_areas>
89+
<output>.roo/temp/pr-[PR_NUMBER]/pattern-analysis.md</output>
90+
</delegation>
91+
</step>
92+
93+
<step number="7">
94+
<name>Delegate Architecture Review</name>
95+
<description>
96+
Create a subtask for architectural analysis.
97+
</description>
98+
<delegation>
99+
<mode>architect</mode>
100+
<focus_areas>
101+
- Module boundary violations
102+
- Dependency management issues
103+
- Separation of concerns
104+
- Potential circular dependencies
105+
- Overall architectural consistency
106+
</focus_areas>
107+
<output>.roo/temp/pr-[PR_NUMBER]/architecture-review.md</output>
108+
</delegation>
109+
</step>
110+
111+
<step number="8">
112+
<name>Delegate Test Coverage Analysis</name>
113+
<description>
114+
If test files are modified or added, delegate test analysis.
115+
</description>
116+
<delegation>
117+
<mode>test</mode>
118+
<focus_areas>
119+
- Test organization and location
120+
- Test coverage adequacy
121+
- Test naming conventions
122+
- Mock usage patterns
123+
- Edge case coverage
124+
</focus_areas>
125+
<output>.roo/temp/pr-[PR_NUMBER]/test-analysis.md</output>
126+
</delegation>
127+
</step>
128+
</delegated_analysis>
129+
130+
<synthesis>
131+
<step number="9">
132+
<name>Synthesize Findings</name>
133+
<description>
134+
Collect all delegated analysis results and create comprehensive review.
135+
</description>
136+
<actions>
137+
- Read all analysis files from .roo/temp/pr-[PR_NUMBER]/
138+
- Identify critical issues vs suggestions
139+
- Check against existing comments to avoid redundancy
140+
- Prioritize findings by impact
141+
</actions>
142+
</step>
143+
144+
<step number="10">
145+
<name>Create Final Review Report</name>
146+
<description>
147+
Generate comprehensive review report with all findings.
148+
</description>
149+
<output>.roo/temp/pr-[PR_NUMBER]/final-review.md</output>
150+
<sections>
151+
- Executive Summary
152+
- Critical Issues (must fix)
153+
- Pattern Inconsistencies
154+
- Redundancy Findings
155+
- Architecture Concerns
156+
- Test Coverage Issues
157+
- Minor Suggestions
158+
</sections>
159+
</step>
160+
</synthesis>
161+
162+
<completion>
163+
<step number="11">
164+
<name>Present Review to User</name>
165+
<description>
166+
Show the review findings and ask for action.
167+
</description>
168+
<decision_points>
169+
<if_called_by_mode>
170+
Only present the analysis report, do not comment on PR
171+
</if_called_by_mode>
172+
<if_direct_review>
173+
Ask user if they want to post the review as a comment
174+
</if_direct_review>
175+
</decision_points>
176+
</step>
177+
178+
<step number="12">
179+
<name>Post Review Comment (if approved)</name>
180+
<description>
181+
If user approves and not called by another mode, post review.
182+
</description>
183+
<mcp_approach>
184+
Use add_issue_comment or create PR review
185+
</mcp_approach>
186+
<cli_fallback>
187+
gh pr comment [PR_NUMBER] --repo [owner]/[repo] --body-file .roo/temp/pr-[PR_NUMBER]/final-review.md
188+
</cli_fallback>
189+
</step>
190+
</completion>
191+
192+
<error_handling>
193+
<github_api_failures>
194+
Always fall back to GitHub CLI commands
195+
</github_api_failures>
196+
<delegation_failures>
197+
Continue with available analysis and note limitations
198+
</delegation_failures>
199+
<context_preservation>
200+
Always save intermediate results to temp files
201+
</context_preservation>
202+
</error_handling>
203+
</orchestrator_workflow>

0 commit comments

Comments
 (0)