How to combine language-specific rules with core rules for maximum development efficiency
- Rule Stack Combinations
- Project-Specific Setups
- Performance Optimization
- Team Configurations
- Migration Strategies
Perfect for: Modern web development, React projects, Node.js applications
# Essential JavaScript Stack (7 rules)
.cursor/rules/
├── javascript.mdc # JavaScript ES2022+ patterns
├── efficiency.mdc # Tool call optimization
├── debugging.mdc # Systematic debugging
├── terminal.mdc # Terminal optimization
├── audit.mdc # Code quality assurance
├── commonsense.mdc # Best practices
└── ADR.mdc # Decision tracking (optional)Synergy Benefits:
javascript.mdc+efficiency.mdc= Modern patterns with minimal tool callsjavascript.mdc+debugging.mdc= Type-aware debugging with async patternsjavascript.mdc+audit.mdc= Comprehensive code quality with modern standards
Perfect for: Enterprise applications, large codebases, team projects
# Essential TypeScript Stack (8 rules)
.cursor/rules/
├── typescript.mdc # TypeScript mastery
├── javascript.mdc # JavaScript fundamentals
├── efficiency.mdc # Tool call optimization
├── debugging.mdc # Systematic debugging
├── terminal.mdc # Terminal optimization
├── audit.mdc # Code quality assurance
├── commonsense.mdc # Best practices
└── memory-management.mdc # Context management for large projectsSynergy Benefits:
typescript.mdc+javascript.mdc= Complete language coveragetypescript.mdc+memory-management.mdc= Smart context for complex typestypescript.mdc+audit.mdc= Type-safe code quality assurance
Perfect for: Full-stack applications, microservices, complex architectures
# Complete Full-Stack Stack (11 rules)
.cursor/rules/
├── typescript.mdc # TypeScript mastery
├── javascript.mdc # JavaScript fundamentals
├── efficiency.mdc # Tool call optimization
├── debugging.mdc # Systematic debugging
├── terminal.mdc # Terminal optimization
├── audit.mdc # Code quality assurance
├── commonsense.mdc # Best practices
├── memory-management.mdc # Context management
├── session-coordinator.mdc # Session continuity
├── development-journal.mdc # Learning patterns
└── ADR.mdc # Architectural decisionsSynergy Benefits:
- Complete language coverage with all optimization rules
- Session continuity for complex development workflows
- Pattern learning across different technologies
# React TypeScript Optimal Setup
.cursor/rules/
├── typescript.mdc # Component typing, hooks, props
├── javascript.mdc # Modern React patterns
├── efficiency.mdc # Bundle operations
├── debugging.mdc # Component debugging
├── audit.mdc # Component quality
└── commonsense.mdc # React best practicesProject Commands:
# Single command project setup
"Create React TypeScript project with components, hooks, and tests"
# Component generation
"Create UserProfile component with TypeScript props and state"
# Testing setup
"Add React Testing Library with TypeScript configuration"# Node.js API Optimal Setup
.cursor/rules/
├── typescript.mdc # API typing, interfaces
├── javascript.mdc # Async patterns
├── efficiency.mdc # API optimization
├── debugging.mdc # Server debugging
├── terminal.mdc # Server operations
├── audit.mdc # API quality
└── ADR.mdc # Architecture decisionsAPI Commands:
# API scaffolding
"Create Express TypeScript API with authentication and validation"
# Route generation
"Create RESTful routes for User resource with proper typing"
# Database integration
"Add Prisma with TypeScript models and migrations"# React Native Optimal Setup
.cursor/rules/
├── typescript.mdc # Mobile component typing
├── javascript.mdc # Mobile patterns
├── efficiency.mdc # Mobile optimization
├── debugging.mdc # Mobile debugging
├── audit.mdc # Mobile quality
└── commonsense.mdc # Mobile best practicesMobile Commands:
# Mobile setup
"Create React Native TypeScript project with navigation"
# Component creation
"Create native components with platform-specific styling"
# State management
"Add Redux Toolkit with TypeScript for state management"# Load rules based on project type
# Check package.json for project type detection# In typescript.mdc
---
description: TypeScript patterns when tsconfig.json exists
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---
# In javascript.mdc
---
description: JavaScript patterns for specific project types
globs: ["src/**/*.js", "src/**/*.jsx", "components/**/*.js"]
alwaysApply: false
---# Monitor rule effectiveness
echo "=== Rule Performance Analysis ===" && \
echo "Active rules: $(ls .cursor/rules/*.mdc | wc -l)" && \
echo "JavaScript files: $(find . -name "*.js" -o -name "*.jsx" | wc -l)" && \
echo "TypeScript files: $(find . -name "*.ts" -o -name "*.tsx" | wc -l)" && \
echo "Rule file sizes: $(du -sh .cursor/rules/*.mdc | sort -hr | head -3)"# Collaborative Setup
.cursor/rules/
├── typescript.mdc # Type consistency
├── javascript.mdc # Code consistency
├── efficiency.mdc # Team efficiency
├── debugging.mdc # Shared debugging
├── audit.mdc # Code quality
├── commonsense.mdc # Shared practices
└── ADR.mdc # Decision trackingTeam Benefits:
- Consistent code patterns across team members
- Shared debugging and quality standards
- Architectural decision tracking
# Enterprise Setup
.cursor/rules/
├── typescript.mdc # Enterprise typing
├── javascript.mdc # Standard patterns
├── efficiency.mdc # Scale optimization
├── debugging.mdc # Systematic debugging
├── terminal.mdc # Operation efficiency
├── audit.mdc # Quality gates
├── commonsense.mdc # Enterprise practices
├── memory-management.mdc # Context optimization
├── session-coordinator.mdc # Team handoffs
├── development-journal.mdc # Knowledge sharing
└── ADR.mdc # Architecture governanceEnterprise Benefits:
- Scalable development patterns
- Knowledge preservation and sharing
- Governance and quality gates
# Setup dual rules
.cursor/rules/
├── javascript.mdc # Current codebase
├── typescript.mdc # Target patterns
├── efficiency.mdc # Migration efficiency
└── audit.mdc # Migration quality# Migration commands
"Convert this JavaScript file to TypeScript with proper typing"
"Add TypeScript types to existing JavaScript functions"
"Create TypeScript interfaces for data structures"# Final setup
.cursor/rules/
├── typescript.mdc # Primary language
├── javascript.mdc # Legacy support
├── efficiency.mdc # Optimized workflow
├── debugging.mdc # Type-aware debugging
└── audit.mdc # Type safety assurance# Analyze existing codebase
"Audit this codebase for modernization opportunities"
"Identify areas that would benefit from TypeScript"
"Analyze current JavaScript patterns and suggest improvements"# Week 1: Core efficiency
.cursor/rules/
├── efficiency.mdc
├── debugging.mdc
└── commonsense.mdc
# Week 2: Add language awareness
.cursor/rules/
├── javascript.mdc # Modern patterns
├── efficiency.mdc
├── debugging.mdc
└── commonsense.mdc
# Week 3: Add quality assurance
.cursor/rules/
├── javascript.mdc
├── audit.mdc # Quality gates
├── efficiency.mdc
├── debugging.mdc
└── commonsense.mdc# Morning startup (efficiency + terminal + language)
"Check project status, update dependencies, and run tests"
# Feature development (language + efficiency + debugging)
"Create user authentication feature with TypeScript and tests"
# Code review (audit + language + commonsense)
"Review this pull request for code quality and best practices"
# Deployment (terminal + efficiency + debugging)
"Build, test, and deploy to staging environment"# Full-stack feature (all rules working together)
"Create a complete user management system with:
- TypeScript backend API
- React frontend with TypeScript
- Database models and migrations
- Comprehensive tests
- Documentation"
# Performance optimization (efficiency + audit + language)
"Optimize this application for performance and maintainability"
# Architecture decision (ADR + language + commonsense)
"Evaluate options for state management and create ADR"# Check for conflicting patterns
grep -r "alwaysApply: true" .cursor/rules/
grep -r "globs:" .cursor/rules/ | grep -E "(javascript|typescript)"# Monitor rule performance
time echo "Test command with all rules active"
ps aux | grep -i cursor
du -sh .cursor/rules/# Verify rule loading order
ls -la .cursor/rules/
# Check rule dependencies
grep -r "depends\|requires" .cursor/rules/# Conditional loading based on project type
---
description: Load TypeScript rules only for TS projects
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---# Start with essential rules
Essential: efficiency.mdc, debugging.mdc, commonsense.mdc
# Add language-specific
+ javascript.mdc OR typescript.mdc
# Add quality assurance
+ audit.mdc
# Add team features
+ ADR.mdc, session-coordinator.mdc- Start with essential rules (efficiency, debugging, commonsense)
- Add language-specific rules based on project needs
- Monitor performance impact of rule combinations
- Use conditional loading for large projects
- Document team rule configurations
- Don't load all rules for every project
- Don't ignore performance monitoring
- Don't forget to update rules documentation
- Don't skip testing rule combinations
- Don't use conflicting rule patterns
| Project Type | Essential | Language | Quality | Team | Performance |
|---|---|---|---|---|---|
| Small JS | ✅ | js.mdc | audit.mdc | - | ✅ |
| Large JS | ✅ | js.mdc | audit.mdc | ADR.mdc | ✅ |
| Small TS | ✅ | ts.mdc + js.mdc | audit.mdc | - | ✅ |
| Large TS | ✅ | ts.mdc + js.mdc | audit.mdc | ADR.mdc + memory.mdc | ✅ |
| React | ✅ | ts.mdc + js.mdc | audit.mdc | - | ✅ |
| Node.js | ✅ | ts.mdc + js.mdc | audit.mdc | ADR.mdc | ✅ |
| Full-Stack | ✅ | ts.mdc + js.mdc | audit.mdc | All team rules | ✅ |
# JavaScript Stack
"Create modern JavaScript application with best practices"
# TypeScript Stack
"Create TypeScript application with strict typing"
# Full-Stack
"Create full-stack application with TypeScript and modern patterns"
# Enterprise
"Create enterprise application with all quality gates"Maximize your development efficiency with intelligent rule combinations! 🚀
Last updated: December 2024