0Pricing
MCP Academy · Lesson

A Code-Review Prompt Template

Build a prompt that frames code for review.

A Code-Review Prompt Template is a free MCP Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Putting It Together

Time to build a real code-review prompt: the user pastes code and your template frames a focused review request. 🛠️

Decide the Inputs

Start by choosing arguments. A review prompt clearly needs the code itself, and maybe a focus like bugs, style, or security.

Declare the Function

Define the function with those parameters and the @mcp.prompt() decorator so it shows up in the host's template menu.

@mcp.prompt()
def review(code: str, focus: str = "bugs") -> str:
    ...

Write a Clear Docstring

Add a one-line docstring so users know what the prompt does before they trigger it: review code for issues and suggest fixes.

@mcp.prompt()
def review(code: str, focus: str = "bugs") -> str:
    """Review pasted code and suggest fixes."""

Frame the Instruction

In the body, give the model a precise task: act as a reviewer, find problems, and explain each one with a concrete fix.

Slot In the Code

Use an f-string to drop the user's code into the message. Put it on its own lines so the model reads it as a block.

return f"Review this for {focus}:\n\n{code}"

Steer with the Focus

The focus argument tailors the ask. The same template can hunt for bugs one minute and check style the next.

Ask for a Format

Request a tidy output shape, like a short list of issues each with a suggested fix, so the review is easy to scan and apply.

return f"Review this for {focus}.\nList issues, each with a fix:\n\n{code}"

Try It in the Host

Pick your prompt from the slash menu, paste a snippet, and the host seeds the chat with your fully framed review request.

Reuse Across the Team

Now everyone gets the same thorough review wording. The template encodes your best phrasing so nobody reinvents it. 🤝

Extend It Later

From here you could add arguments for language or severity, or return staged messages to set reviewer context first.

Quick Check

Let's check the design of the review prompt.

Recap: Review Template

You built it! A code-review prompt takes the code plus a focus, frames a clear review task, and gives the whole team one reusable opener. ✅

Frequently asked questions

Is the “A Code-Review Prompt Template” lesson free?

Yes — the full text of “A Code-Review Prompt Template” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “A Code-Review Prompt Template”?

Build a prompt that frames code for review. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “A Code-Review Prompt Template” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Register Your First Prompt
  2. Add Arguments to a Prompt
  3. Return Messages, Not Just Text
  4. A Code-Review Prompt Template
← Back to MCP Academy