cursor-rules
Best practices for Cursor IDE with AWS, Next.js, and React Native
Install / Use
npx skills add jimmypocock/cursor-rulesInstalls into whichever agent you are using.
.cursorrules
Cursor IDE rules (legacy)
Quality Score
Category
Development & EngineeringSupported Platforms
Skill content
View source on GitHubCursor Rules for AWS Serverless & Modern Applications
A comprehensive set of rules and best practices for the Cursor IDE to guide AI-assisted development of serverless applications, web frontends, and mobile apps.
Quick Installation
Add these rules to your existing project with a single command:
curl -fsSL https://raw.githubusercontent.com/jimmypocock/cursor-rules/main/install.sh | bash
This will download and install only the necessary rule files into your project's .cursor/rules directory.
Overview
This repository contains a collection of configuration files for Cursor IDE that provides context-specific guidance to the AI assistant. These rules help ensure that all code generated by the AI follows consistent patterns, best practices, and architectural principles across your projects.
Key Components
-
Base Rules - Core development principles that apply across all projects, including coding conventions, error handling, and security best practices.
-
TypeScript Rules - Specific guidelines for TypeScript development, including type definitions, modern features, and organization patterns.
-
AWS Serverless Rules:
- Lambda Functions - Best practices for design, performance, cold start mitigation, and error handling
- DynamoDB - Data modeling principles, key design, query optimization, and cost efficiency
- IAM - Security best practices, least privilege principles, and role design
- CloudFormation/SAM - Infrastructure as code patterns and deployment practices
- GameLift - Game server integration, matchmaking, and fleet management
- Bedrock - Foundation model integration, prompt engineering, and agent design
- SageMaker - ML pipeline design, model deployment, and monitoring
- VPC - Network architecture, security, and connectivity patterns
- EventBridge - Event-driven design, rule configuration, and integration patterns
-
Web Development Rules:
- Next.js - App Router architecture, component design, data fetching, and performance optimization
- React - Component patterns, hooks usage, state management, and performance optimization
-
Mobile Development Rules:
- React Native - Project setup, component architecture, navigation, and performance optimization
- Expo - Expo ecosystem integration, EAS services, and deployment strategies
-
Supporting Tools:
- Installation script for easy adoption
- GitHub workflow for automated maintenance
- Validation tools to ensure rule quality
- Best practice checkers to keep rules updated
- Comprehensive documentation
Benefits of This Approach
- Comprehensive Coverage: Rules for all major aspects of modern application development
- Modularity: Each rule file focuses on a specific technology or concept
- Maintainability: Clear organization makes rules easy to update as best practices evolve
- Automation: Tools to validate and distribute rules across projects
- Knowledge Sharing: Captures expert knowledge in a format that benefits the entire team
Implementation Details
The rules follow the modern MDC (Markdown Configuration) format introduced in Cursor v0.45+, which allows:
- Domain-specific configurations targeting specific file patterns
- Hierarchical rule inheritance with base rules extended by more specialized ones
- Agent-centric instructions treating the AI as a specialized coding assistant
Directory Structure
.
├── .cursor/
│ └── rules/
│ ├── base.mdc # Core development principles
│ ├── typescript.mdc # TypeScript best practices
│ ├── aws-lambda.mdc # Lambda function guidelines
│ ├── aws-dynamodb.mdc # DynamoDB patterns and practices
│ ├── aws-iam.mdc # IAM security best practices
│ ├── aws-sam.mdc # SAM template configuration
│ ├── aws-cloudformation.mdc # CloudFormation best practices
│ ├── aws-vpc.mdc # VPC network architecture
│ ├── aws-gamelift.mdc # GameLift integration patterns
│ ├── aws-bedrock.mdc # Bedrock AI implementation
│ ├── aws-sagemaker.mdc # SageMaker ML development
│ ├── aws-eventbridge.mdc # EventBridge event-driven patterns
│ ├── nextjs.mdc # Next.js application development
│ ├── react.mdc # React component patterns
│ ├── react-native.mdc # React Native mobile development
│ └── expo.mdc # Expo ecosystem integration
├── .github/
│ ├── workflows/
│ │ └── cursor-rules.yml # GitHub workflow for maintenance
│ └── scripts/
│ ├── validate-rules.js # Rule validation script
│ ├── check-aws-best-practices.js # Checks AWS best practices
│ ├── check-frontend-best-practices.js # Checks frontend best practices
│ ├── check-mobile-best-practices.js # Checks mobile best practices
│ └── package.json # Dependencies for scripts
├── install.sh # Installation script
├── LICENSE # MIT License
└── README.md # This file
Installation Options
Option 1: One-Line Installation (Recommended)
The easiest way to add these rules to your project is using our installation script:
curl -fsSL https://raw.githubusercontent.com/jimmypocock/cursor-rules/main/install.sh | bash
This script will:
- Download only the necessary rule files
- Create a
.cursor/rulesdirectory in your project if it doesn't exist - Copy the rules into your project
- Clean up any temporary files
- Detect your project type and provide feedback
Option 2: Manual Installation
If you prefer a manual approach:
-
Clone this repository:
git clone https://github.com/jimmypocock/cursor-rules.git -
Copy the rules directory to your project:
cp -r cursor-rules/.cursor/rules your-project/.cursor/ -
Open your project in Cursor IDE.
Customizing Rules
These rules are designed to be a starting point. You should customize them to match your team's specific needs:
- Open any
.mdcfile in the.cursor/rulesdirectory - Modify the rules to match your specific requirements
- Save the file and Cursor will immediately use the updated rules
Rule Types
Base Rules
The base.mdc file contains core development principles that apply to all code, regardless of technology:
- Code organization and naming conventions
- Error handling and logging
- Security principles
- Performance optimization
- Documentation standards
Technology-Specific Rules
Other files contain rules tailored to specific technologies, such as:
- aws-lambda.mdc - Lambda function design and implementation
- aws-dynamodb.mdc - DynamoDB data modeling and access patterns
- nextjs.mdc - Next.js application architecture and components
- react-native.mdc - React Native mobile development
Recommended Attachment Modes
For optimal AI guidance and performance, we recommend configuring these rules with specific attachment modes in Cursor IDE:
Setting Up Attachment Modes
- Open Cursor IDE
- Go to Settings > Rules
- Find each rule file and set its attachment mode as recommended below
Recommended Configuration
| Rule Type | Recommended Mode | Explanation |
|-----------|------------------|-------------|
| Core Rules | Always | These fundamental rules should apply to all development |
| base.mdc | Always | Core development principles apply universally |
| readme-documentation.mdc | Always | Documentation standards should be consistent throughout |
| Technology-Specific Rules | Auto Attached or Agent Requested | These should only activate when relevant |
| AWS service rules | Auto Attached or Agent Requested | Provides AWS guidance only when working with related files |
| Web/mobile rules | Auto Attached or Agent Requested | Offers framework-specific advice when in relevant files |
This configuration ensures:
- Consistent Standards: Core best practices are always applied
- Contextual Guidance: Specialized rules appear only when relevant
- Reduced Noise: You won't get AWS advice when working on frontend code
- Better Performance: Reduces context size by only including pertinent rules
To manually override these settings for a specific interaction, you can use the Rules dropdown menu in the chat interface.
Team Collaboration
For teams, we recommend:
- Centralize Rules - Maintain rules in a dedicated repository
- Review Process - Establish a process for reviewing and updating rules
- Automation - Use the included GitHub workflow to sync rules across projects
- Documentation - Document why certain rules exist to build understanding
Validation Tools
This repository includes tools to validate and maintain your cursor rules:
-
Rule Validator: Ensures all rule files follow the correct format
cd .github/scripts npm install node validate-rules.js -
Best Practice Checkers: Scripts to check for updates to best practices
node check-aws-best-practices.js node check-frontend-best-practices.js node check-mobile-best-practices.js
GitHub Integration
The included GitHub workflow automates:
- Validation: Ensures all rules follow the correct format
- Distribution: Syncs rules to other repositories you maintain
- Updates: Checks for new best practices and creates issues
Compatibility
- Cursor IDE v0.45 or later (supports MDC format)
- Earlier versions can still use the
.cursorrulesformat (deprecated)
Contributing
We welcome contributions to improve these rules! Please submit a pull request with your suggested changes.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Cursor IDE team for creating a fantastic AI-assisted development tool
- AWS for their serverless best practices documentation
- Next.js, React, and React Native communities for their valuable guidance
Related Skills
headroom
73.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
career-ops
72.3kOpen-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)
ai-job-search
43.5kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
