Editor Rules
How to use Ultracite with Cursor, Windsurf or Zed.
Ultracite provides seamless integration with modern AI-powered code editors 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 Biome's linting and formatting. While Biome handles code formatting and catches syntax errors, the editor rules guide AI assistants to write better code from the start, reducing the need for fixes later.
This dual approach ensures both automated code quality (through Biome) and intelligent code generation (through editor rules).
Setup
Automatic Setup
When you run npx ultracite init
, you'll be prompted to select which editor rules you want to enable:
? Which editor rules do you want to enable (optional)?
◯ GitHub Copilot (VSCode)
◯ Cursor
◯ Windsurf
◯ Zed
◯ Claude Code
◯ OpenAI Codex
◯ Kiro IDE
This will create the relevant file in your project directory.
Manual Setup
If you want to manually create the rules file, you can do so by creating the relevant file in your project directory.
.cursor/rules/ultracite.mdc
for Cursor.windsurf/rules/ultracite.md
for Windsurf.rules
for Zed.github/copilot-instructions.md
for GitHub Copilot.claude/CLAUDE.md
for Claude Code./AGENTS.md
for OpenAI Codex
Then, copy and paste this content into the file.
Supported Editors
GitHub Copilot (VSCode)
Visual Studio Code automatically detects and applies rules from the .github/copilot-instructions.md
file. The rules are written in Markdown format and guide GitHub Copilot's AI to follow specific coding conventions.
As part of the Ultracite automatic setup, you can opt to create this file.
Cursor
Cursor is an AI-powered code editor built on top of Visual Studio Code. Cursor automatically detects and applies rules from the .cursor/rules/
directory. The rules are written in Markdown format and guide Cursor's AI to follow specific coding conventions.
As part of the Ultracite automatic setup, you can opt to create a .cursor/rules/ultracite.mdc
file that contains all the coding rules and conventions.
Windsurf
Windsurf is another AI-powered development environment. During the setup process, you can opt to create a .windsurf/rules/ultracite.md
file with the same comprehensive rule set. Similar to Cursor, Windsurf reads rules from the .windsurf/rules/
directory and applies them when generating code suggestions.
Zed
Zed is a high-performance, multiplayer code editor. During the setup process, you can opt to create a .rules
file in your project root. Zed uses the .rules
file to understand project-specific coding conventions and applies them when providing AI-powered code assistance.
Claude Code
Claude Code is a command-line AI bringing Claude’s raw power directly in your terminal. It lets you search million-line codebases instantly and turn hours-long workflows into a single command. During the setup process, you can opt to create a .claude/CLAUDE.md
file with the same comprehensive rule set.
OpenAI Codex
OpenAI Codex is an open-source local coding agent that runs in your command line interface. Pair with it to write, edit, and understand code. During the setup process, you can opt to create a ./AGENTS.md
file with the same comprehensive rule set.
Kiro IDE
Kiro IDE is an AI-powered code editor by Amazon, designed to bring vibe coding to the Enterprise. During the setup process, you can opt to create a .kiro/steering/linting-and-formatting.md
file with the same comprehensive rule set.
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:
- Modify existing rules: Edit the rule files directly
- Add project-specific rules: Append additional guidelines
- Disable rules: Remove or comment out rules that don't apply to your project