Skip to main content
Experts provide domain-specific knowledge and best practices to guide AI code generation. HAI Build comes with four built-in experts and supports custom experts for your unique tech stack.
Experts feature demonstration

Experts in Action

What are Experts?

Experts are specialized AI assistants that:
  • Provide guidelines for specific technologies or domains
  • Include best practices from industry standards
  • Reference documentation for accurate code generation
  • Maintain consistency across your codebase
  • Reduce errors by following proven patterns
Experts integrate directly into the AI’s system prompt, influencing every decision it makes during code generation.

Built-In Experts

HAI Build includes four production-ready experts:

.NET Expert

Expertise:
  • ASP.NET Core web applications
  • Entity Framework Core
  • Dependency injection patterns
  • C# best practices
  • .NET ecosystem tools
Use for:
  • Web APIs and microservices
  • Enterprise applications
  • Azure cloud integrations

Terraform Expert

Expertise:
  • Infrastructure as Code
  • AWS, Azure, GCP providers
  • Module design patterns
  • State management
  • Security best practices
Use for:
  • Cloud infrastructure provisioning
  • Multi-cloud deployments
  • Infrastructure automation

Node.js Expert

Expertise:
  • Express.js and Fastify
  • TypeScript for Node
  • npm ecosystem
  • Async patterns and promises
  • Testing with Jest/Mocha
Use for:
  • Backend services
  • REST and GraphQL APIs
  • Serverless functions

Go Expert

Expertise:
  • Idiomatic Go patterns
  • Concurrency with goroutines
  • Standard library usage
  • Error handling
  • Testing and benchmarking
Use for:
  • High-performance services
  • CLI tools
  • Distributed systems
Built-in experts are read-only and maintained by the HAI Build team. For customization, create a custom expert.

Custom Experts

Create your own experts tailored to your team’s needs:
1

Open Experts Panel

Navigate to the Experts section in HAI Build sidebar.
2

Create New Expert

Click “Create Custom Expert” and provide:
  • Name: Descriptive identifier (e.g., “React with Redux”)
  • Guidelines: Markdown-formatted best practices
  • Document Links: Up to 3 reference URLs (optional)
3

Configure Guidelines

Write your expert’s guidelines in Markdown:
# React Component Best Practices

## Functional Components
- Always use functional components with hooks
- Prefer `const` for component declarations
- Use TypeScript for all components

## State Management
- Use Redux Toolkit for global state
- Keep component state local when possible
- Avoid prop drilling with Context API

## Performance
- Memoize expensive computations with `useMemo`
- Use `React.memo` for pure components
- Lazy load routes with `React.lazy`
4

Add Documentation (Optional)

Provide URLs to reference documentation:
  • Official docs
  • Internal wikis
  • Best practice guides
HAI Build will download and process these for the AI.
5

Save and Activate

Your custom expert is now available for selection.

Expert Storage Structure

Custom experts are stored in your workspace:
workspace/
├── .hai-experts/
│   ├── react-redux/
│   │   ├── metadata.json
│   │   ├── prompt.md
│   │   └── docs/
│   │       ├── react-docs.md
│   │       ├── redux-toolkit.md
│   │       └── status.json
│   └── python-fastapi/
│       ├── metadata.json
│       └── prompt.md
Stores expert configuration:
{
  "name": "React with Redux",
  "createdAt": "2026-03-03T10:30:00Z",
  "documentLinks": [
    "https://react.dev/learn",
    "https://redux-toolkit.js.org/"
  ]
}
See README description: Lines 116-146

Using Experts

Selecting an Expert

1

Open Expert Selector

Click the expert icon in the chat interface or settings.
2

Choose Expert

Select from built-in or custom experts.
3

Confirm Selection

The expert’s guidelines are now active for all AI interactions.

Expert-Guided Code Generation

Once an expert is active:
  1. System Prompt Enhancement: Expert guidelines are injected into the AI’s system prompt
  2. Context-Aware Responses: AI follows expert’s best practices
  3. Consistent Patterns: Code matches your defined standards
  4. Documentation References: AI can cite expert documentation
Example:
User: “Create a React component for a user profile”AI generates:
import React from 'react'

class UserProfile extends React.Component {
  render() {
    return <div>{this.props.name}</div>
  }
}

export default UserProfile
User: “Create a React component for a user profile”AI generates (following expert guidelines):
import React, { FC } from 'react'

interface UserProfileProps {
  name: string
  email: string
}

export const UserProfile: FC<UserProfileProps> = ({ name, email }) => {
  return (
    <div className="user-profile">
      <h2>{name}</h2>
      <p>{email}</p>
    </div>
  )
}

Expert Guidelines Best Practices

❌ “Write good code”✅ “Use TypeScript strict mode. Always define return types for functions. Prefer const over let.”
## Error Handling

Always wrap async operations in try-catch:

