Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/customization/prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ description: "These are the specialized instructions that shape how models respo

## Learn More

Prompts have the same syntax as [prompt files](/customization/prompts). The `config.yaml` spec for `prompts` can be found [here](/reference#prompts).
- [Explore prompts](https://hub.continue.dev/?type=prompts) on the Hub
- Learn more in the [prompts deep dive](/customize/deep-dives/prompts)
- View [`prompts`](/reference#prompts) in the YAML Reference for more details
120 changes: 82 additions & 38 deletions docs/customize/deep-dives/prompts.mdx
Original file line number Diff line number Diff line change
@@ -1,62 +1,106 @@
---
title: "Creating Custom Prompts in Continue"
description: "Learn how to create reusable prompt files in Continue to streamline repetitive tasks, including examples for code reviews, security checks, and entity generation"
title: "How to Create and Manage Prompts in Continue"
description: "Prompts are used to kick off tasks for Agent, Plan, and Chat requests"
keywords: [prompts, context, slash command]
sidebarTitle: "Prompts"
---

Prompts are reusable instructions that can be referenced at any time during chat. They are especially useful as context for repetitive and/or complex tasks.
Prompts are included as user messages and especially useful as instructions for repetitive and/or complex tasks.

<Info>
Prompts were previously defined in a `.prompt` file format, but for
consistency we now recommend using the same Markdown format as
[rules](./rules) and adding `alwaysApply: false` to the frontmatter so
that they are manually triggered.
</Info>
## Slash commands

## Quick Start: How to Create Your First Prompt File
By setting `invokable` to `true`, you make the markdown file a prompt, which will be available when you type <kbd>/</kbd> in Chat, Plan, and Agent mode.

Below is a quick example of setting up a prompt file:
```md title="explain-invokable.md"
---
name: Explain invokable
description: Explains what happens when you set invokable to true
invokable: true
---

Explain that when `invokable` is set to `true`, a slash command becomes available in the IDE extensions and CLI
```

1. Create a folder called `.continue/rules` at the top level of your workspace
2. Add a file called `review-prompt.md` to this folder.
3. Write the following contents to `review-prompt.md` and save.
These slash commands can be combined with additional instructions, including highlighted code, to provide additional context.

```md title="review-prompt.md"
## Example: `Create Supabase functions` prompt

Here is a prompt that generates high-quality PostgreSQL functions that adhere to best practices:

```md title="supabase-create-functions.md"
---
name: Redux best practices review
alwaysApply: false
name: Create Supabase functions
description: Guidelines for writing Supabase database functions
invokable: true
---

Review the currently open file for adherence to Redux best practices, as explained in their style guide at https://redux.js.org/style-guide/.
# Database: Create functions

You're a Supabase Postgres expert in writing database functions. Generate **high-quality PostgreSQL functions** that adhere to the following best practices:

## General Guidelines

1. **Default to `SECURITY INVOKER`:**

- Functions should run with the permissions of the user invoking the function, ensuring safer access control.
- Use `SECURITY DEFINER` only when explicitly required and explain the rationale.

2. **Set the `search_path` Configuration Parameter:**

- Always set `search_path` to an empty string (`set search_path = '';`).
- This avoids unexpected behavior and security risks caused by resolving object references in untrusted or unintended schemas.
- Use fully qualified names (e.g., `schema_name.table_name`) for all database objects referenced within the function.

3. **Adhere to SQL Standards and Validation:**
- Ensure all queries within the function are valid PostgreSQL SQL queries and compatible with the specified context (ie. Supabase).

...
```

Now to use this prompt, you can open Chat, type <kbd>/</kbd>, select the prompt, and type out any additional instructions you'd like to add.
<Info>You can read the rest of the `Create Supabase functions` prompt [here](http://hub.continue.dev/supabase/create-functions)</Info>

## Example Prompt Templates for Common Use Cases
If you are using a local `config.yaml`, you can add it to your agent like this:

Below are more examples to get you started. You can also visit the Hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&blockType=prompts).
```md title="config.yaml"
...

### How to Create a Security Review Prompt
prompts:
- uses: supabase/create-functions

```md title="security-review.md"
---
name: Security best practices review
alwaysApply: false
---
...
```

If you are using Continue Hub, you can add it to your agent by selecting "Use Rule" [here](https://hub.continue.dev/supabase/create-functions)

To use this prompt, you can open Chat / Agent / Edit, type <kbd>/</kbd>, select the prompt, and type out any additional instructions you'd like to add.

## Using a prompt with `cn`

Review the changes in the current git diff for these security best practices:
You can run this command to start [cn](../../guides/cli) with the [Create Supabase functions](http://hub.continue.dev/supabase/create-functions) prompt.

- Does the architecture follow security-by-design principles?
- Are there potential security vulnerabilities in the system design?
- Is sensitive data handled appropriately throughout the lifecycle?
```
cn --prompt supabase/create-functions "I need a function that checks for the health status"
```
Alternatively, you can start [cn](../../guides/cli) and then type <kbd>/</kbd> to manually invoke the prompt yourself.

### How to Create a Prompt That References Existing Files
## Using a prompt to kick off a Continuous AI workflow

```md title="typeorm-entity-generator.md"
---
name: Generate a new TypeORM entity
alwaysApply: false
---
You can kick off Continuous AI workflows using a prompt with [cn](../../guides/cli).

For example, say you are building a SaaS application and must repeatedly create custom Supabase validation functions for each new feature that accepts user input.

Referencing `src/db/dataSource.ts` and `src/db/entity/SampleEntity.ts`, generate a new TypeORM entity based on the following requirements:
These functions require you to interpret business requirements, implement complex cross-table logic (like checking user permissions, tier limits, and time-based restrictions), and make judgment calls about edge cases.

Each function is unique enough that it can't be templated or scripted. This is where kicking off a Continuous AI workflow to get you started can be quite helpful.

Here is a command that you could run whenever you have a new feature:

```
cn -p --prompt supabase/create-functions "I need a function for the new feature on my current branch similar to my existing database functions"
```

<Info>You can see the entire `Create Supabase functions` prompt [here](http://hub.continue.dev/supabase/create-functions)</Info>

When you run this workflow, [cn](../../guides/cli) will checkout your current branch, explore the new and existing code, and then draft a function for you.

You will then be able to review the implementation and improve it before you merge the new feature.
15 changes: 3 additions & 12 deletions docs/customize/deep-dives/rules.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "How to Create and Manage Rules in Continue"
description: "Rules are used to provide instructions to the model for Agent, Chat, and Edit requests."
keywords: [rules, .continuerules, system, prompt, message]
description: "Rules are used to provide system message instructions to the model for Agent, Chat, and Edit requests"
keywords: [rules, system, prompt, message]
sidebarTitle: "Rules"
---

Expand Down Expand Up @@ -156,13 +156,4 @@ Continue includes a simple default system message for [Agent](../../features/age

This can be viewed in the rules section of the toolbar (see above), or in the source code [here](https://github.com/continuedev/continue/blob/main/core/llm/constructMessages.ts#L4).

Advanced users can override this system message for a specific model if needed by using `chatOptions.baseSystemMessage`. See the [`config.yaml` reference](/reference#models).

### Legacy: .continuerules File (Deprecated)

<Warning>
`.continuerules` will be deprecated in a future release. Please use the
`.continue/rules` folder instead.
</Warning>

You can create project-specific rules by adding a `.continuerules` file to the root of your project. This file is raw text and its full contents will be used as rules.
Advanced users can override this system message for a specific model if needed by using `chatOptions.baseSystemMessage`. See the [`config.yaml` reference](/reference#models).
36 changes: 0 additions & 36 deletions docs/customize/deep-dives/slash-commands.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/customize/model-roles/edit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 3
---
import { ModelRecommendations } from '/snippets/ModelRecommendations.jsx'

It's often useful to select a different model to respond to Edit prompts than for chat prompts, as Edits are often more code-specific and may require less conversational readability.
It's often useful to select a different model to respond to Edit instructions than for Chat instructions, as Edits are often more code-specific and may require less conversational readability.

In Continue, you can add `edit` to a model's roles to specify that it can be used for Edit requests. If no edit models are specified, the selected `chat` model is used.

Expand Down
2 changes: 1 addition & 1 deletion docs/customize/model-roles/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ icon: "book-open"

- [`chat`](/customize/model-roles/chat): Used for chat conversations in the extension sidebar
- [`autocomplete`](/customize/model-roles/autocomplete): Used for autocomplete code suggestions in the editor
- [`edit`](/customize/model-roles/edit): Used to generate code based on edit prompts
- [`edit`](/customize/model-roles/edit): Used to generate code based on edit instructions
- [`apply`](/customize/model-roles/apply): Used to decide how to apply edits to a file
- [`embed`](/customize/model-roles/embeddings): Used to generate embeddings used for vector search (@Codebase and @Docs context providers)
- [`rerank`](/customize/model-roles/reranking): Used to rerank results from vector search
Expand Down
23 changes: 10 additions & 13 deletions docs/hub/blocks/block-types.mdx
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
---
title: "Blocks: Models, Rules, Prompts, and MCP servers"
title: "Models, Rules, Prompts, and MCP servers"
sideBarTitle: "Block Types"
description: "Explore the different types of reusable blocks in Continue Hub including models, MCP servers, rules, and prompts"
---

## Models

Models are blocks that let you specify Large Language Models (LLMs) and other deep learning models to be used for various roles in the open-source IDE extension like Chat, Autocomplete, Edit, Embed, Rerank, etc. You can explore available models on [the hub](https://hub.continue.dev/explore/models).

Continue supports [many model providers](/customize/model-providers), including Anthropic, OpenAI, Gemini, Ollama, Amazon Bedrock, Azure, xAI, DeepSeek, and more. Models can have one or more of the following roles depending on its capabilities, including `chat`, `edit`, `apply`, `autocomplete`, `embed`, and `rerank`. Read more about roles [here](/customize/model-roles). View [`models`](/reference#models) in the YAML Reference for more details.
Models are blocks that let you specify Large Language Models (LLMs) and other deep learning models to be used for various roles in the open-source IDE extension like Chat, Autocomplete, Edit, Embed, Rerank, etc. You can explore available models on [the hub](https://hub.continue.dev/?type=models).

Continue supports [many model providers](/customize/model-providers), including Anthropic, OpenAI, Gemini, Ollama, Amazon Bedrock, Azure, xAI, DeepSeek, and more. Models can have one or more of the following roles depending on its capabilities, including `chat`, `edit`, `apply`, `autocomplete`, `embed`, and `rerank`.

Read more about roles [here](/customize/model-roles) and view [`models`](/reference#models) in the YAML Reference for more details.

## MCP Servers

Model Context Protocol (MCP) is a standard way of building and sharing tools for language models. MCP Servers can be defined in `mcpServers` blocks. [Explore MCP Servers](https://hub.continue.dev/explore/mcp) on the hub.
Model Context Protocol (MCP) is a standard way of building and sharing tools for language models. MCP Servers can be defined in `mcpServers` blocks.

Learn more in the [MCP deep dive](/customize/deep-dives/mcp), and view [`mcpServers`](/reference#mcpservers) in the YAML Reference for more details.
[Explore MCP Servers](https://hub.continue.dev/?type=mcpServers) on the Hub, learn more in the [MCP deep dive](/customize/deep-dives/mcp), and view [`mcpServers`](/reference#mcpservers) in the YAML Reference for more details.

## Rules

Rules blocks are instructions that your custom AI code agent will always keep in mind - the contents of rules are inserted into the system message for all Chat requests. [Explore rules](https://hub.continue.dev/explore/rules) on the hub.
Rules blocks are instructions that your custom AI code agent will always keep in mind - the contents of rules are inserted into the system message for all Chat, Plan, and Agent requests.

Learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details.
[Explore rules](https://hub.continue.dev/?type=rules) on the Hub, learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details.

## Prompts

Prompts blocks are pre-written, reusable prompts that can be referenced at any time during chat. They are especially useful as context for repetitive and/or complex tasks. [Explore prompts](https://hub.continue.dev/explore/prompts) on the hub.

Prompt blocks are pre-written, reusable prompts that can be referenced at any time during chat. They are especially useful as context for repetitive and/or complex tasks. [Explore prompts](https://hub.continue.dev/explore/prompts) on the hub.
Prompt blocks have the same syntax as [prompt files](/customize/deep-dives/prompts). The `config.yaml` spec for `prompts` can be found [here](/reference#prompts).

Prompts blocks are pre-written, reusable instructions that are used to kick off a task. They are especially useful as context for repetitive and/or complex tasks.

[Explore prompts](https://hub.continue.dev/?type=prompts) on the Hub, learn more in the [prompts deep dive](/customize/deep-dives/prompts), and view [`prompts`](/reference#prompts) in the YAML Reference for more details.
2 changes: 1 addition & 1 deletion docs/hub/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Continue Hub provides a centralized platform for managing the essential building
- **[Models](/hub/blocks/block-types#models)**: Discover and configure models from various providers
- **[MCP Tools](/hub/blocks/block-types#mcp-servers)**: Access and integrate Model Context Protocol tools to retrieve real-time data and take action
- **[Rules](/hub/blocks/block-types#rules)**: Define custom guidelines for your custom AI coding agent to follow
- **[Prompts](/hub/blocks/block-types#prompts)**: Create and share reusable prompts that kickoff your custom AI coding agent
- **[Prompts](/hub/blocks/block-types#prompts)**: Create and share reusable instructions that kickoff your agent

Continue Hub also makes it easy for engineering leaders to centrally [configure](/hub/secrets/secret-types) and [govern](/hub/governance/org-permissions) these resources for their organization.
Loading
Loading