Smart Commit Copilot
Smart Commit Copilot is a Visual Studio Code extension that adds an LLM-assisted review step to the Git commit flow inside Source Control.
The extension reviews staged changes before commit, optionally generates a commit message when the input box is empty, and can automatically push the current branch after a successful review.
Features
- Reviews staged Git changes before commit.
- Blocks commits when the review score is below or equal to the configured threshold.
- Generates a commit message automatically when none is provided.
- Supports separate skills for code review and commit message generation.
- Automatically switches to chunked review for large diffs.
- Pushes the current branch after a successful local commit.
- Writes detailed execution logs to the output panel.
How It Works
Smart Commit Copilot follows this workflow:
- Read the staged diff from
git diff --cached.
- Generate a commit message with the configured commit-message skill if the Source Control input box is empty.
- Run code review with the configured review skill.
- For large diffs, split the staged diff into chunks, review each chunk, and summarize the results.
- Compare the final score with the configured threshold.
- Create the local commit and push the current branch only if the review passes.
Scope and Limitations
- The extension only affects commits started through the Smart Commit Copilot command.
- It does not modify local Git hooks.
- It does not intercept command-line
git commit.
- It uses OpenAI-compatible chat completion APIs configured by the user.
Configuration
The extension provides the following settings:
smartCommit.threshold
smartCommit.baseUrl
smartCommit.model
smartCommit.apiKey
smartCommit.extraHeaders
smartCommit.requestTimeoutMs
smartCommit.maxDiffChars
smartCommit.codeReviewSkill
smartCommit.gitCommitMessageSkill
smartCommit.maxDiffChars is used for both:
- the maximum staged diff size sent in a single review request
- the target chunk size when large diffs switch to chunked review
Built-in Skills
The extension currently includes two built-in skill groups:
code-review
Default skill used to review staged changes before commit.
git-commit-message
Default skill used to generate a single-line Conventional Commit message.
These skills are configured independently:
smartCommit.codeReviewSkill
Leave empty to use the default code-review skill. Variants such as code-review1 are also supported.
smartCommit.gitCommitMessageSkill
Leave empty to use the default git-commit-message skill. Variants such as git-commit-message1 are also supported.
The selected review skill ID is included in the review result.
Model Integration
Smart Commit Copilot works with OpenAI-compatible APIs. Configure:
smartCommit.baseUrl
smartCommit.model
smartCommit.apiKey
This can be used with direct providers, gateways, or proxy services that expose a compatible chat completions endpoint.
Example Configuration
{
"smartCommit.threshold": 5,
"smartCommit.baseUrl": "https://your-provider.example.com/v1",
"smartCommit.model": "deepseek-chat",
"smartCommit.apiKey": "sk-xxxx",
"smartCommit.extraHeaders": "{}",
"smartCommit.requestTimeoutMs": 1000000,
"smartCommit.maxDiffChars": 80000,
"smartCommit.codeReviewSkill": "code-review",
"smartCommit.gitCommitMessageSkill": "git-commit-message"
}
Commands
Smart Commit Copilot: Review, Generate Commit Message, and Commit
Smart Commit Copilot: Open Review Output
Usage
- Configure the model connection settings in VS Code.
- Stage the files you want to commit.
- Optionally enter a commit message in Source Control.
- Run
Smart Commit Copilot: Review, Generate Commit Message, and Commit.
- Review the result in the output panel.
If the final review score is below or equal to the configured threshold, the commit is blocked and the commit message is kept for follow-up edits.
If the local commit succeeds but the remote push fails, the extension reports that state explicitly.
When the staged diff exceeds smartCommit.maxDiffChars, the extension automatically switches to chunked review. The final result is determined by the lowest-performing chunk after local aggregation, and the summary step does not override the gate decision.
Output
The output panel includes:
- repository path
- API base URL
- model ID
- selected review skill
- selected commit-message skill when used
- review mode (
single or chunked)
- full diff character count
- chunk count and summary source for chunked review
- threshold
- score
- summary
- detailed findings
If the commit-message generation input was truncated before being sent to the model, that is also shown in the output.