
From idea to app with AI
AI coding agents can write a lot of code very quickly, but they build exactly what you describe β and when the description is vague, they fill the gaps with guesses. In this lesson you'll learn a three-phase way to take any project from idea to app with AI: plan it in writing, test it as a clickable prototype, and only then build the full web app, if your idea needs one.
What you need: an AI with a coding harness
A chat assistant can talk about code, but it can't touch your project. A coding agent can, because it works inside a harness: the program around the AI model that connects it to your files. Switch between the two below to see the difference.
π Your project folder
- PLAN.md
- index.html
- style.css
No access
Any tool with a coding harness works for everything in this lesson: Google Antigravity, Claude Code, Cursor, Cline in VS Code, GitHub Copilot's agent mode and others. The process matters more than the tool. Our codelabs use Antigravity because it's free.
Don't have a coding agent yet? Start with Getting started with Google Antigravity or Setting up VS Code with Cline.
Three phases: plan, prototype, build
Think of how a building gets made. An architect starts with a written brief, then builds a small scale model that people can walk around and react to, and only then pours the foundation. Changing the brief costs nothing; changing a finished building costs a fortune. Software works the same way.
π 1. Plan
Talk the idea through with your AI and save the result as a short plan in a file.
You end up with: a PLAN.md file
π¨ 2. Prototype
Build a clickable static version with sample data and share it on GitHub Pages.
You end up with: a link anyone can open
ποΈ 3. Build
If the idea needs logins, saved data or secret keys, build the real web app in a fresh project.
You end up with: a working web app
Each phase produces something you keep, and you can stop after any of them. Plenty of good projects never need phase 3.
Phase 1: plan in writing
This is the phase beginners skip, and the one that saves the most time. When you type βbuild me an app for my gym,β the AI has to invent who uses it, what it does and what it leaves out. It will guess confidently, and you'll spend hours undoing those guesses. Fifteen minutes of planning prevents that.
Let the AI interview you
Instead of trying to write a perfect description yourself, describe your idea in a sentence or two and ask the AI to interview you β one question at a time β until it understands what you want. Answering questions is much easier than writing a specification from scratch, and the questions reveal decisions you didn't know you had to make.
What a good plan includes
- Summary: the problem and who it's for, in two sentences.
- Must-haves: no more than five features, each written as something a person can do (βA parent can sign their child up for a classβ).
- Not now: features you're deliberately leaving out. Don't skip this one β without it, the AI keeps adding things nobody asked for.
- Data: what information the project keeps, if any, and who can see it. This answer decides whether you'll need phase 3.
- Done when: how you'll know the first version works.
Save the plan in a file, not just in the chat
Long conversations lose track of early details, and a new conversation starts with no memory at all. A PLAN.md file in your project folder outlasts every conversation: start each new one with βRead PLAN.md,β and update the file whenever you change your mind.
π PLAN.md
Stays in your project folder
π¬ Monday
Read PLAN.md.
π¬ Thursday
Read PLAN.md.
π¬ Two weeks later
Read PLAN.md.
Create a folder for your project and give it a name that ends in -prototype, such as gym-classes-prototype (phase 3 explains why). Open the folder in your coding agent and send the prompt below. Fill in the three lines at the top first β everything under them stays as it is.
My idea:
Who it's for:
The problem it solves:
I want to turn the idea above into a small web project. Before anyone writes code, help me write a plan.
Interview me first. Ask one question at a time and wait for my answer before asking the next. Ask about who will use it, what they need to do, what information it has to keep, and what I'm happy to leave out for now. If part of my idea is harder or more expensive than it sounds, tell me. Keep going until you could explain the project back to me.
Then write the plan in a file called PLAN.md with these sections:
1. Summary: the problem and who it's for, in two sentences.
2. Must-haves: no more than five features, each written as something a person can do.
3. Not now: features we're deliberately leaving out.
4. Data: what information the project keeps, if any, and who can see it.
5. Done when: how I'll know the first version works.
Use plain language and keep it short. Don't write any code yet.β Check: Your project folder has a PLAN.md that you can read in two minutes, and every must-have describes something a person does.
Phase 2: build a clickable prototype
A prototype is a static website β just HTML, CSS and JavaScript files β that looks and clicks like the real thing. It uses sample data written straight into the code, so there's no database, no logins and no server. That makes it quick to build, free to host and easy to throw away.
New to static websites? The lesson Create your own website explains what they can and can't do.
In the same project folder, send this prompt. Describe the look you want on the first line β for example, βfriendly and colorfulβ or βclean and professional, in dark blue.β
Look and feel:
Read PLAN.md. Build a clickable prototype of this project as a static website: plain HTML, CSS and JavaScript, with no build step, no server and no database, so it can be hosted on GitHub Pages.
Use realistic sample data written directly in the code. Every must-have should have a screen I can click through, even if a button only shows a message instead of saving anything. Don't put any passwords or secret keys in the code.
Start with the home page and the first must-have only. Then stop and tell me how to open it in my browser so I can check it before you continue.β Check: You can open the prototype in your browser and click through the first must-have.
Then ask for the remaining must-haves one at a time, checking each one before moving on. The habits further down keep this from going sideways.
Publish it and show it to people
Put the prototype online with GitHub Pages and you get a free link you can send to anyone. This is the real reason the prototype exists: to get honest reactions before you invest in building the real thing.
Follow Getting started with GitHub and then Use GitHub Pages to host a static website to publish it.
- β’ Send the link to three to five people who would actually use it β not only friends being polite.
- β’ If you can, watch them use it without explaining anything. Where they hesitate is where the design is unclear.
- β’ Write down what confused them and what they asked for.
Then bring what you learned back into your plan. Paste the feedback on the first line:
What people told me:
Read PLAN.md and the feedback above. Suggest changes to the plan and the prototype. For each new idea, say whether it belongs in Must-haves or in Not now, and why. Wait for me to agree, then update PLAN.md and the prototype.Habits that keep AI on track
These apply from the first line of code in phase 2 to the last feature in phase 3.
πͺ One feature at a time
Never ask for the whole app in one prompt. Small requests give you small changes that you can understand and check.
π Check every change yourself
When the AI says it's done, that's a claim, not a fact. Open the page, click every button and try it on your phone.
πΎ Save a version after every step that works
Commit your work with Git each time something works. If the AI breaks something later, you can go back in seconds instead of untangling it.
π Ask the AI to review its own work
AI tools find more problems when you ask them to look for problems. Send the prompt below after each feature.
π Start fresh when it goes in circles
If the AI keeps trying fixes that don't work, stop. Open a new conversation, tell it to read PLAN.md and describe the one problem you're stuck on.
π Keep secrets out of chat and code
Never paste passwords or API keys into a conversation or into your files. Phase 3 shows where they go instead.
Review what you just built against PLAN.md. List anything that's missing, broken or doesn't match the plan, and anything you assumed without asking me. Don't fix anything yet β just give me the list.Do you need phase 3?
Many projects are finished after phase 2. A portfolio, a menu, an event page or a product landing page can stay on GitHub Pages for good. A polished prototype is also a great way to show a developer or a client exactly what you want built.
Answer these four questions to find out.
1. Do people need to log in?
2. Does information need to be saved and seen by other people or on other devices β sign-ups, orders, messages?
3. Does it use a secret key, for example for an AI service, payments or sending email?
4. Does something need to happen when nobody has the page open, like sending a reminder the day before?
β οΈ The beginner mistake: a secret key in a static site
It's tempting to make the prototype βreally workβ by pasting an API key into its JavaScript so it can call an AI service or a payment provider. Don't. Every file in a static site is sent to every visitor, and anyone can read the key with their browser's developer tools. Whoever copies it can use your account and run up your bill. If your idea needs a secret key, that's your sign that you need phase 3, where the key stays on the server.
Phase 3: build the real app
β οΈ Start a fresh project β don't grow the prototype
The other common mistake is trying to turn the prototype's files into the real app. The prototype was built to be fast and fake, so adding logins and a database to it is slower and messier than starting clean. Start a new project instead, and keep the prototype online as your reference β that's why its name ends in -prototype.
π my-app-prototype
- β’ HTML, CSS and JavaScript
- β’ Sample data in the code
π GitHub Pages Β· stays online as your reference
π my-app
- β’ Started from Next-Stage
- β’ Real data in a database
π Vercel + Supabase or Neon
Start from Next-Stage
You could ask the AI to set up a web app from nothing, but it would spend your first hour on setup and make choices you can't judge yet. Next-Stage is a starter template with the framework, styling, an API layer, tests and instructions for AI agents already set up and working together.
Follow Start a web app with Next-Stage to create your project. It needs Node.js β if you don't have it yet, start with Getting started with Node.js & npm.
Copy PLAN.md from the prototype folder into the new project. Then send this prompt with the location of your prototype folder on the first line.
Prototype folder:
Read PLAN.md. This project replaces the static prototype in the folder above, which shows how the app should look and behave. Rebuild it properly here, one must-have at a time, starting with the first one.
As you go:
- Keep secret keys on the server, never in code that runs in the browser.
- When a feature needs to save information, stop and tell me, so we can set up a database first.
- Add tests for each feature.
After each feature, tell me how to check it, and wait for me before starting the next one.β Check: The first must-have works in your new app and looks like it does in the prototype.
Where it lives: hosting and data
GitHub Pages can only serve static files, so the real app needs a host that runs server code, and most apps eventually need a database to keep information safe and shared. Each of these has its own codelab:
- Deploy web apps with Vercel β put your app online, with a new version every time you push to GitHub.
- Getting started with Supabase β a database with built-in logins, a good fit for most first apps.
- Getting started with Neon β a serverless PostgreSQL database, if you only need to store data.
Secret keys go in environment variables: a .env.local file on your computer, which Git never uploads, and your project's settings on Vercel. Never in your code, and never in a chat.
Want to see how the frontend, backend and database fit together? Read Elements of a web application.
Summary
AI works best when you do the thinking and let it do the typing. Plan in writing so it builds what you mean. Prototype so real people can react before you invest. Build the full app only when the idea needs one β in a fresh project on a solid foundation.
Recommended codelab order
For phases 1 and 2:
- Getting started with Google Antigravity β set up a free coding agent, or use the one you already have.
- Getting started with GitHub β save versions of your work and put it online.
- Use GitHub Pages to host a static website β publish your prototype and get a link to share.
If you need phase 3:
- Getting started with Node.js & npm β install the tools a web app needs on your computer.
- Start a web app with Next-Stage β start the real app from a solid template.
- Deploy web apps with Vercel β put the app online.
- Getting started with Supabase β add a database and logins when your app needs to keep data.