Cursor Rules for Building Agents

Use .cursorrules to improve AI coding assistant suggestions when building agents with Kern

A .cursorrules file teaches AI coding assistants (like Cursor, Windsurf) how to build better agents with Kern.

What is .cursorrules?

.cursorrules is a configuration file that provides your AI coding assistant with instructions on how to generate specific code. Kern's recommended .cursorrules file contains:

  • Kern-specific patterns and best practices
  • Correct parameter names and syntax
  • Common mistakes to avoid
  • When to use Agent vs Team vs Workflow

Think of it as a reference guide that helps your AI assistant build agents correctly with Kern.

Why Use It?

Without .cursorrules, AI assistants might suggest:

  • Wrong parameter names (like agents= instead of members= for Teams)
  • Outdated patterns or incorrect syntax
  • Performance anti-patterns (creating agents in loops)
  • Non-existent methods or features

With .cursorrules, your AI will:

  • Suggest correct Kern patterns automatically
  • Follow performance best practices
  • Use the right approach for your use case
  • Catch common mistakes before you make them

How to Use .cursorrules

Copy the Kern .cursorrules file to your project root:

1# Download the .cursorrules file
2curl -o .cursorrules https://raw.githubusercontent.com/kern-agi/kern/main/.cursorrules
3
4# Or clone and copy
5git clone https://github.com/kern-ai/kern.git
6cp kern/.cursorrules /path/to/your/project/

Your AI assistant (Cursor, Windsurf, etc.) will automatically detect and use it.

github

View .cursorrules on GitHub

View the full .cursorrules file for building agents with Kern

IDE Support

.cursorrules works with:

  • Cursor - Automatic detection
  • Windsurf - Native support
  • Other AI assistants - Support may vary depending on integration

Learn More

For detailed examples and patterns:

Note

The .cursorrules file is focused on building agents with Kern. If you're contributing to the Kern framework itself, that will be covered separately.