> ## Documentation index
> Fetch the complete documentation index at: https://contextrepo.com/docs/llms.txt
> Use it to find every page before exploring further.

# Prompts

> Create, edit, version, organize, and share reusable prompt templates from the Context Repo dashboard.

Prompts are the core building blocks of your Context Repo workspace. They're reusable templates for AI interactions that you can create, organize, version, and access from any connected AI assistant through the MCP server.

Context Repo stores prompt content verbatim. You can write placeholder text such as `${variableName}`, but Context Repo does not fill in or execute those placeholders.

## Creating a Prompt

Click **New Prompt** in the dashboard toolbar to open the creation dialog.

The dialog includes these fields:

| Field              | Required | Description                                                                                           |
| ------------------ | -------- | ----------------------------------------------------------------------------------------------------- |
| **Title**          | Yes      | A short, descriptive name for your prompt — this is how you'll find it in search and your prompt list |
| **Description**    | No       | A brief note about what this prompt does, shown in search results and the prompt list                 |
| **Prompt Content** | Yes      | The full prompt text, including any placeholder notation you want to preserve                         |
| **Collections**    | No       | Assign your prompt to one or more collections to keep things organized                                |

Once you click **Create Prompt**, you're taken directly to the prompt detail page where you can preview, edit, organize, copy, share, archive, or delete it.

> **Note:** Every prompt gets version history from the moment it's created. Your first save is automatically recorded as version 0.

## Editing a Prompt

Open any prompt from your list to see its detail page. The detail page has three tabs: **Preview**, **Editor**, and **Versioning**.

To edit your prompt:

1. Switch to the **Editor** tab
2. Update the title, description, content, or collection selection
3. Click **Save Changes** when you're done

The dashboard sends the title, description, and content together when you save. A save with non-empty content therefore creates a new version (see [Version History](https://contextrepo.com/docs/dashboard/prompts#version-history) below). If you change your mind, click **Cancel** to discard your unsaved field changes.

The **Preview** tab shows your prompt content rendered as formatted text, along with its creation date, last-updated date, visibility, version number, views, and copies. If the prompt has variable metadata created through the REST API, that metadata appears below the content.

## Placeholders and Variable Metadata

Prompt content is free-form text. You can use `${variableName}` as a placeholder convention:

```text
Review this ${language} code for ${reviewType} issues:

${codeSnippet}
```

Context Repo returns those placeholders exactly as stored. The caller that retrieves the prompt is responsible for replacing them, if replacement is needed.

The REST API also accepts an optional `variables` array. Each entry has a name, a type (`string`, `number`, or `boolean`), and an optional description. This is stored metadata only; it does not add form fields or perform substitution.

> **Warning:** The dashboard does not detect placeholders or let you edit variable metadata. Prompts created in the dashboard start with an empty `variables` array. Use the [REST API](https://contextrepo.com/docs/api/endpoints#create-prompt) when you need to define that metadata.

## Version History

The original prompt is recorded as version 0. Dashboard saves with non-empty content create a new version. At the REST API level, non-empty content, parameter, and variable updates create versions; title, description, and tag-only updates patch the current prompt without adding a version.

### What's Tracked

Each version records:

- The full prompt content, parameters, and variable metadata at that point in time
- A **change log**
- A timestamp and who made the change

### Viewing History

Switch to the **Versioning** tab on any prompt detail page. You'll see every version, with the current version marked. Click the expand arrow on a version to compare its content with the previous version line by line.

### Restoring a Previous Version

If you need to roll back, click the **Restore** button on any previous version. You'll see a confirmation dialog before anything changes. Restoring creates a new version from that snapshot's content, parameters, and variables. The current title, description, tags, and visibility stay unchanged.

## Managing Prompts

### Visibility

Every prompt is either **public** or **private**:

- **Private** prompts are visible only to you
- **Public** prompts have a read-only link that anyone with the link can open

Open the actions menu (the three-dot icon), select **Share**, and choose **Make public**. The link is pinned to the current prompt version. Later edits do not change what the link shows until you choose **Update link**. Select **Stop sharing** to revoke public access.

### Archiving

If you're not actively using a prompt but don't want to delete it, use **Archive** from the actions menu. This marks the prompt as archived without deleting it or its history. Use **Unarchive** on the prompt detail page to clear that status.

- **Archive**: Open the actions menu and select **Archive**
- **Unarchive**: Find the archived prompt and select **Unarchive** from its actions menu

### Deleting

To permanently remove a prompt, open the actions menu and select **Delete**. You'll see a confirmation dialog — this action can't be undone.

> **Warning:** Deleting a prompt removes it and all its version history permanently. If you might need it later, consider archiving instead.

### Organizing with Collections

You can assign prompts to collections during creation or while editing. Collections help you group related prompts and documents together — for example, a "Code Review" collection might contain your review checklist prompt alongside relevant reference documents.

To update collection assignments, switch to the **Editor** tab and use the collections selector before saving.

## Related Pages

- [Documents](https://contextrepo.com/docs/dashboard/documents): Upload files and scrape webpages to build your knowledge base.
- [Collections](https://contextrepo.com/docs/dashboard/collections): Group prompts and documents into organized workspaces.
- [Search](https://contextrepo.com/docs/dashboard/search): Find prompts, documents, and collections with semantic or keyword search.
- [MCP Tools Reference](https://contextrepo.com/docs/mcp/tools-reference): Manage prompts programmatically with the 7 prompt MCP tools.
