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

# Prompt Engineering Patterns

> Improve output reliability with practical prompting techniques

## Overview

Prompt quality has the biggest impact on response quality. Use consistent structures to improve reliability.

```mermaid theme={null}
flowchart LR
    A[Task Definition] --> B[Prompt Template]
    B --> C[Run in Playground]
    C --> D[Inspect Output]
    D --> E[Refine Instructions]
    E --> C
```

## Core Patterns

### 1) Role + Task + Output Format

```text theme={null}
You are a support analyst.
Task: Summarize the incident.
Output: JSON with keys root_cause, impact, next_step.
```

### 2) Constraint-Driven Prompting

Add explicit limits:

* Word count ceiling
* Required sections
* Forbidden content

### 3) Few-Shot Examples

Provide 1-2 examples when format consistency is critical.

### 4) Self-Check Instruction

Ask for final verification against constraints before completion.

## Evaluation Loop

* Start minimal.
* Add one constraint at a time.
* Retry only after recording what changed.

<Check>When benchmarking models, keep the prompt static and adjust only generation parameters per trial.</Check>
