# AI rules for AI-assisted development

> AI rules for AI-assisted development

Source: https://docs.uniform.app/docs/guides/ai/ai-rules

By default, LLM's knowledge of Uniform will be limited to what was indexed by LLM using public internet and subject to the cutoff date.
To enhance your prompting with the latest knowledge of Uniform, it is highly recommended to feed Uniform-specific AI rules into your LLM context.

## AI rules library

That's why we are maintaining the library of Uniform-specific rules to help your LLM tools work with better accuracy.
Feeding these rules to your LLM will help it understand the context of the project and the specific requirements of Uniform.

You can find the library of rules [here](https://github.com/uniformdev/ai-rules).

### Must-have rules

1. `rules/uniform.mdc` - describes the core principles and concepts of Uniform
2. `rules/uniform-sdk.mdc` - describes the Uniform SDK and its capabilities

### Framework-specific rules

1. `rules/uniform-next-page-router.mdc` - for Next.js Page Router
2. `rules/uniform-next-app-router.mdc` - for Next.js App Router

### Optional rules

The rules files under `rules/optional-personal-preferences` contain non-essential rules that contain alternative defaults, highly recommended to review those and adjust to your liking.

## How to use AI rules

To use AI rules, you need to add them to your LLM context. This varies per AI tool.

### CLI Installation (Recommended)

The easiest way to install AI rules is using the Uniform CLI. This method supports both Cursor and Claude Code:

```bash
npx @uniformdev/cli@latest ai rules install
```

This command will automatically download and configure the AI rules for your project, placing them in the appropriate location for your AI tool.

### Manual Setup

If you prefer to set up the rules manually or need custom configuration, you can follow the instructions below.

#### Setup with Cursor

1. Download the rules from the [GitHub repository](https://github.com/uniformdev/ai-rules) and place them in the `.cursor` folder in your project root.
2. Open a new chat window and add the desired rules into your context when working with Uniform.

![Add AI rules to your context](https://docs.uniform.app/images/guides/ai/cursor-add-rules-to-context.png)

#### Claude Code and other tools

Point Claude Code to the folder with the rules to augment its understanding of Uniform specifics.
