Adding Laminar cursor rules to Cursor
This guide explains how to set up Cursor rules to enhance your development experience when working with Laminar, the open-source platform for tracing and evaluating AI applications.
What are Cursor Rules?
Cursor rules are persistent instructions that provide context and guidance to the Cursor AI editor. They help maintain consistent coding patterns, enforce best practices, and automate common workflows specific to your project or technology stack.
Why Use Laminar Cursor Rules?
Laminar cursor rules help you:
- Maintain consistent Laminar implementation patterns
- Automatically apply observability best practices
- Reduce setup time for new AI features
- Ensure proper instrumentation and tracing
- Follow Laminar’s recommended coding conventions
Method 1: Using the CLI Command (Recommended)
The easiest way to add Laminar cursor rules is using the official CLI command.
Prerequisites
Make sure you have the Laminar Python SDK of at least version 0.6.6
installed:
Add Cursor Rules
Run the following command in the folder where you want to add the rules:
This command will:
- Create the
.cursor/rules
directory if it doesn’t exist - Download the latest official Laminar cursor rules
- Save them as
laminar.mdc
in your.cursor/rules
folder - Automatically configure the rules for your project
Verify Installation
After running the command, you should see:
- A new
.cursor/rules/laminar.mdc
file in your project - The rules appearing in your Cursor editor (go to
Cursor Settings > Rules
)
After adding the rules, you must reload your Cursor editor window for the rules to take effect. Use Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux) to open the command palette, type Reload Window
, and press Enter.
Method 2: Manual Download
If you prefer to manually add the rules or the CLI command isn’t available, you can download the official rules file directly.
Step 1: Download the Rules File
Click this link to download the official Laminar cursor rules: Download laminar.mdc
Right-click the link and select “Save As” to download the file.
Step 2: Create Rules Directory
In your project root, create the cursor rules directory structure:
Step 3: Add the Rules File
Place the downloaded laminar.mdc
file in the .cursor/rules
directory:
After adding the rules file, you must reload your Cursor editor window for the rules to take effect. Use Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux) to open the command palette, type Reload Window
, and press Enter.
Step 4: Verify in Cursor
- After reloading, go to
Cursor Settings > Rules
- You should see the Laminar rule listed and active
Using the Laminar Rules
Now that you have the Laminar cursor rules installed, you can leverage them by prompting the Cursor agent. The rules will automatically guide the AI to follow Laminar best practices and patterns.
Example Prompts
Try these prompts in Cursor chat to see the rules in action:
- “Instrument this code with Laminar” - Add observability to existing functions
- “Set up Laminar in this project” - Initialize Laminar with proper configuration
- “Add Laminar tracing to my OpenAI calls” - Instrument LLM interactions
- “Create a Laminar evaluation for this function” - Set up evaluation workflows
- “Add session management with Laminar” - Implement user session tracking
- “Help me debug this Laminar trace” - Troubleshoot observability issues
The Cursor agent will now automatically apply Laminar patterns, use correct import statements, follow naming conventions, and suggest appropriate instrumentation based on your code context.