LogoNEXTDEVKIT Docs

Ruler - AI Agent Instructions

Centralized AI agent instruction management using Ruler

NEXTDEVKIT uses Ruler to centrally manage AI agent instructions across different AI coding assistants. This ensures consistent guidance and context for all AI tools you use in development.

What is Ruler?

Ruler is a centralized instruction management system that distributes your coding guidelines to multiple AI agents like GitHub Copilot, Claude, Cursor, Aider, and more. Instead of maintaining separate configuration files for each agent, Ruler provides a single source of truth.

Installation

Install Ruler globally using npm:

npm install -g @intellectronica/ruler

Or use it directly with npx:

npx @intellectronica/ruler apply

Quick Start

NEXTDEVKIT comes pre-configured with Ruler. To apply the existing rules to your AI agents:

# Navigate to your NEXTDEVKIT project root
cd your-nextdevkit-project

# Apply rules to all configured AI agents
ruler apply

This will automatically configure your AI agents with NEXTDEVKIT's coding standards and project context.

Target Specific AI Agents

If you prefer not to configure all AI agents, you can target specific ones:

# Configure only Cursor
ruler apply --agents cursor

# Configure multiple specific agents
ruler apply --agents cursor,claude,copilot

This allows you to selectively generate configuration files for only the AI tools you actually use.

For more AI IDEs and options, visit the official Ruler documentation.

Pre-configured Rules

NEXTDEVKIT includes the following pre-configured instruction files in the .ruler/ directory:

🏗️ Project Architecture (project-architecture.md)

  • Complete project structure overview
  • Technology stack details
  • Directory organization
  • Configuration system explanation

🛠️ Development Guidelines (development-guidelines.md)

  • Coding standards and best practices
  • Development workflow processes
  • Code review guidelines
  • Testing strategies

🔧 Core Functions (core-files-and-functions.md)

  • Essential file locations
  • Key function references
  • API usage patterns
  • Common utilities

⚡ Common Commands (common-commands.md)

  • Frequently used development commands
  • Deployment procedures
  • Database operations
  • Troubleshooting steps

Example Configuration

Here's what your Ruler setup includes:

# .ruler/ruler.toml
[agents.copilot]
enabled = true
output_path = ".github/copilot-instructions.md"

[agents.claude]
enabled = true
output_path = "CLAUDE.md"

[agents.cursor]
enabled = true
output_path = ".cursor/rules/ruler_cursor_instructions.mdc"

Supported AI Agents

Ruler works with these popular AI coding assistants:

  • GitHub Copilot.github/copilot-instructions.md
  • ClaudeCLAUDE.md
  • Cursor.cursor/rules/ruler_cursor_instructions.mdc
  • Aiderruler_aider_instructions.md
  • Windsurf.windsurf/rules/ruler_windsurf_instructions.md
  • Cline.clinerules

Customization

To add custom instructions:

  1. Create new .md files in the .ruler/ directory
  2. Run ruler apply to distribute to all agents
  3. Your custom rules will be combined with existing NEXTDEVKIT guidelines

For more advanced configuration options, visit the official Ruler documentation.

Benefits

  • Consistency: Same instructions across all AI tools
  • Efficiency: Single source of truth for all guidelines
  • Context: AI agents understand NEXTDEVKIT's architecture
  • Automation: No manual configuration of individual agents