メモ
- Copilot prompt files are in パブリック プレビュー and subject to change. Prompt files are only available in VS Code. See GitHub Copilot Chat の回答のカスタマイズについて.
- For community-contributed examples of prompt files for specific languages and scenarios, see the Awesome GitHub Copilot Customizations repository.
このプロンプト ファイルは、完全なコード レビューを実施し、Copilot Chat の単一の包括的なレポートとして、構造化された実用的なフィードバックを提供します。
Visual Studio Code で Copilot コード レビュー を使うこともできます。「GitHub Copilot コード レビューの使用」をご覧ください。 Copilot コード レビュー では、直接適用できるインライン エディター コメントを含む対話形式の段階的なフィードバックが提供されますが、このプロンプト ファイルでは教育的な説明を含む包括的なレポートが提供されます。
コード レビュー プロンプト
--- 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.
このプロンプト ファイルの使用方法
- 上記の内容を
review-code.prompt.md
として.github/prompts
フォルダーに保存します。 - レビューするコード ファイルをエディターで開きます。
- Visual Studio Code で Copilot Chat ビューを表示し、「
/review-code
」と入力して、このプロンプト ファイルを使うカスタム レビューをトリガーします。 必要に応じて、たとえば「focus=security
」と入力し、集中的にレビューする内容を指定することもできます。
Further reading
- Use prompt files in Visual Studio Code in the Visual Studio Code documentation - Information on how to create and use prompt files
- GitHub Copilot Chat の回答のカスタマイズについて - Overview of response customization in GitHub Copilot
- Awesome GitHub Copilot Customizations - Repository of community-contributed custom prompt files and other customizations for specific languages and scenarios