| 1 | --- |
| 2 | title: "Creating Custom Prompts in Continue" |
| 3 | description: "Learn how to create reusable prompt files in Continue to streamline repetitive tasks, including examples for code reviews, security checks, and entity generation" |
| 4 | --- |
| 5 | |
| 6 | 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. |
| 7 | |
| 8 | <Info> |
| 9 | Prompts were previously defined in a `.prompt` file format, but for |
| 10 | consistency we now recommend using the same Markdown format as |
| 11 | [rules](./rules) and adding `alwaysApply: false` to the frontmatter so |
| 12 | that they are manually triggered. |
| 13 | </Info> |
| 14 | |
| 15 | ## Quick Start: How to Create Your First Prompt File |
| 16 | |
| 17 | Below is a quick example of setting up a prompt file: |
| 18 | |
| 19 | 1. Create a folder called `.continue/rules` at the top level of your workspace |
| 20 | 2. Add a file called `review-prompt.md` to this folder. |
| 21 | 3. Write the following contents to `review-prompt.md` and save. |
| 22 | |
| 23 | ```md title="review-prompt.md" |
| 24 | --- |
| 25 | name: Redux best practices review |
| 26 | alwaysApply: false |
| 27 | --- |
| 28 | |
| 29 | Review the currently open file for adherence to Redux best practices, as explained in their style guide at https://redux.js.org/style-guide/. |
| 30 | ``` |
| 31 | |
| 32 | 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. |
| 33 | |
| 34 | ## Example Prompt Templates for Common Use Cases |
| 35 | |
| 36 | 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). |
| 37 | |
| 38 | ### How to Create a Security Review Prompt |
| 39 | |
| 40 | ```md title="security-review.md" |
| 41 | --- |
| 42 | name: Security best practices review |
| 43 | alwaysApply: false |
| 44 | --- |
| 45 | |
| 46 | Review the changes in the current git diff for these security best practices: |
| 47 | |
| 48 | - Does the architecture follow security-by-design principles? |
| 49 | - Are there potential security vulnerabilities in the system design? |
| 50 | - Is sensitive data handled appropriately throughout the lifecycle? |
| 51 | ``` |
| 52 | |
| 53 | ### How to Create a Prompt That References Existing Files |
| 54 | |
| 55 | ```md title="typeorm-entity-generator.md" |
| 56 | --- |
| 57 | name: Generate a new TypeORM entity |
| 58 | alwaysApply: false |
| 59 | --- |
| 60 | |
| 61 | Referencing `src/db/dataSource.ts` and `src/db/entity/SampleEntity.ts`, generate a new TypeORM entity based on the following requirements: |
| 62 | ``` |