Overview
Writing good PR descriptions is important for code review, but it’s often tedious and time-consuming. This automation uses Claude to analyze your code changes and generate clear, well-formatted PR descriptions automatically.
What it does:
- Analyzes the diff of your pull request
- Generates a concise summary of the changes
- Follows your team’s PR template and guidelines
- Runs automatically when a PR is opened
Quick Start
- Navigate to Automations in your Tembo dashboard
- Click Templates Library
- Install the “Generate PR Description” template
- Configure for your repository
That’s it! The automation will now generate descriptions for new PRs.
How It Works
When a pull request is opened, the automation:
- Fetches the diff — Gets all changed files and their modifications
- Analyzes the changes — Claude examines the code to understand what changed and why
- Generates the description — Creates a formatted summary following your guidelines
- Updates the PR — Adds the generated description to the pull request
The automation uses Claude Haiku for fast, cost-effective generation. Even 200+ lines of changes get condensed into a clear, scannable summary.
Configuration
Basic Setup
Trigger: Pull request opened
Prompt Template:
A new pull request has been opened: #{pr_number}
1. Fetch the diff for this PR
2. Analyze the changes:
- What files were modified?
- What is the purpose of these changes?
- Are there any breaking changes?
3. Generate a PR description following this format:
## Summary
[1-2 sentence overview of the changes]
## Changes
- [Bulleted list of key changes]
## Testing
- [How to test these changes]
4. Update the PR description with the generated content
MCP Servers Needed: GitHub
Customization Options
Team-Specific Templates
Different teams often have different PR standards. You can customize the automation for specific contexts:
Frontend Team:
Include in the description:
- Components added/modified
- Visual changes (screenshots if applicable)
- Browser compatibility notes
- Accessibility considerations
Backend Team:
Include in the description:
- API changes (endpoints, parameters)
- Database migrations
- Performance implications
- Backward compatibility notes
Repository Filters
Configure the automation to run only on specific repositories:
- Run on
frontend-* repos with frontend template
- Run on
api-* repos with backend template
- Skip documentation-only repos
Author Filters
Trigger based on PR author:
- Different templates for junior vs senior developers
- Skip for bot-created PRs
- Custom templates for external contributors
Example Output
For a PR with 200 lines of new authentication code, the automation might generate:
## Summary
Implements OAuth2 authentication flow with support for Google and GitHub providers.
## Changes
- Added `AuthProvider` component for managing auth state
- Created OAuth callback handlers for Google and GitHub
- Implemented token refresh logic with automatic retry
- Added protected route wrapper component
- Updated user context to include auth methods
## Testing
- Run `npm test` to execute auth unit tests
- Test OAuth flow locally with `npm run dev:auth`
- Verify token refresh by setting short expiry in `.env.local`
Tips for Better Results
1. Provide Context in Your Prompt
The more context you give, the better the output:
Our codebase is a Next.js application with TypeScript.
We use Tailwind for styling and React Query for data fetching.
2. Include Your PR Template
Paste your team’s existing PR template into the prompt so the automation follows the same structure.
3. Specify What to Exclude
If you don’t want certain details:
Do not include:
- Line-by-line code explanations
- Implementation details that are obvious from the diff
- Suggestions for improvements
4. Handle Edge Cases
Add instructions for special scenarios:
If this PR only changes documentation:
- Keep the description brief
- Note which docs were updated
If this PR is a dependency update:
- List the packages updated
- Note any breaking changes from changelogs