Automatically generate production-quality, modular .cursorrules for any project
"Empowering developers, one cursor rule at a time"
Cursor Rules Generator is an intelligent system that automatically analyzes your codebase and generates comprehensive, organized cursor rules with zero manual input.
Instead of writing rules manually or using generic templates, this system:
- π Scans your repository - Dependencies, structure, code patterns, git workflow, environment variables
- π Analyzes everything - Compares your patterns against best practices
- π― Gives you options - Use current patterns, adopt best practices, or hybrid
- π Generates modular structure - Organized files instead of one massive document
- π Includes role-based system - Cursor automatically adopts appropriate expert roles
- One simple prompt - No manual project description needed
- Intelligent scanning - Detects all technologies, frameworks, patterns
- Zero placeholders - All values from actual codebase analysis
Generates organized structure instead of single massive file:
your-project/
βββ .cursorrules # Main entry point (~150 lines)
βββ .cursor/
βββ rules/ # Topic-specific detailed rules
β βββ architecture.mdc
β βββ code-style.mdc
β βββ git-workflow.mdc
β βββ testing.mdc
β βββ security.mdc
β βββ performance.mdc
βββ prompts/ # Modular role-based system
β βββ README.mdc # Role announcement guide
β βββ documentation-writer.mdc
β βββ frontend-developer.mdc
β βββ backend-developer.mdc
β βββ software-architect.mdc
β βββ code-reviewer.mdc
β βββ qa-engineer.mdc
β βββ security-analyst.mdc
β βββ performance-engineer.mdc
β βββ database-administrator.mdc
βββ quick-reference.mdc # Commands & patterns
- Languages: JavaScript/TypeScript, Python, Go, Rust, Ruby, Java, PHP, Dart, Elixir, Swift
- Frameworks: React, Vue, Angular, Next.js, FastAPI, Django, Flask, Express, and more
- Project Types: Web apps, APIs, mobile apps, CLI tools, libraries, microservices
Cursor automatically announces and adopts appropriate expert roles:
- π Documentation Writer
- βοΈ Frontend Developer
- π§ Backend Developer
- ποΈ Software Architect
- π§ͺ QA Engineer
- π Security Analyst
- And more...
Start with pre-built templates for popular tech stacks, then let our analyzer customize them for your project:
Available Templates:
Frameworks:
- βοΈ React + TypeScript + Tailwind
- β‘ Next.js App Router
- π Python FastAPI
- π Django REST Framework
- π Vue 3 + TypeScript
- π Express + TypeScript
Full Stacks:
- π― Full-Stack TypeScript
- ποΈ Microservices Architecture
Languages:
- π Python Best Practices
- π¦ Rust Patterns
DevOps & Cloud (NEW!):
- π§ Terraform + AWS
- βΈοΈ Kubernetes + Helm
- π³ Docker Compose
- π GitHub Actions CI/CD
How It Works:
- Optional: Choose a template:
"List available templates" - Automatic: Analyzer scans your codebase
- Smart Merge: Template best practices + your patterns
- Result: Best of both worlds!
See TEMPLATES.md for details on each template.
Set up once, use everywhere! The MCP server integrates directly with Cursor.
No installation needed - uses npx to run automatically!
# Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"cursor-rules-generator": {
"command": "npx",
"args": ["-y", "cursor-rules-generator-mcp@latest"],
"env": {
"TEMPLATE_REPO_URL": "https://github.com/ankitpro/cursor-rules-generator.git"
}
}
}
}That's it! Restart Cursor, then use in any project:
"Generate cursor rules for /path/to/my/project"
The MCP server automatically:
- β Fetches latest templates from GitHub
- β Analyzes your project
- β Generates cursor rules
- β No manual installation required!
π Full MCP Setup Guide: MCP_SETUP.md
Copy the folder to each project:
# Clone and copy to your project
git clone https://github.com/ankitpro/cursor-rules-generator.git
cp -r cursor-rules-generator /path/to/your/project/
cd /path/to/your/project
# In Cursor:
@cursor-rules-generator
Scan my repository and generate comprehensive .cursorrules based on my actual codebase.
# Commit and cleanup
git add .cursorrules .cursor/
git commit -m "chore: Add cursor rules"
rm -rf cursor-rules-generator| File | Purpose |
|---|---|
| README.md | Project overview - Start here! |
| TEMPLATES.md | NEW v3.0! Template library guide |
| CHANGELOG.md | v3.0 features and changelog |
| MCP_SETUP.md | MCP Server setup guide |
| QUICK_START.md | 5-minute setup guide (folder method) |
| docs/USER_GUIDE.md | Complete user guide |
| docs/GENERATOR_TEMPLATE.md | Master template (for Cursor AI) |
| docs/STRUCTURE_EXAMPLE.md | Visual example of generated structure |
| CONTRIBUTING.md | Contribution guidelines |
Cursor scans your repository:
- π¦ Dependencies - package.json, requirements.txt, go.mod, etc.
- ποΈ Structure - Monorepo, frontend/backend split, folder organization
- π Code Patterns - Naming conventions, error handling, function patterns
- π³ Git Workflow - Branches, commits, versioning
- βοΈ Environment - .env files, configuration
- π§ͺ Testing - Framework, patterns, coverage
Cursor generates comprehensive report:
π Repository Analysis Complete
π¦ Detected Technologies:
- Frontend: React 18.2.0 with TypeScript
- Backend: Node.js 20.x with Express 4.x
- Database: PostgreSQL
- Testing: Jest + React Testing Library
π Code Patterns Found:
β
Consistent camelCase for functions
β οΈ Mixed error handling (suggest standardization)
β No JSDoc comments found
π‘ Recommendations:
1. Add JSDoc to public APIs
2. Standardize error handling
3. Adopt conventional commits
π― Choose:
A) Use current patterns (as-is documentation)
B) Apply best practices (with improvements)
C) Hybrid approach (choose per topic)
Based on your choice, Cursor creates:
- Main
.cursorruleswith quick context .cursor/rules/with detailed topic files.cursor/prompts/with individual role files (each role has its own file for easy customization!).cursor/quick-reference.mdcwith commands
- π New Projects - Set up quality standards from day one
- π Existing Projects - Document actual patterns and conventions
- π Multiple Projects - Maintain consistency across repos
- π₯ Onboarding - New members learn standards progressively
- π Code Reviews - Standardized patterns for consistent reviews
- π Collaboration - Share and sync coding standards
- π’ Multi-team Projects - Ensure consistency across teams
- π Quality Standards - Enforce best practices automatically
- π§ Maintenance - Easy updates to standards over time
Automatically detects and documents:
- React hooks patterns
- Material-UI component usage
- Express service layer
- Jest + React Testing Library
- PostgreSQL parameterized queries
Automatically detects and documents:
- Async/await patterns
- Type hints usage
- Pydantic models
- pytest patterns
- SQLAlchemy queries
Automatically detects and documents:
- Package organization
- Error handling patterns
- Testing with table-driven tests
- Docker deployment
- gRPC or REST API design
- Read QUICK_START.md - 5-minute setup
- Try in a test project first
- Review generated files
- Explore docs/STRUCTURE_EXAMPLE.md
- Read docs/USER_GUIDE.md for details
- Review docs/CHANGELOG.md
- Regenerate with v2.0 for modular structure
- Migrate custom rules to appropriate files
Contributions are welcome and encouraged! Whether you're fixing bugs, adding features, or improving documentation, your input is valued.
π See CONTRIBUTING.md for complete guidelines
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test thoroughly
- Commit:
git commit -m "feat: Your feature description" - Push and create a Pull Request
- π Add support for more languages/frameworks
- π Create rule templates for common project types
- π§ͺ Add comprehensive tests
- π§ Add CI/CD integration checks
- π Build rule validation tool
- π Create community rule sharing platform
- π Improve documentation and examples
All skill levels welcome! See CONTRIBUTING.md for detailed guidelines.
Ankit Agarwal
- π§ Email: ankitagarwalpro@gmail.com
- π GitHub: @ankitpro
- π‘ Mission: Making Cursor development more efficient for everyone
"Born from real-world needs, built for real-world developers."
MIT License - See LICENSE file for details
- Inspired by the Cursor community
- Based on production experience and best practices from real-world usage
- Built for developers, by developers
- π¬ GitHub Issues: For bug reports and feature requests
- π Documentation: Comprehensive guides in this repository
# Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"cursor-rules-generator": {
"command": "npx",
"args": ["-y", "cursor-rules-generator-mcp@latest"],
"env": {
"TEMPLATE_REPO_URL": "https://github.com/ankitpro/cursor-rules-generator.git"
}
}
}
}
# Restart Cursor, then use in any project:
"Generate cursor rules for /path/to/my/project"# Clone and copy to your project
git clone https://github.com/ankitpro/cursor-rules-generator.git
cp -r cursor-rules-generator /path/to/your/project/
# Open in Cursor:
@cursor-rules-generator
Scan my repository and generate comprehensive .cursorrulesTransform your development workflow with intelligent, automated cursor rules! π
./install-mcp.sh- Automated MCP server setup./verify-setup.sh- Verify installation is correct
Version: 2.0.0
Last Updated: November 10, 2025
Status: β
Production Ready