OpenCoze
Back to template library

AI-Powered Pull Request Auto-Review Workflow

DevelopmentCozeUpdated 2026-05-08

Automatically review agent-generated PRs in a CI/CD pipeline to detect code quality issues, technical debt, and security vulnerabilities before merging.

System Prompt
Use {repo} {pr_id} {reviewer_role} placeholders, not double braces.

Variable Dictionary (fill in your AI tool)

This section only explains placeholders. It is not an input form on this website. Copy the prompt, then replace variables in Coze / Dify / ChatGPT.

{repo}

Full GitHub repository name, e.g., owner/repo

Filling hint: replace this with your real business context.

{pr_id}

Pull Request number

Filling hint: replace this with your real business context.

{reviewer_role}

Reviewer role, e.g., Senior Engineer

Filling hint: replace this with your real business context.

Quick Variable Filler (Optional)

Fill variables below to generate a ready-to-run prompt in your browser.

{repo}

Full GitHub repository name, e.g., owner/repo

{pr_id}

Pull Request number

{reviewer_role}

Reviewer role, e.g., Senior Engineer

Generated Prompt Preview

Missing: 3
Use {repo} {pr_id} {reviewer_role} placeholders, not double braces.

How to Use This Template

Best for

Teams that need faster development output with more stable prompt quality.

Problem it solves

Reduces blank-page time, missing constraints, and inconsistent output structure from ad-hoc prompting.

Steps

  1. Copy the template prompt.
  2. Paste it into your AI tool (Coze / Dify / ChatGPT).
  3. Replace placeholder variables using the dictionary above.
  4. Run and refine constraints based on output quality.

Not ideal when

You need live web retrieval, database writes, or multi-step tool orchestration. Use full workflow automation for that.

Success Case

Input:
repo=example/repo pr_id=42 reviewer_role=Senior Engineer
Output:
AI-generated comment with code improvement suggestions, technical debt notes, and PR status set to "Ready to merge".

Boundary Case

Input:
repo=example/repo pr_id=9999 reviewer_role=Senior Engineer
Fix:
Verify the PR ID or check repository permissions.

What to Try Next

Keep exploring with similar templates and matching tools.

Continue Where You Left Off

No recent items yet.

Workflow Steps

  1. 1. Pull the PR diff and metadata via the GitHub API.

  2. 2. Run static analysis tools (ESLint, Bandit, SonarQube) to flag syntax errors, potential bugs, and code smells.

  3. 3. Feed the PR content, analysis results, and reviewer role to an AI model to generate review comments, improvement suggestions, and merge recommendations.

  4. 4. Post the AI-generated review as a comment on the PR using the GitHub API.

  5. 5. If the AI deems the PR safe to merge, automatically merge; otherwise, label it as "Needs changes" and notify the developer.

Constraints

  • PR code size exceeds 5,000 lines – split into multiple reviews
  • PR contains binary files – skip static analysis and rely solely on AI review

Explore More in This Category

Development

Recommended Stack

Tools that work well with this template.

Coze

Official site

Low-code agent workflow platform for fast automation delivery.

Open

OpenAI

Official site

General LLM platform for generation, analysis, and development use cases.

Open