wizard · diff

git:20260625.d1a5594 to git:20260718.206f45d

58 added, 64 removed. Audit A to A.

---
name: wizard
- description: "Run a guided multi-step wizard (debug, refactor, release-prep, security, test-gen) conversationally. Triggers on: run a wizard, debug wizard, refactor wizard, security wizard, test-gen wizard, walk me through, guided wizard."
+ description: Guided multi-step wizards with XML task decomposition
---
- # Wizard
-
- **IMPORTANT: Start your response with a context preamble.**
+ # wizard
- Call `help_lookup(topic="wizard", mode="preamble")` and display the
- returned `preamble` text as a blockquote. Then tell the user they can
- say "tell me more" for a step-by-step guide, or answer the scoping
- question below to proceed.
+ Guided multi-step wizards with XML task decomposition
+ for complex workflows.
- If the MCP call fails, fall back to:
+ ## Routes
- > **Wizard** — Runs a guided, multi-step wizard. I'll show you the
- > wizard's steps, ask you each question, then run it and present the
- > result.
+ | Subcommand | Action |
+ | ---------- | ------ |
+ | `run debug` | Debug wizard |
+ | `run test-gen` | Test generation wizard |
+ | `run refactor` | Refactoring wizard |
+ | `run security` | Security wizard |
+ | `run release-prep` | Release prep wizard |
+ | `create` | Create a custom wizard |
+ | `list` | List available wizards |
+ | `edit` | Edit a wizard |
- ## Scoping
+ ## Usage
- 1. **Which wizard?** If the user didn't name one, list the registered
- wizards (id + description) and ask. Get the live list — never
- hand-author it:
+ ```bash
+ /wizard # Ask what to do
+ /wizard run debug # Debug wizard
+ /wizard run test-gen # Test gen wizard
+ /wizard run refactor # Refactoring wizard
+ /wizard run security # Security wizard
+ /wizard run release-prep # Release prep wizard
+ /wizard create # Create custom wizard
+ /wizard list # List wizards
+ ```
- ```bash
- python -c "import json; from attune.wizards import list_wizards; print(json.dumps([{'id': w.wizard_id, 'description': w.description} for w in list_wizards()]))"
- ```
+ ## Behavior
- 2. **Any starting context?** e.g. a file path or error message the
- wizard should begin from.
+ ### run
- ## Execution
+ Handles all built-in wizards (`debug`, `test-gen`,
+ `refactor`, `security`, `release-prep`). When invoked
+ with a specific wizard (e.g., `/wizard run debug`),
+ skip the wizard selection question.
- This wizard runs on an interactive engine, so you (the model) drive it:
- show the steps, collect the answers, then run it once with those
- answers supplied.
+ Use `AskUserQuestion` to scope:
- 1. **Inspect the steps** for the chosen wizard:
+ - Which wizard to run? (if not specified)
+ - What target files or path?
- ```bash
- python -c "import json; from attune.wizards import describe_wizard_steps; print(json.dumps(describe_wizard_steps('debug')))"
- ```
+ Then execute the wizard step-by-step, using
+ `AskUserQuestion` at each decision point.
- Each entry has `id`, `type`, `name`, `description`; `question` steps
- also carry `questions` (in `AskUserQuestion` format).
+ ### create
- 2. **Ask the user the question-step questions** via `AskUserQuestion`
- (batch up to 4 at a time). Collect answers keyed by each question's
- `question_id`. `review`/`confirm` steps need no upfront answer — the
- engine auto-proceeds on their defaults this cut.
+ Guide the user through wizard creation:
- 3. **Run the wizard** with the collected answers. Write them to a temp
- JSON file (avoids shell-quoting issues) and run:
+ 1. Name and description
+ 2. Steps definition
+ 3. XML task templates
+ 4. Validation criteria
- ```bash
- ANSWERS_JSON=/tmp/wizard_answers.json python -c "
- import json, os, asyncio
- from attune.wizards import run_wizard_prefilled
- answers = json.load(open(os.environ['ANSWERS_JSON']))
- result = asyncio.run(run_wizard_prefilled('debug', answers=answers, initial_context={}))
- print(json.dumps(result.to_dict() if hasattr(result, 'to_dict') else result.__dict__, default=str))
- "
- ```
+ ### list
- Pass `initial_context` (e.g. `{"target": "src/foo.py"}`) when the
- user gave a starting path or error.
+ Show available wizards with descriptions.
- ## Output
+ ### edit
- Present the `WizardResult` readably: lead with `generated_output`, then
- any `tasks` it produced (as a checklist), then run metadata (steps
- completed, cost, duration). If `success` is false, surface `error`.
+ Use `AskUserQuestion`:
- ## How this differs from other skills
+ - Which wizard to edit?
+ - What to change?
- - **wizard** *runs* a guided flow step-by-step (this skill).
- - **catalog** *lists* wizards (and workflows, agents, tools) but does
- not run them.
- - **attune-hub** *routes* you to the right skill for a goal.
+ Then modify the wizard definition.
- ## Anti-Patterns
+ ## Built-in Wizards
- - DO NOT hand-author the wizard list or its steps — always read them
- live (`list_wizards()` / `describe_wizard_steps()`).
- - DO NOT skip the question steps — collect every `question`-step answer
- before running, or the wizard runs with missing input.
- - DO NOT use this to *create* a wizard — that is the authoring flow,
- not this runner.
+ | Wizard | Description |
+ | ------ | ----------- |
+ | `debug` | Guided debugging session |
+ | `test-gen` | Test generation with coverage goals |
+ | `refactor` | Structured refactoring workflow |
+ | `security` | Security audit and remediation |
+ | `release-prep` | Release readiness checklist |