> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kombai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

> Rules provide project-level or global instructions for Kombai. With rules, you can control Kombai's behavior across your projects. For example, you can enforce specific coding standards, architectural patterns, and output formats.

export const DeleteIcon = props => {
  return <div style={{
    display: "inline",
    justifyContent: "center",
    alignItems: "center"
  }}>
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" stroke="currentColor" strokeWidth="0" style={{
    cursor: "pointer",
    display: "inline"
  }} {...props}>
        <g transform="scale(1.5)">
          <path fillRule="evenodd" clipRule="evenodd" d="M10 3h3v1h-1v9l-1 1H4l-1-1V4H2V3h3V2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1zM9 2H6v1h3V2zM4 13h7V4H4v9zm2-8H5v7h1V5zm1 0h1v7H7V5zm2 0h1v7H9V5z" />
        </g>
      </svg>
    </div>;
};

export const EditIcon = props => {
  return <div style={{
    display: "inline",
    justifyContent: "center",
    alignItems: "center"
  }}>
      <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-pen" style={{
    cursor: "pointer",
    display: "inline"
  }} {...props}>
        <path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"></path>
      </svg>
    </div>;
};

## Project rules

Project rules are stored in `.kombai/rules`. Monorepos can include separate `./kombai/rules` directories for each project. Project rules allow you to enforce crucial project-specific instructions like naming conventions, folder structure, and internationalization.

Examples of project rules:

1. Generate new UI components only inside `src/ui/components/` and route files only inside `src/app/routes/`.
2. All visible text must be sourced from a translation system, not hard-coded strings.

## User rules

User rules are global instructions defined in your system's home directory (`~/.kombai/rules/`). They allow you to enforce instructions you want to apply across all your projects.

Examples of user rules:

1. Always respond in Turkish. Write all the texts and alt-texts used in the code in Turkish.
   <Note>
     Only the LLM responses will be in the specified language. The rest of the
     tool's interface will remain in English.
   </Note>
2. Use a default dark theme on all new components and pages.

## Organizing rules

You can keep multiple rule files side by side in the `.kombai/rules` directory to organize your rules across separate files.

<Note>
  Rules are loaded from the direct contents of the `.kombai/rules` directory
  only. Rule files placed in nested subfolders are not picked up.
</Note>

## AGENTS.md

`AGENTS.md` is a rule file for AI agents. Use it as an alternative to `.kombai/rules`. It can be global or local to a project.

Kombai automatically picks up the `AGENTS.md` file stored in the project (as a Project Rule). For global instructions, create an `AGENTS.md` file in your system's home directory (`~/AGENTS.md`); Kombai auto-detects it as a User Rule. If you don't want an auto-detected `AGENTS.md` applied, you can exclude it from the **Rules, Commands & Skills** page in Settings by clicking the <DeleteIcon /> icon next to it and confirming. This only excludes the file; it is not deleted from disk.

## Manage rules

Rules can be managed through the **Rules, Commands & Skills** page in Settings.

Kombai automatically picks up any rule file stored in the project, and lists rules under the **Individual** tab, grouped as **User Rules** (global rules stored in `~/.kombai/rules/`) and **Project Rules** (stored in `.kombai/rules/`). Click **Refresh** at the top of the page to re-scan the lists from disk.

### Create a rule

To create a rule:

1. Click the gear icon below the chat input box to open Settings.
2. Select the **Rules, Commands & Skills** tab from the left menu.
3. Click the **+ Add** dropdown next to **Rules** and select **Create User Rule** or **Create Project Rule**.
4. Enter a name for the rule and click **Create**. Kombai creates a markdown file for it in your home `.kombai` folder (User Rule) or your project's `.kombai` folder (Project Rule).

### Import a rule

Use this to bring in an existing rule file or folder, such as an `AGENTS.md` or a rules file from another tool.

1. Click the gear icon below the chat input box to open Settings.
2. Select the **Rules, Commands & Skills** tab from the left menu.
3. Click the **+ Add** dropdown next to **Rules** and select **Import User Rules** or **Import Project Rules**.
4. Browse to and select the rule file or folder you want to import.

### Delete a rule

To delete a rule:

1. Click the gear icon below the chat input box to open Settings.
2. Select the **Rules, Commands & Skills** tab from the left menu.
3. Click the <DeleteIcon /> icon next to the rule you want to remove, under **User Rules** or **Project Rules**, and confirm.

### Modify a rule

To modify a rule:

1. Click the gear icon below the chat input box to open Settings.
2. Select the **Rules, Commands & Skills** tab from the left menu.
3. Click <EditIcon /> next to the rule you want to modify, under **User Rules** or **Project Rules**.
4. Edit the newly opened rule file and save it.

## Team rules

Team rules let you share and discover rules across your team. Publish your local rules for team members to use, or use rules shared by others.

<Note>You need to be part of the Team plan to use team rules.</Note>

### Publish a rule

You can publish any local rule from your repo to your team. To publish a rule:

1. Click the gear icon below the chat input box to open Settings.
2. Select the **Rules, Commands & Skills** tab from the left menu.
3. Switch to the **Team** tab and go to the **Team Rules** section.
4. Under **Publish Your Rules**, select the local rules you want to publish from the dropdown.
5. Click the **Publish** button.

The rule will now be available to all members of your team.

<Note>
  You must have local rules added in the **Rules** tab before you can publish
  them.
</Note>

### Discover and use team rules

The **Team Rules** section (in the **Team** tab) lists all rules published by members of your team. You can search for rules by name or author using the search bar at the top of the list.
