# Prompting Best Practices

Source: https://marketplace.gohighlevel.com/docs/app-studio/PromptingBestPractices

App Studio builds what you describe. The clearer your description, the fewer rounds it takes to get the app you want. These practices come from how developers build with App Studio today.

---

## Start with a clear first description

Your first message sets up the whole app. Cover four things:

| Say | Example |
|---|---|
| **Where** the app shows up | "A page in the sub-account's left menu" or "a page in the app's settings" |
| **Who** uses it | "for front-desk staff", "for the sub-account admin" |
| **What data** it uses | "today's appointments from the sub-account's calendars", "contacts tagged *lead*" |
| **What happens** on each action | "a *Send reminder* button that texts the contact …", "show a toast when it's sent" |

**Too vague:**

```text
An appointment reminder app.
```

**Clear:**

```text
A page in the sub-account's left menu for front-desk staff. It lists today's appointments
from the sub-account's calendars with the contact's name and phone. Each row has a
"Send reminder" button that texts the contact: "Hi {first name}, see you today at {time}."
Show a toast when the text is sent.
```

:::tip Say where the page goes
If you want a page your users open from the sub-account's **left menu**, say so. Otherwise App Studio may put it in the app's settings.
:::

---

## Build in small steps

- **One change per message.** When you ask for several things at once, some can get missed. Send them one by one and check each in the preview.
- **Start with the core screen.** Get the main page working first, then add filters, settings, extra pages and polish.
- **Use the suggestions.** After each build, App Studio suggests follow-up changes above the message box. Clicking one sends it right away.
- **Ask for sample data early.** Pages that show HighLevel data are empty in the preview until you connect a sub-account. Ask App Studio to show sample data when no sub-account is connected, so you can see and refine the layout right away.

---

## Be specific

- **Name things the way they appear on screen.** "The *Send reminder* button on the Front desk page" is better than "the button".
- **Give exact text** for messages, labels and empty states, in quotes.
- **Use HighLevel's words** for HighLevel data: contacts, opportunities, pipelines, calendars, appointments, conversations, tags, custom fields.
- **Describe the rules.** "Only show appointments with status *confirmed*", "skip contacts without a phone number".
- **Attach an image** of a sketch, a mockup or a screen you like. It's often faster than describing a layout.

---

## Answer App Studio's questions

App Studio sometimes asks a question before it builds, such as which calendar to use or whether to send a message for real. Answer it instead of skipping. A skipped question means App Studio picks a default, which may not be what you want, for example adding a feature that sends messages.

---

## Fixing bugs

When something doesn't work, tell App Studio three things:

1. **What you did:** "I clicked *Send reminder* on Jane's row."
2. **What you expected:** "Jane should get a text, and a toast should say *Sent*."
3. **What happened:** "Nothing happened, and the button kept spinning."

Add a screenshot and any error text you see. Describe one bug per message.

If a change made things worse, don't ask App Studio to undo it. Open **Version history** (click the app name) and **Restore** the last good version. Your current version is kept, so you can go back to it.

---

## Always check for yourself

A build that finishes without errors isn't proof that every feature works. After each change:

- Check it in the **preview**.
- [Try it in HighLevel](./TestInHighLevel.md) with a test sub-account before you publish, especially for anything that sends messages, changes records or takes payments.

---

## Keep your app safe

- **Keep secrets in environment variables.** Add API keys under **Backend → Environment variables**, never in chat, and never in a variable whose name starts with `VITE_`.
- **Don't trust the browser with money or permissions.** If your app charges, discounts or decides who can do what, ask App Studio to check it on the server, for example: *"Check the amount on the server from the order, not from the page."*
- **Be careful with database changes on live data.** Changing or deleting rows, or making a column required, also affects your clients' data when you publish. Ask App Studio how a change affects existing rows before you publish it.
- **Ask only for the access you need.** Each HighLevel API your app calls adds a scope your clients must approve. A new scope in an update means clients have to approve it before they get the update.

---

## Example prompts

**A dashboard**

```text
A page in the sub-account's left menu that shows open opportunities by pipeline stage,
with the total value per stage and a list of the 10 most valuable deals. Add a filter
for pipeline.
```

**A form that writes to the CRM**

```text
A page in the sub-account's left menu where staff log a listing inquiry: name, phone,
email and the listing address. On submit, create or update the contact, tag them
"listing-inquiry", and create an opportunity in the "Listings" pipeline.
```

**Your own data**

```text
Save each reminder that was sent: the contact, the appointment time and who sent it.
Add a "Sent today" tab on the Front desk page that lists them, newest first.
```

**An outside service**

```text
When staff click "Check address", call the Acme Geocoding API with the contact's address
and show the result. The API key is in the environment variable ACME_API_KEY.
```
