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

# Rule repository

> Browse and manage alert rule templates, with support for data source type classification, sharing, and import

The rule repository provides a template management mechanism for alert rules. You can save commonly used alert rules as templates for team reuse and quick import into the alert rules list.

**Menu Entry**: Rule Repository

## Browse by data source type

The rule repository homepage displays all available data source types as cards. Click a data source type (e.g., Prometheus, MySQL) to view all rule templates under that type.

You can filter data source types by name using the search box.

## Rule template list

After clicking a data source type, a side drawer displays the rule templates for that type with the following information:

| Column          | Description                            |
| --------------- | -------------------------------------- |
| **Description** | Description text for the rule template |
| **Visibility**  | Private, tenant-visible, or public     |
| **Contributor** | Creator information and update time    |

Search by description content is supported.

## Create a rule template

<Steps>
  <Step title="Click New">
    Click the **New Ruleset** button in the rule template list.
  </Step>

  <Step title="Fill in the form">
    | Config Item      | Description                                                |
    | ---------------- | ---------------------------------------------------------- |
    | **Description**  | Description text for the rule template                     |
    | **Visibility**   | Controls who can see and use this template                 |
    | **Rule Content** | Define alert rules in JSON format, with formatting support |
  </Step>

  <Step title="Set visibility">
    Rule templates support three visibility levels:

    | Visibility         | Description                                  |
    | ------------------ | -------------------------------------------- |
    | **Private**        | Visible only to the creator                  |
    | **Tenant-visible** | Visible to all members under the same tenant |
    | **Public**         | Visible to all users                         |
  </Step>

  <Step title="Save">
    Click **OK** to complete creation.
  </Step>
</Steps>

## Edit and delete

Only the template creator (or the primary account of the same tenant) can edit and delete templates.

* **View**: Click the description text or the **View** button to see the template details.
* **Edit**: Click the **Edit** button to modify template information.
* **Delete**: Click the **Delete** button and confirm to delete the template.

## Import from the rule repository

The **Import** entry in the alert rules list no longer offers a "Rule Repository" mode. Templates are now imported directly from the rule repository page:

<Steps>
  <Step title="Open template details">
    Click a template's description in the rule template list to open the template detail drawer.
  </Step>

  <Step title="Select the rules to import">
    Check the rules to import in the detail drawer. Click the inline **Import** button to import a single rule, or check several rules and click **Bulk import** to import them together.
  </Step>

  <Step title="Select the target group and channel">
    Choose the **group** to import the rules into and the **channel** for event delivery, then click OK to complete the import.
  </Step>
</Steps>

After the import, the page reports how many rules were imported, skipped, and invalid; rules with the same name are skipped by default. For the file-upload import flow of the alert rules list, see [Import alert rules](/en/monitors/quickstart/quickstart#import-alert-rules).
