This directory contains optimized Cursor rules that follow the latest specification and best practices, including an auto-improvement system that automatically detects patterns and suggests rule enhancements.
- cursor_rules.mdc - Main specification and formatting guidelines
- self_improve.mdc - Continuous improvement and pattern recognition
- auto_improvement.mdc - NEW: Automatic rule improvement system
- authentication_best_practices.mdc - Security and authentication guidelines
- hotchocolate_best_practices.mdc - GraphQL and HotChocolate best practices
- development_workflow.mdc - Development process and project organization
- pattern_detector.ps1 - NEW: PowerShell script for automatic pattern detection
The auto-improvement system automatically detects when the same patterns appear multiple times in your codebase and suggests rule improvements:
- Pattern Detection: Identifies recurring code patterns across 3+ files
- Rule Suggestions: Automatically generates new rule suggestions
- Quality Metrics: Assesses rule completeness and effectiveness
- Cross-Referencing: Maintains rule relationships and dependencies
- Automatic Detection: Monitors code for recurring patterns
- Threshold Triggers: Suggests improvements when patterns appear 3+ times
- Rule Generation: Creates comprehensive rule suggestions
- Quality Assessment: Evaluates rule effectiveness and completeness
- Architectural Patterns: Service registration, DI, middleware
- Code Quality: Error handling, logging, validation
- Performance: Database queries, caching, async patterns
- Security: Authentication, authorization, input validation
# Run pattern detection (PowerShell)
.\pattern_detector.ps1 -ProjectRoot . -PatternThreshold 3
# Customize detection
.\pattern_detector.ps1 -PatternThreshold 5 -OutputFile "custom_analysis.json"All rules follow this standardized format:
---
description: Clear, one-line description of what the rule enforces
globs: path/to/files/*.ext, other/path/**/*
alwaysApply: boolean
---
# Rule Title
## Section
- **Key Point in Bold**
- Sub-points with details
- Examples and explanations- Always Apply Rules: These rules are automatically applied to all relevant files
- Domain Rules: Apply to specific file types or directories
- Cross-References: Rules reference each other for consistency
- Auto-Improvement: Rules automatically improve based on detected patterns
- Eliminated Duplication: Consolidated similar rules into comprehensive files
- Standardized Format: All rules follow the same structure and metadata
- Proper Cross-Referencing: Rules link to each other for maintainability
- Focused Scope: Each rule file has a clear, specific purpose
- Latest Specification: Follows current Cursor rules best practices
- 🚀 Auto-Improvement: Rules automatically evolve based on codebase patterns
- Automatic: The auto-improvement system detects and suggests updates
- Manual: Update rules when new patterns emerge
- Examples: Add examples from actual codebase
- Cross-Reference: Rules automatically maintain references
- Quality: Follow the self-improvement guidelines in self_improve.mdc
- Pattern Detection: System monitors code for recurring patterns
- Threshold Trigger: When pattern appears 3+ times, system suggests improvement
- Rule Suggestion: Generates comprehensive rule or update suggestion
- Quality Assessment: Evaluates rule completeness and effectiveness
- Implementation: Apply approved rule improvements
- Continuous Monitoring: System continues to detect new patterns
A complete backup of all rules is available in cursor-rules-backup-YYYYMMDD-HHMMSS.zip in the project root.
- Run Pattern Detection: Execute
.\pattern_detector.ps1to analyze your codebase - Review Suggestions: Check generated rule suggestions in
pattern_analysis.json - Implement Improvements: Apply high-priority rule enhancements
- Monitor Quality: Use the auto-improvement system for continuous enhancement