From a59a665a0c33c506c3c3980ead34983dc31f6763 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 9 Jun 2025 10:23:30 -0700 Subject: [PATCH 1/5] rename rules.md to mdx --- .../deep-dives/{rules.md => rules.mdx} | 64 ++++++++++++++----- 1 file changed, 48 insertions(+), 16 deletions(-) rename docs/docs/customize/deep-dives/{rules.md => rules.mdx} (74%) diff --git a/docs/docs/customize/deep-dives/rules.md b/docs/docs/customize/deep-dives/rules.mdx similarity index 74% rename from docs/docs/customize/deep-dives/rules.md rename to docs/docs/customize/deep-dives/rules.mdx index 36be61127..ff642197b 100644 --- a/docs/docs/customize/deep-dives/rules.md +++ b/docs/docs/customize/deep-dives/rules.mdx @@ -3,6 +3,9 @@ description: Rules are used to provide instructions to the model for Chat, Edit, keywords: [rules, .continuerules, system, prompt, message] --- +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + # Rules Rules provide instructions to the model for [Chat](../../chat/how-to-use-it.md), [Edit](../../edit/how-to-use-it.md), and [Agent](../../agent/how-to-use-it.md) requests. @@ -60,27 +63,56 @@ Rules blocks can be simple text, written in YAML configuration files, or as Mark - `name` (**required**): A display name/title for the rule - `rule` (**required**): The text content of the rule -- `schema` (**required**): The schema version of the YAML file (e.g., `v1`) +- `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"]`). -```yaml title=".config.yaml" -rules: - - Always annotate Python functions with their parameter and return types + + + ```yaml title="doc-standards.md" + --- + name: Documentation Standards + globs: docs/**/*.{md,mdx} + alwaysApply: false + description: Standards for writing and maintaining Continue Docs + --- - - name: TypeScript best practices - rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly. - globs: "**/*.{ts,tsx}" +# Continue Docs Standards - - name: TypeScript test patterns - rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking. - globs: - - "src/**/*.test.ts" - - "tests/**/*.ts" +- Follow Docusaurus documentation standards +- Include YAML frontmatter with title, description, and keywords +- Use consistent heading hierarchy starting with h2 (##) +- Include relevant Admonition components for tips, warnings, and info +- Use descriptive alt text for images +- Include cross-references to related documentation +- Reference other docs with relative paths +- Keep paragraphs concise and scannable +- Use code blocks with appropriate language tags - - uses: myprofile/my-mood-setter - with: - TONE: concise -``` + ```` + + + + ```yaml title="doc-standards.yaml" + name: Documentation Standards + globs: docs/**/*.{md,mdx} + alwaysApply: false + rules: + - name: Documentation Standards + rule: > + - Follow Docusaurus documentation standards + - Include YAML frontmatter with title, description, and keywords + - Use consistent heading hierarchy starting with h2 (##) + - Include relevant Admonition components for tips, warnings, and info + - Use descriptive alt text for images + - Include cross-references to related documentation + - Reference other docs with relative paths + - Keep paragraphs concise and scannable + - Use code blocks with appropriate language tags + ```` + + + + ### `.continue/rules` folder From 8d0780d259b12c3314bf6ff7652bc894adef8e7e Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 9 Jun 2025 10:27:42 -0700 Subject: [PATCH 2/5] swapped examples to markdown --- docs/docs/customize/deep-dives/rules.mdx | 62 ++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) 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 From 2a0e3639de9db2998cda72daed9ca6455065cb34 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 9 Jun 2025 11:28:36 -0700 Subject: [PATCH 3/5] fix broken links --- docs/docs/agent/how-to-customize.md | 2 +- docs/docs/blocks/rules.md | 2 +- docs/docs/chat/how-to-customize.md | 2 +- docs/docs/hub/blocks/block-types.md | 2 +- docs/docs/reference.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/agent/how-to-customize.md b/docs/docs/agent/how-to-customize.md index 495dd9547..a89f0f6b3 100644 --- a/docs/docs/agent/how-to-customize.md +++ b/docs/docs/agent/how-to-customize.md @@ -9,7 +9,7 @@ sidebar_position: 5 Adding Rules can be done in your assistant locally or in the Hub. -[Explore Rules on the Hub](https://hub.continue.dev/explore/rules) and see the [Rules deep dive](../customize/deep-dives/rules.md) for more details and tips on creating rules. +[Explore Rules on the Hub](https://hub.continue.dev/explore/rules) and see the [Rules deep dive](../customize/deep-dives/rules.mdx) for more details and tips on creating rules. ## Add MCP tools diff --git a/docs/docs/blocks/rules.md b/docs/docs/blocks/rules.md index c43a28b5a..4d106a24c 100644 --- a/docs/docs/blocks/rules.md +++ b/docs/docs/blocks/rules.md @@ -22,4 +22,4 @@ Your assistant detects rule blocks and applies the specified rules while in [Age ## Learn More -Learn more in the [rules deep dive](../customize/deep-dives/rules.md), and view [`rules`](../reference.md#rules) in the YAML Reference for more details. +Learn more in the [rules deep dive](../customize/deep-dives/rules.mdx), and view [`rules`](../reference.md#rules) in the YAML Reference for more details. diff --git a/docs/docs/chat/how-to-customize.md b/docs/docs/chat/how-to-customize.md index ce8c9ff1b..f0bf11019 100644 --- a/docs/docs/chat/how-to-customize.md +++ b/docs/docs/chat/how-to-customize.md @@ -7,7 +7,7 @@ sidebar_position: 5 There are a number of different ways to customize Chat: -- You can add a [`rules` block](../hub/blocks/block-types.md#rules) to your assistant to give the model persistent instructions through the system prompt. See the [rules deep dive](../customize/deep-dives/rules.md) for more information. +- You can add a [`rules` block](../hub/blocks/block-types.md#rules) to your assistant to give the model persistent instructions through the system prompt. See the [rules deep dive](../customize/deep-dives/rules.mdx) for more information. - You can configure [`@Codebase`](../customize/deep-dives/codebase.mdx) - You can configure [`@Docs`](../customize/deep-dives/docs.mdx) - You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.mdx) diff --git a/docs/docs/hub/blocks/block-types.md b/docs/docs/hub/blocks/block-types.md index 03b92c08a..127bef59e 100644 --- a/docs/docs/hub/blocks/block-types.md +++ b/docs/docs/hub/blocks/block-types.md @@ -35,7 +35,7 @@ Learn more in the [MCP deep dive](../../customize/deep-dives/mcp.mdx), and view Rules blocks are instructions that your custom AI code assistant 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. -Learn more in the [rules deep dive](../../customize/deep-dives/rules.md), and view [`rules`](../../reference.md#rules) in the YAML Reference for more details. +Learn more in the [rules deep dive](../../customize/deep-dives/rules.mdx), and view [`rules`](../../reference.md#rules) in the YAML Reference for more details. ## Prompts diff --git a/docs/docs/reference.md b/docs/docs/reference.md index cdaf35aeb..9ff1077f9 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -296,7 +296,7 @@ context: List of rules that the LLM should follow. These are concatenated into the system message for all [Chat](./chat/how-to-use-it.md), [Edit](./edit/how-to-use-it.md), and [Agent](./agent/how-to-use-it.md) requests. -See the [rules deep dive](./customize/deep-dives/rules.md) for details. +See the [rules deep dive](./customize/deep-dives/rules.mdx) for details. Explicit rules can either be simple text or an object with the following properties: From 405689bc41e42258f4580ee1299c852899476dd5 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 9 Jun 2025 16:05:07 -0700 Subject: [PATCH 4/5] new-rule.md --- docs/docs/customize/deep-dives/rules.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/customize/deep-dives/rules.mdx b/docs/docs/customize/deep-dives/rules.mdx index 5cccdbce3..132a8534c 100644 --- a/docs/docs/customize/deep-dives/rules.mdx +++ b/docs/docs/customize/deep-dives/rules.mdx @@ -125,7 +125,7 @@ name: New rule 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`. +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.md`. ### Examples From 7f99cbcb19d451b72522ba59dacd3fb0e0523457 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Tue, 10 Jun 2025 15:28:36 -0700 Subject: [PATCH 5/5] explicit alwaysApply example --- docs/docs/customize/deep-dives/rules.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/customize/deep-dives/rules.mdx b/docs/docs/customize/deep-dives/rules.mdx index 132a8534c..59c9c3894 100644 --- a/docs/docs/customize/deep-dives/rules.mdx +++ b/docs/docs/customize/deep-dives/rules.mdx @@ -62,8 +62,10 @@ 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** 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"]`). +- `alwaysApply`: true - Always include the rule, regardless of file context +- `alwaysApply`: false - Only include if globs exist AND match file context +- `alwaysApply`: undefined - Default behavior: include if no globs exist OR globs exist and match