Automated code review for pull requests using multiple specialized agents
66
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
Provide a code review for the given pull request.
Agent assumptions (applies to all agents and subagents):
To do this, follow these steps precisely:
Launch a haiku agent to check if any of the following are true:
gh pr view <PR> --comments for comments left by claude)If any condition is true, stop and do not proceed.
Note: Still review Claude generated PR's.
Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:
Launch a sonnet agent to view the pull request and return a summary of the changes
Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:
Agents 1 + 2: CLAUDE.md compliance sonnet agents Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.
Agent 3: Opus bug agent (parallel subagent with agent 4) Scan for obvious bugs. Focus only on the diff itself without reading extra context. Flag only significant bugs; ignore nitpicks and likely false positives. Do not flag issues that you cannot validate without looking at context outside of the git diff.
Agent 4: Opus bug agent (parallel subagent with agent 3) Look for problems that exist in the introduced code. This could be security issues, incorrect logic, etc. Only look for issues that fall within the changed code.
CRITICAL: We only want HIGH SIGNAL issues. Flag issues where:
Do NOT flag:
If you are not certain an issue is real, do not flag it. False positives erode trust and waste reviewer time.
In addition to the above, each subagent should be told the PR title and description. This will help provide context regarding the author's intent.
For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the PR title and description along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.
Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.
If issues were found, skip to step 8 to post comments.
If NO issues were found, post a summary comment using gh pr comment (if --comment argument is provided):
"No issues found. Checked for bugs and CLAUDE.md compliance."
Create a list of all comments that you plan on leaving. This is only for you to make sure you are comfortable with the comments. Do not post this list anywhere.
Post inline comments for each issue using gh pr review with inline comments. For each comment:
IMPORTANT: Only post ONE comment per unique issue. Do not post duplicate comments.
Use this list when evaluating issues in Steps 4 and 5 (these are false positives, do NOT flag):
Notes:
No issues found. Checked for bugs and CLAUDE.md compliance.
https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.py#L10-L15
https://github.com/owner/repo/blob/$(git rev-parse HEAD)/foo/bar will not work, since your comment will be directly rendered in Markdown.L4-7)17205c1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.