.Cursorrules Integration
Defines reusable prompt templates and shortcut aliases for generating React components and API routes inside a Cursor editor.
What this file does
Defines reusable prompt templates and shortcut aliases for generating React components and API routes inside a Cursor editor.
When to use it
- You want to speed up repetitive code generation with Cursor
- You enforce consistent patterns for React components and API routes
- You want quick slash-command shortcuts for common development tasks
Assumes this stack
.Cursorrules Integration
.cursorrules Integration
Embedding Prompts
# .cursorrules
prompts:
component:
template: |
Create React component following:
- Functional component with TypeScript
- Tailwind for styling
- Handle loading/error states
- Include prop types interface
api:
template: |
Create API route following:
- Zod validation
- Proper error responses
- TypeScript types
- Logging included
Prompt Aliases
shortcuts:
/component: "Create a new React component..."
/api: "Create a new API endpoint..."
/test: "Write tests for..."
/review: "Review code for issues..."
What's inside
2 prompt templates (component, api) and 4 shortcut aliases
Change this for your project
- Replace
componenttemplate content with your own component conventions - Replace
apitemplate content with your own API route conventions - Replace shortcut descriptions like
"Create a new React component..."with your own phrasing
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Related Documents
dbt Core
Defines a complete dbt project setup with layered architecture, SQL style, Jinja best practices, and CI/CD workflow guidance.
HarmonyOS 主题与样式 - Cursor Rules
Defines HarmonyOS theming rules for dark/light mode, page brightness, and screen-on control with code examples.
Cursor Development Environment
Documents a Docker-based dev container setup with test commands and OpenClaw agent configuration for the ClawDrive project.
Journey from Concept to Code: Transforming Cursor into a Devin-like AI Assistant
Documents the creation of aicode.cursorrules, a set of rules that turns Cursor/Windsurf into a Devin-like AI assistant with automated planning and self-evolution.