Skip to content

Commit a0a7fc5

Browse files
author
Abdullah Khawer
committed
feat: Add code-reviewer chat mode, update README.md accordingly and create slower demos in gif format.
1 parent 48065c0 commit a0a7fc5

7 files changed

+106
-23
lines changed

README.md

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,40 @@ Custom chat modes allow you to modify GitHub Copilot's behavior in VS Code. Each
1717

1818
| Title | Description | Category |
1919
| ----- | ----------- | -------- |
20-
| [Terraform Helm Release Upgrade Analyser](chat-modes/terraform-helm-release-upgrade-analyser.chatmode.md) | Creates a detailed upgrade plan for a Helm release created via Terraform by analysing the configuration differences between the current and desired Helm chart versions and any breaking changes | Infrastructure & DevOps |
20+
| [Code Reviewer](chat-modes/code-reviewer.chatmode.md) | Analyzes code changes between two branches to perform comprehensive code reviews and suggest improvements for security, performance, and code quality | Development Tools |
21+
| [Code Commit Assistant](chat-modes/code-commit-assistant.chatmode.md) | Analyzes code changes, prepares conventional commit messages, and commits to a new branch with proper Git workflow automation | Development Tools |
2122
| [Dockerfile Developer](chat-modes/dockerfile-developer.chatmode.md) | Develops optimized, secure, and best-practice Dockerfiles based on user requirements and application context | Infrastructure & DevOps |
23+
| [Terraform Helm Release Upgrade Analyser](chat-modes/terraform-helm-release-upgrade-analyser.chatmode.md) | Creates a detailed upgrade plan for a Helm release created via Terraform by analysing the configuration differences between the current and desired Helm chart versions and any breaking changes | Infrastructure & DevOps |
2224
| [Conversation to Chat Mode](chat-modes/conversation-to-chat-mode.chatmode.md) | Creates a custom chat mode file based on a conversational interface where users describe their specific task requirements and guidelines | Development Tools |
23-
| [Code Commit Assistant](chat-modes/code-commit-assistant.chatmode.md) | Analyzes code changes, prepares conventional commit messages, and commits to a new branch with proper Git workflow automation | Development Tools |
2425

25-
## Terraform Helm Release Upgrade Analyser
26+
## Code Reviewer
2627

27-
This chat mode helps you safely upgrade Helm releases managed by Terraform by:
28+
This chat mode helps you perform comprehensive code reviews by analyzing changes between Git branches and providing detailed feedback by:
2829

29-
- **Automatic Detection**: Scans your Terraform code to identify Helm release resources
30-
- **Version Comparison**: Compares template files and default values between chart versions
31-
- **Breaking Change Analysis**: Identifies potential breaking changes and compatibility issues
32-
- **Detailed Planning**: Creates comprehensive upgrade plans with step-by-step instructions
30+
- **Branch Comparison**: Analyzes code differences between source and target branches using Git diff
31+
- **Security Analysis**: Checks for secrets exposure, SQL injection vulnerabilities, and security best practices
32+
- **Performance Review**: Identifies inefficient algorithms, memory leaks, and unnecessary computations
33+
- **Code Quality**: Looks for code smells, duplicate code, complex functions, and formatting issues
34+
- **Best Practices**: Verifies proper error handling, logging, and documentation standards
35+
- **Targeted Suggestions**: Provides specific code snippets with improvements, file paths, and line numbers
3336

3437
### Demo
3538

36-
![Demo](demos/terraform-helm-release-upgrade-analyser.chatmode.gif)
39+
![Demo](demos/code-reviewer.chatmode.gif)
40+
41+
## Code Commit Assistant
42+
43+
This chat mode helps you automate your Git workflow by analyzing code changes and creating proper commits by:
44+
45+
- **Automatic Code Analysis**: Analyzes all uncommitted changes to understand the scope and impact of modifications
46+
- **Conventional Commits**: Automatically determines the appropriate conventional commit type (feat, fix, docs, etc.) based on code changes
47+
- **Branch Management**: Creates new branches for your changes following Git best practices
48+
- **Quality Checks**: Optionally runs pre-commit hooks and Terraform formatting before committing
49+
- **Automated Workflow**: Handles the complete Git workflow from branch creation to pushing changes
50+
51+
### Demo
52+
53+
![Demo](demos/code-commit-assistant.chatmode.gif)
3754

3855
## Dockerfile Developer
3956

@@ -49,6 +66,19 @@ This chat mode helps you create optimized, secure, and production-ready Dockerfi
4966

5067
![Demo](demos/dockerfile-developer.chatmode.gif)
5168

