> ## Documentation Index
> Fetch the complete documentation index at: https://backdrift.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompting

> How to describe your backend to the AI.

The quality of your backend depends on how well you describe it. This guide covers best practices for writing effective prompts.

## The Basics

Backdrift's AI understands natural language. You don't need to use technical jargon or specific formats. Just describe what you want your application to do.

### Good Prompt Structure

A good prompt typically includes:

1. **What the app does** - The core purpose
2. **Who uses it** - User types and roles
3. **What data it manages** - Entities and their relationships
4. **Special requirements** - Multi-tenancy, jobs, file storage

### Example: Task Management

```
A task management app where users can create projects, add tasks
with due dates and priorities, and assign tasks to team members.

Each organization should have isolated data. Organization admins
can invite members and assign roles (admin, member, viewer).
```

This prompt tells Backdrift:

* Core entities: projects, tasks, users
* Relationships: tasks belong to projects, users belong to organizations
* Multi-tenancy: organizations have isolated data
* Roles: admin, member, viewer

## Prompt Patterns

### Multi-Tenant SaaS

```
A multi-tenant [type of app] where each organization has isolated data.
Organization admins can invite members and assign roles.
```

### Event-Driven Workflows

```
When a [event happens], send a [notification/email].
Run a [frequency] job to [do something].
```

### File Storage

```
Users can upload [file types] to [entity].
Files should be stored securely with [requirements].
```

## What to Include

<AccordionGroup>
  <Accordion title="Entities & Fields">
    Be specific about what data you need to store:

    ```
    Tasks have a title, description, due date, priority
    (low/medium/high), and status (pending/in-progress/done).
    ```
  </Accordion>

  <Accordion title="Relationships">
    Explain how entities connect:

    ```
    Tasks belong to projects. Projects belong to organizations.
    Users can be assigned to multiple tasks.
    ```
  </Accordion>

  <Accordion title="Access Control">
    Define who can do what:

    ```
    Admins can create and delete projects.
    Members can create tasks but not delete projects.
    Viewers can only read data.
    ```
  </Accordion>

  <Accordion title="Workflows">
    Describe automated processes:

    ```
    When a task is marked complete, notify the project owner.
    Every night, send a digest of overdue tasks.
    ```
  </Accordion>
</AccordionGroup>

## What NOT to Include

<Warning>
  Avoid implementation details. Let Backdrift decide how to build it.
</Warning>

❌ Don't say: "Use DynamoDB with a GSI on user\_id"
✅ Do say: "Users should be able to query their own tasks efficiently"

❌ Don't say: "Create a Lambda function triggered by SQS"
✅ Do say: "Process task assignments asynchronously"

❌ Don't say: "Use Cognito with OAuth 2.0"
✅ Do say: "Users sign in with email and password"

## Example Prompts

### E-commerce Platform

```
An e-commerce platform with products, categories, and orders.

Customers can browse products, add to cart, and checkout.
Admins can manage products, view orders, and update inventory.

When an order is placed, send a confirmation email.
Run a daily job to check for low inventory and alert admins.
```

### Customer Support System

```
A customer support ticketing system.

Customers submit tickets with a subject and description.
Support agents are assigned tickets and can respond.
Managers can see all tickets and reassign them.

Track ticket status: open, in-progress, resolved, closed.
When a ticket is resolved, email the customer.
```

### Booking System

```
A booking system for a fitness studio.

Classes have a name, instructor, time, and capacity.
Members can book spots in classes.
Instructors can view their schedule.

Don't allow overbooking—enforce capacity limits.
Send a reminder email 24 hours before each class.
```

## Iterating on Your Prompt

After your initial prompt, use [Spec Chat](/workflow/spec-chat) to refine:

```
User: "Add a comments feature to tasks"
User: "Make the due date required"
User: "Add file attachments to tickets"
User: "Change the status options to: new, active, blocked, done"
```

<Card title="Spec Chat" icon="comments" href="/workflow/spec-chat">
  Learn how to iterate on your backend with conversational AI.
</Card>
