Примечание.
- Файлы запроса Copilot находятся в public preview и подвергаются изменению. Файлы запросов доступны только в IDE VS Code, Visual Studio и JetBrains. Смотрите АВТОЗАГОЛОВОК.
- Примеры файлов запросов для определенных языков и сценариев в сообществе см. в репозитории GitHub Copilot Customizations .
Этот файл запроса проводит тщательные проверки кода и предоставляет структурированные, практические отзывы в виде единого комплексного отчета в Копилот Чат.
Кроме того, можно использовать Обзор кода Copilot в Visual Studio Code, см . autoTITLE. Обзор кода Copilot предоставляет интерактивные, пошаговые отзывы с встроенными комментариями редактора, которые можно применить непосредственно, в то время как этот файл запроса предоставляет полный отчет с учебными объяснениями.
Запрос на проверку кода
---
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.
---
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.
Использование этого файла запроса
- Сохраните вышеуказанное содержимое как
review-code.prompt.mdв папке.github/prompts. - Откройте файл кода, который нужно просмотреть в редакторе.
- В Visual Studio Codeотобразите представление Копилот Чат и введите
/review-codeдля активации пользовательской проверки с помощью этого файла запроса. При необходимости можно также указать, на что вы хотите сосредоточиться на проверке, введяfocus=security, например.
данных, многократно используемых.copilot.prompt-files-further-reading %}