Important
This is alpha stage and will change significantly.
A native macOS application for managing Cursor rules across multiple projects with change tracking and synchronization capabilities.
- Rules Source Management: Track
.mdcrule files from a source directory - Multi-Project Support: Manage rules across multiple projects simultaneously
- Directory Tree Visualization: Navigate project structures with
.gitignoresupport - Rule Application Tracking: Track which rules are applied to which directories
- Change Detection: Automatically detect when source rules are modified
- Batch Synchronization: Update all affected projects with a single click
- IDE Configuration: Per-project IDE settings (Cursor, VSCode, etc.)
- Filesystem Scanning: Detect manually added rules and missing files
- JSON Persistence: Human-readable state storage for version control
- macOS 14.0 or later
- Swift 6.0 or later
- Xcode 16.0 or later (for development)
git clone https://github.com/sangdth/rules-manager.git
cd rules-manager
swift build -c release
.build/release/RulesManager- Set Up Sources Directory: Create a
./sourcesdirectory containing your.mdcrule files - Add Projects: Import projects you want to manage
- Apply Rules: Navigate directory trees and apply rules to specific directories
- Sync Changes: When source rules change, sync all affected projects
- Place your
.mdcfiles in the./sourcesdirectory - The app monitors this directory for changes automatically
- Use "Reveal in Finder" to quickly access your sources folder
- Copy manually added rules to sources using the context menu
- Click the
+button to add a new project - Select a project to view its directory structure
- Directory tree respects
.gitignorepatterns - Configure IDE settings per project (default: Cursor)
- Select a directory in the tree view
- Choose rules from the "Available Rules" panel
- Rules matching existing files are auto-checked
- Click "Confirm Apply" to batch apply/remove rules
- Applied rules appear as children in the directory tree
- Update Affected: Updates only rules that have changed
- Sync All: Force-syncs all tracked rules across all projects
- Both operations show confirmation before proceeding
- Switch to "JSON" tab to inspect application state
- Copy state for debugging or issue reporting
- View detected rules with status indicators:
- ✅ Green checkmark: Applied by this app
⚠️ Orange question: Manually added- ❌ Red warning: Tracked but file missing
- Language: Swift 6+ with strict concurrency
- UI Framework: SwiftUI with Observation framework
- Platform: macOS 14.0+
- Build System: Swift Package Manager
- Persistence: JSON files (Codable)
- File Monitoring: FSEvents
MVVM architecture with actor-based services:
- Views: SwiftUI components (
@MainActorisolated) - ViewModels: Observable state management
- Services: Actor-isolated business logic
- Models: Sendable, Codable domain types
Sources/RulesManager/
├── Models/ # Domain models and errors
├── Services/ # Actor-based services
│ └── Protocols/ # Service protocols
├── ViewModels/ # Observable ViewModels
└── Views/ # SwiftUI views
Tests/RulesManagerTests/
├── Models/ # Model tests
├── Services/ # Service tests
├── Integration/ # Integration tests
└── Fixtures/ # Test fixtures
swift buildswift testswift runType checking is enforced on all changes:
swift build --build-testsAll code uses Swift 6's strict concurrency checking.
Application state is persisted to:
~/Library/Application Support/RulesManager/tracking-data.json
Applied rules are written to:
[Project]/.cursor/rules/ # For Cursor IDE (default)
[Project]/.vscode/rules/ # For VSCode (configurable)
- Unit Tests: 60 tests covering all models and services
- Integration Tests: Full workflow validation
- Test Coverage: 98%+ across core functionality
- Fixtures: Isolated test projects and source files
This project is in alpha. Major changes expected.
TBD
- Enhanced file watching with debouncing
- Rule templates and snippets
- Conflict resolution UI
- Performance optimization for large projects
- Support for additional IDEs
- Import/export configurations
- Command-line interface
- File watch integration test can be flaky (expected behavior)
- Large directory indexing may take time (>1000 directories)
- No real-time collaboration support
- No rule validation or parsing
This is an alpha project. Use at your own risk.