From f36355825e53b07d8e087e6cbf2d14e0b88895bb Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Tue, 23 Sep 2025 09:43:12 -0500 Subject: [PATCH] feat: add test version of PR review command - Creates a non-production PR review command for evaluation - Outputs review results locally without posting to GitHub - Allows multiple test runs without polluting PR with comments - Useful for evaluating review effectiveness before production use --- .roo/commands/pr-review.md | 355 +++++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 .roo/commands/pr-review.md diff --git a/.roo/commands/pr-review.md b/.roo/commands/pr-review.md new file mode 100644 index 0000000000..041315e282 --- /dev/null +++ b/.roo/commands/pr-review.md @@ -0,0 +1,355 @@ + + ``` + + + [ ] 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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Fetch Repository and Pull Request Information + + Get repo info: + + ``` + + gh repo view --json owner,name + + ``` + + Fetch PR details: + + ``` + + gh pr view [PR_NUMBER] --repo [owner]/[repo] --json number,title,body,author,state,url,headRefName,baseRefName,headRefOid,mergeable,isDraft,createdAt,updatedAt + + ``` + + + ``` + + + [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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Fetch Associated Issue (If Any) + + While reviewing check if the PR is within scope of the issue and it's actually an attempt at solving it. + Check PR body for issue references (e.g., "Fixes #123"): + + ``` + + gh issue view [issue_number] --repo [owner]/[repo] --json number,title,body,author,state,url,createdAt,updatedAt,comments + + ``` + + + ``` + + + [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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Fetch Pull Request Diff + + Get changes: + + ``` + + gh pr diff [PR_NUMBER] --repo [owner]/[repo] + + ``` + + + ``` + + + [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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Fetch Existing PR Comments and Reviews + + **CRITICAL:** Get existing feedback BEFORE reviewing: + + + ``` + + gh pr view [PR_NUMBER] --repo [owner]/[repo] --comments + + ``` + + + ``` + + gh api repos/[owner]/[repo]/pulls/[PR_NUMBER]/reviews + + ``` + + Note all existing issues, files/lines mentioned, and resolution status. + + + ``` + + + [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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Check Out Pull Request Locally + + + ``` + + gh pr checkout [PR_NUMBER] --repo [owner]/[repo] + + ``` + + + ``` + + + [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 + [ ] Review changes + [ ] Present review to the user + + + ``` + + + + + + Verify Existing Comments Against Current Code + + For each existing comment: + - Check if issue addressed in current code + - Mark as resolved or pending + - Examine the relevant code areas to verify fixes + + Track: + - Resolved comments (DON'T repeat) + - Still valid comments + - New issues (main focus) + + + + [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 + [ ] Review changes + [ ] Present review to the user + + + + + + + + Review Changes + + **Review methodology:** + + 1. **Contract Consistency:** + - Verify all referenced properties exist in their types/interfaces/classes + - Check for invalid, missing, or renamed properties + - Confirm changes don’t break inheritance, composition, or overrides + - Look for contract violations across related entities + + 2. **Reference and Usage Review:** + - Trace references to changed functions, methods, or classes + - Ensure usages remain compatible with changes + - Watch for subtle breaking changes + + 3. **Security review:** + - Check for exposed sensitive data + - Verify input validation + - Look for injection vulnerabilities + + 4. **Code quality checks:** + - Identify code smells (long methods, complex logic, tight coupling) + - Find duplicated code that should be refactored + - Check for hardcoded English strings (should use i18n) + - Verify test coverage for new/changed code + + 5. **Performance considerations:** + - Look for inefficient algorithms + - Identify potential memory leaks + + **NEVER** run tests or execute code - only 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 + [x] Verify existing comments against current code + [x] Review changes + [ ] Present review to the user + + + ``` + + + + + + Present Review to the User + + + ``` + + I've completed my review of PR #[number]. Here's what I found: + + [If applicable: **Existing comments resolved:** + - Comment about X - now addressed] + + **Review Findings:** + - Critical, important, and minor items are summarized above. + + Inline Comments (edit as needed): + + List all review comments below using fenced code blocks, one per comment, with the info string "inline_comment". + Use these fields: + - path + - line + - side (LEFT/RIGHT) + - body + + Example format (replace with real comments): + ```inline_comment + path: src/services/marketplace/SimpleInstaller.ts + line: 87 + side: RIGHT + body: Installing a marketplace mode overwrites a local mode with the same slug. Consider blocking or prompting to avoid unintended data loss. + ``` + + What would you like to do with these findings? + + Switch to Code mode and fix the issues/suggestions + Let me modify the suggestions first + + + ``` + + **If switching to Code mode:** + + ``` + + + [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] Review changes + [x] Present review to the user + [ ] Address critical issues + [ ] Implement important suggestions + [ ] Apply minor improvements (if time permits) + [ ] Test changes + [ ] Commit and push fixes + + + ``` + + + ``` + + code + User requested to fix the issues and suggestions found during PR 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 + [x] Verify existing comments against current code + [x] Review changes + [x] Present review to the user + + + ``` + + +