69+
## Terraform Helm Release Upgrade Analyser
70+
71+
This chat mode helps you safely upgrade Helm releases managed by Terraform by:
72+
73+
- **Automatic Detection**: Scans your Terraform code to identify Helm release resources
74+
- **Version Comparison**: Compares template files and default values between chart versions
75+
- **Breaking Change Analysis**: Identifies potential breaking changes and compatibility issues
76+
- **Detailed Planning**: Creates comprehensive upgrade plans with step-by-step instructions
77+
78+
### Demo
79+
80+
![Demo](demos/terraform-helm-release-upgrade-analyser.chatmode.gif)
81+
5282
## Conversation to Chat Mode
5383

5484
This meta chat mode helps you create new custom chat modes through a guided conversation by:
@@ -62,20 +92,6 @@ This meta chat mode helps you create new custom chat modes through a guided conv
6292

6393
![Demo](demos/conversation-to-chat-mode.chatmode.gif)
6494

65-
## Code Commit Assistant
66-
67-
This chat mode helps you automate your Git workflow by analyzing code changes and creating proper commits by:
68-
69-
- **Automatic Code Analysis**: Analyzes all uncommitted changes to understand the scope and impact of modifications
70-
- **Conventional Commits**: Automatically determines the appropriate conventional commit type (feat, fix, docs, etc.) based on code changes
71-
- **Branch Management**: Creates new branches for your changes following Git best practices
72-
- **Quality Checks**: Optionally runs pre-commit hooks and Terraform formatting before committing
73-
- **Automated Workflow**: Handles the complete Git workflow from branch creation to pushing changes
74-
75-
### Demo
76-
77-
![Demo](demos/code-commit-assistant.chatmode.gif)
78-
7995
# 📖 How to Use Chat Modes
8096

8197
To use any of these custom chat modes effectively, follow these general steps:
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
description: Analyze code changes between two branches to do a code review and suggest changes if required
3+
tools: ['runCommands']
4+
model: Claude Sonnet 4
5+
---
6+
7+
# Code Reviewer Mode
8+
9+
You are in "Code Reviewer" mode. Your task is to analyze code changes between two branches to do a code review and suggest changes if required by running all the commands as per the instructions and guidelines on behalf of the user in the directory selected as the context.
10+
11+
## Prerequisites
12+
13+
- You need to add context which is a directory having code changes. If the context is missing then you will not proceed further and ask the user to add the right context until it is provided.
14+
15+
## Instructions and Guidelines
16+
17+
1. **Ask for Source Branch**: Ask for source branch name from the user if not provided upfront.
18+
19+
2. **Ask for Target Branch**: Ask for target branch name from the user if not provided upfront.
20+
21+
3. **Find Changed Files**: Use the following command to find all the changed files: `git diff --name-only <SOURCE_BRANCH> <TARGET_BRANCH>`
22+
23+
4. **Code Review Analysis**: Analyze all the code changes in each changed file to do a comprehensive code review based on the following guidelines:
24+
- Share only code snippets that need changes with specific suggestions along with file path and line numbers.
25+
- Check for secrets exposure, SQL injection, vulnerabilities.
26+
- Identify inefficient algorithms, memory leaks, unnecessary computations.
27+
- Look for code smells, duplicate code, complex functions, trailing whitespaces.
28+
- Verify proper error handling, logging, documentation.
29+
30+
You can ask the questions specified above to the user as follows:
31+
```
32+
Kindly let me know:
33+
34+
1. Source Branch: What is the name of the source branch (the branch with new changes)?
35+
2. Target Branch: What is the name of the target branch (usually main/master)?
36+
```
37+
38+
## Example Usage
39+
40+
To use this chat mode effectively, follow these steps:
41+
42+
### Prerequisites
43+
44+
- Ensure you have a Git repository with both the source and target branches
45+
- Know what source branch and target branch you want to use for your code review
46+
- Ensure the directory having code changes is added as the context
47+
48+
### Prompt Examples
49+
50+
**Option 1: Let the mode prompt you with all the questions**
51+
52+
```
53+
Start.
54+
```
55+
56+
**Option 2: Provide answers upfront**
57+
58+
```
59+
Source Branch: feature/new-feature
60+
Target Branch: master
61+
```
62+
63+
## Disclaimers
64+
65+
- **Git Repository Required**: This chat mode requires an active Git repository with both the source and target branches
66+
- **Code Analysis**: The assistant will analyze your code changes to do a code review and suggest changes if required
67+
- **Potential Token Usage**: This chat mode may incur additional token usage, which could impact your usage limits or costs depending on your AI service plan
-5.17 MB
Loading

demos/code-reviewer.chatmode.gif

14 MB
Loading
1.14 MB
Loading
708 KB
Loading
2.21 MB
Loading

0 commit comments

Comments
 (0)