> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/create-content/blocks/prompt.md).

# Prompt

Add a prompt block to a page to share reusable AI prompts

Prompt blocks let you share reusable AI prompts in your docs. Readers can copy the prompt in one click, or open it in a supported AI tool.

### Add a prompt block

1. On an empty line, type `/`.
2. Click **Prompt** in the insert menu.
3. Add the block content and settings.

### Prompt block fields

Each prompt block includes these fields:

* **Description**: A short summary of what the prompt does.
* **Icon**: An optional icon that helps readers scan the block.
* **Prompt**: The prompt text you can copy or send to an AI tool.

The prompt field supports Markdown, so you can structure longer prompts with headings, lists, and other formatting.

### Prompt options

#### Open in AI providers

The **Open in AI providers** setting controls whether the block shows a menu of AI tools that can open the prompt directly.

If you enable this setting, readers can open the prompt from the provider menu in published docs.

If you leave this setting unset, GitBook derives its initial value from the site-level **Open in AI providers** page action. You can manage that setting in [Extra configuration](/docs/manage-your-site/customization/extra-configuration.md#open-in-ai-providers).

#### Default visibility

The **Default visibility** setting controls how much of the prompt readers can see initially.

Choose **Hidden** to hide the prompt. Choose **Partially visible** for a 10-line preview, or **Fully visible** for the full prompt.

### Example

Use a prompt block when you want readers to reuse a prompt exactly as written. For example:

{% prompt description="Example prompt" icon="rectangle-terminal" defaultExpanded="full" %}

```markdown
Summarize the key changes in this release note. Group the response into: new features, breaking changes, and recommended next steps. Keep the answer under 150 words.
```

{% endprompt %}

### When to use a prompt block

Prompt blocks work well for:

* Reusable prompts for support, onboarding, or troubleshooting
* Prompt templates for summaries, analysis, or drafting
* Workflows that start in your docs and continue in an AI tool

### Best practices

Write prompts the same way you want readers to use them:

* State the task clearly.
* Define the output format.
* Add constraints like length, tone, or required inputs.

### Published docs behavior

On a published page, a prompt block helps readers move faster.

* **Copy prompt** copies the full prompt to the clipboard.
* **Open in AI providers** shows a provider menu when enabled.

## Representation in Markdown

{% code overflow="wrap" %}

````markdown
{% prompt description="Example prompt" icon="rectangle-terminal" openInAIProviders="true" defaultExpanded="full” %}
```markdown
Summarize the key changes in this release note. Group the response into: new features, breaking changes, and recommended next steps. Keep the answer under 150 words.
```
{% endprompt %}
````

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/create-content/blocks/prompt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
