cursor-templates
v1.0.1
Published
A comprehensive template system for Cursor IDE with AI-optimized configurations
Maintainers
Readme
Cursor Templates 🚀
A comprehensive template system for Cursor IDE, providing ready-to-use project configurations with AI-optimized .cursorrules files.
Features
- Pre-configured Templates: Ready-to-use templates for popular frameworks
- AI-Optimized Rules: Each template includes
.cursorrulesfor optimal AI assistance - CLI Tool: Easy template management and initialization
- Template Discovery: Search and discover templates
- Extensible: Create and share your own templates
Installation
npm install -g cursor-templatesOr use directly with npx:
npx cursor-templates initQuick Start
Initialize a new project with a template
cursor-templates initOr specify a template directly:
cursor-templates init --template nextjs-app-routerList available templates
cursor-templates listSearch for templates
cursor-templates search react
cursor-templates search --category backendAvailable Templates
Frontend
- nextjs-app-router: Next.js 14+ with App Router, TypeScript, and Tailwind CSS
- react-typescript-vite: React with TypeScript, Vite, and modern tooling
Backend
- python-fastapi-async: FastAPI with async/await, SQLAlchemy, and modern Python patterns
- node-express-typescript: Express.js with TypeScript, modern middleware, and best practices
Template Structure
Each template includes:
.cursorrules: AI assistant configuration specific to the framework- Template metadata: Description, version, author, and tags
- Example files: Starter code following best practices
- Commands: Common commands for development, building, and testing
Example .cursorrules file
# Next.js App Router Development Rules
You are an expert Next.js developer specializing in:
- Next.js 14+ with App Router
- TypeScript for type safety
- Tailwind CSS for styling
- React Server Components
## Code Style
- Use functional components with TypeScript interfaces
- Implement server components by default
- Add 'use client' directive only when necessary
...Creating Custom Templates
1. Create a new template
cursor-templates create2. Edit the template configuration
Templates are stored in templates/<template-name>/template.json:
{
"name": "my-template",
"description": "My custom template",
"version": "1.0.0",
"author": "Your Name",
"tags": ["custom", "framework"],
"rules": {
"context": "You are an expert developer...",
"style": {
"language": "TypeScript",
"framework": "Your Framework",
"conventions": ["Convention 1", "Convention 2"]
},
"restrictions": ["Don't do X", "Avoid Y"],
"preferences": ["Prefer A", "Use B when possible"]
},
"files": [
{
"path": ".cursorrules",
"content": "# Your Cursor rules here..."
}
],
"commands": {
"install": "npm install",
"dev": "npm run dev",
"build": "npm run build"
}
}3. Validate your template
cursor-templates validate my-templateCLI Commands
| Command | Description |
|---------|-------------|
| init | Initialize a new project with a template |
| list | List all available templates |
| search <query> | Search for templates |
| create | Create a new template |
| validate <template> | Validate a template |
| featured | Show featured templates |
| import <url> | Import a template from GitHub |
| recommend | Get template recommendations |
Template Schema
Templates follow a defined schema for consistency:
- name: Unique template identifier
- description: Brief description of the template
- version: Semantic version (x.y.z)
- rules: Cursor AI configuration
- context: AI assistant context
- style: Code style preferences
- restrictions: Things to avoid
- preferences: Preferred approaches
- files: Files to create when template is applied
- commands: Common development commands
Contributing
- Fork the repository
- Create your template in
templates/ - Test your template with
cursor-templates validate - Submit a pull request
Integration with Cursor IDE
After initializing a template:
- Open the project in Cursor IDE
- The
.cursorrulesfile will automatically configure the AI assistant - The AI will follow the specified conventions and best practices
Advanced Features
Template Discovery
# Search by category
cursor-templates search --category frontend
# View featured templates
cursor-templates featured
# Get recommendations
cursor-templates recommendImport from GitHub
cursor-templates import https://github.com/user/template-repoBest Practices
- Keep rules focused: Make
.cursorrulesspecific to your framework - Include examples: Provide example code in your templates
- Document commands: Include all relevant development commands
- Use semantic versioning: Follow semver for template versions
- Test thoroughly: Validate templates before sharing
Key Features
| Feature | Status | Description |
|---------|--------|-------------|
| Framework Templates | ✅ | 15+ modern framework templates |
| AI Rules Configuration | ✅ | Optimized .cursorrules for each template |
| CLI Tool | ✅ | Powerful command-line interface |
| Template Discovery | ✅ | Search and browse templates |
| GitHub Import | ✅ | Import templates from repositories |
| Custom Templates | ✅ | Create your own templates |
License
MIT
Support
- Report issues: GitHub Issues
- Documentation: Full Documentation
Built with ❤️ for the Cursor IDE community
