> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Wizard AI Generation Guide

> This guide explains how to use AI-assisted wizard creation to rapidly build and customize workflow wizards from natural language descriptions.

This guide explains how to use AI-assisted wizard creation to rapidly build and customize workflow wizards from natural language descriptions.

## Overview

The AI Wizard Generator uses advanced language models to:

* Create complete wizard structures from descriptions
* Generate appropriate fields and validation
* Configure branching logic automatically
* Suggest optimal step organization

## Accessing AI Generation

1. Navigate to **Platform → Wizards**
2. Click **New Wizard** or open an existing wizard in the Builder
3. Click the **Generate with AI** button (✨ icon) in the toolbar

## Writing Effective Descriptions

The quality of your description directly impacts the generated wizard. Here are tips for best results:

### Be Specific About Fields

❌ **Vague:** "Create an employee form"

✅ **Specific:** "Create an employee onboarding wizard that collects first name, last name, email, phone number, hire date, department, and job title"

### Mention Conditions

If you need branching logic, describe the conditions:

✅ "Create an onboarding wizard. If the employee is full-time, show benefits selection. If part-time, skip to equipment request."

### Specify Field Types

When precision matters:

✅ "Collect date of birth (date picker), salary (currency), and department (dropdown with options: HR, Engineering, Sales, Marketing)"

### Include Validation Requirements

✅ "Email must be a valid company email (@company.com). Phone is optional. All other fields are required."

## Example Prompts

### Simple Form Wizard

```
Create a contact form wizard with:
- Personal info step: name, email, phone
- Message step: subject, message (long text), urgency (low/medium/high)
- Review step
```

### Branching Wizard

```
Create a support ticket wizard:
1. Issue type: Bug, Feature Request, or Question
2. If Bug: collect steps to reproduce, expected behavior, actual behavior
3. If Feature: collect description, business justification
4. If Question: collect topic, question details
5. All paths end with a review step
```

### Complex Workflow

```
Create an employee exit interview wizard for HR:
- Exit reason: Resignation, Retirement, Termination, Other
- If Resignation: last day, forwarding address, exit interview availability
- If Retirement: retirement date, benefits continuation preferences
- All: equipment return checklist, knowledge transfer status
- Review and acknowledgment step
```

## Understanding the Preview

After generation, you'll see a preview of the wizard:

### Step List

* **Form Steps** show field count and types
* **Branch Steps** display conditions and targets
* **Review Steps** are marked accordingly

### Field Details

Click to expand each step and see:

* Field names and types
* Required indicators
* Help text suggestions
* Validation rules

### Branch Logic

Branch steps show:

* Each condition with its target
* Default fallback path
* Visual path indicators

## Editing Generated Wizards

After reviewing the preview:

### Accept & Create

* Creates the wizard with the generated configuration
* Opens in the Builder for final adjustments
* Saves as a draft (unpublished)

### Edit in Builder

* Loads the generated steps into the Builder
* Make changes before saving
* Full access to all configuration options

### Regenerate

* Not happy with the result? Click **Regenerate**
* Modify your description and try again
* Each generation is independent

## Generate Similar Feature

Already have a wizard and want a variant?

1. Open an existing wizard in the Builder
2. Click **More → Generate Similar**
3. Describe the changes you want:
   * "Add an emergency contact section"
   * "Remove the benefits step and add a contractor agreement"
   * "Make this wizard for part-time employees"

## Best Practices

### Start Simple

1. Generate a basic version first
2. Review and test the output
3. Iterate with modifications

### Combine with Manual Editing

AI generation is a starting point:

1. Generate the initial structure
2. Refine field labels and help text
3. Adjust validation rules
4. Fine-tune branching conditions

### Version Your Changes

1. Generate a wizard
2. Publish as v1.0
3. Use "Generate Similar" for modifications
4. Publish as v1.1
5. Compare versions if needed

## Limitations

### What AI Can Generate

✅ Form steps with common field types
✅ Basic branching logic
✅ Review steps
✅ Standard validation rules
✅ Help text and placeholders

### What Requires Manual Work

❌ Custom step components
❌ Complex multi-level branching
❌ Integration with external systems
❌ Advanced regex validation patterns
❌ Custom field types

### Rate Limits

* Requests are rate-limited per organization
* If you hit limits, wait a moment and retry
* Contact support for higher limits

## Troubleshooting

### Generation Takes Too Long

* Simplify your description
* Break into smaller wizards
* Check your internet connection

### Poor Quality Output

* Add more detail to your description
* Specify field types explicitly
* Include example values
* Mention validation requirements

### Missing Fields

* Explicitly list all required fields
* Don't assume common fields are included
* Add them manually in the Builder

### Wrong Field Types

* Specify types in your description
* Example: "email (email field)" or "hire\_date (date picker)"
* Edit in Builder after generation

## Privacy & Security

AI wizard generation:

* **Does not store** your descriptions
* **Does not include** sample data in training
* **Does not transmit** existing wizard data
* **Is organization-scoped** - only you see your generations

> **Important:** Never include real PII/PHI in your descriptions. Use generic field names like "SSN" rather than actual values.

## Related Documentation

* [Wizard Analytics Guide](./wizard-analytics-guide.md)
* [Wizard Branching Guide](./wizard-branching-guide.md)
* [Wizard Builder Documentation](../../src/platform/wizards/README.md)
* [Platform AI Integration](../../specs/pf/specs/PF-27-platform-ai.md)
