How to Write Your First AI Coding Prompt
Updated · Tech checked
A first prompt that works: goal, context, scope, one example, and how to verify. Bad versus improved example plus the brief builder tool.
The direct answer
Write your first prompt in five lines: goal (what done looks like), context (user plus files), scope (which files, what stays), one example (filled input plus exact output), verify (the checks you will run). Then use the project brief builder tool to generate the copyable text locally.
Bad versus improved
Bad: "Make me a modern app for my business." Improved: "Build the HTML structure for a bakery page: menu, hours, phone-order form with labeled inputs. No styling yet. I will check headings render and the form submits to a demo message."
Method and mistakes
One task per message; plan before code; quote the check list back. The failure pattern is vague praise words (modern, complete, professional) with zero checkable behavior.
Frequently asked questions
How long should the first prompt be? Five to ten lines. Longer than a paragraph usually hides two tasks; split them.
Does a good prompt guarantee good code? No. It raises the odds; preview and tests still decide.
Sources and review
- Lessons M02 and labs A04-A06, brief builder tool (this site). Last review: 2026-10-04.