Ground the AI before you build
Here is the move that makes everything else work, and the one beginners skip. Every time you open a fresh chat, the AI knows nothing except whatever is in front of it. If you have not told it your platform, your stack, and your constraints, it guesses, and a confident guess that is wrong costs you more than no answer at all.
So you ground it. Write a short file that states your stack, your platform, and the hard constraints of the project, and keep it where the AI can see it on every request. When you integrate anything external, point the AI at the real, current API documentation rather than letting it work from memory, because models hallucinate field names and endpoints that looked right two versions ago. This is not a rare edge case. Research has clocked AI assistants confidently citing package names and methods that do not exist, and a meaningful share of those hallucinated dependencies are even registrable, which is its own security hole. Grounding in the live docs is the difference between an integration that works and an afternoon chasing a method that never existed.
On top of that, keep a rules file for the fundamentals the AI must never get wrong: the machine you are on, the language you use, where the backend lives, and a standing instruction to write code to a senior engineer's standard. These are the things you should never have to repeat in a prompt, so you write them once and let them apply to everything.
There is a more powerful version of grounding for the services you lean on most. Instead of pasting docs by hand, you can connect the AI directly to a service through a tool bridge so it works from that service's current actions and best practices. That keeps integrations like billing or your database on the right path without you babysitting every call.
Worked example. A founder asks an agent to add Stripe billing. Ungrounded, the agent writes against an API shape from its training cut-off, invents a webhook event that was renamed, and the payments silently fail in test. Grounded, the founder first points the agent at the current Stripe docs and a rules file that says where secrets live and that nothing real should be charged in testing. The agent now writes against today's API, uses the correct event names, and flags exactly which keys it needs. One of these is a ten-minute task; the other is a lost afternoon and a near-miss with live money.
The reason one-prompt demos look like magic is that the setup is hidden. The person did the grounding first, then issued the prompt that worked because of it. The grounding is the skill. The prompt is just the visible tip.