|
| 1 | +# Prompting Guide |
| 2 | + |
| 3 | +This guide covers best practices for prompting in Bolt, applicable to both [Supabase mode](./1_supabase.md) and [External API mode](./2_external_api.md). |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +# AI Models |
| 8 | + |
| 9 | +Bolt supports multiple AI models. Choose based on your task complexity and token budget: |
| 10 | + |
| 11 | +| Model | Speed | Token Usage | Best For | |
| 12 | +|-------|-------|-------------|----------| |
| 13 | +| **Haiku** | Fast | Low | Small tasks with detailed instructions | |
| 14 | +| **Sonnet** | Medium | Medium | Smaller features, bugfixes (default) | |
| 15 | +| **Opus** | Sometimes slower | High (up to 2x Sonnet) | New features, design-heavy work | |
| 16 | + |
| 17 | +**Recommendations:** |
| 18 | +- **Haiku**: Use when you can provide very specific, detailed instructions for small/simple changes |
| 19 | +- **Sonnet**: Good balance for most development work - the default choice |
| 20 | +- **Opus**: Recommended for new features, especially when using design reference images. Produces better code quality and more accurate design implementations |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +# Planning Mode |
| 25 | + |
| 26 | +Bolt has two interaction modes accessible via the **Plan** button: |
| 27 | + |
| 28 | +| Mode | Description | |
| 29 | +|------|-------------| |
| 30 | +| **Agent Mode** | Default mode - Bolt immediately implements changes | |
| 31 | +| **Planning Mode** | Bolt explains proposed changes before implementing | |
| 32 | + |
| 33 | +**When to use Planning Mode:** |
| 34 | +- Complex features where you want to confirm the approach first |
| 35 | +- When you're unsure if the AI understood your requirements correctly |
| 36 | +- To avoid wasted tokens on unwanted features or misunderstood instructions |
| 37 | +- When exploring different implementation options |
| 38 | + |
| 39 | +**How it works:** |
| 40 | +1. Click the **Plan** button to switch to Planning Mode |
| 41 | +2. Describe what you want to build |
| 42 | +3. Bolt will outline the proposed changes without implementing them |
| 43 | +4. Review and confirm, or provide corrections |
| 44 | +5. Once confirmed, Bolt implements the agreed-upon changes |
| 45 | + |
| 46 | +This helps prevent misunderstandings and saves tokens by catching issues before code is written. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +# General Prompting Tips |
| 51 | + |
| 52 | +- **One feature at a time**: Keep prompts to max one new feature per prompt |
| 53 | +- **Be technical when debugging**: When fixing bugs, provide more technical directions on how to fix if possible |
| 54 | +- **Use checkpoints**: After each prompt, Bolt creates a checkpoint you can revert back to |
| 55 | +- **Manual edits welcome**: You can also edit code manually and run commands in the terminal |
| 56 | +- **Guide the AI**: If Bolt can't find the correct queries/models for a feature, tell it explicitly what to use |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +# Design & Styling |
| 61 | + |
| 62 | +By default, Bolt apps may look "bland" because the AI by default only styles components via props from the generated theme (Atlas defaults unless changed). |
| 63 | + |
| 64 | +**If you have a design, wireframe or concept available:** |
| 65 | + |
| 66 | +- Generate your theme from Figma and override the defaults |
| 67 | +- Provide Bolt with screenshots, mockups, or design references |
| 68 | +- Tell it explicitly to match the image |
| 69 | +- If allowed, you may tell it to use `style` overrides on the components to give it more freedom |
| 70 | + |
| 71 | +Example prompt: |
| 72 | + |
| 73 | +``` |
| 74 | +Here's an example image of the design I want. Implement this screen matching the design, including the color scheme shown in the image. You may use style overrides on UI components to achieve better accuracy |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +# First Prompt |
| 80 | + |
| 81 | +Your first prompt should give an overview of the app and focus on authentication. See mode-specific guidance: |
| 82 | +- [Supabase Mode - First Prompt](./1_supabase.md#first-prompt) |
| 83 | +- [External API Mode - First Prompt](./2_external_api.md#first-prompt) |
| 84 | + |
0 commit comments