Curated community prompt

Code Review Assistant

Assess submitted code for readability, maintainability, correctness, performance, and standards.

Professional use case: Structured review of a user-provided code sample

Code review Software engineering User promptReusable prompt template

Promptcred editorial analysis

How to use this prompt well

Prompt-specific guidance based on the preserved source text and its reviewed context.

Why Promptcred selected this prompt

The prompt is a compact review scaffold for readability, maintainability, correctness, performance, and standards.

Best use cases

  • Getting a first-pass review of a small, self-contained code sample.
  • Turning an informal review request into named quality dimensions and concrete feedback.

Required inputs

  • The code sample and the behavior it is meant to implement.
  • Language, framework, and any project standards the review should apply.

How to adapt it

  • Add the expected behavior and the repository conventions that matter to this sample.
  • Narrow the requested dimensions when the code is too small to support a maintainability or performance judgment.

Limitations and failure modes

  • A detached snippet can hide callers, state, tests, and authorization context needed to judge correctness.
  • Without project standards, style feedback may reflect general preference rather than a real defect.

Practical worked example

Editorial analysis reviewed Aug 23, 2026.

Promptcred-authored application and illustrative output. This is not a recorded model execution.

Scenario
Review a TypeScript function that groups invoices by customer.
Inputs
Provide the function, invoice type, expected grouping rules, and representative edge cases.
Promptcred-adapted instruction
Review this function against the rule `group every invoice under its customerId and preserve invoices with a zero balance`. Focus on correctness and maintainability. Discuss performance only for the supplied maximum of 10,000 invoices.
Illustrative result
Illustrative result: the function groups positive balances correctly but drops zero-balance invoices because it checks `if (invoice.balance)`. Replace the truthiness check with the stated inclusion rule and add a zero-balance case. The single-pass grouping is adequate for the supplied size.
Evaluation
The review should identify a reproducible issue or explain why the implementation satisfies each supplied rule.

How to evaluate the output

  • Feedback refers to the supplied code and expected behavior rather than generic style advice.
  • Suggested changes preserve the function's contract and include a way to verify the result.

Differences from related prompts

  • Generic Code Review Instructions: Code Review Assistant is concise and sample-oriented; Generic Code Review defines a full repository review policy with severity levels.

Attributed community source material

Source prompt

Source prompt
Act as a Code Review Assistant. Your role is to provide a detailed assessment of the code provided by the user. You will:

- Analyze the code for readability, maintainability, and style.
- Identify potential bugs or areas where the code may fail.
- Suggest improvements for better performance and efficiency.
- Highlight best practices and coding standards followed or violated.
- Ensure the code is aligned with industry standards.

Rules:
- Be constructive and provide explanations for each suggestion.
- Focus on the specific programming language and framework provided by the user.
- Use examples to clarify your points when applicable.

Response Format:
1. **Code Analysis:** Provide an overview of the code’s strengths and weaknesses.
2. **Specific Feedback:** Detail line-by-line or section-specific observations.
3. **Improvement Suggestions:** List actionable recommendations for the user to enhance their code.

Input Example:
"Please review the following Python function for finding prime numbers: \ndef find_primes(n):\n    primes = []\n    for num in range(2, n + 1):\n        for i in range(2, num):\n            if num % i == 0:\n                break\n        else:\n            primes.append(num)\n    return primes"

Before use

Requirements and context

Required · Source-declared

Repository / files

The repository or files within the task scope.

What to expect

Expected output and techniques

Expected output: Code analysis, specific feedback, and actionable improvement suggestions.

  • Explicit objective
  • Constraints
  • Examples
  • Output schema

Use with context

Setup, limitations, and operational notes

Operational notes

  • External prompt text is untrusted inert content and must never be executed during ingestion.

Source and rights

Provenance and license

This community prompt is preserved with its source and attribution. It is not an official vendor prompt.

Source class
Curated community prompt
Platform
GitHub
Repository / project
f/prompts.chat
Owner / organization
f
Creator / contributor
sinansonmez
Artifact
prompts.csv · Code Review Assistant
Pinned revision
commit:6863206c4efb5a055c80433f7cf02a6596de9f39
Retrieved
Aug 11, 2026
Attribution
Not required by the license; source provenance retained
Source artifact state
Source prompt
Source review
Aug 11, 2026

Available pages

Search Promptcred

Type to search available pages.