The Playbook

How to prompt so it actually builds what you meant.

5 phases, 23 principles — from a blank prompt to a shipped product, plus what to do when it breaks. Everything I've learned about working with the model instead of fighting it, written down so you don't have to relearn it the hard way.

23 principles5 phases8 triage fixesBy Pedro Matos Costa
01

Lay the Foundation

Decide what you're building and how it should feel before you write a single prompt.

01

Plan before you prompt

Before using Lovable, define what you're building. Skipping this is like starting a painting without deciding what you're painting. Answer four questions: What is this product or feature? Who is it for? Why will they use it? What is the one key action the user should take?

You're not writing a spec doc, you're setting direction. Vague ideas produce vague outputs. Use Plan mode for this stage — you can talk through ideas and let the AI ask smart questions without touching code.

Plan mode

I want to build [your idea]. Ask me any questions you need to fully understand what I want from this feature and how I envision it.

The scoping template

Fill this in before your first prompt, then paste it into your project Knowledge file.

Product Summary: [One or two sentences. What is this?] Target Audience: [Who is it for? Be specific — "small agency owners", not "businesses".] Project Goals: [What does the target audience accomplish with it?] How Does the App Work: [The core loop, in plain language. User does X, app does Y.] Main Screens: [List them. Three to six is usually enough to start.] Main Features: [The ones without which the product doesn't exist.] Secondary Features: [Nice to have. Build these last, or never.] Integrations & Their Role: [Auth, database, email, payments — and what each one is actually for.] What the App Isn't: [The guardrails. Everything you are deliberately not building.]

Most people skip “What the App Isn't” — it's the field that prevents the most scope creep.

02

Map the user journey visually

Design isn't about individual screens, it's about what happens between them. Map the journey from landing on the page to completing the key action.

Think in transitions: What does the user see first? What builds trust? What gives them confidence to act? Where does that action lead? Even a simple 3-step sketch — Hero → Features → CTA — makes your prompts far more effective.

You're not stacking blocks. You're guiding behavior. Every section should have a reason to exist — and a reason to lead to the next one.
03

Don't skip the design direction

Your visual language is a foundation, not a polish layer. Lovable needs to know the look and feel early, otherwise your interface might function but feel totally wrong. Don't fix design problems later, decide them up front.

Choose a direction — calm and elegant, bold and disruptive, premium and sleek — then feed it into your prompt using buzzwords, tone descriptors and UI patterns.

Use a calm, wellness-inspired design. Soft gradients, muted earth tones, round corners, and generous padding. Font is 'Inter'. Overall tone should feel gentle and reassuring.

You don't prompt your way into good design. You prompt from it.
02

Think in Systems

Build in parts, not pages. Speak the vocabulary the model already understands.

04

Build one piece at a time

Lovable works best when you build your UI in modular parts, not full pages at once. Asking it to generate an entire landing page is like dumping a recipe into a blender.

Approach prompts like Lego bricks: a hero section, a feature grid, a testimonial slider, a pricing table. Build one, review it, refine it, then move on. If something looks wrong you fix that block instead of re-prompting the whole page.

Create a hero section with the headline: 'Track every project in one place.' Subtext: 'Simple project management for small teams.' CTA button: 'Get Started Free.' Use a centered layout with generous vertical spacing.

A full-page prompt gets you noise. A section-based prompt gets you signal.
05

Design with real content

Lovable does not work well with placeholder content like lorem ipsum or "feature 1 / feature 2". The model responds to structure and intent, and the fastest way to show intent is real words.

Even if your final copy isn't ready, write what a user would actually read. A real headline might need two lines instead of one. A CTA might work better as a verb than a noun. Placeholder text hides those issues, real content reveals them early.

Hero section with headline: 'Design Calmly.' Subtext: 'Turn stress into structure with Lovable.' CTA: 'Start Building Free.' Use copy-centered layout with generous vertical spacing.

Design loves constraints. Real content creates the right ones.
06

Speak atomic: buttons, cards, modals

Lovable thinks in atoms. The smaller and more specific your UI language, the better it performs. Instead of "a section with a signup", say "a form with an input field for email and a rounded CTA button".

Describe cards, badges, toggles, chips, form fields, dropdowns, toasts. This atomic vocabulary also lets you layer complexity gradually — start with a card, add a badge, then add hover states.

Create a card with a user profile picture, name, and a follow button. Add a badge for verified users, and show a tooltip when hovering over the badge.

The smaller the part, the smarter the response.
07

Use buzzwords to dial in aesthetic

It's not enough to describe layout, you need to guide the tool on vibe. Lovable understands terms like minimal, expressive, cinematic, playful, premium and developer-focused. These aren't fluff — they're promptable parameters that influence typography, spacing, shadow, border radius and colour palette.

Use them early and include them in every section to avoid the default UI look. You can mix and match: a page can be bold and disruptive in the hero and calm and reassuring in the pricing section.

Design a landing page hero that feels premium and cinematic. Use layered depth, translucent surfaces, soft motion blur, and dramatic contrast between headline and background.

Design isn't just structure. It's tone. Buzzwords define it.
03

Build with Precision

Scope every prompt. Say what to change and what to leave alone.

08

Say exactly what you want, and what you don't

Every prompt modifies a living codebase. Tell Lovable what to build, where to build it, and what to leave alone. Use the Location + Behavior + Guardrails formula.

On the /settings page, add a toggle for email notifications under the 'Preferences' section. It should default to on. Don't modify the sidebar navigation or the account info section above it.

09

Build a prompt pattern library

Prompts are easier to write and far more effective when you use structured, repeatable patterns. Think of them as layout recipes. A good layout prompt breaks the section into visual parts, clarifies their order and defines how they're styled — usually a header → content → action structure.

Write a go-to structure for a feature grid, a testimonial slider, a pricing table, then reuse and remix them. Store these in your project Knowledge file so the agent applies them automatically.

Create a feature section with a centered headline, followed by three horizontally aligned cards. Each card includes an icon on top, a headline, and a short description. Cards should have soft shadows and lift on hover.

10

Attach images and reference files

Attach images to any prompt: screenshots of bugs, reference designs, napkin sketches. Use @ to reference specific files in your project or other projects in your workspace. This focuses the AI's attention exactly where you need it.

11

Add visuals via URL

Drop in product demos, generated clips or tutorial videos using URLs. Prompt for placement (below hero, inside a feature card), style (rounded corners, autoplay, muted) and context (why it's there).

Embed a product demo video. Use this URL: [your-link.mp4]. Place it below the feature section in a full-width card with a soft shadow.

12

Use Visual Edit instead of prompts

Visual Edit mode lets you make design changes by clicking directly on elements in the preview. Adjust colours, swap fonts, tweak spacing or replace images without writing a prompt. Save your credits for logic, structure and behaviour.

Think of edits as design overrides, not replacements. Be precise: say "replace", "update" or "adjust" instead of "make this better".

Visual edit

Change the CTA button text to 'Get Started' and increase the padding to 24px horizontal. Keep the existing background color and font.

04

Iterate and Ship

Small changes, checked one at a time. Refactor before the codebase gets confusing.

13

One change, then check

The rhythm of good building is prompt, review, prompt, review. Each change should be small enough that you can clearly see what worked and what didn't. If something breaks, you know exactly which prompt caused it.

Add a 'Last active' timestamp below each username in the team members list. Format it as '3 hours ago' style relative time. Don't change the card layout or the existing name/role display.

14

Design for your backend from day one

If you want your projects to do more than look good, think about how they'll actually work. Supabase handles auth, databases, storage and edge functions.

When designing with it in mind, anticipate auth logic (what shows when logged in vs logged out), dynamic content (what's pulled from a table) and states (empty, loading, failed). You don't need a working backend during design, but shaping your UI as if it's already there future-proofs your layout.

If the user is logged in via Supabase, show their profile image and name in the top right. If not, display a 'Log In' button and route them to the auth screen.

15

Refactor and improve

As your project grows, periodically ask Lovable to clean things up. Large, messy files confuse the AI. Keeping your codebase modular means the AI can understand and modify each piece more reliably.

Plan mode

Review the current codebase. Are there any files that have grown too large or components that should be split into smaller, reusable pieces? Suggest a refactoring plan but don't make any changes yet.

16

Version control is your friend

Autosave doesn't mean auto-organised. Think in milestones (layout locked, content added, logic wired). Note what changed and why in your prompts. Preview before major changes, and duplicate the project if you're about to take a risky leap. Small cost, big safety net.

Autosave doesn't mean auto-organized. Build intentionally. Iterate with awareness.
05

When It Breaks

The preview went white, the build failed, or a feature quietly stopped working. Work through it in this order instead of firing more prompts.

17

Stop prompting the moment it breaks

The instinct when something breaks is to immediately send another prompt. Resist it. Every prompt you fire at a broken state stacks new changes on top of a fault you haven't identified yet — and now two things are wrong instead of one.

Before anything else, note the last prompt that worked. That's your restore point, and knowing it turns a scary problem into a small one.

18

Describe the symptom, not the cause

If you're not a developer, your guess about what broke is probably wrong — and a wrong guess sends the agent digging in the wrong file. You don't need to know the cause. You need to describe what you saw precisely.

Three things: what you did, what you expected, what actually happened. That's enough for the agent to find it.

After I click 'Save' on the settings page, I expected the toggle to stay on. Instead the page goes blank and I have to refresh. This started after the last change to the settings form. I don't know what's causing it — find out before changing anything.

19

Give it the error text and a screenshot

Never paraphrase an error. Copy it exactly — the full message from the console or the failed build — and attach a screenshot of the broken screen. Between them, the agent usually finds the fault on the first pass.

One thing that trips people up: when the console shows a wall of red, the first error is the real one. Everything below it is usually a knock-on effect.

20

Two failed fixes, then switch to Plan mode

Use the automatic fix attempt once. If a second try also fails, stop. A third attempt on the same approach almost never works, and each one adds more changes you'll have to unpick.

Switch to Plan mode and ask for a diagnosis instead of a fix. Making the agent explain the cause before touching anything is the single highest-value habit in debugging.

Plan mode

Don't change any code yet. Explain what is causing this error: which file, which specific line, and why it's happening. Then give me two options for fixing it and tell me which you'd pick.

21

Isolate before you fix

Narrow down where the problem actually lives before asking for a fix. Four quick checks: does it break on a hard refresh, on a different page, when logged out, and on mobile?

Most breakages in AI-built apps hide in the states nobody prompted for — empty data, still loading, failed request, logged out. If your app works when you're logged in with data and breaks otherwise, that's the answer.

22

Reverting is not failure

Restoring to the last working version is almost always cheaper than six fix prompts. It costs you one change; the fix spiral costs you an afternoon and leaves the codebase messier than it started.

Go back, then come at the same goal with a smaller, more scoped prompt. You'll usually get there faster than if you'd never broken it.

23

Keep a log of what broke it

The same mistakes repeat. Write down one line each time something breaks: what you asked for, and what went wrong. After a handful of entries the pattern is obvious — and it's usually about how you're prompting, not about the tool.

Feed those patterns into your project Knowledge file so the agent avoids them without being told each time.

Quick triage

Find the symptom, make the first move. Then go back to the principles above.

Preview is blank or white

Something failed while rendering. Open the console and take the first error, not the last one — the rest are knock-on effects.

Build failed right after an edit

Almost always a broken import or typo in the file just changed. Revert that single change before trying anything else.

Works in preview, breaks once published

A difference in environment or data. Check anything depending on being logged in, or on a key or secret that isn't set in production.

Data doesn't appear

An empty result and a failed request look identical on screen. Ask the agent to show which one is actually happening before it changes anything.

My change didn't show up

Hard refresh first. If it's still missing, the agent probably edited a different component than the one you're looking at — point it at the right file with @.

Everything got slow

Usually one file doing too much. Ask for a refactor plan in Plan mode rather than a fix.

Looks broken only on mobile

Responsive behaviour was never specified. Re-prompt that one section with explicit desktop / tablet / mobile rules.

It fixed one thing and broke another

The prompt was too broad. Revert, then re-prompt naming exactly what to change and what to leave alone.