OpenCoze
Back to template library

Codex Automated Code Review Workflow

DevelopmentCozeUpdated 2026-04-05

Automatically generate code review comments for GitHub pull requests using Codex, saving developers time and ensuring consistent code quality.

System Prompt
You are a senior code reviewer. Given the following code snippet, provide a concise review in Markdown bullet points, focusing on style, readability, performance, security, and best practices. Reviewer role: {reviewer_role}. Limit to {max_comments} comments. Code snippet:

{code_snippet}

Please respond in a professional tone.

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.

{code_snippet}

The code to review, multi-line text supported.

Filling hint: replace this with your real business context.

{reviewer_role}

Role of the reviewer, e.g., "Senior Backend Engineer".

Filling hint: replace this with your real business context.

{max_comments}

Maximum number of review comments to return, integer.

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.

{code_snippet}

The code to review, multi-line text supported.

{reviewer_role}

Role of the reviewer, e.g., "Senior Backend Engineer".

{max_comments}

Maximum number of review comments to return, integer.

Generated Prompt Preview

Missing: 3
You are a senior code reviewer. Given the following code snippet, provide a concise review in Markdown bullet points, focusing on style, readability, performance, security, and best practices. Reviewer role: {reviewer_role}. Limit to {max_comments} comments. Code snippet:

{code_snippet}

Please respond in a professional tone.

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:
code_snippet: "def add(a,b):\n return a+b\n"\nreviewer_role: "Senior Backend Engineer"\nmax_comments: 3
Output:
- The function is simple and clear. - Consider adding type hints for better readability. - Add a docstring for automated documentation.

Boundary Case

Input:
code_snippet: ""\nreviewer_role: "Senior Backend Engineer"\nmax_comments: 3
Fix:
Please provide the code snippet to review.

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. Trigger on PR creation or update.

  2. 2. Extract changed files and code snippets from the PR.

  3. 3. Populate the prompt with {code_snippet}, {reviewer_role}, {max_comments} and call Codex.

  4. 4. Post the returned Markdown comments as PR reviews.

Constraints

  • File exceeds 10k lines causing LLM timeout
  • Unsupported programming languages (e.g., assembly)
  • Private repositories require additional authentication

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