Skip to main content

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

1

Stage Your Changes

First, stage the files you want to commit using Git:
git add src/components/UserProfile.tsx
git add src/services/user.service.ts
Or stage all changes:
git add .
2

Trigger Generation

Generate a commit message using one of these methods:Method 1: Source Control UI
  1. Open the Source Control panel in VS Code
  2. Click the HAI Build icon in the Source Control toolbar
Method 2: Command Palette
  1. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  2. Type Generate Commit Message with HAI
  3. Press Enter
The HAI icon appears in your Source Control panel when HAI Build is installed.
3

Wait for Generation

HAI Build will:
  1. Analyze your staged changes with git diff
  2. Understand what was modified
  3. Generate a concise, descriptive commit message
  4. Insert the message into the commit input box
A progress indicator shows “Generating commit message…”
4

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.
5

Commit Changes

Commit using your preferred method:
# VS Code UI: Click the checkmark icon
# Or use git command:
git commit
# Message is already populated

Commit Message Format

HAI Build generates messages following the Conventional Commits specification:

Structure

<type>: <short description>

<detailed description (optional)>

Commit Types

HAI Build automatically determines the appropriate type:
TypeUsage
featNew feature or functionality
fixBug fix
docsDocumentation changes
styleCode style/formatting (no logic change)
refactorCode refactoring
perfPerformance improvements
testAdding or updating tests
choreMaintenance tasks, dependency updates
ciCI/CD configuration changes
buildBuild system changes

Example Generated Messages

feat: add user profile editing functionality

Implement profile edit form with validation, image upload, 
and API integration. Includes error handling and loading states.

Advanced Features

Adding Developer Notes

Provide context to influence the generated message:
1

Start Generation

Click the HAI Build icon or use the command palette.
2

Enter Notes (Optional)

If you’ve already typed notes in the commit message box:
  • HAI Build reads your existing notes
  • Incorporates relevant information
  • Generates message considering your context
Add notes about why you made changes. HAI uses this to create more meaningful messages.
Example:
Your Note
Fixed the performance issue users reported with large datasets

↓ HAI generates:

perf: optimize data rendering for large datasets

Implement virtualization and pagination to handle datasets 
with 10k+ items. Resolves performance degradation reported by users.

Multi-Repository Workspaces

When your workspace contains multiple Git repositories:
1

Trigger Generation

Click the HAI Build icon or use the command palette.
2

Select Repository

If multiple repositories have changes, HAI Build prompts:
Select repository for commit message generation:
○ frontend (3 files changed)
○ backend (5 files changed)
○ Generate for all repositories with changes
3

Generate Messages

  • Single Repository: Message generated for selected repo
  • All Repositories: Messages generated for each repo with changes

Canceling Generation

If you need to stop the generation process:
  1. Click the Stop icon that appears during generation
  2. Or use Command Palette: Generate Commit Message with HAI - Stop
Generation typically completes in a few seconds. Canceling is rarely needed.

Best Practices

Always review the generated message:Check:
  • Accuracy of the description
  • Appropriate commit type
  • Completeness of context
✏️ Edit if:
  • Important context is missing
  • Wording can be clearer
  • Ticket/issue numbers should be referenced
Example edit:
Generated:
feat: add user authentication

Edit to:
feat: add user authentication [PROJ-123]

Implement JWT-based authentication with refresh tokens.
Fixes issue where users were logged out prematurely.
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
Poor commits:
  • fix: multiple bugs and add features
  • update: changed some files
  • WIP: stuff
Atomic commits help HAI generate precise messages.
For complex changes, add context before generating:
Your Note
Refactored the authentication flow to support OAuth2.
Broke backward compatibility with old token format.
Migrations included.

↓ HAI considers this context:

refactor!: migrate authentication to OAuth2

BREAKING CHANGE: Old authentication tokens no longer supported.
Implement OAuth2 flow with authorization code grant.
Include migration script for existing user sessions.
The ! indicates a breaking change, following conventional commits.
Smaller, frequent commits are easier to describe:Instead of:
# End of day: 47 files changed
git add .
git commit -m "various updates"
Try:
# After each logical change
git add src/auth/
git commit  # HAI: "feat: implement user authentication"

git add src/profile/
git commit  # HAI: "feat: add user profile management"

git add tests/
git commit  # HAI: "test: add auth and profile tests"
Smaller diffs → More accurate messages

Integration with HAI Workflow

Commit message generation integrates seamlessly with other HAI features:

After Task Execution

1

Complete Task

Execute a HAI Task or code generation request.
2

Review Changes

Review the diffs and accept changes.
3

Stage Changes

git add .
4

Generate Commit Message

Use HAI Build to generate a message based on the task changes.
5

Commit

Commit with the generated message.

With Code Generation

Workflow Example
1. Request: "Add user profile editing feature"
2. HAI generates: components, services, tests
3. You review and accept changes
4. Stage files: git add src/profile/
5. Generate commit: HAI creates "feat: add user profile editing"
6. Commit: git commit
7. Push: git push

Troubleshooting

Issue: “No changes found in repository”Solutions:
  • Ensure files are staged with git add
  • Check git status to 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:
  1. Go to Settings in HAI sidebar
  2. Select your preferred LLM provider
  3. Choose a model (faster models work well for commit messages)
Commit message generation works with smaller, faster models since the task is straightforward. You don’t need to use your most powerful model.

Git Best Practices with HAI

Workflow Recommendations

  1. Feature Branch Workflow
    git checkout -b feature/user-profiles
    # Make changes with HAI
    git add .
    # Generate commit message
    git commit
    git push origin feature/user-profiles
    
  2. 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
  3. 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 log and git blame are 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.

Build docs developers (and LLMs) love