← Back to Directory
šŸ‘Øā€šŸ’»

Code Review Assistant

Automatically summarize PRs, check CI status, and provide initial code review feedback

šŸ¤– 0 ↑ 0 ↓ Ā |Ā  šŸ‘¤ 0 ↑ 0 ↓
intermediateā± 35 minutesšŸ”„ 5 swappable alternatives

šŸ§‚ Ingredients

šŸ”Œ APIs

pull_requests_diffs_ci_status_and_review_comments

šŸ”„ Alternatives:

Gitlab — Built-in CI/CD, self-hostableBitbucket — Atlassian ecosystem integration

notify_team_of_new_prs_and_review_status

šŸ”„ Alternatives:

Discord — Free, great for communitiesTelegram — Simple bot API, no approval neededTeams — Enterprise/Office 365 integration

šŸ“‹ Step-by-Step Build Guide

STEP 1

Connect to GitHub API and set up webhook or polling for new PRs on your repos

1. Connect to GitHub API and set up webhook or polling for new PRs on your repos

Use the GitHub API to fetch the relevant data.

GET https://api.github.com/repos/{owner}/{repo}/{endpoint}
Headers: Authorization: Bearer {GITHUB_TOKEN}, Accept: application/vnd.github.v3+json

Parse the response and extract the key fields.
Handle pagination if results exceed one page (check Link header).
Rate limit: GitHub allows 5,000 requests/hour with auth. If you get 403, check X-RateLimit-Remaining header.

Format the output concisely with the most important information first.

šŸ§‘ Human Required

  • • ## Connect the API 1. Sign up for the service if you don't have an account 2. Find the API settings in your account dashboard 3. Generate an API key or access token 4. Share the key with your agent when prompted šŸ’” Most services have a free tier that's sufficient to get started.
STEP 2

When a new PR is opened, pull the diff and file list

2. When a new PR is opened, pull the diff and file list

Use the GitHub API to fetch the relevant data.

GET https://api.github.com/repos/{owner}/{repo}/{endpoint}
Headers: Authorization: Bearer {GITHUB_TOKEN}, Accept: application/vnd.github.v3+json

Parse the response and extract the key fields.
Handle pagination if results exceed one page (check Link header).
Rate limit: GitHub allows 5,000 requests/hour with auth. If you get 403, check X-RateLimit-Remaining header.

Format the output concisely with the most important information first.
STEP 3

Generate a PR summary

3. Generate a PR summary: what changed, which files, estimated complexity, and a plain-English description

Compile the gathered data into a structured report.

Format as clean Markdown with:
- Title/date header
- Executive summary (2-3 sentences)
- Key metrics section with actual numbers
- Detailed sections with bullet points
- Action items or recommendations at the end

Keep it scannable — busy people read reports in 30 seconds.
Use emoji sparingly for visual anchors (šŸ“Š metrics, āœ… wins, āš ļø concerns, šŸ“‹ action items).
Include data comparisons: "X this period vs Y last period (↑Z%)"

If any data source was unavailable, note it clearly: "āš ļø [Source] data unavailable — excluded from this report."
STEP 4

Run automated checks

4. Run automated checks: PR size (flag if >500 lines), test coverage (any test files changed?), sensitive files (env, config, auth)

Monitor the data for anomalies and trigger alerts when thresholds are exceeded.

Detection rules:
1. Compare current values against defined thresholds
2. Check for sudden changes (>X% deviation from rolling average)
3. Look for pattern breaks (missing expected data, unusual timing)
4. Cross-reference multiple signals for higher confidence

For each detected anomaly:
- Severity: šŸ”“ Critical (immediate action) / 🟔 Warning (attention needed) / šŸ”µ Info (notable)
- What: specific metric and current value
- Why: what threshold or pattern was violated
- Context: recent trend, baseline comparison
- Suggested action: what to do about it

Suppress duplicate alerts — don't re-alert for the same issue within the configured cooldown period.
STEP 5

Check CI status

5. Check CI status — are all checks passing? Flag failures with relevant logs

Check CI status — are all checks passing? Flag failures with relevant logs

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 6

Post a review comment with

6. Post a review comment with: summary, automated check results, and any flagged concerns

Post a review comment with: summary, automated check results, and any flagged concerns

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 7

Notify the team in Slack

7. Notify the team in Slack: 'New PR #123 by @author — [summary]. CI: āœ… passing. Size: medium (247 lines)'

Use the GitHub API to fetch the relevant data.

GET https://api.github.com/repos/{owner}/{repo}/{endpoint}
Headers: Authorization: Bearer {GITHUB_TOKEN}, Accept: application/vnd.github.v3+json

Parse the response and extract the key fields.
Handle pagination if results exceed one page (check Link header).
Rate limit: GitHub allows 5,000 requests/hour with auth. If you get 403, check X-RateLimit-Remaining header.

Format the output concisely with the most important information first.
STEP 8

Track PR lifecycle

8. Track PR lifecycle: time to first review, time to merge, review rounds

Track PR lifecycle: time to first review, time to merge, review rounds

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.

šŸ¤– Example Agent Prompt

Use the GitHub API to fetch the relevant data.

GET https://api.github.com/repos/{owner}/{repo}/{endpoint}
Headers: Authorization: Bearer {GITHUB_TOKEN}, Accept: application/vnd.github.v3+json

Parse the response and extract the key fields.
Handle pagination if results exceed one page (check Link header).
Rate limit: GitHub allows 5,000 requests/hour with auth. If you get 403, check X-RateLimit-Remaining header.

Format the output concisely with the most important information first.

Copy this prompt into your agent to get started.