diff --git a/docs/docs/customize/deep-dives/rules.mdx b/docs/docs/customize/deep-dives/rules.mdx index ff642197b..5cccdbce3 100644 --- a/docs/docs/customize/deep-dives/rules.mdx +++ b/docs/docs/customize/deep-dives/rules.mdx @@ -26,15 +26,15 @@ To form the system message, rules are joined with new lines, in the order they a Below is a quick example of setting up a new rule file: 1. Create a folder called `.continue/rules` at the top level of your workspace -2. Add a file called `pirates-rule.yaml` to this folder. -3. Write the following contents to `pirates-rule.prompt` and save. +2. Add a file called `pirates-rule.md` to this folder. +3. Write the following contents to `pirates-rule.md` and save. -```yaml title=".continue/rules/pirates-rule.yaml" +```md title=".continue/rules/pirates-rule.md" +--- name: Pirate rule -version: 0.0.1 -schema: v1 -rules: - - Talk like a pirate. +--- + +- Talk like a pirate. ``` Now test your rules by asking a question about a file in chat. @@ -61,8 +61,7 @@ Explore available rules [here](https://hub.continue.dev/explore/rules), or [crea Rules blocks can be simple text, written in YAML configuration files, or as Markdown (`.md`) files. They can have the following properties: -- `name` (**required**): A display name/title for the rule -- `rule` (**required**): The text content of the rule +- `name` (**required** for YAML): A display name/title for the rule - `alwaysApply` (optional): Always include the rule, regardless of file context - `globs` (optional): When files are provided as context that match this glob pattern, the rule will be included. This can be either a single pattern (e.g., `"**/*.{ts,tsx}"`) or an array of patterns (e.g., `["src/**/*.ts", "tests/**/*.ts"]`). @@ -118,12 +117,12 @@ Rules blocks can be simple text, written in YAML configuration files, or as Mark You can create project-specific rules by adding a `.continue/rules` folder to the root of your project and adding new rule files. -```yaml title=".continue/rules/new-rule.yaml" +```md title=".continue/rules/new-rule.md" +--- name: New rule -version: 0.0.1 -schema: v1 -rules: - - Always give concise responses +--- + +Always give concise responses ``` This is also done when selecting "Add Rule" in the Assistant settings. This will create a new folder in `.continue/rules` with a default file named `new-rule.yaml`. @@ -132,26 +131,29 @@ This is also done when selecting "Add Rule" in the Assistant settings. This will If you want concise answers: -```yaml title=".continue/rules/concise-rule.yaml" -rules: - - name: Always give concise answers - rule: | - Please provide concise answers. Don't explain obvious concepts. - You can assume that I am knowledgable about most programming topics. +```md title=".continue/rules/concise-rule.md" +--- +name: Always give concise answers +--- + +Please provide concise answers. Don't explain obvious concepts. +You can assume that I am knowledgable about most programming topics. ``` If you want to ensure certain practices are followed, for example in React: -```yaml title=".continue/rules/functional-rule.yaml" -rules: - - name: Always use functional components - rule: | - Whenever you are writing React code, make sure to - - use functional components instead of class components - - use hooks for state management - - define an interface for your component props - - use Tailwind CSS for styling - - modularize components into smaller, reusable pieces +```md title=".continue/rules/functional-rule.md" +--- +name: Always use functional components +--- + +Whenever you are writing React code, make sure to + +- use functional components instead of class components +- use hooks for state management +- define an interface for your component props +- use Tailwind CSS for styling +- modularize components into smaller, reusable pieces ``` ### Chat System Message