# Chat AI Mode

The **AI Chat Mode** is where you describe what you want. The AI turns that into **specification**, **code**, and an app running on the **Preview**.

Use Chat AI to:

* Create an app from scratch.
* Make large changes (new modules, entities, screens).
* Iterate quickly with approval at each step.

{% hint style="info" %}
For “surgical” backend changes, use the [Editor Mode](https://app.gitbook.com/s/XnYvLewhXbdSQIvAlbqN/documentacao/modo-editor).
{% endhint %}

### Prerequisites

* You have edit permission on the project.
* Your app opens in the **Preview**.

### Typical flow

{% stepper %}
{% step %}

### Write a prompt (intent + constraints)

Include:

* App goal.
* Modules and entities.
* Fields and types (e.g., `String`, `Date`, `Picklist`).
* Business rules (validations, states, permissions).

{% hint style="warning" %}
Avoid asking for “everything at once”. Break into changes of 1–3 items.
{% endhint %}
{% endstep %}

{% step %}

### Review the app specification

The analyst agent proposes a **App Specification**.

Review focusing on:

* Names of modules, entities and fields.
* Relationships (1-N, N-N) and required fields.
* Rules that need to become validations.
* What stays **out of scope**.

If something is wrong, correct it in the chat with clear instructions.
{% endstep %}

{% step %}

### Approve and follow the agentic coding

Upon approval, the agents begin generation.

You should:

* Wait for completion.
* Read the summary of what was changed.
* Validate whether the intent was met.
  {% endstep %}

{% step %}

### Test in Preview

Use Preview to validate the actual flow.

Quick checklist:

* Navigation (menus, routes).
* Basic CRUD (create/edit/list/remove).
* Business rules and validations.
* Perceived performance (lists, filters).
  {% endstep %}

{% step %}

### Make “Change Requests”

When you request an enhancement, the AI opens a **change request**.

Best practices:

* Write atomic changes.
* State what should change and what should remain.
* State how to validate: “expected result”.

Prompt examples:

* “Add a **attachments** in **Task**. Type attachments.”
* “Create the module **Projects** and relate **Task → Project** (1 project per task).”
* “Create a picklist **status** with: New | In Progress | Review | Done.”
  {% endstep %}
  {% endstepper %}

### Quick prompt tips

* Prefer imperative phrases: “create”, “add”, “change”, “remove”.
* Name entities and fields consistently.
* Always state the impact on screens: list, form, detail.
* When there is a rule: describe the **trigger** and the **expected error**.

### If something goes wrong

* If generation stalls or becomes inconsistent: see [AI generation failures](https://app.gitbook.com/s/XnYvLewhXbdSQIvAlbqN/solucao-de-problemas/falhas-na-geracao-por-ia).
* If Preview doesn’t open: check extensions (adblock) and try an incognito window.

### Recommended readings

* First project in 15 min: [Start here](https://app.gitbook.com/s/XnYvLewhXbdSQIvAlbqN/comece-aqui)
* How to write better prompts: [1. Prompt tips](https://app.gitbook.com/s/XnYvLewhXbdSQIvAlbqN/tutoriais-praticos/1.-dicas-de-prompts)
