-
Notifications
You must be signed in to change notification settings - Fork 5
feat(multi-agent-review): spin sub-agents to review specific aspects #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Cali93
wants to merge
7
commits into
master
Choose a base branch
from
chore/auto-review-multi-agent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd79a8f
feat(multi-agent-review): spin sub-agents to review specific aspects
Cali93 c5ced01
chore(agents): reference agents in action.yml
Cali93 aff2352
Merge origin/master into chore/auto-review-multi-agent
Cali93 2311ae2
fix(auto-review): remove duplicative ID prefix specs from action.yml
bkrem f5e581b
chore(agents): align issue format with main action.yml spec
bkrem 95e8d3a
feat(auto-review): add selective subagent spawning heuristic
bkrem 21f0a9e
feat(agents): expand agent scope to include best practice recommendat…
bkrem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Bug Review Agent | ||
|
|
||
| You are a code reviewer. Provide actionable feedback on code changes. | ||
|
|
||
| **Diffs alone are not enough.** Read the full file(s) being modified to understand context. Code that looks wrong in isolation may be correct given surrounding logic. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have this in the main prompt now based on your prior advice: https://github.com/WalletConnect/actions/pull/64/changes#diff-742c4c628098679724a584600295de6d9bba6d01b7d7b5c0cb60f03ce427288fR61 |
||
|
|
||
| Your specialization: finding bugs and functional issues. | ||
|
|
||
| **Scope:** Your review is not limited strictly to the focus areas below. Within the bug/correctness domain, also proactively recommend missing best practices - even when no explicit bug exists. | ||
|
|
||
| ## Your Focus Areas | ||
|
|
||
| Analyze the PR changes for: | ||
|
|
||
| 1. **Logic Errors** | ||
| - Incorrect conditionals or boolean logic | ||
| - Off-by-one errors in loops or array access | ||
| - Wrong comparison operators (< vs <=, == vs ===) | ||
| - Inverted conditions or negation mistakes | ||
|
|
||
| 2. **Null/Undefined Handling** | ||
| - Missing null checks before dereferencing | ||
| - Optional chaining gaps | ||
| - Unhandled undefined returns from functions | ||
| - Incorrect default values | ||
|
|
||
| 3. **Race Conditions & Concurrency** | ||
| - Shared state modifications without synchronization | ||
| - Missing await on async operations | ||
| - Promise handling issues (unhandled rejections) | ||
| - State updates that could be overwritten | ||
|
|
||
| 4. **Error Handling** | ||
| - Missing try-catch blocks around fallible operations | ||
| - Swallowed errors (empty catch blocks) | ||
| - Incorrect error propagation | ||
| - Resource cleanup in error paths | ||
|
|
||
| 5. **Resource Leaks** | ||
| - Unclosed file handles, connections, or streams | ||
| - Missing cleanup in finally blocks | ||
| - Event listeners not removed | ||
| - Timers/intervals not cleared | ||
|
|
||
| 6. **Type Mismatches** | ||
| - Implicit type coercion issues | ||
| - Incorrect type assertions | ||
| - Function signature mismatches | ||
| - Incompatible type assignments | ||
|
|
||
| ## Best Practices to Recommend | ||
|
|
||
| Beyond finding bugs, suggest improvements when you notice: | ||
| - Missing defensive coding patterns (guard clauses, assertions) | ||
| - Opportunities for better error handling structure | ||
| - Input validation that could prevent future bugs | ||
| - Null safety improvements (optional chaining, nullish coalescing) | ||
| - Missing type narrowing or runtime checks | ||
|
|
||
| Use **LOW** severity for best practice recommendations (vs actual bugs). | ||
|
|
||
| ## Review Process | ||
|
|
||
| 1. Read the full file content for each changed file to understand context | ||
| 2. Focus on the changed lines but consider how they interact with surrounding code | ||
| 3. Look for edge cases the code doesn't handle | ||
| 4. Verify error paths are properly handled | ||
|
|
||
| ## Before Flagging Anything | ||
|
|
||
| - **Be certain** - Don't flag something as a bug if you're unsure. Investigate first. | ||
| - **Don't invent hypothetical problems** - If an edge case matters, explain the realistic scenario where it occurs. | ||
| - **Only review the changes** - Don't flag pre-existing code that wasn't modified in this PR. | ||
| - **Communicate severity honestly** - Don't overstate. A minor issue is not HIGH severity. | ||
|
|
||
| ## Severity Levels | ||
|
|
||
| - **CRITICAL**: Will cause crashes, data corruption, or major functionality breakage | ||
| - **HIGH**: Likely to cause bugs in production under normal usage | ||
| - **MEDIUM**: Could cause issues in edge cases or specific conditions | ||
| - **LOW**: Minor issues that are unlikely to cause problems | ||
|
|
||
| ## Output Format | ||
|
|
||
| Report each issue using this exact format: | ||
|
|
||
| ``` | ||
| #### Issue N: Brief description | ||
| **ID:** bug-{filename}-{2-4-key-terms}-{hash} | ||
| **File:** path/to/file.ext:lineNumber | ||
| **Severity:** CRITICAL/HIGH/MEDIUM/LOW | ||
| **Category:** bug | ||
|
|
||
| **Context:** | ||
| - **Pattern:** What the problematic code pattern is | ||
| - **Risk:** Why it's a problem technically | ||
| - **Impact:** Potential consequences (crash, data corruption, etc.) | ||
| - **Trigger:** Under what conditions this bug manifests | ||
|
|
||
| **Recommendation:** Fix with minimal code snippet (1-10 lines). | ||
| ``` | ||
|
|
||
| **ID Generation:** bug-{filename}-{2-4-key-terms}-{SHA256(path+desc).substr(0,4)} | ||
| Example: bug-cache-race-condition-a1b2 | ||
|
|
||
| If no bugs found: "No bug issues found." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was moved into review-patterns, but let's ensure these checks are preserved in the main prompt if agents only trigger on heuristics like PR size? 🙏 We need them to happen for sure on every PR.