# One-Shot vs Iterative Development

## The Two Approaches Explained

**Non-technical explanation**: Think of building an app like cooking a meal. One-shot is like making a complete Thanksgiving dinner from a single detailed recipe all at once. Iterative is like cooking dish by dish, tasting as you go, and adjusting. Both work, but different situations call for different approaches.

**Visual comparison**:

**One-Shot Approach**:

{% @mermaid/diagram content="%%{init: {'theme':'default', 'themeVariables': {'fontSize':'16px'}}}%%
graph TB
A1\[Write Complete Prompt] --> B1\[Buzzy AI Generates<br/>Full App Structure]
B1 --> C1\[Review Everything]
C1 --> D1\[Refine in Visual Editor]
D1 --> E1\[Test & Launch]" %}

**Iterative Approach**:

{% @mermaid/diagram content="%%{init: {'theme':'default', 'themeVariables': {'fontSize':'16px'}}}%%
graph TB
A2\[Write Basic Prompt] --> B2\[Generate Core]
B2 --> C2\[Review & Test]
C2 --> D2\[Add Feature Prompt]
D2 --> E2\[Generate Addition]
E2 --> F2\[Review & Test]
F2 --> G2\[Repeat Until Done]" %}

### One-Shot Development with Buzzy AI v3

**What it is**: Writing a comprehensive, detailed prompt that describes your entire application, letting Buzzy AI v3 generate the complete app structure at once.

**Real example**:

```
"Build a complete recipe management app with:

DATA MODEL:
- Users (name, email, role: Cook/Admin)
- Recipes Datatable with fields:
  - name, description, prep_time (minutes), cook_time (minutes)
  - difficulty (dropdown: Easy, Medium, Hard)
  - cuisine_type (dropdown: Italian, Mexican, Asian, etc.)
  - Viewers field set to recipe author
  - ingredients (Subtable → Ingredients Datatable)
  
- Ingredients Datatable (Subtable of Recipes):
  - ingredient_name, quantity, unit
  
- Comments Datatable:
  - comment_text, author (linked to Users)
  - recipe_id (linked to Recipes)

SCREENS:
1. Recipe list with search, filter by cuisine and difficulty
2. Recipe detail showing ingredients list and comments
3. Add recipe form with nested ingredient entries
4. Edit recipe with ability to add/remove ingredients
5. My Recipes screen filtered to current user

SECURITY:
- Recipes visible to all users but editable only by author
- Use Viewers field for recipe ownership
- Comments visible to all, authored by current user

Make it mobile-responsive with card layouts."
```

**Buzzy AI v3 generates**:

* **Brief**: Summary of what the app does
* **Blueprint**: All screens and navigation flow
* **Data tab**: Complete Datatables with Subtables and relationships
* **Design tab**: All screen layouts with components and actions

### Iterative Development with Buzzy

**What it is**: Building the app incrementally—start with core features, test thoroughly, then add more features one at a time using Buzzy AI prompts and visual editor.

**Real example approach**:

**Phase 1** - Basic foundation:

```
Prompt: "Build a basic recipe app with:
- Recipes Datatable (name, description, prep_time)
- Recipe list screen
- Recipe detail screen
- Add recipe form
- Users can only see their own recipes (Viewers field)"

→ Generate → Review → Test in preview mode
```

**Phase 2** - Add ingredients:

```
Prompt: "Add ingredients to the recipe app:
- Create Ingredients Datatable as Subtable of Recipes
- Fields: ingredient_name, quantity, unit
- Update recipe detail screen to show ingredients list
- Update add/edit forms to include ingredient entries"

→ Generate → Review → Test in preview mode
```

**Phase 3** - Add comments:

```
Prompt: "Add comments feature:
- Comments Datatable linked to Recipes
- Show comments on recipe detail screen
- Add comment form for logged-in users"

→ Generate → Review → Test in preview mode
```

**Phase 4** - Polish UX (manual edits in Design tab):

* Adjust layout spacing
* Improve mobile responsiveness
* Add helpful empty states
* Enhance button styles

## When to Use One-Shot with Buzzy

### Good Use Cases

**Simple, well-defined apps**:

* ✅ Contact form apps
* ✅ Simple CRUD apps (task lists, inventory trackers)
* ✅ Internal tools (calculators, data entry forms)
* ✅ Prototypes to demonstrate concepts
* ✅ MVPs to validate ideas

**Characteristics**:

* Single or simple user roles
* Clear data model (2-4 Datatables)
* Standard UI patterns
* Straightforward business logic
* No complex external integrations

### Advantages

1. **Speed**: Get a working Buzzy app in minutes
2. **Complete vision**: Buzzy AI v3 sees your full requirements
3. **Consistency**: Generated App Definition uses consistent patterns
4. **All basics covered**: Brief, Blueprint, Data, and Design all generated
5. **Safe to modify**: Can use visual editor to refine without breaking anything

### Disadvantages

1. **Generic assumptions**: Buzzy AI v3 makes reasonable assumptions that may not be exactly what you want
2. **May need refinement**: Data relationships might need adjustment
3. **Less understanding**: If you don't review what was generated, you won't understand your app structure
4. **Context limits**: Very large prompts may not generate optimal results

### One-Shot Best Practices with Buzzy

**1. Be extremely specific about data relationships**:

```
Bad: "Build a recipe app"

Good: "Build a recipe app where:
- Each recipe has a name, description, prep time in minutes, and step-by-step instructions
- Each recipe has multiple ingredients (use Subtable) with name, quantity, and unit
- Users can create and edit their own recipes
- Recipe list screen should be searchable
- Recipe detail screen shows ingredients as a list
- Users should only see their own recipes unless they're shared"
```

**2. Include all requirements upfront**:

* Data structure with specific mention of Subtables (1:M) or Linked Table Fields (N:M)
* Security requirements (Viewers fields, Organizations/Teams)
* All screens and key navigation flows
* Mobile and web needs
* Critical display rules

**3. Review what Buzzy AI v3 generated**:

* **Brief**: Does it capture your app's purpose?
* **Blueprint**: Are all necessary screens included?
* **Data tab**: Check Datatables, Subtables, and Linked Table Fields
* **Design**: Review screen layouts and components

**4. Use preview mode to test**:

* Navigate through all screens
* Test data entry and editing
* Verify display rules work correctly
* Check mobile view

**5. Refine using visual editor**:

* Adjust screen layouts in Design tab
* Fine-tune display rules
* Update field labels and placeholders
* Modify navigation flow

{% hint style="warning" %}
**Reality Check**: Even simple apps usually need refinement. The difference with Buzzy: you can safely edit in the visual editor without breaking anything. No risk of corrupting generated code.
{% endhint %}

## When to Use Iterative with Buzzy

### Good Use Cases

**Complex apps**:

* ✅ Multi-role applications (with Organizations and Teams)
* ✅ Complex data relationships (many Subtables and Linked Table Fields)
* ✅ External API integrations (requiring Buzzy Functions)
* ✅ Apps that will grow over time

**Learning situations**:

* ✅ You're new to Buzzy's platform
* ✅ You're learning about Subtables and Linked Table Fields
* ✅ Requirements are evolving as you explore

**Production apps**:

* ✅ Apps where data model design is critical
* ✅ Apps where UX quality matters more than speed
* ✅ Apps with specific security requirements

### Advantages

1. **Control**: Build exactly what you want, reviewing each step
2. **Learning**: Understand Buzzy's data model and structure as you build
3. **Quality**: Catch data model issues early before they cascade
4. **Understanding**: Learn how Subtables and Linked Table Fields work
5. **Flexibility**: Easy to change direction with Buzzy's visual editor

### Disadvantages

1. **Slower**: Takes more time than one-shot approach
2. **Multiple prompts**: Need to communicate clearly across iterations
3. **More decisions**: You decide the build sequence
4. **Testing overhead**: Need to test after each iteration

### Iterative Best Practices with Buzzy

**1. Build using Buzzy AI v3 workflow**:

**Phase 1 - Foundation**:

* **Prompt**: "Build basic structure with core Datatables"
* **Review**: Check generated Brief, Blueprint, and Data model
* **Refine**: Adjust Subtable relationships in Data tab if needed
* **Test**: Use preview mode

**Phase 2 - Core Features**:

* **Prompt**: "Add \[specific feature] with \[data relationships]"
* **Review**: Check how it integrates with existing structure
* **Refine**: Use Design tab to adjust screen layouts
* **Test**: Verify new workflows in preview

**Phase 3 - External Integrations** (if needed):

* Create Buzzy Functions for external APIs
* Add Constants for API keys
* Test Functions before integrating into app
* Wire up Functions in app actions

**Phase 4 - Polish**:

* Refine UX using Design tab
* Add display rules for conditional visibility
* Optimize screen layouts for mobile
* Test thoroughly with realistic data

**2. Test between iterations**:

* Use Buzzy's preview mode after each change
* Test with different user roles (if applicable)
* Verify data relationships work correctly
* Check mobile and web views

**3. Be specific about Buzzy concepts**:

```
Bad: "Add comments"

Good: "Add a Comments subtable to the Tasks datatable. Each comment should have:
- content (text field)
- author (link to current user)
- created_at (timestamp)

Show comments in the Task Detail screen below the task info.
Only logged-in users can add comments. Users can edit or delete 
their own comments only (use Viewers field for this)."
```

**4. Use visual editor strategically**:

* Make small UX adjustments manually in Design tab
* Use AI prompts for structural changes (new Datatables, Subtables)
* Don't prompt AI for every tiny visual tweak
* Leverage Buzzy's version control (Versions tab) to rollback if needed

**5. Document your data model**:

* Keep a data model diagram updated
* Note complex Subtable/Linked Field relationships
* Document security patterns (Viewers, Team Viewers)
* Note any Buzzy Functions and their purpose

## Hybrid Approach with Buzzy

In practice, most successful Buzzy projects use a combination:

### The Hybrid Strategy

**1. One-shot for foundation**: Prompt Buzzy AI v3 to generate basic app structure with core Datatables and screens

**2. Iterative for features**: Add functionality using focused prompts, testing each addition

**3. Visual editor for refinements**: Use Design tab to adjust layouts, display rules, and actions

**4. Buzzy Functions for complex integrations**: Create Functions for external APIs, advanced calculations, or custom logic

### Example: E-commerce App with Buzzy

**One-shot (Day 1)**: Prompt: "Build an e-commerce app with:

* Products datatable (name, description, price, image, inventory count)
* Orders datatable with Order Items subtable (to store product, quantity, price)
* Users datatable for customers
* Screens: product list (searchable), product detail, shopping cart, my orders"

**Review and adjust**:

* Check Data tab for Subtable relationships
* Verify Orders → Order Items uses Subtable correctly
* Test basic navigation in preview

**Iterative additions (Days 2-5)**:

* Day 2: Prompt for product categories (use Linked Table Field for N:M)
* Day 3: Prompt for checkout flow screens
* Day 4: Create Buzzy Function for payment processing (Stripe API)
* Day 5: Prompt for order history and status tracking

**Visual refinements (Days 6-7)**:

* Use Design tab to improve product card layouts
* Add display rules for inventory warnings
* Refine checkout flow UX
* Optimize mobile experience

**Buzzy Functions** (as needed):

* Payment processing via Stripe
* Inventory management logic
* Order confirmation emails
* Price calculations with discounts

## Switching Approaches Mid-Project

Sometimes you realize the chosen approach isn't working:

### From One-Shot to Iterative

**When to switch**:

* Data model needs significant restructuring
* Generated screens don't match your vision
* Requirements have significantly changed
* You need more control over the structure

**How to switch with Buzzy**:

1. Use Buzzy's Versions tab to save current state
2. Identify what's working well (keep it)
3. Use focused prompts to rebuild problematic areas
4. Leverage Design tab for manual adjustments
5. Test thoroughly in preview mode

**Advantage with Buzzy**: Safe to iterate because you have version control and visual editing without breaking anything

### From Iterative to One-Shot

**When to switch**:

* Need to add entire new section quickly
* Current approach feels too slow
* Adding standard, well-defined features
* Want Buzzy AI v3 to generate structure for new area

**How to switch with Buzzy**:

1. Document current app structure
2. Write comprehensive prompt for new section
3. Let Buzzy AI v3 generate the new structure
4. Review generated Datatables, screens, and relationships
5. Test how it integrates with existing app
6. Use Design tab to refine integration points

## Decision Framework for Buzzy

Ask yourself:

### Choose One-Shot with Buzzy AI v3 if:

* [ ] App is simple (< 5 Datatables, straightforward relationships)
* [ ] Requirements are fully defined
* [ ] Standard UI patterns work for your needs
* [ ] Speed is critical (MVP, prototype, demo)
* [ ] You're comfortable reviewing generated App Definitions

### Choose Iterative with Buzzy if:

* [ ] App is complex (> 5 Datatables, many Subtables/Linked Fields)
* [ ] Requirements are evolving
* [ ] External integrations needed (Buzzy Functions)
* [ ] Data model design is critical
* [ ] You're learning Buzzy's platform
* [ ] You want to understand every aspect of your app

### Choose Hybrid if:

* [ ] Medium complexity app
* [ ] Mix of standard and custom features
* [ ] Some time pressure but quality matters
* [ ] App will grow over time
* [ ] Need external API integrations (Buzzy Functions)
* [ ] Want speed of one-shot with control of iterative

## Common Mistakes with Buzzy

### Mistake 1: One-Shot for Complex Apps

**Problem**: Trying to describe everything in one massive prompt for a complex Buzzy app

**Result**:

* Suboptimal data model with unclear relationships
* Missing Subtables or incorrect Linked Table Fields
* Generic screens that don't match your vision
* Time wasted restructuring vs starting iteratively

**Fix**: Use iterative approach for apps with complex data relationships or multiple user roles

### Mistake 2: Too Iterative (Over-Prompting)

**Problem**: Using Buzzy AI prompts for every tiny change instead of Design tab

**Result**:

* Painfully slow progress
* Wasted prompts on trivial changes
* Could have used visual editor much faster
* Never ship because always tweaking

**Fix**: Use AI prompts for structural changes (Datatables, Subtables), use Design tab for UI refinements

### Mistake 3: No Testing Between Iterations

**Problem**: Adding feature after feature without using preview mode

**Result**:

* Issues compound in data model
* Display rules don't work as expected
* Navigation becomes confusing
* Don't discover problems until much later

**Fix**: Use preview mode after each significant iteration, test all workflows

### Mistake 4: Ignoring Data Model Review

**Problem**: Not reviewing generated Datatables, Subtables, and Linked Table Fields

**Result**:

* Inefficient data structure
* Wrong relationship types (Subtable vs Linked Field)
* Performance issues later
* Hard to add features later

**Fix**: Always review Data tab after Buzzy AI v3 generates structure. Verify relationships make sense.

### Mistake 5: Scope Creep

**Problem**: Continuously adding "just one more thing"

**Result**:

* Never finished
* Overwhelmed by complexity
* Lost sight of MVP
* App becomes unmaintainable

**Fix**: Define MVP clearly using Buzzy AI v3, publish it, then iterate with additional features

## Next Steps

* **Need to change something?**: [Making Changes Effectively](https://docs.buzzy.buzz/the-ultimate-guide-for-vibe-coding-an-application-with-ai/project-workflow/making-changes)
* **Deciding AI prompts vs visual editor**: [AI vs Manual Edits](https://docs.buzzy.buzz/the-ultimate-guide-for-vibe-coding-an-application-with-ai/project-workflow/ai-vs-manual-edits)
* **Ready to test**: [Testing Approaches](https://docs.buzzy.buzz/the-ultimate-guide-for-vibe-coding-an-application-with-ai/project-workflow/testing-approaches)
* **Learn Buzzy AI v3**: [Buzzy AI v3 Guide](https://docs.buzzy.buzz/getting-started-with-buzzy/new-buzzy-ai-v3)

{% hint style="success" %}
**Remember**: With Buzzy, there's less risk than traditional code generation. You have version control, visual editing, and no code to break. The best approach depends on your app's complexity and your familiarity with Buzzy's platform. Start with your best guess and adjust as you learn—Buzzy makes it safe to iterate.
{% endhint %}
