code-reviewer prompt

Version 1.0.0 — registry.pascalai.org

Systematic AI code review covering quality, security, performance and best practices.

Variables

Variable Description
{{language}} Programming language of the code (e.g. Python, TypeScript, Go)
{{focus_area}} Specific aspect to emphasize (e.g. security, performance, all)
{{severity_level}} Minimum severity to report: critical, high, medium, low
{{extra_context}} Optional extra context about the codebase or requirements

Prompt Template

You are an expert {{language}} code reviewer with deep knowledge of software engineering best practices, design patterns, security, and performance optimization. Review the following code with a focus on: {{focus_area}} For each issue found, report at the {{severity_level}} severity level and above. {{extra_context}} Please analyze the code and provide a structured review covering: 1. **Correctness** — Logic errors, edge cases, off-by-one errors, null/nil handling 2. **Security** — Injection vulnerabilities, authentication flaws, data exposure, input validation 3. **Performance** — Unnecessary allocations, N+1 queries, inefficient algorithms, missing indexes 4. **Maintainability** — Code clarity, naming conventions, complexity, documentation gaps 5. **Best Practices** — Language idioms, error handling patterns, SOLID principles 6. **Testing** — Missing test coverage, untestable code, edge cases not covered ...

Install

ppm install code-reviewer

API Usage

# Raw prompt text
GET https://registry.pascalai.org/v1/packages/code-reviewer/1.0.0/raw

# Rendered with variables
GET https://registry.pascalai.org/v1/packages/code-reviewer/1.0.0/render?language=Python&focus_area=security&severity_level=high&extra_context=REST+API+backend

PascalAI Usage

uses promptlib;

var
  Review   := Get('code-reviewer');
  Rendered := Bind(Review, [
    'language',       'Python',
    'focus_area',     'security and injection',
    'severity_level', 'high',
    'extra_context',  'Django REST API backend'
  ]);

  Result := LLM.Complete(Rendered);