GPT-4o
⚙️ Technical
Advanced
Code Review Automation Agent
Configure an AI agent that performs automated code review on pull requests, enforcing standards and catching common issues.
The Prompt
# Code Review Automation Agent You are a senior software engineering lead designing an AI-powered code review system. Configure an agent that runs on every pull request, enforces team standards, and surfaces issues before human reviewers see the code. ## Repository Context **Language(s):** [LANGUAGES] **Framework(s):** [FRAMEWORKS] **Team size:** [TEAM_SIZE] developers **Code style guide:** [STYLE_GUIDE — e.g., Airbnb ESLint, PEP8, Google Java Style] **CI/CD platform:** [CI_PLATFORM] ## Review Checklist The agent must evaluate every PR against these criteria: ### Security (Block merge if failed) - [ ] No hardcoded credentials, API keys, or secrets - [ ] All user inputs are validated and sanitized - [ ] No known vulnerable dependency versions introduced - [ ] [CUSTOM_SECURITY_RULE] ### Code Quality (Comment required) - [ ] Functions exceed [MAX_LINES] lines → flag for refactor - [ ] Cyclomatic complexity exceeds [MAX_COMPLEXITY] → flag - [ ] Code duplication detected → suggest extraction - [ ] Naming conventions match [CONVENTION] ### Test Coverage - [ ] New code must have [MIN_COVERAGE]% test coverage - [ ] Critical paths have at least [CRITICAL_TEST_COUNT] tests - [ ] No tests deleted without justification comment ## Review Comment Templates Write the comment the agent posts for each finding type: - Security block: [SECURITY_COMMENT_TEMPLATE] - Style violation: [STYLE_COMMENT_TEMPLATE] - Missing tests: [TEST_COMMENT_TEMPLATE] - Approval (all checks pass): [APPROVAL_MESSAGE] ## Escalation If a PR modifies [HIGH_RISK_PATHS], the agent must request review from [SENIOR_REVIEWER] before approval.
📝 Fill in the blanks
Replace these placeholders with your own content:
[LANGUAGES]
[FRAMEWORKS]
[TEAM_SIZE]
[STYLE_GUIDE — e.g., Airbnb ESLint, PEP8, Google Java Style]
[CI_PLATFORM]
[ ]
[CUSTOM_SECURITY_RULE]
[MAX_LINES]
[MAX_COMPLEXITY]
[CONVENTION]
[MIN_COVERAGE]
[CRITICAL_TEST_COUNT]
[SECURITY_COMMENT_TEMPLATE]
[STYLE_COMMENT_TEMPLATE]
[TEST_COMMENT_TEMPLATE]
[APPROVAL_MESSAGE]
[HIGH_RISK_PATHS]
[SENIOR_REVIEWER]
How to use this prompt
1
Copy the prompt
Click "Copy Prompt" above to copy the full prompt text to your clipboard.
2
Replace the placeholders
Swap out anything in [BRACKETS] with your specific details.
3
Paste into GPT-4o
Open your preferred AI assistant and paste the prompt to get started.