Run a structured code review with a Copilot prompt file

GitHub (GitHub Docs, CC BY 4.0)

Submit a prompt

Overview

A prompt file from GitHub's Copilot customization library that reviews selected code like a senior engineer would. It checks security, performance, code quality, architecture, testing and documentation, and sorts feedback into critical issues, suggestions and good practices, with line references and example fixes.

Use cases

Prompt
Copied 0
---
agent: 'agent'
description: 'Perform a comprehensive code review'
---

## Role

You're a senior software engineer conducting a thorough code review. Provide constructive, actionable feedback.

## Review Areas

Analyze the selected code for:

1. **Security Issues**
   - Input validation and sanitization
   - Authentication and authorization
   - Data exposure risks
   - Injection vulnerabilities

2. **Performance & Efficiency**
   - Algorithm complexity
   - Memory usage patterns
   - Database query optimization
   - Unnecessary computations

3. **Code Quality**
   - Readability and maintainability
   - Proper naming conventions
   - Function/class size and responsibility
   - Code duplication

4. **Architecture & Design**
   - Design pattern usage
   - Separation of concerns
   - Dependency management
   - Error handling strategy

5. **Testing & Documentation**
   - Test coverage and quality
   - Documentation completeness
   - Comment clarity and necessity

## Output Format

Provide feedback as:

**🔴 Critical Issues** - Must fix before merge
**🟡 Suggestions** - Improvements to consider
**✅ Good Practices** - What's done well

For each issue:
- Specific line references
- Clear explanation of the problem
- Suggested solution with code example
- Rationale for the change

Focus on: ${input:focus:Any specific areas to emphasize in the review?}

Be constructive and educational in your feedback.

Can AI?

Alternatives

  • Review code and get prioritized fixesThis prompt reviews a code snippet or diff the way a principal software engineer would. It weighs correctness, security, performance, readability, idiomatic style, and error handling. It then returns an overall assessment, a ranked list of recommendations, and detailed feedback that shows the original code, a suggested fix, and the reasoning for each issue. The output is Markdown and the prompt includes a worked example.Coding agent
  • Generate an OpenAPI 3.0 spec from your API code with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reads your API endpoint code and writes an OpenAPI 3.0.3 specification in YAML. It asks for paths, parameters, request and response schemas with error cases, reusable components, security schemes and realistic examples. To use it, save the file in your repository's .github/prompts folder and call it from Copilot Chat in VS Code, optionally naming the endpoint. Prompt files are a preview feature in VS Code.Coding agent
  • Write a README for your project with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reviews your whole workspace and writes a README. It covers what the project does, why it is useful, how to install and use it, where to get help and who maintains it, and leaves detailed API docs, licence text and contribution rules to separate files. Save it in your repository's .github/prompts folder and run it from Copilot Chat in VS Code.Coding agent
  • Write unit tests for a chosen function with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that studies the function or method you have selected and writes focused unit tests. It covers normal behaviour, invalid and boundary inputs, error handling and side effects, asking which function and test framework to use and aiming for 5 to 8 independent tests.Coding agent
  • Make a phased onboarding plan for joining a new teamA prompt file from GitHub's Copilot customization library for someone new to a team or codebase. You give the team name and your background, and it drafts a plan in three phases: setting up and reading the key documents, exploring the code and finding suitable first tasks or open issues, then learning team habits and making early contributions. Save it as a prompt file in your repository and run it from Copilot Chat in VS Code. Prompt files are a preview feature in VS Code.Education
  • Analyze a research paper's findings and rigorThis prompt reads a research paper and returns a structured review with a summary, authors and organizations, key findings, and a study overview. It checks study quality items such as design, sample size, p-value, effect size, and reproducibility, rates novelty, rigor, and empiricism from 1 to 10 with a chart, and notes conflicts of interest. It ends with a letter grade and a short summary statement, and the grading leans critical.Research

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall