Skip to main content

Overview

Blink lets you build an agent that acts as your PR review partner. Tag it on any pull request and it will review your code, provide constructive feedback, catch potential issues, and help you maintain high code quality standards—all before your teammates review. This page shows you what’s possible and provides prompts you can use in Edit Mode to build your own PR review agent.

Getting started

  1. Create a new agent directory and run blink init
  2. Start the dev server with blink dev
  3. Press Ctrl+T to toggle to Edit Mode
  4. Describe your code review agent using the ideas below

What you can build

Here are examples of what you can ask your PR review agent to do once you’ve built it. These show the kinds of reviews and feedback your agent can provide.
Review PR #234 and provide constructive feedback.

Focus on:
- Code quality and maintainability
- Test coverage and edge cases
- Performance implications
- Security concerns
- Consistency with existing codebase patterns

Be objective, direct, and concise. Provide specific, actionable feedback with
examples. Distinguish between blocking issues and nice-to-haves. Skip nitpicky
comments.
Give PR #456 a quick sanity check before I request review from the team.

Check for:
- Obvious bugs or logic errors
- Missing error handling
- Test coverage gaps
- Incomplete or unclear PR description
- Anything that would obviously fail code review

Flag anything that needs fixing before I tag human reviewers.
Review PR #789 with a security focus.

This PR adds a new file upload endpoint. Check for:
- Input validation and sanitization
- Authentication and authorization
- File type restrictions and size limits
- Path traversal vulnerabilities
- Potential injection attacks
- Sensitive data exposure

Flag any security concerns with severity levels.
Review PR #123 for performance issues.

This PR modifies our data fetching logic. Look for:
- Unnecessary re-renders or recomputations
- N+1 queries or inefficient database access
- Missing indexes or pagination
- Memory leaks or resource cleanup issues
- Blocking operations on the main thread

Provide specific suggestions for optimization.
Review PR #567 from an architecture perspective.

This PR adds a new feature. Evaluate:
- Does it follow existing patterns and conventions?
- Is the abstraction level appropriate?
- Are responsibilities properly separated?
- Is it extensible for future needs?
- Does it introduce unnecessary complexity?

Focus on design decisions and long-term maintainability.
Review the tests in PR #890.

Check for:
- Are critical paths covered?
- Are edge cases tested?
- Are tests testing the right things?
- Are test names clear and descriptive?
- Are tests brittle or tightly coupled?
- Are there integration tests where needed?

Suggest missing test cases and improvements.
Review PR #345 for clarity and documentation.

Check:
- Is the code self-documenting?
- Are complex algorithms explained?
- Is the PR description clear and complete?
- Are breaking changes documented?
- Are new APIs documented?
- Would a new team member understand this code?

Suggest where more documentation or clarity is needed.

Building your PR review agent

Switch to Edit Mode (Ctrl+T) and use these prompts to build your agent. Copy and customize them based on what you want your agent to do.
You don’t need to use all of these prompts. Start with 2-3 that match your needs, test the agent, then add more capabilities as needed.

Make it provide constructive code reviews

When reviewing PRs, the agent should: be objective, direct, and concise. Be
specific (reference line numbers and files), suggest improvements with examples,
explain the "why" behind suggestions, and distinguish between blocking issues
and nice-to-haves. Skip nitpicky feedback and fluff. Focus on: correctness,
maintainability, performance, security, and consistency.

Make it catch common bugs and issues

The agent should flag common issues during review: null pointer exceptions,
off-by-one errors, race conditions, missing error handling, unclosed resources,
infinite loops or recursion, type coercion bugs, and incorrect async/await usage.
For each issue, reference the specific line and explain why it's problematic with
a suggested fix.

Make it check test coverage

When reviewing a PR, the agent should analyze test coverage: identify untested
code paths, flag missing edge cases, check that error cases are tested, verify
integration tests for API changes, and ensure test names clearly describe what
they test. Suggest specific test cases that should be added.

Make it review for security vulnerabilities

The agent should scan for security issues: SQL injection risks, XSS vulnerabilities,
insecure authentication or authorization, exposed secrets or API keys, unsafe
deserialization, CSRF vulnerabilities, and improper input validation. For each
finding, explain the risk and provide a secure alternative.

Make it assess performance implications

