---
title: Rules
description: Generate editor rule files for Cursor, Claude Code, and other AI tools so code suggestions start closer to your repo standards.
---

Ultracite provides seamless integration with AI coding assistants by automatically generating editor-specific rule files. These rules help guide AI assistants to write better, more consistent code that follows best practices.

The editor rules work alongside your linter's formatting and linting. While your linter handles code formatting and catches errors, the editor rules guide AI assistants to write better code from the start, reducing the need for fixes later.

The generated rules intentionally focus on code quality and implementation guidance instead of hardcoding formatter-specific settings like line width, quote style, or trailing commas. That keeps the rules portable across repositories while still letting each project's configured formatter stay in charge.

This dual approach ensures both automated code quality (through linting) and intelligent code generation (through AI coding rules).

## Setup

### Automatic Setup

When you run `npx ultracite init`, you'll be prompted to select which agent files you want to add:

```bash
? Which agent files do you want to add (optional)?
  ◯ Universal (creates AGENTS.md for Codex, Jules, Devin, and more)
  ◯ Claude (creates .claude/CLAUDE.md)
  ◯ Replit (creates replit.md)
  # ... and more
```

This will create the relevant rule file(s) in your project directory.

### Manual Setup

If you want to manually set things up, create the relevant file in your project directory. You can find the rule file location for each agent on their respective pages. Then, copy and paste [this content](https://github.com/haydenbleasel/ultracite/blob/main/packages/data/src/rules.ts) into the file.

## Supported Agents

Ultracite supports a wide range of AI coding assistants. Check the **Agents** section in the navigation bar for the full list of supported agents, including setup instructions and configuration details for each one.

## Reusable Skills

If your AI tool supports installable reusable skills, see the [Agent Skills](/skills) guide. The global Ultracite skill gives you the same baseline guidance across repositories while leaving formatting decisions to each repo's configured linter and formatter.

## Benefits

Using Ultracite editor rules provides several advantages:

- **Consistency**: All AI-generated code follows the same conventions
- **Quality**: Rules enforce best practices and prevent common mistakes
- **Accessibility**: Built-in accessibility guidelines ensure inclusive code
- **Performance**: Rules promote efficient patterns and avoid anti-patterns
- **Security**: Guidelines help prevent common security vulnerabilities

## Customization

While the default rules are comprehensive, you can customize them for your specific needs:

1. **Modify existing rules**: Edit the rule files directly
2. **Add project-specific rules**: Append additional guidelines
3. **Disable rules**: Remove or comment out rules that don't apply to your project
