cursor-rules-template
v1.1.1
Published
Best practice Cursor AI rules template organized by domain
Maintainers
Readme
Cursor Rules Template
A comprehensive, domain-organized Cursor AI rules template following best practices for AI-assisted development. Use as a template or install via npm CLI.
Quick Start
Option 1: npm Package (Recommended)
# Install globally
npm install -g cursor-rules-template
# Or use npx (no installation needed)
npx cursor-rules-template init
# Add specific domains
npx cursor-rules-template add data backend frontend
# List installed domains
npx cursor-rules-template listOption 2: Manual Copy
- Clone or copy this repository
- Copy
.cursor/rules/to your project - Copy
docs/templates to your project - Customize rules for your stack
Structure
.cursor/
└── rules/
├── workflow.mdc # Main workflow (PRD-first approach)
├── data/
│ └── data.mdc # Data engineering rules (dbt, Dagster, SQL)
├── backend/
│ └── backend.mdc # Backend API rules (Python, Go, Java, etc.)
└── frontend/
└── frontend.mdc # Frontend rules (React, Vue, TypeScript, etc.)
docs/
├── prd/
│ └── _template.md # PRD template
└── tasks/
└── _template.json # Task breakdown templateCLI Commands
cursor-rules init # Initialize all rules
cursor-rules add <domain> # Add specific domain(s)
cursor-rules remove <domain> # Remove domain rules
cursor-rules list # List installed domains
cursor-rules update # Update to latest versionAvailable Domains:
workflow- PRD-first workflow (always included)data- Data engineering (dbt, Dagster, SQL)backend- Backend APIs (Python, Go, Java, etc.)frontend- Frontend (React, Vue, TypeScript, etc.)
Customization
Each domain rule file is a template - customize it for your specific stack:
- Data Domain: Adapt for your tools (dbt, Airflow, Prefect, Spark, etc.)
- Backend Domain: Adapt for your framework (Express, FastAPI, Spring, etc.)
- Frontend Domain: Adapt for your framework (React, Vue, Svelte, Angular, etc.)
Rules use glob patterns to apply only to relevant files, so you can mix and match domains.
Workflow
Phase 1: PRD Creation
- Create PRD in
docs/prd/[feature-name]-prd.md - Wait for approval before proceeding
Phase 2: Task Breakdown
- Create task breakdown in
docs/tasks/[feature-name]-tasks.json - Break into granular subtasks (<4 hours each)
- Wait for approval before coding
Phase 3: Implementation
- Work on one task at a time
- Reference task IDs in commits
- Update task status as you progress
Domain Rules
Data Domain
- DBT model organization and standards
- Dagster asset patterns
- SQL best practices
- Data quality and testing
Backend Domain
- API structure and standards
- Error handling patterns
- Security best practices
- Performance optimization
Frontend Domain
- Component structure
- Accessibility standards
- State management patterns
- Performance optimization
Customization
Each domain rule file uses glob patterns to apply only to relevant files. You can:
- Add new domain folders (e.g.,
mobile/,devops/) - Modify glob patterns to match your project structure
- Add project-specific rules to each domain file
Best Practices
- Rules are concise (<500 lines each)
- Domain-specific rules only apply to relevant files
- Workflow rules apply globally
- Templates provide structure for planning
Distribution Options
1. npm Package (Recommended) ✅
npx @cursor-rules/template init- Easy installation
- Versioned updates
- Simple CLI interface
2. MCP Server (Future)
For dynamic rule loading via Model Context Protocol. See MCP.md for details.
3. Manual Copy
Clone and copy .cursor/rules/ to your project.
