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

# Create and Structure AI Prompts with Prompt Blocks

> Build AI prompts from structured blocks — role, objective, context, examples, reasoning, and constraints — then expand them anywhere with a shortcut.

SprintBrain's prompt editor breaks a prompt into up to six named blocks, each with a toggle. Enable only the blocks your task needs, fill them in, and SprintBrain assembles them into a single prompt body at expansion time. This structure makes prompts easier to read, easier to improve, and easier for the quality scorer to grade.

## The prompt block editor

Every prompt is composed of six blocks in a fixed order. You can enable or disable each block independently — a simple task might only need **Role**, **Objective**, and **Reasoning**, while a complex one benefits from all six.

| Block           | Purpose                    | Example                                 |
| --------------- | -------------------------- | --------------------------------------- |
| **Role**        | Define who the AI is       | "You are a senior software engineer…"   |
| **Objective**   | State the task clearly     | "Your task is to review…"               |
| **Context**     | Provide background         | Relevant background about the situation |
| **Examples**    | Show input/output pairs    | Guide the model with demonstrations     |
| **Reasoning**   | Instruct thinking approach | "Think step by step…"                   |
| **Constraints** | What the model must not do | Boundaries and limitations              |

Each block shows a placeholder hint as you write — for example, the **Examples** block prompts you with *"Show input/output pairs to guide the model"* — so you always know what belongs in each section.

### Example: a fully structured prompt

Here is what a code-review prompt looks like with all six blocks filled in:

```text theme={null}
[ROLE]
You are a senior software engineer with deep expertise in TypeScript and React.

[OBJECTIVE]
Your task is to review the code diff below and identify bugs, performance issues,
and violations of the team's coding standards.

[CONTEXT]
The codebase follows the Airbnb ESLint ruleset. The team targets Node 20 and
React 18. This is a pull request for a customer-facing feature, so correctness
is more important than brevity.

[EXAMPLES]
Input: a useState hook with a stale closure
Output: "Line 42 — the callback captures `count` from the first render.
         Use the functional updater form: setCount(prev => prev + 1)."

[REASONING]
Think step by step. First check for bugs, then performance, then style.
Double-check your result before producing the final review.

[CONSTRAINTS]
Do not rewrite the code. Flag issues only. Keep each comment under 40 words.
Do not comment on formatting — the linter handles that automatically.
```

<Tip>
  Enable only the blocks your prompt actually needs. Simpler prompts often perform better than over-engineered ones — a clear **Role** + **Objective** + **Reasoning** frequently outperforms a six-block prompt where the extra sections are vague or redundant.
</Tip>

## Giving a prompt its own shortcut

If you use a prompt frequently, give it a shortcut so you can expand it without opening the picker.

<Steps>
  <Step title="Open the prompt editor">
    Click **New prompt** or click an existing prompt card to open the editor panel.
  </Step>

  <Step title="Enter a shortcut">
    In the **Shortcut** field, type a short identifier — for example, `coderev`. Use only letters, numbers, hyphens, or underscores. SprintBrain sanitises the input automatically.
  </Step>

  <Step title="Save the prompt">
    Click **Create prompt** (or **Save changes**). The shortcut is now live.
  </Step>

  <Step title="Use it anywhere">
    In any text field, type your prompt trigger prefix followed by the shortcut and press **Tab**. For example, if your prefix is `/`, type `/coderev` + **Tab** and the full prompt expands at your cursor.
  </Step>
</Steps>

Leave the shortcut field empty to keep the prompt accessible through the `"""` picker only.

## Dynamic fields in prompts

Prompts support the same dynamic field syntax as snippets. Use placeholders to collect values from the user at expansion time — the same inline overlay that appears for snippets appears for prompts too.

| Syntax                                                    | What it does                                                 |
| --------------------------------------------------------- | ------------------------------------------------------------ |
| `{formtext: label="Guest name"}`                          | Prompts for a single-line text value                         |
| `{formdate: label="Check-in"}`                            | Opens a date picker                                          |
| `{formmenu: default="English"; options="Spanish,French"}` | Shows a dropdown                                             |
| `{{placeholder}}`                                         | A simple placeholder that the user fills in before inserting |

**Example** — a support-reply prompt that asks for the customer's name and issue at expansion time:

```text theme={null}
[ROLE]
You are a friendly customer success agent for a SaaS product.

[OBJECTIVE]
Write a reply to {{customer_name}}'s support ticket about {formtext: label="Issue summary"}.

[CONSTRAINTS]
Keep the tone warm but professional. Reply in under 100 words.
```

At expansion, SprintBrain pauses, shows the overlay for *Issue summary*, then inserts the finished prompt with all values filled in.
