Changesets · Branches · Tags · Compare
| Changeset | 5c65352c196aea4210954e5229d0945ebd6087de45109c28d20fa3c5132c47d5 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-06-22 23:16 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-06-22 23:16 -07:00 |
| Parents | 79297418933b |
1 file changed
modified docs/docs/customize/deep-dives/prompts.md +33 −72
| @@ -5,93 +5,54 @@ | ||
| 5 | 5 | 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. |
| 6 | 6 | |
| 7 | 7 | :::info |
| 8 | -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) | |
| 8 | +Prompts were previously defined in a `.prompt` file format, but for consistency we now recommend using the same Markdown format as [rules](./rules.mdx) and adding `alwaysApply: false` to the frontmatter so that they are manually triggered. | |
| 9 | 9 | ::: |
| 10 | 10 | |
| 11 | -## Examples | |
| 12 | - | |
| 13 | -Below are some examples to get you started. | |
| 14 | - | |
| 15 | -### Security review | |
| 16 | - | |
| 17 | -```text title="Security best practices review" | |
| 18 | -@open - Review these files for the following security best practices: | |
| 19 | -- Does the architecture follow security-by-design principles? | |
| 20 | -- Are there potential security vulnerabilities in the system design? | |
| 21 | -- Is sensitive data handled appropriately throughout the lifecycle? | |
| 22 | -``` | |
| 23 | - | |
| 24 | -### Reference best practice guides | |
| 25 | - | |
| 26 | -```text title="Redux best practices review" | |
| 27 | -@https://redux.js.org/style-guide/ | |
| 28 | -@currentFile | |
| 11 | +### Quick Start | |
| 29 | 12 | |
| 30 | -Review this code for adherence to Redux best practices. | |
| 31 | -``` | |
| 13 | +Below is a quick example of setting up a prompt file: | |
| 32 | 14 | |
| 33 | -### Pull in commonly used files for tasks | |
| 15 | +1. Create a folder called `.continue/rules` at the top level of your workspace | |
| 16 | +2. Add a file called `review-prompt.md` to this folder. | |
| 17 | +3. Write the following contents to `review-prompt.md` and save. | |
| 34 | 18 | |
| 35 | -```text title="Generate a new TypeORM entity" | |
| 36 | -@src/db/dataSource.ts @src/db/entity/SampleEntity.ts | |
| 19 | +```md title="review-prompt.md" | |
| 20 | +--- | |
| 21 | +name: Redux best practices review | |
| 22 | +alwaysApply: false | |
| 23 | +--- | |
| 37 | 24 | |
| 38 | -Use these files to generate a new TypeORM entity based on the following requirements: | |
| 25 | +Review the currently open file for adherence to Redux best practices, as explained in their style guide at https://redux.js.org/style-guide/. | |
| 39 | 26 | ``` |
| 40 | 27 | |
| 41 | -## Including Context Providers in your prompts | |
| 42 | - | |
| 43 | -Many [context providers](../context-providers.mdx) can be referenced by typing "@" followed by the name of the context provider. The currently supported list is: | |
| 44 | - | |
| 45 | -- `@terminal` - The contents of the terminal | |
| 46 | -- `@currentFile` - The currently active file | |
| 47 | -- `@open` - All open files | |
| 48 | -- `@os` - Information about the operating system | |
| 49 | -- `@problems` - Problems reported by the language server in the active file | |
| 50 | -- `@repo-map` - A map of files in the repository | |
| 51 | -- `@tree` - A tree view of the repository structure | |
| 52 | - | |
| 53 | -Or you can directly type URLs and file paths: | |
| 54 | - | |
| 55 | -- `@https://github.com/continuedev/continue` - The contents of a URL | |
| 56 | -- `@src/index.ts` - The contents of a file (VS Code only) | |
| 28 | +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. | |
| 57 | 29 | |
| 58 | -All references will be attached as context items, rather than injected directly inline. | |
| 30 | +## Further Examples | |
| 59 | 31 | |
| 60 | -## Local `.prompt` files | |
| 32 | +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). | |
| 61 | 33 | |
| 62 | -In addition to Prompt blocks on the Hub, you can also define prompts in local `.prompt` files, located in the `.continue/prompts` folder at the top level of your workspace. This is useful for quick iteration on prompts to test them out before pushing up to the Hub. | |
| 63 | - | |
| 64 | -### Quick Start | |
| 65 | - | |
| 66 | -Below is a quick example of setting up a prompt file: | |
| 67 | - | |
| 68 | -1. Create a folder called `.continue/prompts` at the top level of your workspace | |
| 69 | -2. Add a file called `test.prompt` to this folder. | |
| 70 | -3. Write the following contents to `test.prompt` and save. | |
| 34 | +### Security review | |
| 71 | 35 | |
| 72 | -```.prompt | |
| 73 | -name: Current file prompt | |
| 74 | -description: A test prompt using the current file context provider | |
| 36 | +```md title="security-review.md" | |
| 37 | +--- | |
| 38 | +name: Security best practices review | |
| 39 | +alwaysApply: false | |
| 75 | 40 | --- |
| 76 | -@currentFile | |
| 77 | -``` | |
| 78 | - | |
| 79 | -Now to use this prompt, you can open Chat, type <kbd>/</kbd>, select the prompt, and add type out some additional text such as "Review the code for any issues". | |
| 80 | - | |
| 81 | -### Format | |
| 82 | - | |
| 83 | -The format is inspired by [HumanLoops's .prompt file](https://docs.humanloop.com/docs/prompt-file-format), with additional templating to reference files, URLs, and context providers. | |
| 84 | 41 | |
| 85 | -:::info | |
| 86 | -The current state of this format is experimental and subject to change | |
| 87 | -::: | |
| 42 | +Review the changes in the current git diff for these security best practices: | |
| 88 | 43 | |
| 89 | -### Preamble | |
| 44 | +- Does the architecture follow security-by-design principles? | |
| 45 | +- Are there potential security vulnerabilities in the system design? | |
| 46 | +- Is sensitive data handled appropriately throughout the lifecycle? | |
| 47 | +``` | |
| 90 | 48 | |
| 91 | -The "preamble" is everything above the `---` separator, and lets you specify model parameters. It uses YAML syntax and currently supports the following parameters: | |
| 49 | +### Pull in commonly used files for tasks | |
| 92 | 50 | |
| 93 | -- `name` - The display title | |
| 94 | -- `description` - The description you will see in the dropdown | |
| 95 | -- `version` - Can be either "1" (for legacy prompt files) or "2" (this is the default and does not need to be set) | |
| 51 | +```md title="typeorm-entity-generator.md" | |
| 52 | +--- | |
| 53 | +name: Generate a new TypeORM entity | |
| 54 | +alwaysApply: false | |
| 55 | +--- | |
| 96 | 56 | |
| 97 | -If you don't need any of these parameters, you can leave out the preamble and do not need to include the `---` separator. | |
| 57 | +Referencing `src/db/dataSource.ts` and `src/db/entity/SampleEntity.ts`, generate a new TypeORM entity based on the following requirements: | |
| 58 | +``` |