AI Rules

AI Rules

Learn about the AI assistant rules included with Nuxt AI.

Nuxt AI includes a set of pre-defined rules that can be used with AI assistants like Cursor and Claude to enhance your development workflow.

What are AI Rules?

AI rules are configuration files that provide context and instructions to AI assistants when working with your codebase. They help the AI understand:

  • The structure and purpose of your project
  • Coding standards and conventions
  • Best practices for specific frameworks or libraries
  • Documentation requirements

Different AI assistants use different formats for rules:

  • Cursor uses .mdc files in the .cursor/rules directory
  • Claude can use standard Markdown (.md) files
  • Other AI assistants may have their own formats

Rules in Nuxt AI

Nuxt AI generates and manages rules for various AI assistants, focusing on:

  1. Project Structure - Understanding the Nuxt project layout and key files
  2. Nuxt Best Practices - Guidelines for working with the Nuxt ecosystem
  3. Typescript - Guidelines for working with Typescript

Benefits of AI Rules

Using AI rules provides several benefits:

  • Consistency - Ensure AI assistants follow your project's conventions
  • Efficiency - Reduce the need to repeatedly explain your project to AI
  • Quality - Guide AI to produce higher-quality code and suggestions
  • Learning - AI can learn from your existing patterns and best practices

Getting Started

By default, Nuxt AI will generate rules for Cursor in the .cursor/rules directory. You can configure this behavior in your nuxt.config.ts file:

nuxt.config.ts
export default defineNuxtConfig({
  ai: {
    dev: {
      client: 'cursor', // Choose between 'cursor' or 'claude'
      rules: {
        enabled: true
      }
    }
  }
})