# The Definition assistant

Review a Definition for problems, accept suggested fixes, and describe a change in your own words.

## Opening it

The assistant sits beside the Definition editor. Choose **Assistant** in the editor's toolbar, or
switch the side rail from **Contract** to **Assistant**. It has three parts: Review, Assistant review
and Ask the assistant. **Esc** or the close button above it takes you back to the contract. It never publishes, deploys or approves anything; every change it proposes
goes into the draft only when you accept it.

## Review

Review looks for structural problems as you type, such as:

- numbered copies of a question that should be one [per-item question](https://typefuse.dev/guides/per-item-questions)
- fixed policy text sitting in the input schema that belongs in `context`
- a list with no `maxItems`
- a reference to an input field that doesn't exist, or an input field no question uses
- two questions that ask exactly the same thing

Where there is a clear fix, the finding shows the proposed change as a diff, whether it compiles and
what kind of release it would make. **Accept into draft** saves the change to the draft, and Undo
takes it back. If accepting would lose comments or formatting in your YAML, the finding says so first.

**Dismiss** offers **Not now**, which hides a finding for this visit, and **Not a problem**, which
hides it until that question changes.

## Assistant review

Some problems need judgment rather than a rule: vague criteria, options that overlap, a missing
option, a question that asks two things, instructions that contradict the context, or a question
that needs facts the input doesn't carry. **Review my Definition** has the assistant read each
question and look for these. Findings are marked **Likely** or **Possible**, and weaker ones
are grouped under **Worth a look**. After you edit the draft, the results are marked as out of date
until you choose **Review again**.

**Suggest a fix** writes a rewrite of just the part in question, then checks it again and tells you
whether it fixes the problem without introducing new ones. If it can't find a safe rewrite, it says
so rather than guessing. When you accept a fix to a deployed Decision, you can go straight to
comparing it with the live version.

If the assistant review isn't available on your deployment, the panel says so, and Review keeps working.

## Ask the assistant

Describe what you want in your own words, such as "Also flag messages that mention a chargeback",
and choose **Ask the assistant**. It proposes a change to your draft that you can accept or leave. The assistant works out what kind of change you mean (such as adding a judgment,
changing behaviour, explaining behaviour or restructuring) and proposes one next step. That
might be a change to the draft, a Test case or Example to add, or a run, Test run or Comparison to
start. **Try another** asks for a different proposal.

Save the draft before you ask, so the assistant works from what you see.

## What it reads

The assistant reads your Definition, your Examples and Test cases, and totals from your recent
runs. It does not read the inputs of individual recorded calls.
