cursor icon indicating copy to clipboard operation
cursor copied to clipboard

[Feature Request] Add Support for Global Rules Configuration in Cursor AI

Open kyus opened this issue 1 year ago • 5 comments

[Feature Request] Add Support for Global Rules Configuration in Cursor AI

Feature Description

We need the ability to configure and manage .cursor/rules globally across all projects in Cursor AI.

Current Behavior

Currently, .cursor/rules must be set up individually for each project, which leads to:

  • Repetitive setup work for each new project
  • Manual updates required across all projects when rules change
  • Difficulty maintaining consistent rules across projects

Proposed Solution

Add support for global rules configuration:

  1. Global Configuration Structure
{
  "rules": {
    "globalRulesPath": "~/.cursor/rules",
    "autoApplyGlobalRules": true,
    "mergeStrategy": "override" // or "merge"
  }
}
  1. Key Features
  • Automatic recognition of global rules directory
  • Automatic application to new projects
  • Configurable merge strategy for local/global rules
  • Automatic synchronization when rules are updated

Example Rule Structure

# Commit Message Rules

## Basic Structure
<type>(<scope>): <subject>

## Types
- feat: new feature
- fix: bug fix
- docs: documentation changes
- style: formatting, missing semicolons, etc.
- refactor: code refactoring
- test: adding tests, refactoring test
- chore: build tasks, package manager configs

## Scope (Optional)
- (auth): authentication related
- (user): user related
- (admin): admin features
- (common): common functionality

## Subject Rules
- Max 50 characters
- No period at the end
- Use present tense
- Use imperative mood

## Body (Optional)
- Max 72 characters per line
- Explain what and why vs. how

## Footer (Optional)
- Include breaking changes
- Reference issue tracker IDs

## Example
feat(auth): add kakao social login

- Implement OAuth2 authentication flow
- Add kakao profile information integration

Resolves: #123

Implementation Details

  • Storage location for global rules
    • Windows: %APPDATA%/Cursor/rules/
    • macOS: ~/Library/Application Support/Cursor/rules/
    • Linux: ~/.config/Cursor/rules/
  • Version control integration
  • Rule update mechanism

Backward Compatibility

  • Support for existing local rules
  • Migration path for current projects
  • Fallback behavior when global rules are not available

Benefits

  • Maintain consistent development rules
  • Save setup time
  • Easier standardization across teams
  • Improved rule management efficiency

Example Use Case

# Global rules structure
~/.cursor/rules/
  ├── commit-message-rules.mdc
  ├── coding-standards.mdc
  └── project-structure.mdc

Additional Context

This feature would be particularly valuable for team projects where maintaining consistent development rules is crucial.

kyus avatar Feb 11 '25 08:02 kyus

You might find this helpful

https://github.com/getcursor/cursor/issues/2683

Meh-S-Eze avatar Feb 12 '25 16:02 Meh-S-Eze

A simpler change that would allow a workaround is to also read rules from subdirectories. Currently, rules are only read from *.mdc files directly in PROJECT_DIR/.cursor/rules. If rules were also read from subdirectories, you could simply link in (or use a git submodule etc.) the global rules as PROJECT_DIR/.cursor/rules/global/.

This is still just a workaround as this would require setup in each project.

daniels avatar Feb 16 '25 09:02 daniels

Good feature, hoping cursor support this.

zjh7890 avatar May 12 '25 06:05 zjh7890

Appreciate this feature! It can be very useful!

ilan-tentser avatar Jul 06 '25 20:07 ilan-tentser

+1

I'd like to add that the cursor should also automatically read $HOME/.cursor/rules.

cavivie avatar Nov 13 '25 02:11 cavivie