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:
Or stage all changes:
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:

Commit Message Format

HAI Build generates messages following the Conventional Commits specification:

Structure

Commit Types

HAI Build automatically determines the appropriate type:

Example Generated Messages

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

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:
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:
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
The ! indicates a breaking change, following conventional commits.
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

1

Complete Task

Execute a HAI Task or code generation request.
2

Review Changes

Review the diffs and accept changes.
3

Stage Changes

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

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