Hinweis
- Copilot-Promptdateien befinden sich in der public preview. Änderungen sind vorbehalten. Promptdateien sind nur in VS Code verfügbar. Weitere Informationen findest du unter Informationen zum Anpassen der Antworten von GitHub Copilot Chat.
- Beispiele für von der Community bereitgestellte Promptdateien für bestimmte Sprachen und Szenarios findest du im Repository Großartige GitHub Copilot-Anpassungen.
Diese Promptdatei führt umfassende Code Reviews durch und bietet strukturiertes, umsetzbares Feedback als einzelnen umfassenden Bericht in Copilot Chat.
Du kannst Copilot Code Review ebenfalls in Visual Studio Code verwenden. Weitere Informationen findest du unter Verwenden des GitHub Copilot-Code-Reviews. Copilot Code Review bietet interaktives, schrittweises Feedback mit Inlinekommentaren im Editor, die du direkt anwenden kannst, während diese Promptdatei einen umfassenden Bericht mit lehrreichen Erläuterungen liefert.
Prompt für den Code Review
--- mode: '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.
---
mode: '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.
Verwenden dieser Promptdatei
- Speichere den obigen Inhalt in deinem
.github/prompts
Ordner alsreview-code.prompt.md
. - Öffne die zu überprüfende Codedatei im Editor.
- Zeige in Visual Studio Code die Copilot Chat-Ansicht an, und gib
/review-code
ein, um die benutzerdefinierte Überprüfung mithilfe dieser Promptdatei auszulösen. Optional kannst du außerdem angeben, worauf sich die Überprüfung konzentrieren soll, indem du beispielsweisefocus=security
eingibst.
Weitere Informationen
- Verwenden von Promptdateien in Visual Studio Code in der Visual Studio Code-Dokumentation: Informationen zum Erstellen und Verwenden von Promptdateien
- Informationen zum Anpassen der Antworten von GitHub Copilot Chat: Übersicht über die Anpassung von Antworten in GitHub Copilot
- Großartige GitHub Copilot-Anpassungen: Repository der durch die Community bereitgestellten benutzerdefinierten Promptdateien und weiterer Anpassungen für bestimmte Sprachen und Szenarios