Peek behind the magic to see how AI prototyping tools actually work through careful prompt engineering
Aman Khan shows what’s behind the magic of Bolt by dissecting its system prompt.The first lines set context and role: “You are Bolt, an expert AI system, an exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, et cetera.” This tells the AI who it’s supposed to be - setting the role like you’d brief a new contractor.Next comes constraints - it’s operating in an environment called a web container. Like CodePen, where a designer or front-end engineer prototypes an interaction that has HTML, CSS and JavaScript, then it just runs.Then we have what Aman calls “implicit tool calling” - basically saying “here’s what you have at your disposal.” Here are the packages, languages you should use. This is using the prompt to define tools rather than explicit function calling.The system prompt has priorities built in - “important,” “ultra important.” As Aman notes, this is like a typical product manager with P0, P1, P2. These priorities shape how Bolt responds: use valid markdown, don’t be verbose, keep it magical and snappy.Finally, there’s few-shot prompting. As Aman puts it: “This is like every prompting guide that you see out there for using AI tools, combined into one system prompt.” It provides examples with structured tags like “bolt_artifact” and “bolt_action” that tie into how Bolt executes code.When your request goes in, it combines with this system prompt to produce “reasoning tokens” - the LLM thinking through chain of thought. The objective is producing more context to accomplish the original task before generating the actual code.As Aman explains: “When you’re in school and you’re taking a test, a physics exam or a math test, there’s usually a section that says ‘show your work.’ This is the show your work component.” The agent uses the context it has to decide what to generate next. The goal of reasoning here is to generate more context based on the PRD.➡️ Bolt’s “magic” is careful prompt engineering - role, context, constraints, tools, priorities, and examples. Understanding this architecture helps you see how AI prototyping tools actually work and what’s possible when building your own AI features.Check out Aman’s course (not sponsored, he’s just great).