Overview
HAI Build provides intelligent Git integration that automates commit message generation while maintaining best practices for version control. The AI analyzes your changes and generates clear, conventional commit messages.Git Commit Message Generation
HAI Build can automatically generate informative commit messages based on your staged changes.Features
Conventional Commits
Generates messages following conventional commit format
Context-Aware
Analyzes diffs to understand what changed and why
Multi-Repository
Supports workspaces with multiple git repositories
Customizable
Incorporates your notes and preferences
Generating Commit Messages
Trigger Generation
Generate a commit message using one of these methods:Method 1: Source Control UI
- Open the Source Control panel in VS Code
- Click the HAI Build icon in the Source Control toolbar
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Type Generate Commit Message with HAI
- Press Enter
Wait for Generation
HAI Build will:
- Analyze your staged changes with
git diff - Understand what was modified
- Generate a concise, descriptive commit message
- Insert the message into the commit input box
Review and Edit
The generated message appears in the commit message box:
- Review the generated message for accuracy
- Edit if you want to add more context or adjust wording
- Commit when satisfied
HAI Build populates the message field but doesn’t automatically commit. You maintain full control.
Commit Message Format
HAI Build generates messages following the Conventional Commits specification:Structure
Commit Types
HAI Build automatically determines the appropriate type:| Type | Usage |
|---|---|
feat | New feature or functionality |
fix | Bug fix |
docs | Documentation changes |
style | Code style/formatting (no logic change) |
refactor | Code refactoring |
perf | Performance improvements |
test | Adding or updating tests |
chore | Maintenance tasks, dependency updates |
ci | CI/CD configuration changes |
build | Build system changes |
Example Generated Messages
Advanced Features
Adding Developer Notes
Provide context to influence the generated message:
Example:
Your Note
Multi-Repository Workspaces
When your workspace contains multiple Git repositories:Canceling Generation
If you need to stop the generation process:- Click the Stop icon that appears during generation
- Or use Command Palette: Generate Commit Message with HAI - Stop
Best Practices
Stage Related Changes Together
Stage Related Changes Together
Review Generated Messages
Review Generated Messages
Always review the generated message:✅ Check:
- Accuracy of the description
- Appropriate commit type
- Completeness of context
- Important context is missing
- Wording can be clearer
- Ticket/issue numbers should be referenced
Keep Commits Atomic
Keep Commits Atomic
Each commit should represent a single logical change:Good commits:
- ✅
feat: add email validation to signup form - ✅
fix: resolve memory leak in WebSocket connection - ✅
refactor: extract user service to separate module
- ❌
fix: multiple bugs and add features - ❌
update: changed some files - ❌
WIP: stuff
Provide Context in Notes
Provide Context in Notes
For complex changes, add context before generating:The
Your Note
! indicates a breaking change, following conventional commits.Commit Frequently
Commit Frequently
Smaller, frequent commits are easier to describe:Instead of:Try:Smaller diffs → More accurate messages
Integration with HAI Workflow
Commit message generation integrates seamlessly with other HAI features:After Task Execution
With Code Generation
Workflow Example
Troubleshooting
- No Changes to Commit
- Generation Fails
- Generic Messages
- Wrong Commit Type
Issue: “No changes found in repository”Solutions:
- Ensure files are staged with
git add - Check
git statusto see if changes exist - Verify you’re in a git repository
Configuration
Customize commit message generation behavior:Prompt Customization
The commit message generator uses a configurable prompt that:- Follows conventional commit format
- Creates 50-72 character titles
- Describes what changed and why
- Incorporates developer notes
Future versions will support custom prompt templates. Currently, the format follows industry best practices.
Model Selection
Commit messages use your configured LLM provider and model:- Go to Settings in HAI sidebar
- Select your preferred LLM provider
- Choose a model (faster models work well for commit messages)
Git Best Practices with HAI
Workflow Recommendations
-
Feature Branch Workflow
-
Commit Often, Push Less
- Commit after each logical change
- Push after completing a feature or at end of day
- Each commit has a clear, AI-generated message
-
Use Branches for Tasks
- Create a branch for each HAI Task
- Make commits with generated messages
- Create PR when task is complete
Message History
HAI-generated messages contribute to better:- Code reviews: Clear commit messages help reviewers
- Git history: Easy to understand project evolution
- Debugging:
git logandgit blameare more useful - Changelogs: Auto-generate from conventional commits
Next Steps
Task Execution
Execute tasks and commit changes efficiently
Code Generation
Generate code changes worth committing
CLI Usage
Use HAI Build from the command line
Configuration
Customize HAI Build settings
Pro Tip: Combine HAI Build’s code generation with automated commit messages for a seamless development workflow from ideation to version control.