You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/agent/how-to-customize.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ sidebar_position: 5
9
9
10
10
Adding Rules can be done in your assistant locally or in the Hub.
11
11
12
-
[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.
12
+
[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.
Copy file name to clipboardExpand all lines: docs/docs/blocks/rules.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,4 @@ Your assistant detects rule blocks and applies the specified rules while in [Age
22
22
23
23
## Learn More
24
24
25
-
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.
25
+
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.
Copy file name to clipboardExpand all lines: docs/docs/chat/how-to-customize.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ sidebar_position: 5
7
7
8
8
There are a number of different ways to customize Chat:
9
9
10
-
- 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.
10
+
- 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.
11
11
- You can configure [`@Codebase`](../customize/deep-dives/codebase.mdx)
12
12
- You can configure [`@Docs`](../customize/deep-dives/docs.mdx)
13
13
- You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.mdx)
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.
@@ -23,15 +26,15 @@ To form the system message, rules are joined with new lines, in the order they a
23
26
Below is a quick example of setting up a new rule file:
24
27
25
28
1. Create a folder called `.continue/rules` at the top level of your workspace
26
-
2. Add a file called `pirates-rule.yaml` to this folder.
27
-
3. Write the following contents to `pirates-rule.prompt` and save.
29
+
2. Add a file called `pirates-rule.md` to this folder.
30
+
3. Write the following contents to `pirates-rule.md` and save.
28
31
29
-
```yaml title=".continue/rules/pirates-rule.yaml"
32
+
```md title=".continue/rules/pirates-rule.md"
33
+
---
30
34
name: Pirate rule
31
-
version: 0.0.1
32
-
schema: v1
33
-
rules:
34
-
- Talk like a pirate.
35
+
---
36
+
37
+
- Talk like a pirate.
35
38
```
36
39
37
40
Now test your rules by asking a question about a file in chat.
@@ -58,68 +61,101 @@ Explore available rules [here](https://hub.continue.dev/explore/rules), or [crea
58
61
59
62
Rules blocks can be simple text, written in YAML configuration files, or as Markdown (`.md`) files. They can have the following properties:
60
63
61
-
- `name` (**required**): A display name/title for the rule
62
-
- `rule` (**required**): The text content of the rule
63
-
- `schema` (**required**): The schema version of the YAML file (e.g., `v1`)
64
+
-`name` (**required** for YAML): A display name/title for the rule
64
65
-`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"]`).
65
-
66
-
```yaml title=".config.yaml"
67
-
rules:
68
-
- Always annotate Python functions with their parameter and return types
69
-
70
-
- name: TypeScript best practices
71
-
rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
72
-
globs: "**/*.{ts,tsx}"
73
-
74
-
- name: TypeScript test patterns
75
-
rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
76
-
globs:
77
-
- "src/**/*.test.ts"
78
-
- "tests/**/*.ts"
79
-
80
-
- uses: myprofile/my-mood-setter
81
-
with:
82
-
TONE: concise
83
-
```
66
+
-`alwaysApply`: true - Always include the rule, regardless of file context
67
+
-`alwaysApply`: false - Only include if globs exist AND match file context
68
+
-`alwaysApply`: undefined - Default behavior: include if no globs exist OR globs exist and match
69
+
70
+
<TabsgroupId="rules-example">
71
+
<TabItemvalue="md"label="Markdown">
72
+
```yaml title="doc-standards.md"
73
+
---
74
+
name: Documentation Standards
75
+
globs: docs/**/*.{md,mdx}
76
+
alwaysApply: false
77
+
description: Standards for writing and maintaining Continue Docs
78
+
---
79
+
80
+
# Continue Docs Standards
81
+
82
+
- Follow Docusaurus documentation standards
83
+
- Include YAML frontmatter with title, description, and keywords
84
+
- Use consistent heading hierarchy starting with h2 (##)
85
+
- Include relevant Admonition components for tips, warnings, and info
86
+
- Use descriptive alt text for images
87
+
- Include cross-references to related documentation
88
+
- Reference other docs with relative paths
89
+
- Keep paragraphs concise and scannable
90
+
- Use code blocks with appropriate language tags
91
+
92
+
````
93
+
</TabItem>
94
+
<TabItem value="yaml" label="YAML">
95
+
96
+
```yaml title="doc-standards.yaml"
97
+
name: Documentation Standards
98
+
globs: docs/**/*.{md,mdx}
99
+
alwaysApply: false
100
+
rules:
101
+
- name: Documentation Standards
102
+
rule: >
103
+
- Follow Docusaurus documentation standards
104
+
- Include YAML frontmatter with title, description, and keywords
105
+
- Use consistent heading hierarchy starting with h2 (##)
106
+
- Include relevant Admonition components for tips, warnings, and info
107
+
- Use descriptive alt text for images
108
+
- Include cross-references to related documentation
109
+
- Reference other docs with relative paths
110
+
- Keep paragraphs concise and scannable
111
+
- Use code blocks with appropriate language tags
112
+
````
113
+
114
+
</TabItem>
115
+
116
+
</Tabs>
84
117
85
118
### `.continue/rules` folder
86
119
87
120
You can create project-specific rules by adding a `.continue/rules` folder to the root of your project and adding new rule files.
88
121
89
-
```yaml title=".continue/rules/new-rule.yaml"
122
+
```md title=".continue/rules/new-rule.md"
123
+
---
90
124
name: New rule
91
-
version: 0.0.1
92
-
schema: v1
93
-
rules:
94
-
- Always give concise responses
125
+
---
126
+
127
+
Always give concise responses
95
128
```
96
129
97
-
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`.
130
+
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`.
98
131
99
132
### Examples
100
133
101
134
If you want concise answers:
102
135
103
-
```yaml title=".continue/rules/concise-rule.yaml"
104
-
rules:
105
-
- name: Always give concise answers
106
-
rule: |
107
-
Please provide concise answers. Don't explain obvious concepts.
108
-
You can assume that I am knowledgable about most programming topics.
136
+
```md title=".continue/rules/concise-rule.md"
137
+
---
138
+
name: Always give concise answers
139
+
---
140
+
141
+
Please provide concise answers. Don't explain obvious concepts.
142
+
You can assume that I am knowledgable about most programming topics.
109
143
```
110
144
111
145
If you want to ensure certain practices are followed, for example in React:
Copy file name to clipboardExpand all lines: docs/docs/hub/blocks/block-types.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Learn more in the [MCP deep dive](../../customize/deep-dives/mcp.mdx), and view
35
35
36
36
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.
37
37
38
-
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.
38
+
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.
0 commit comments