When reviewing code, the agent should identify performance concerns: inefficient
algorithms or data structures, N+1 query patterns, unnecessary re-renders or
recomputations, blocking operations in critical paths, memory leaks, and missing
pagination or rate limiting. Suggest optimizations with expected impact.

Make it enforce code quality standards

The agent should check for code quality issues: overly complex functions (high
cyclomatic complexity), duplicated code, unclear variable names, missing
documentation for complex logic, inconsistent formatting or style, and violations
of SOLID principles. Focus on maintainability and readability.

Make it verify PR descriptions are complete

Before reviewing code, the agent should check the PR description: Does it explain
what changed and why? Are there screenshots for UI changes? Is there a test plan?
Are breaking changes documented? Are risks or open questions mentioned? If the
description is incomplete, ask for clarification before proceeding with review.

Make it understand your codebase patterns

The agent should learn your codebase conventions: how errors are handled, how
components are structured, naming conventions, testing patterns, and architectural
decisions. When reviewing, flag code that deviates from established patterns and
suggest how to align with existing conventions.

Make it prioritize feedback effectively

The agent should categorize feedback as: blocking (must fix before merge),
important (should fix but not blocking), nice-to-have (optional improvements),
or question (seeking clarification). This helps PR authors prioritize what to
address first. Always be clear about what's required vs. suggested.

Make it provide actionable suggestions

When the agent identifies an issue, it should: show the problematic code, explain
why it's a problem, provide a specific code example of how to fix it, and explain
the benefits of the suggested approach. Avoid vague feedback like "this could be
better"—make every comment actionable.

How it works behind the scenes

When you use the prompts above, Edit Mode automatically implements the right tools for your agent. You don’t need to code anything; just describe what you want. Common tools include:
  • GitHub API - Fetch PR details, read code changes, leave review comments
  • File reading - Examine the changed files and surrounding context
  • Code analysis - Parse and understand code structure and patterns
  • Test execution - Run test suites to verify coverage
  • PR commenting - Add review comments on specific lines or general feedback
  • Pattern matching - Search for common issues and anti-patterns
Edit Mode handles all the technical implementation. Your job is to describe how the agent should review PRs and what to look for.

Iterating on your agent

As you test, you’ll discover what works and what needs adjustment. Use these Edit Mode prompts to refine your agent’s behavior:
The agent should focus on meaningful issues, not style preferences or minor
nitpicks. Skip comments about: formatting (if linters pass), variable naming
(unless truly confusing), personal preferences without clear benefits, and
hypothetical future scenarios. Focus on bugs, security, performance, and
maintainability issues that matter.
The agent should always check for: error handling (what happens when things fail?),
edge cases (empty arrays, null values, boundary conditions), security (input
validation, auth checks), performance (loops in loops, inefficient queries), and
test coverage (are critical paths tested?). Never approve a review without
checking these fundamentals.
Every review comment must be specific and actionable. Instead of "this could be
better," say "this function has O(n²) complexity because of the nested loops—
consider using a hash map to reduce it to O(n)." Always include: what the issue
is, why it matters, and a concrete suggestion for fixing it.
The agent should be constructive, not critical. Frame feedback positively: "This
looks good—one thing to consider is..." instead of "This is wrong." Acknowledge
what's done well before suggesting improvements. Be objective about technical
tradeoffs, not judgmental about decisions.
The agent should provide timely feedback. For small PRs (under 200 lines), review
within minutes. For larger PRs, start with high-level feedback on architecture
and approach, then dive into details. Don't block on minor issues—mark them as
non-blocking and let the author decide whether to address them.

Tips for success

When you’re building:
  • Start with basic code reviews focusing on correctness and bugs
  • Test the agent on small PRs (under 200 lines) first
  • Calibrate feedback style—constructive but direct
  • Review the agent’s reviews to ensure quality
When you’re using it:
  • Tag your agent on PRs before requesting human review
  • Use it for quick sanity checks and early feedback
  • Ask for focused reviews (security, performance, etc.) when needed
  • Don’t skip human reviews—use the agent as a complement
When you’re ready to scale:
  • Build a knowledge base of your codebase patterns
  • Train it on past review comments from your team
  • Integrate with your CI/CD pipeline for automatic reviews
  • Track metrics on review quality and caught issues
Focus on catching real bugs and security issues first. You can always add sophistication like learning from patterns or generating test suggestions later.
I