How to write a prompt so Lovable or Cursor builds an internal tool that works
To get Lovable, Cursor or Claude to build an internal tool that actually works, do not write one long prompt. Write the spec first, then send one phase at a time and check it before the next. The method Personal Software Factory uses in its build tests, with a prompt you can copy.
The short answer
The prompt is not the place to describe the tool. Put the description in a spec: the data model, the rules as numbered statements with worked examples, the seed data and the acceptance checks. Then the prompts become short. Each one says "build phase N of this spec, nothing beyond it, and tell me what you had to interpret".
That is how every blueprint on Personal Software Factory is written and how we test them: an AI builder gets only the spec, builds one phase per prompt, and every acceptance check is run in a real browser before the next phase starts. You can copy a blueprint, or write your own spec with the free spec template.
Why one big prompt fails
An internal tool is mostly rules: who may approve what, what happens when a deadline passes, how a total is rounded. A one-paragraph prompt leaves those rules out, so the builder guesses. The app looks finished in the demo and breaks on the first real case.
Our build tests measure this. Each time a builder had to interpret something the spec did not say, we recorded a gap and fixed the spec. The most common kinds are ambiguous wording, fields the rules depend on that nobody defined, and edge cases with no stated outcome. The full list, by kind, is in What AI app builders get wrong. Almost none of them were coding mistakes. They were things nobody had written down.
Step 1: Give the builder the spec as a file
Save the spec as a Markdown file and make it part of the project, so the builder reads it in every session instead of relying on what you typed three prompts ago.
- In Lovable, add the spec to the project and use plan mode before building. Lovable's prompting guide recommends planning before you prompt, and suggests ending a request with a line asking it to raise any questions it needs answered first.
- In Cursor, keep the spec in the repository and point the agent at it. Cursor's documentation describes project rules stored in
.cursor/rulesand anAGENTS.mdfile for instructions that should apply to every request, which is where "follow spec.md, build only the phase asked for" belongs. - In Claude Code, put the same standing instruction in the project's instructions file and keep the spec next to the code.
Both vendors change these features often, so check their current documentation for the exact names.
Step 2: Send one phase per prompt
Split the build into three to five phases, each of which ends in something you can click through. A typical order is: the data model and the main list; the core workflow; notifications and scheduled jobs; reports and exports.
A phase prompt that works, adapted from the blueprints:
Read spec.md. Build Phase 2 only: [paste the phase's scope from the spec].
Rules:
- Do not build anything from a later phase.
- Use the seed data exactly as written in the spec.
- Where the spec is silent or ambiguous, do not guess silently:
choose the simplest behaviour and list it at the end.
When you finish, list (1) what you built and (2) every place
you had to interpret the spec.
The last line is the most useful one. The list of interpretations is the list of holes in your spec.
Step 3: Check the phase before you continue
After each phase, reset to the seed data and run that phase's acceptance checks by hand in the browser, as the person each check names. An acceptance check is one sentence with a visible result, for example "A request over the team limit goes to the manager first, then to finance".
When a check fails, decide which kind of failure it is:
- The build is wrong. The spec said it clearly. Tell the builder which check failed and what you saw.
- The spec is wrong or silent. Fix the spec first, then ask the builder to apply the changed rule. Never patch the app while leaving the spec out of date, or the next phase will be built on the old rule.
Lovable's guide makes the same point about small steps: say what to change and what to leave alone.
Step 4: Keep prompts narrow when you change things
Later changes follow the same pattern as phases. Name the rule you are changing, the screen it affects, and what must stay the same. "In rule 7, the threshold becomes $1,000. Update the approval chain and the seed data that exercises it. Do not change the request form."
What a prompt cannot do
A passing checklist shows the tool does what the spec says on test data. It does not show that production sign-in, real email delivery, the scheduler, backups and hosting work. Our build notes list these as untested for every build. Before a team relies on the tool, go through Is an AI-built internal tool ready for production?.
Frequently asked questions
What should a prompt for Lovable or Cursor include to build an internal tool?
A reference to a written spec, the one phase to build, an instruction not to build ahead, the seed data to use, and a request to list everything the builder had to interpret. The data model and rules belong in the spec, not in the prompt.
Is there a free prompt or spec template for building internal tools with AI?
Yes. Personal Software Factory publishes a free spec template in Markdown, and free blueprints for common internal tools, each with phased build prompts and acceptance checks you can paste into Lovable, Cursor, Claude Code or Replit.
Why does my AI-built app work in the demo and then break?
Because the rules that matter were never written down, so the builder guessed. The demo exercises the happy path. Real use hits the edge cases: a person on holiday, a refund after a payout, two edits at once. Write each rule with a worked example and a check, and the guessing stops.
Should I use Lovable or Cursor for an internal tool?
Choose by what the tool needs after the first demo: a real database, sign-in limited to your team, scheduled jobs and email. Our comparison of AI app builders for internal tools lists what each builder documents for those four things.
Follow new blueprints
Every new blueprint and build test appears in the feed and in the public GitHub repository. No account, no email list.