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/customize/deep-dives/rules.md
+30-21Lines changed: 30 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -26,50 +26,50 @@ When in Agent mode, you can simply prompt the agent to create a rule for you usi
26
26
For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation.
27
27
:::
28
28
29
+
### `.continue/rules` folder
30
+
You can create project-specific rules by adding a `.continue/rules` folder to the root of your project and adding new rule files.
31
+
32
+
```yaml title="new-rule.yaml"
33
+
name: New rule
34
+
version: 0.0.1
35
+
schema: v1
36
+
rules:
37
+
- Always give concise responses
38
+
39
+
```
40
+
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`.
41
+
29
42
### Syntax
30
43
31
44
Rules blocks can be simple text, written in YAML configuration files, or as Markdown (`.md`) files. They can have the following properties:
32
45
33
46
-`name` (**required**): A display name/title for the rule
34
47
-`rule` (**required**): The text content of the rule
48
+
-`schema` (**required**): The schema version of the YAML file (e.g., `v1`)
35
49
-`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"]`).
36
50
37
-
```yaml title="config.yaml"
51
+
```yaml title=colors.yaml"
52
+
name: New rules
53
+
version: 0.0.1
54
+
schema: v1
38
55
rules:
39
-
- name: Color Themes
56
+
- name: Tailwind Color Themes
40
57
rule: |
41
58
When adding colors to components, use tailwind color classes.
42
59
Do NOT use explicit colors like text-gray-400. Instead, use theme colors.
43
-
44
-
The common available theme colors are:
45
-
- For normal text: foreground, description, description-muted
46
-
- For other text, icons, etc: success, warning, error, accent, link
47
-
- For general components background, border, border-focus
48
-
- For specific components:
49
-
50
-
Any of these colors can be used in tailwind e.g. bg-primary, text-success, border-error, hover:bg-list-hover, etc.
51
60
globs: "*/*.tsx"
52
61
```
53
-
54
-
## Chat System Message
55
-
56
-
Continue includes a simple default system message for [Chat](../../chat/how-to-use-it.md) and [Agent](../../agent/how-to-use-it.md) requests, to help the model provide reliable codeblock formats in its output.
57
-
58
-
This can be viewed in the rules section of the toolbar (see above), or visit the source code [here](https://github.com/continuedev/continue/blob/main/core/llm/constructMessages.ts#L4)
59
-
60
-
Advanced users can override this system message for a specific model if needed by using `chatOptions.baseSystemMessage`. See the [`config.yaml` reference](../../reference.md#models).
61
-
62
62
## `.continuerules`
63
63
64
64
:::warning
65
65
66
-
`.contninuerules`will be deprecarted in a future release. Please use `.continue/rules` instead.
66
+
`.contninuerules`will be deprecated in a future release. Please use the `.continue/rules` folder instead.
67
67
68
68
:::
69
69
70
70
You can create project-specific rules by adding a `.continuerules` file to the root of your project. This file is raw text and its full contents will be used as rules.
71
71
72
-
### Simple Examples
72
+
## Simple Examples
73
73
74
74
- If you want concise answers:
75
75
@@ -87,3 +87,12 @@ Whenever you are writing React code, make sure to
87
87
- use Tailwind CSS for styling
88
88
- modularize components into smaller, reusable pieces
89
89
```
90
+
91
+
## Chat System Message
92
+
93
+
Continue includes a simple default system message for [Chat](../../chat/how-to-use-it.md) and [Agent](../../agent/how-to-use-it.md) requests, to help the model provide reliable codeblock formats in its output.
94
+
95
+
This can be viewed in the rules section of the toolbar (see above), or visit the source code [here](https://github.com/continuedev/continue/blob/main/core/llm/constructMessages.ts#L4)
96
+
97
+
Advanced users can override this system message for a specific model if needed by using `chatOptions.baseSystemMessage`. See the [`config.yaml` reference](../../reference.md#models).
0 commit comments