Wizards
Interactive, multi-step workflows that guide users through complex development tasks by breaking them into sequential steps with prompts, questions, and validation.
Core structure
Wizards are built from these components:
WizardStep — A single step in the workflow, containing an ID, name, description, execution type, and optional prompt template. Steps can be questions that collect user input or automated actions that process data.
WizardConfig — Metadata describing the wizard's purpose, domain (like "development"), estimated cost and duration, and version information.
BaseWizard — The abstract foundation that all wizards inherit from. It handles step execution, context building, and result collection through a standardized run() method.
WizardResult — The final output containing the wizard ID, completion status, collected data, generated output, and execution metrics like cost and duration.
Built-in wizard types
Attune includes five specialized wizards for common development scenarios:
DebugWizard— Guides systematic debugging with step-by-step problem identificationRefactorWizard— Walks through code restructuring with safety checksReleasePrepWizard— Automates release preparation tasks and validationSecurityWizard— Conducts guided security audits with risk assessmentTestGenWizard— Generates comprehensive test suites through interactive prompting
Each wizard customizes the base workflow by implementing build_prompt_context() to prepare AI prompts and process_step_result() to handle user responses.
Step execution flow
Wizards execute through a consistent pattern:
- Each step defines its execution mode via
StepType(question vs. automated action) - The wizard builds context using the step's prompt template and current session data
- For question steps, the wizard presents forms to collect user input
- For action steps, the wizard processes data automatically
- Results are validated and stored before moving to the next step
- The final
WizardResultcontains all collected data and generated outputs
Custom wizard creation
You can create custom wizards by extending BaseWizard or by saving YAML definitions that define steps, prompts, and validation rules. The save_custom_wizard() function stores these definitions for reuse, while register_wizard() makes wizard classes available to the system.