diff --git a/.roo/rules-pr-reviewer/1_workflow.xml b/.roo/rules-pr-reviewer/1_workflow.xml deleted file mode 100644 index 444694a52094..000000000000 --- a/.roo/rules-pr-reviewer/1_workflow.xml +++ /dev/null @@ -1,493 +0,0 @@ - - - Initialize Review Process - - Create a todo list to track the PR review workflow: - - - - [ ] Fetch pull request information - [ ] Fetch associated issue (if any) - [ ] Fetch pull request diff - [ ] Fetch existing PR comments and reviews - [ ] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - This helps track progress through the review process and ensures all steps are completed. - - - - - Fetch Pull Request Information - - If the user provides a PR number or URL, extract the necessary information: - - Repository owner and name - - Pull request number - - Use the GitHub CLI to fetch the PR details: - - - gh pr view [PR_NUMBER] --repo [owner]/[repo] --json number,title,body,author,state,url,headRefName,baseRefName,headRefOid,mergeable,isDraft,createdAt,updatedAt - - - Parse the JSON output to understand the PR's current state and metadata. - IMPORTANT: Save the headRefOid value as it will be needed for submitting the review via the API. - - - - [x] Fetch pull request information - [ ] Fetch associated issue (if any) - [ ] Fetch pull request diff - [ ] Fetch existing PR comments and reviews - [ ] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Fetch Associated Issue (If Any) - - 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 CLI to fetch its details: - - - gh issue view [issue_number] --repo [owner]/[repo] --json number,title,body,author,state,url,createdAt,updatedAt,comments - - - The issue description and comments can provide valuable context for the review. - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [ ] Fetch pull request diff - [ ] Fetch existing PR comments and reviews - [ ] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Fetch Pull Request Diff - - Get the pull request diff to understand the changes: - - - gh pr diff [PR_NUMBER] --repo [owner]/[repo] - - - This will show the complete diff of all changes in the PR. - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [ ] Fetch existing PR comments and reviews - [ ] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Fetch Existing PR Comments and Reviews - - IMPORTANT: Before reviewing any code, first get all existing comments and reviews to understand what feedback has already been provided: - - Fetch all review comments: - - gh pr view [PR_NUMBER] --repo [owner]/[repo] --comments - - - Also fetch review details: - - gh api repos/[owner]/[repo]/pulls/[PR_NUMBER]/reviews - - - 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. - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [ ] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Check Out Pull Request Locally - - Use the GitHub CLI to check out the pull request locally: - - - gh pr checkout [PR_NUMBER] --repo [owner]/[repo] - - - This allows you to: - - Navigate the actual code structure - - Understand how changes interact with existing code - - Get better context for your review - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [ ] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Verify Existing Comments Against Current Code - - 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. - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [x] Verify existing comments against current code - [ ] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Perform Comprehensive Review - - 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 - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [x] Verify existing comments against current code - [x] Perform comprehensive review - [ ] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Prepare Review Comments - - 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 7 - - 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/[owner]/[repo]/blob/[branch]/[path/to/file]#L[line-number]`. - - 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). - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [x] Verify existing comments against current code - [x] Perform comprehensive review - [x] Prepare review comments - [ ] Preview review with user - [ ] Submit review or create tasks - - - - - - - Preview Review with User - - 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. - - - 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: - - Create a comprehensive review with all comments - Create individual tasks for each suggestion using new_task - Let me modify the suggestions first - Skip submission - just wanted the analysis - - - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [x] Verify existing comments against current code - [x] Perform comprehensive review - [x] Prepare review comments - [x] Preview review with user - [ ] Submit review or create tasks - - - - - - - Submit Review - - Based on user preference, submit the review using the GitHub API to support inline comments: - - 1. Construct the review payload with inline comments. For each comment, you need: - - The file path (relative to repository root) - - The line number where the comment should appear - - The comment body text - - The side ("RIGHT" for new code, "LEFT" for old code) - - 2. Submit the review using the GitHub API with heredoc syntax: - - gh api -X POST repos/[owner]/[repo]/pulls/[PR_NUMBER]/reviews --input - < - - - The review will be created with all inline comments attached to specific lines of code. - - Example for a review: - - gh api -X POST repos/RooCodeInc/Roo-Code/pulls/6378/reviews --input - < - - - - - [x] Fetch pull request information - [x] Fetch associated issue (if any) - [x] Fetch pull request diff - [x] Fetch existing PR comments and reviews - [x] Check out pull request locally - [x] Verify existing comments against current code - [x] Perform comprehensive review - [x] Prepare review comments - [x] Preview review with user - [x] Submit review or create tasks - - - - - - - Create Tasks for Suggestions (Optional) - - 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: - - [appropriate mode based on task type] - Fix [issue type] in [file]: [specific description of what needs to be done] - - - Example task creation: - - code - 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. - - - - translate - 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. - - - 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." - - - \ No newline at end of file diff --git a/.roo/rules-pr-reviewer/2_best_practices.xml b/.roo/rules-pr-reviewer/2_best_practices.xml deleted file mode 100644 index f367f25b60e1..000000000000 --- a/.roo/rules-pr-reviewer/2_best_practices.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - ALWAYS create a todo list at the start to track the review workflow (Step 1) - - Use GitHub CLI (`gh`) commands instead of MCP tools for all GitHub operations - - ALWAYS fetch the PR's headRefOid in Step 2 - this is required for API review submission - - ALWAYS fetch existing comments and reviews BEFORE reviewing any code (Step 5) - - Create a list of all existing feedback before starting your review - - Check out the PR locally using `gh pr checkout` for better context understanding - - Systematically verify each existing comment against the current code (Step 7) - - Track which comments are resolved vs still pending - - Only provide feedback on NEW issues or UNRESOLVED existing issues - - Never duplicate feedback that has already been addressed - - Always fetch and review the entire PR diff before commenting - - Check for and review any associated issue for context - - Focus on the changes made, not unrelated code - - Ensure all changes are directly related to the linked issue - - Use a friendly, curious tone in all comments - - Ask questions rather than making assumptions - there may be intentions behind the code choices - - Provide actionable feedback with specific suggestions - - Focus exclusively on issues and improvements - skip all praise or positive comments - - Use minimal markdown - avoid headings (###, ##) and excessive formatting - - Only use markdown for code blocks or when absolutely necessary for clarity - - Consider the PR's scope - suggest breaking up large PRs - - Verify proper i18n implementation for UI changes - - Check for test coverage without executing tests - - Look for signs of technical debt and code smells - - Ensure consistency with existing code patterns - - Link to specific lines using full GitHub URLs - - Present findings in a numbered list format for clarity - - Group feedback by priority (critical, important, minor) - - Always preview comments with the user before submitting - - Use the GitHub API for submitting reviews to support inline comments - - Construct proper JSON payloads with commit_id, body, event, and comments array - - Each inline comment needs: path, body, line number, and side (RIGHT for new code) - - Use COMMENT when submitting the review - - Use heredoc syntax (--input - < \ No newline at end of file diff --git a/.roo/rules-pr-reviewer/3_common_mistakes_to_avoid.xml b/.roo/rules-pr-reviewer/3_common_mistakes_to_avoid.xml deleted file mode 100644 index 0aee6e6099f1..000000000000 --- a/.roo/rules-pr-reviewer/3_common_mistakes_to_avoid.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - Not creating a todo list at the start to track the review workflow - - Using MCP tools instead of GitHub CLI commands for GitHub operations - - Forgetting to fetch headRefOid in Step 2 - this is REQUIRED for API review submission - - Starting to review code WITHOUT first fetching existing comments and reviews - - Failing to create a list of existing feedback before reviewing - - Not systematically checking each existing comment against the current code - - Repeating feedback that has already been addressed in the current code - - Ignoring existing PR comments or failing to verify if they have already been resolved - - Running tests or executing code during review - - Making judgmental or harsh comments - - Providing feedback on code outside the PR's scope - - Overlooking unrelated changes not tied to the main issue - - Including ANY praise or positive comments - focus only on issues - - Using markdown headings (###, ##, #) in review comments - - Using excessive markdown formatting when plain text would suffice - - Submitting comments without user preview/approval - - Forgetting to check for an associated issue for additional context - - Missing critical security or performance issues - - Not checking for proper i18n in UI changes - - Failing to suggest breaking up large PRs - - Using internal evaluation terminology in public comments - - Not providing actionable suggestions for improvements - - Reviewing only the diff without local context - - Making assumptions instead of asking clarifying questions about potential intentions - - Forgetting to link to specific lines with full GitHub URLs - - Not presenting findings in a clear numbered list format - - Failing to offer the task creation option for addressing suggestions - - Creating tasks without specific context or file references - - Choosing inappropriate modes when creating tasks for suggestions - - Not updating the todo list after completing each step - - Not including --repo flag when using gh commands for non-default repositories - - Using wrong commit_id in review payload (must use headRefOid from PR info) - - Forgetting to specify "side": "RIGHT" for comments on new code - - Using incorrect line numbers that don't match the actual diff - - Not escaping special characters in JSON payload properly - - Not using COMMENT as the event type in the review payload - - Not constructing proper file paths relative to repository root - - Submitting empty comments array when inline comments are needed - - Forgetting to use < \ No newline at end of file diff --git a/.roomodes b/.roomodes index d027cec83fbb..17ec5fce2309 100644 --- a/.roomodes +++ b/.roomodes @@ -205,21 +205,6 @@ customModes: - command - mcp source: project - - slug: pr-reviewer - name: 🔍 PR Reviewer - roleDefinition: |- - You are Roo, a pull request reviewer specializing in code quality, structure, and translation consistency. Your expertise includes: - Analyzing pull request diffs and understanding code changes in context - Evaluating code quality, identifying code smells and technical debt - Ensuring structural consistency across the codebase - Verifying proper internationalization (i18n) for UI changes - Providing constructive feedback with a friendly, curious tone - Reviewing test coverage and quality without executing tests - Identifying opportunities for code improvements and refactoring - You work primarily with the RooCodeInc/Roo-Code repository, using GitHub MCP tools to fetch and review pull requests. You check out PRs locally for better context understanding and focus on providing actionable, constructive feedback that helps improve code quality. - whenToUse: Use this mode to review pull requests on the Roo-Code GitHub repository or any other repository if specified by the user. - description: Review PRs for code quality, structure, and i18n compliance. - groups: - - read - - - edit - - fileRegex: \.md$ - description: Markdown files only - - mcp - - command - source: project - slug: mode-writer name: ✍️ Mode Writer roleDefinition: |-