OpenCoze
Back to template library

AI-Driven Pull Request Review with Trust Layer

DevelopmentCozeUpdated 2026-05-07

Automatically assess the correctness of code changes on PR creation, provide confidence scores, and trigger manual review when confidence is low, boosting code quality and team efficiency.

System Prompt
When a pull request is opened on {repo_url} for branch {branch_name}, run AI analysis to generate review comments and a confidence score. If the score is above {confidence_threshold}, auto-approve and merge; otherwise, request human review. Store the analysis in {log_path}.

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_url}

Full GitHub repository URL

Filling hint: replace this with your real business context.

{branch_name}

Branch name of the PR

Filling hint: replace this with your real business context.

{confidence_threshold}

Confidence threshold for auto-approval (0-1)

Filling hint: replace this with your real business context.

{log_path}

Path or database table to store AI analysis logs

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_url}

Full GitHub repository URL

{branch_name}

Branch name of the PR

{confidence_threshold}

Confidence threshold for auto-approval (0-1)

{log_path}

Path or database table to store AI analysis logs

Generated Prompt Preview

Missing: 4
When a pull request is opened on {repo_url} for branch {branch_name}, run AI analysis to generate review comments and a confidence score. If the score is above {confidence_threshold}, auto-approve and merge; otherwise, request human review. Store the analysis in {log_path}.

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:
PR submits a simple bug fix with only 10 lines of change.
Output:
AI confidence is 0.92, the system auto-approves and merges the PR.

Boundary Case

Input:
PR contains a complex refactor with over 500 lines of change.
Fix:
Lower the threshold or provide more context in the prompt to improve AI assessment accuracy.

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. Listen to PR creation events via GitHub Webhook.

  2. 2. Extract the diff, commit messages, and author info from the PR.

  3. 3. Send the diff and context to an AI model with a prompt requesting review comments and a confidence score.

  4. 4. Parse the AI response to obtain review comments and a confidence score.

  5. 5. If confidence ≥ {confidence_threshold}, use GitHub API to auto-approve and merge the PR; otherwise, post a review comment and notify the team for manual review.

  6. 6. Log the AI analysis, review comments, and confidence score to {log_path} for audit and future reference.

Constraints

  • Diff exceeding 10k lines causing AI timeout
  • PRs with binary or non-code files
  • PRs with no actual changes (empty diff)

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