\`\`\`typescript
try {
  const data = await fetchUser(id)
  return data
} catch (error) {
  logger.error('Failed to fetch user', error)
  throw new UserFetchError(error)
}
\`\`\`
Structure guidelines hierarchically:
# Python FastAPI Expert

## Project Structure
- Use `app/` directory for application code
- Separate routes, models, and services

## Dependency Injection
- Use FastAPI's `Depends` for services
- Define dependencies in `app/dependencies.py`

## Testing
- Use pytest for all tests
- Mock external services with `unittest.mock`
Link to official documentation:
Follow the [Official TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/)
for advanced type patterns.

Document Processing

When you add document links to an expert:
1

URL Validation

HAI Build validates the URLs and checks accessibility.
2

Content Fetching

Downloads the documentation content.
3

Markdown Conversion

Converts HTML/PDF to clean Markdown format.
4

Storage

Saves processed docs in the expert’s docs/ folder.
5

Status Tracking

Updates status.json with processing status.
Document processing happens asynchronously. Large documentation sites may take several minutes to process.

Supported Document Types

  • Web pages: HTML documentation
  • GitHub README: Markdown from repositories
  • API docs: OpenAPI/Swagger specifications
  • PDFs: Technical guides (experimental)
Documents are re-processed when links change or every 30 days to ensure freshness.

Expert Use Cases

Team Standards

Codify your team’s conventions:
  • Naming conventions
  • File organization
  • Comment styles
  • Git commit formats

Framework Patterns

Enforce framework-specific patterns:
  • Next.js app router conventions
  • Django REST framework structure
  • Spring Boot annotations
  • Rails ActiveRecord patterns

Security Guidelines

Embed security best practices:
  • Input validation rules
  • Authentication patterns
  • Secret management
  • SQL injection prevention

Testing Standards

Define testing expectations:
  • Unit test structure
  • Integration test patterns
  • Mocking strategies
  • Coverage requirements

API Design

Standardize API development:
  • RESTful conventions
  • GraphQL schema design
  • Error response formats
  • Versioning strategies

Database Patterns

Guide database interactions:
  • ORM usage
  • Migration patterns
  • Query optimization
  • Transaction handling

Advanced Expert Features

Multi-Expert Scenarios

Scenario: Full-stack application
1

Backend Expert

Use Node.js expert for API development
2

Frontend Expert

Switch to React expert for UI components
3

Infrastructure Expert

Apply Terraform expert for deployment
Switch experts mid-task by selecting a different expert. The AI adapts immediately.

Combining Experts with Other Features

Apply experts to task execution:
  1. Load tasks from Specif AI
  2. Select appropriate expert (e.g., .NET for backend tasks)
  3. Execute tasks with expert guidance
  4. Consistent code across all task outputs

Editing Experts

1

Locate Expert Files

Navigate to .hai-experts/<expert-name>/
2

Edit prompt.md

Modify guidelines in your preferred editor:
code .hai-experts/react-redux/prompt.md
3

Update metadata.json (Optional)

Change expert name or add/remove document links.
4

Reload Expert

HAI Build automatically detects changes. If not, restart the task.
Important: Changes to built-in experts are not supported. Clone a built-in expert to create a customized version.

Sharing Experts

Share experts across teams:
1

Commit to Git

Add .hai-experts/ to version control:
git add .hai-experts/
git commit -m "Add React Redux expert"
2

Team Members Pull

Others clone the repository and get the expert automatically.
3

Centralized Updates

Update expert guidelines in one place, everyone benefits.
Create a dedicated repository for organization-wide experts and reference it as a git submodule.

Troubleshooting

  • Check .hai-experts/ folder exists
  • Verify prompt.md file is present
  • Ensure metadata.json is valid JSON
  • Restart HAI Build extension
  • Verify URLs are accessible
  • Check network connectivity
  • Review status.json for error details
  • Try removing and re-adding the link
  • Verify expert is selected/active
  • Check guidelines are clear and specific
  • Ensure guidelines don’t conflict with task requirements
  • Try rephrasing guidelines with examples
  • Save all files in expert directory
  • Restart current task
  • Clear HAI Build cache
  • Reload VS Code window

Best Practices Summary

1

Start Simple

Create basic experts with core guidelines before adding complexity.
2

Iterate Based on Output

Review AI-generated code and refine expert guidelines accordingly.
3

Use Examples Liberally

Code examples are more effective than abstract rules.
4

Keep Guidelines Focused

One expert per domain/framework. Don’t mix unrelated concerns.
5

Version Control Experts

Treat expert files as code—commit, review, and version them.
6

Document Rationale

Explain why certain patterns are preferred in comments.

Next Steps

AI-Powered Coding

See how experts integrate with AI workflows

Task Management

Use experts with HAI Tasks for consistent results

Custom Instructions

Layer experts with .clinerules for maximum control

Focus Chain

Apply experts across multi-step task execution

Build docs developers (and LLMs) love