A guest article by Tomek Sułkowski, Founding Engineer at Bolt.New and Stackblitz
When discussing AI adoption with companies, most are either fully committed to AI or aspire to be, but struggle to find ways to make it useful. Usage is skyrocketing, but many are still figuring out where actual efficiency gains lie.
With vibe coding, the goal is to achieve the desired result as quickly as possible without sacrificing quality. The best way to accomplish this is to give your AI tools a good prompt.
How and why you ask a machine to do something will improve the output. This is true for coding assistants like Cursor and Windsurf and AI text-to-development platforms like Bolt and Replit. They function differently, but chances are you will encounter both in your work.
This article explores how to get the best possible output from these tools. We’ll start with general advice that applies to all AI development tools and then break down how coding assistants differ from end-to-end development tools that turn prompts into fully functioning software.
Vibe coding prompt best practices
While there are some nuances between these different tools, there are a few general guidelines that work well across all AI code development platforms:
Be specific about your objectives: Whether building an entire app or fixing a single detail, give the AI a straightforward, benchmarkable task. Avoid ambiguity or unnecessary complexity. The more precise your outcome description, the closer the result will match your vision.
Break complex requests into manageable steps: If you're adding a significant feature or building a sophisticated site, prompt in stages: first generate the skeleton, then flesh out the logic, and finally add tests. AI output improves significantly when you clarify or tweak your requirements in follow-up prompts.
Provide context and constraints upfront: Include your preferred frameworks, style guidelines, and any existing patterns you want to follow. Specify file structure, naming conventions, test coverage requirements, and dependency handling.
Reference existing materials: Give your AI something to work with, whether that's documentation, existing code files, visual mockups, or style guides. Point to specific files, directories, or code segments to help the tool understand your existing patterns and produce more consistent results.
Granular control is best for AI coding assistants
With embedded coding assistants like Cursor and Windsurf, you often work within an existing codebase, which affects how you approach prompting. The AI can see your project structure and existing code, allowing you to be more specific with your requests.
In your prompts, reference specific files and functions so the tool knows what to edit. For example, you will get a better output if you say, "Refactor the validateUser function in utils/auth.js to return more descriptive error messages."
Since you're working in a live codebase, be explicit about what should and shouldn't change. "Update the login component to use the new authentication hook, but don't modify the existing error handling" prevents the AI from making unwanted changes to working code.
These tools are machines, and they like patterns. Giving it a file or directory to reference can mimic that structure and help maintain consistency across your codebase. They're also helpful for understanding unfamiliar code. Ask them to "explain how the authentication flow works in this codebase" or "suggest ways to optimize this database query" to get insights about your existing code.
Remember that coding assistants work best with focused, incremental changes. Instead of "rewrite this entire module," try "extract the data transformation logic into a separate utility function," followed by "add error handling to the new utility function," and then "write tests for the utility function."
Don't forget to mention testing, documentation, and code quality expectations. "Add comprehensive error handling with TypeScript types, include JSDoc comments, and write unit tests with at least 80% coverage" ensures the AI delivers production-ready code.
Give it a try and see how your outputs change. The best way to learn is through iteration. Be open to experimenting to see what gets you the closest to your desired outcome.
End-to-end AI development tools need the complete picture
The best prompts for platforms like Bolt and Replit go beyond just describing what you want; they describe the feel and function of your entire application. A generic prompt like "give me a landing page" will give you a generic result. Instead, be explicit about what you're building and who will use it.
Think through the scope from the start. Is this a mobile app, a web-based CMS, or both? Who will be using your product? Will you need user authentication and payment processing? These details help the AI understand the complexity and scale of what you're building.
The key is to combine technical specifications with clear visual language. Mention your preferred stack (React, Tailwind, Next.js) while also providing visual inspiration, such as "similar to Duolingo but with warmer and more muted colors."
Visual descriptors help convey personality. Terms like "welcoming and minimalist with lots of white space" or "soft pastel gradients with rounded corners" help the AI understand the emotional tone you're aiming for. If you want your design to mirror a specific aesthetic trend, such as "flat design," "brutalism," or "skeuomorphism," it is helpful to convey that preference so the AI achieves a precise look and feel from the start. When possible, reference screenshots, diagrams, or mood boards to communicate layouts and aesthetics that words alone can't capture.
Remember the practical considerations, too. If you need accessibility compliance, mobile responsiveness, or the ability to handle significant traffic, make that clear from the beginning. These requirements will shape how the application is built.
Finally, be open to iteration, because the best results rarely come from a single perfect prompt. Start with a solid foundation and then refine one element at a time. Be explicit about what should change and what should stay the same. You don't want to accidentally modify something that's already working well.