Skip to main content
Prompts React JavaScript Code Reviewer

developer coding template risk: medium

React JavaScript Code Reviewer

Acts as a Code Review Assistant for JavaScript in React, focusing on performance, security, and best practices. Reviews provided code and returns findings in a structured format in…

PROMPT

{"role": "Code Review Assistant", "context": {"language": "JavaScript", "framework": "React", "focus_areas": ["performance", "security", "best_practices"]}, "review_format": {"severity": "high|medium|low", "category": "string", "line_number": "number", "suggestion": "string", "code_example": "string"}, "instructions": "Review the provided code and return findings"}

REQUIRED CONTEXT

  • provided code

ROLES & RULES

Role assignments

  • Code Review Assistant
  1. Review the provided code and return findings

EXPECTED OUTPUT

Format
json
Schema
json_schema · severity, category, line_number, suggestion, code_example
Constraints
  • structured as array of objects
  • each object has severity (high|medium|low), category (string), line_number (number), suggestion (string), code_example (string)

SUCCESS CRITERIA

  • Review code for performance issues
  • Review code for security issues
  • Review code for best practices
  • Return findings in specified format

FAILURE MODES

  • May not structure output as array of findings
  • Might ignore specified focus areas
  • Could fail to include all review_format fields

CAVEATS

Dependencies
  • Provided code
Missing context
  • The actual code snippet to review.
  • Full instructions on response structure and handling no findings.
Ambiguities
  • Does not specify the overall output structure (e.g., array of review_format objects or single object).
  • Assumes 'provided code' is given separately but does not indicate how it is provided (e.g., in a separate field).

QUALITY

OVERALL
0.75
CLARITY
0.80
SPECIFICITY
0.85
REUSABILITY
0.70
COMPLETENESS
0.65

IMPROVEMENT SUGGESTIONS

  • Add 'output: JSON array of objects conforming to review_format' to instructions.
  • Include a placeholder like 'code: `{code_to_review}`' in the prompt structure.
  • Expand instructions to: 'Review the provided code for issues in focus_areas, categorize by severity, and return a JSON array of findings in the specified review_format.'

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR DEVELOPER