> For the complete documentation index, see [llms.txt](https://docs.codemate.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemate.ai/work/rules.md).

# Rules

Rules allow you to create reusable instructions that guide how CodeMate Work responds to your requests. They can be used to apply project-specific requirements, team guidelines, or preferred ways of working consistently across conversations.

For example, you can create a rulebook that instructs Work to follow specific coding conventions, use a particular response format, or follow project guidelines.

<img src="https://2395938751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8BnJrGJwy0hT6DEkmb4%2Fuploads%2F0hh3N9gaXoclJnXlcoh0%2Funknown.png?alt=media&amp;token=24c9e547-ff78-424d-a922-067c5cbe4b4b" alt="" height="238" width="488">

<br>

### Creating a Rule

**1. Open Rules**

Open the Rules section in the CodeMate Work interface.

**2. Create a new Rulebook**

Click + New and select Create new rule.&#x20;

**3. Add Rulebook details**

Enter a name for the rulebook and provide the instructions you want Work to follow.

**4. Save the rulebook**

Save the rulebook to add it to your available rulebooks.

<img src="https://2395938751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8BnJrGJwy0hT6DEkmb4%2Fuploads%2FBD6LCYv77RZVyGH7GUmb%2Funknown.png?alt=media&amp;token=5cda787c-7636-479d-8789-54394e0625f4" alt="" height="261" width="500">

### Applying a Rule

Once a rulebook has been created, you can apply it to a Work conversation when you want its instructions to guide the response.

**1. Mention the Rule**

In the conversation input, type @ to open the available rules.

**2. Select a Rule**

Choose the rulebook you want to apply to the conversation.

**3. Send your request**

Enter your request and submit it. Work will use the selected rulebook's instructions while processing the request.

<img src="https://2395938751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8BnJrGJwy0hT6DEkmb4%2Fuploads%2Fu2yEexjPeS1n3PYH7oXo%2Funknown.png?alt=media&amp;token=782f3c1c-51d6-4245-9d0d-1485e508a992" alt="" height="265" width="515">

### Managing Rules

The Rules section provides a centralized view of your rulebooks. You can review existing rulebooks, edit their instructions, enable or disable them, or delete rulebooks that are no longer needed.
