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

# Rules

> Add reusable quality and analysis directives to your projects

<Note>
  **Jump to:** [Adding a Rule](#adding-a-rule) | [When to Use Rules](#when-to-use-rules) | [Templates as Rules](#using-templates-as-rules) | [Browse Rule Templates](#browse-rule-templates)
</Note>

Rules are reusable directives you attach to a project on the platform. Each rule has a **name** (a concise title describing what it enforces) and a **description** (the full instruction set the AI follows during generation). Rules persist across generations and can be shared with teams, reused across different projects, and applied across different languages depending on how flexible the constraint is. Add once, enforce everywhere.

## Adding a Rule

There are two ways to create and add rules on the platform:

<Tabs>
  <Tab title="From the Prompting Section">
    <Steps>
      <Step title="Open Your Project">
        Open your project on the platform.
      </Step>

      <Step title="Go to the Prompting Section">
        Navigate to the prompting section of your project. The project must be in the prompting phase to add or create rules from here.
      </Step>

      <Step title="Add or Create a Rule">
        Add an existing rule to your project, or create a new one by entering a **name** (a concise title, e.g., "Require Test Coverage") and a **description** (the full directive text).
      </Step>

      <Step title="Save">
        Save - the rule is enforced on all future generations for this project.
      </Step>
    </Steps>

    <Warning>
      Adding and creating rules from the prompting section is only available while the project is in the prompting phase. If the project is past the prompting phase, you can only remove rules that were already added. To create new rules at any time, use **Settings > Rules** instead.
    </Warning>
  </Tab>

  <Tab title="From Settings">
    <Steps>
      <Step title="Navigate to Settings">
        Open **Settings** on the platform.
      </Step>

      <Step title="Open the Rules Tab">
        Click the **Rules** tab.
      </Step>

      <Step title="Create a New Rule">
        Enter a **name** (a concise title) and a **description** (the full directive text). Browse the [rule templates](/templates/rules-overview) for ready-to-use descriptions you can paste in.
      </Step>

      <Step title="Save">
        Save - the rule is available to add to any project.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## When to Use Rules

Add a rule when you want a quality constraint enforced **consistently** - rather than repeating the same instruction in every prompt. Rules are ideal for standards that apply across projects and teams: test coverage requirements, code style enforcement, security analysis, and performance profiling.

Because rules can be shared with teams and reused across different projects and languages, they are especially valuable for organization-wide standards that should apply regardless of the specific codebase.

If you need a constraint for a single generation only, include it directly in your prompt instead.

## Using Templates as Rules

The [rule templates](/templates/rules-overview) provide 10 ready-to-use directive descriptions covering common quality and analysis dimensions. Copy a template's description text and paste it into a new rule on the platform.

You can also write your own custom rules from scratch. Custom rules follow the same format: a **name** and a **description**. Write the description as a directive - state what the AI should do, what patterns are forbidden, and what validation criteria apply.

## Browse Rule Templates

<Card title="Rule Templates" icon="scale-balanced" href="/templates/rules-overview">
  View all available rule templates and their descriptions
</Card>
