Best practices
Habits that get better results from the AI and keep your project safe, from rules and Plan mode to versions and row level security.
These habits help on your first project and your fiftieth.
1. Tell the AI about your project once
Write what the app does, who it is for and the patterns you want in project knowledge. Put firm instructions, such as "use the Brand colors only" or "every page must work on a phone", in rules: open Settings > AI > Customize or type /rules.
The AI reads both on every turn, so you do not have to repeat yourself.
2. Plan the big changes
For anything that touches several pages or adds data, switch to Plan mode with Shift + Tab (or /plan). Review the plan, change it, then build from it. For small changes, such as a color or a label, stay in Build. See Chat modes.
3. Ask for one thing at a time
One page or one feature per message gives cleaner results than a long list. Be concrete about what, where and how it should look.
| Instead of | Try |
|---|---|
| "Make a login page" | "Add a sign-in page with email and password, a Forgot password link and inline errors." |
| "Add a dashboard" | "Add a /dashboard page with a sidebar, the user's name in the header and three cards: members, bookings, revenue." |
| "Fix the styling" | "The three pricing cards have different heights. Make them the same height." |
More in Prompting best practices.
4. Point the AI to the right place
- Select an element on the canvas before you write. The AI gets the element and where it lives in the code.
- Type
@to add files, folders, a URL, your Git changes or the current problems. See Mentions and context. - Attach a screenshot when words are not enough.
5. Make small visual changes yourself
Spacing, colors, font sizes, alignment and radius are faster in the Styles panel than in a prompt. Select the element on the canvas and change the value.
6. Go back instead of piling up fixes
Every AI turn that changes files leaves a version card. If a change goes wrong, revert to the version before it, then ask again with a clearer prompt. Save a named version before a big change. See Version history.
To try a risky idea without touching your project, duplicate it first.
7. Keep the conversation short
Long conversations cost more credits and blur the context.
/contextshows how full the conversation is./compactsummarizes it and keeps going./clearstarts a new conversation.
See Slash commands.
8. Protect your data from day one
- Ask for row level security on every table when you create it. See Database.
- Keep secret keys in Secrets and use them in edge functions, never in page code.
- Run the security scan before you publish.
More in Security best practices.
9. Back up your code
Connect GitHub to keep a copy of your code in your own repository and to work on it with others.
10. Give precise feedback
When the result is close but not right, say what is wrong, what you expected and where:
The header covers the content on phones. It should stay at the top and the content should scroll under it.
Learn a few shortcuts
Cmd/Ctrl + K opens the command palette and Cmd/Ctrl + Shift + L adds the selection to the chat. See Keyboard shortcuts.