|
|
@@ -0,0 +1,349 @@
|
|
|
+<workflow>
|
|
|
+ <step number="1">
|
|
|
+ <name>Fetch Pull Request Information</name>
|
|
|
+ <instructions>
|
|
|
+ By default, use the GitHub MCP server to fetch and review pull requests from the
|
|
|
+ https://github.com/RooCodeInc/Roo-Code repository.
|
|
|
+
|
|
|
+ If the user provides a PR number or URL, extract the necessary information:
|
|
|
+ - Repository owner and name
|
|
|
+ - Pull request number
|
|
|
+
|
|
|
+ Use the GitHub MCP tool to fetch the PR details:
|
|
|
+
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>get_pull_request</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="2">
|
|
|
+ <name>Fetch Associated Issue (If Any)</name>
|
|
|
+ <instructions>
|
|
|
+ Check the pull request body for a reference to a GitHub issue (e.g., "Fixes #123", "Closes #456").
|
|
|
+ If an issue is referenced, use the GitHub MCP tool to fetch its details:
|
|
|
+
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>get_issue</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "issue_number": [issue_number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+
|
|
|
+ The issue description and comments can provide valuable context for the review.
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="3">
|
|
|
+ <name>Fetch Pull Request Diff</name>
|
|
|
+ <instructions>
|
|
|
+ Get the pull request diff to understand the changes:
|
|
|
+
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>get_pull_request_diff</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="4">
|
|
|
+ <name>Fetch Existing PR Comments and Reviews</name>
|
|
|
+ <instructions>
|
|
|
+ IMPORTANT: Before reviewing any code, first get all existing comments and reviews to understand what feedback has already been provided:
|
|
|
+
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>get_pull_request_comments</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+
|
|
|
+ Also fetch existing reviews:
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>get_pull_request_reviews</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+
|
|
|
+ Create a mental or written list of:
|
|
|
+ - All issues/suggestions that have been raised
|
|
|
+ - The specific files and line numbers mentioned
|
|
|
+ - Whether comments appear to be resolved or still pending
|
|
|
+
|
|
|
+ This information will guide your review to avoid duplicate feedback.
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="5">
|
|
|
+ <name>Check Out Pull Request Locally</name>
|
|
|
+ <instructions>
|
|
|
+ Use the GitHub CLI to check out the pull request locally:
|
|
|
+
|
|
|
+ <execute_command>
|
|
|
+ <command>gh pr checkout [PR_NUMBER]</command>
|
|
|
+ </execute_command>
|
|
|
+
|
|
|
+ This allows you to:
|
|
|
+ - Navigate the actual code structure
|
|
|
+ - Understand how changes interact with existing code
|
|
|
+ - Get better context for your review
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="6">
|
|
|
+ <name>Verify Existing Comments Against Current Code</name>
|
|
|
+ <instructions>
|
|
|
+ Now that you have the code checked out locally and know what comments exist:
|
|
|
+
|
|
|
+ 1. For each existing comment/review point:
|
|
|
+ - Navigate to the specific file and line mentioned
|
|
|
+ - Check if the issue has been addressed in the current code
|
|
|
+ - Mark it as "resolved" or "still pending" in your notes
|
|
|
+
|
|
|
+ 2. Use read_file or codebase_search to examine the specific areas mentioned in comments:
|
|
|
+ - If a comment says "missing error handling on line 45", check if error handling now exists
|
|
|
+ - If a review mentioned "this function needs tests", check if tests have been added
|
|
|
+ - If feedback was about code structure, verify if refactoring has occurred
|
|
|
+
|
|
|
+ 3. Keep track of:
|
|
|
+ - Comments that have been addressed (DO NOT repeat these)
|
|
|
+ - Comments that are still valid (you may reinforce these if critical)
|
|
|
+ - New issues not previously mentioned (these are your main focus)
|
|
|
+
|
|
|
+ This verification step is CRITICAL to avoid redundant feedback and ensures your review adds value.
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="7">
|
|
|
+ <name>Perform Comprehensive Review</name>
|
|
|
+ <instructions>
|
|
|
+ Review the pull request thoroughly:
|
|
|
+ - Verify that the changes are directly related to the linked issue and do not include unrelated modifications.
|
|
|
+ - Focus primarily on the changes made in the PR.
|
|
|
+ - Prioritize code quality, code smell, structural consistency, and for UI-related changes, ensure proper internationalization (i18n) is applied.
|
|
|
+ - Watch for signs of technical debt (e.g., overly complex logic, lack of abstraction, tight coupling, missing tests, TODOs).
|
|
|
+ - For large PRs, alert the user and recommend breaking it up if appropriate.
|
|
|
+ - NEVER run tests or execute code in PR Reviewer mode. The repository likely has automated testing. Your role is limited to:
|
|
|
+ - Code review and analysis
|
|
|
+ - Leaving review comments
|
|
|
+ - Checking code quality and structure
|
|
|
+ - Reviewing test coverage and quality (without execution)
|
|
|
+
|
|
|
+ Document your findings in a numbered list format:
|
|
|
+ 1. Code quality issues
|
|
|
+ 2. Structural improvements
|
|
|
+ 3. Missing tests or documentation
|
|
|
+ 4. Potential bugs or edge cases
|
|
|
+ 5. Performance concerns
|
|
|
+ 6. Security considerations
|
|
|
+ 7. Internationalization (i18n) issues
|
|
|
+ 8. Technical debt indicators
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="8">
|
|
|
+ <name>Prepare Review Comments</name>
|
|
|
+ <instructions>
|
|
|
+ Format your review comments following these guidelines:
|
|
|
+
|
|
|
+ CRITICAL: Before adding any comment, verify it's not already addressed:
|
|
|
+ - Cross-reference with your notes from Step 6
|
|
|
+ - Only comment on NEW issues or UNRESOLVED existing issues
|
|
|
+ - Never repeat feedback that has been addressed in the current code
|
|
|
+
|
|
|
+ Your suggestions should:
|
|
|
+ - Use a **friendly, curious tone** — prefer asking: "Is this intentional?" or "Could we approach this differently to improve X?"
|
|
|
+ - Avoid assumptions or judgments; ask questions instead of declaring problems.
|
|
|
+ - Skip ALL praise and positive comments. Focus exclusively on issues that need attention.
|
|
|
+ - Use Markdown sparingly — only for code blocks or when absolutely necessary for clarity. Avoid markdown headings (###, ##, etc.) entirely.
|
|
|
+ - Avoid including internal evaluation terminology (e.g., scores or internal tags) in public comments.
|
|
|
+
|
|
|
+ When linking to specific lines or files, use full GitHub URLs relative to the repository, e.g.
|
|
|
+ `https://github.com/RooCodeInc/Roo-Code/blob/main/src/api/providers/human-relay.ts#L50`.
|
|
|
+
|
|
|
+ Present your findings as a numbered list organized by priority:
|
|
|
+
|
|
|
+ **Critical Issues (Must Fix):**
|
|
|
+ 1. [Issue description with file/line reference]
|
|
|
+ 2. [Issue description with file/line reference]
|
|
|
+
|
|
|
+ **Important Suggestions (Should Consider):**
|
|
|
+ 3. [Suggestion with rationale]
|
|
|
+ 4. [Suggestion with rationale]
|
|
|
+
|
|
|
+ **Minor Improvements (Nice to Have):**
|
|
|
+ 5. [Improvement suggestion]
|
|
|
+ 6. [Improvement suggestion]
|
|
|
+
|
|
|
+ Include a note about which existing comments you verified as resolved (for user awareness).
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="9">
|
|
|
+ <name>Preview Review with User</name>
|
|
|
+ <instructions>
|
|
|
+ Always show the user a preview of your review suggestions and comments before taking any action.
|
|
|
+ Present your findings as a numbered list clearly for the user before submitting comments.
|
|
|
+
|
|
|
+ <ask_followup_question>
|
|
|
+ <question>I've completed my review of PR #[number]. Here's what I found:
|
|
|
+
|
|
|
+ [If applicable: **Existing comments that have been resolved:**
|
|
|
+ - Comment about X on file Y - now addressed
|
|
|
+ - Suggestion about Z - implemented]
|
|
|
+
|
|
|
+ **Review Findings:**
|
|
|
+
|
|
|
+ **Critical Issues (Must Fix):**
|
|
|
+ 1. [Specific issue with file/line reference]
|
|
|
+ 2. [Specific issue with file/line reference]
|
|
|
+
|
|
|
+ **Important Suggestions (Should Consider):**
|
|
|
+ 3. [Suggestion with rationale]
|
|
|
+ 4. [Suggestion with rationale]
|
|
|
+
|
|
|
+ **Minor Improvements (Nice to Have):**
|
|
|
+ 5. [Improvement suggestion]
|
|
|
+ 6. [Improvement suggestion]
|
|
|
+
|
|
|
+ Would you like me to:</question>
|
|
|
+ <follow_up>
|
|
|
+ <suggest>Create a comprehensive review with all comments</suggest>
|
|
|
+ <suggest>Create individual tasks for each suggestion using new_task</suggest>
|
|
|
+ <suggest>Let me modify the suggestions first</suggest>
|
|
|
+ <suggest>Skip submission - just wanted the analysis</suggest>
|
|
|
+ </follow_up>
|
|
|
+ </ask_followup_question>
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="10">
|
|
|
+ <name>Submit Review</name>
|
|
|
+ <instructions>
|
|
|
+ Based on user preference, submit the review as a comprehensive review:
|
|
|
+
|
|
|
+ 1. First create a pending review:
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>create_pending_pull_request_review</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number]
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+
|
|
|
+ 2. Add comments to the pending review using:
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>add_pull_request_review_comment_to_pending_review</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number],
|
|
|
+ "path": "[file path]",
|
|
|
+ "line": [line number],
|
|
|
+ "body": "[comment text]",
|
|
|
+ "subjectType": "LINE"
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+
|
|
|
+ 3. Submit the review:
|
|
|
+ <use_mcp_tool>
|
|
|
+ <server_name>github</server_name>
|
|
|
+ <tool_name>submit_pending_pull_request_review</tool_name>
|
|
|
+ <arguments>
|
|
|
+ {
|
|
|
+ "owner": "[owner]",
|
|
|
+ "repo": "[repo]",
|
|
|
+ "pullNumber": [number],
|
|
|
+ "event": "COMMENT",
|
|
|
+ "body": "[overall review summary]"
|
|
|
+ }
|
|
|
+ </arguments>
|
|
|
+ </use_mcp_tool>
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+
|
|
|
+ <step number="11">
|
|
|
+ <name>Create Tasks for Suggestions (Optional)</name>
|
|
|
+ <instructions>
|
|
|
+ If the user chooses to create individual tasks for each suggestion, use the new_task tool to create separate tasks:
|
|
|
+
|
|
|
+ For each numbered finding from your review:
|
|
|
+ 1. Determine the appropriate mode based on the type of work needed:
|
|
|
+ - Use "code" mode for bug fixes, implementation changes, or refactoring
|
|
|
+ - Use "translate" mode for internationalization (i18n) issues
|
|
|
+ - Use "test" mode for missing or inadequate test coverage
|
|
|
+ - Use "docs-extractor" mode for documentation issues
|
|
|
+ - Use "architect" mode for structural or design improvements
|
|
|
+ - Use "debug" mode for investigating potential bugs
|
|
|
+
|
|
|
+ 2. Create a clear, actionable task message that includes:
|
|
|
+ - The specific issue or suggestion
|
|
|
+ - The file(s) and line numbers affected
|
|
|
+ - Any relevant context from the PR
|
|
|
+ - The expected outcome
|
|
|
+
|
|
|
+ 3. Use the new_task tool for each suggestion:
|
|
|
+ <new_task>
|
|
|
+ <mode>[appropriate mode based on task type]</mode>
|
|
|
+ <message>Fix [issue type] in [file]: [specific description of what needs to be done]</message>
|
|
|
+ </new_task>
|
|
|
+
|
|
|
+ Example task creation:
|
|
|
+ <new_task>
|
|
|
+ <mode>code</mode>
|
|
|
+ <message>Fix missing error handling in src/api/users.ts:45-52. The getUserById function should handle cases where the user is not found and return an appropriate error response.</message>
|
|
|
+ </new_task>
|
|
|
+
|
|
|
+ <new_task>
|
|
|
+ <mode>translate</mode>
|
|
|
+ <message>Add missing i18n translations for new user profile fields in src/components/UserProfile.tsx. The fields 'bio', 'location', and 'website' need to be wrapped with translation functions.</message>
|
|
|
+ </new_task>
|
|
|
+
|
|
|
+ After creating all tasks, provide a summary:
|
|
|
+ "I've created [X] individual tasks for the review findings:
|
|
|
+ - [Y] code fixes/improvements
|
|
|
+ - [Z] translation/i18n tasks
|
|
|
+ - [etc.]
|
|
|
+
|
|
|
+ Each task contains the specific context and requirements for addressing the issue."
|
|
|
+ </instructions>
|
|
|
+ </step>
|
|
|
+</workflow>
|