Hello, I am sharing my cursor rules by way of illustrating how I work with AI as my development co-pilot. I think it encapsulates a lot of 'good' practices I have come to rely on (and stolen, borrowed, improved) to help me make the most out of my agentic development experience.
This repository contains .mdc
files that guide AI coding agents (Cursor, in particular) to follow best practices for development, project management, and code quality. Feel free to mix and match as you see fit.
Fork away. Or, branch and send me a PR for changes.
- EK
Two import scripts are available:
import-cursor-rules.sh
(Bash - Unix/Linux/macOS)import-cursor-rules.py
(Python - Cross-platform)
# Copy all rules to a new project
./import-cursor-rules.sh /path/to/my-project
# Python version (cross-platform)
./import-cursor-rules.py /path/to/my-project
# Create symlinks (changes to source rules affect all projects)
./import-cursor-rules.sh -l symlink /path/to/my-project
# Only import specific rule sets
./import-cursor-rules.sh -r general,git /path/to/my-project
# Python project with force overwrite
./import-cursor-rules.sh -r python -f /path/to/python-project
# View all options
./import-cursor-rules.sh --help
copy
(default): Independent copies, safe for modificationsymlink
: Links to source rules, updates automaticallyhardlink
: Shared file data, updates with source changes
Core directives that apply to all projects:
-
01-core-directive.mdc
- Foundation principles and methodology- Functional and modular design principles
- Approval-based workflow
- Project plan management
- Critical checkpoints
-
02-pre-work-analysis.mdc
- Before starting work- Plan context review
- Request alignment checking
- Conflict detection and resolution
-
03-during-work-tracking.mdc
- Active work monitoring- Progress tracking
- Decision documentation
- Discovery logging
-
04-post-work-updates.mdc
- After completing work- Status updates
- Plan synchronization
- Completion tracking
-
06-conflict-resolution.mdc
- Handling conflicts- Conflict detection
- Resolution protocols
- Communication guidelines
-
07-integration-workflow.mdc
- Development integration- Code workflow integration
- Documentation synchronization
- Testing and CI/CD alignment
Version control and collaboration standards:
101-commit-message-standards.mdc
- Commit message formatting102-branch-naming-conventions.mdc
- Branch naming rules103-git-workflow-standards.mdc
- Git workflow practices
UI/UX and design system standards:
201-design-system-standards.mdc
- Design system guidelines202-ui-component-standards.mdc
- UI component standards203-accessibility-standards.mdc
- Accessibility requirements
Specialized directives for Python development:
301-virtual-environment-setup.mdc
- Python environment management usinguv
302-python-code-standards.mdc
- Python coding standards303-python-testing-standards.mdc
- Python testing practices
- Seek first to understand - Promote thoughtful analysis before action
- Small things, loosely coupled - Be functional and modular; keep mutations isolated, avoid side effects
- As simple as possible but no simpler - Balance simplicity with functionality
- Critical thinking encouraged - Don't agree automatically; offer helpful critiques
- Start every project with a plan - Always begin with a project plan
- No changes without approval - Share specific plans and wait for explicit approval
- Surgical changes only - Keep modifications minimal and targeted
- Explain rationale - Always explain why a change is needed
- Test thoroughly - Verify changes work, don't break functionality, test edge cases
- Documentation first - Document approach before coding, explain decisions, keep README current
The system looks for project plans in this order:
PROJECT_PLAN.md
(root directory)docs/PROJECT_PLAN.md
- Any file containing "project plan", "roadmap", or "milestones"
User Request → Pre-Work Analysis → Active Work → Post-Work Updates
↓ ↓ ↓ ↓
Plan Check → Conflict Resolution → Progress Track → Plan Update
- ✅ Read plan before starting any work
- ✅ Verify request aligns with current milestone
- ✅ Update plan after completing tasks
- ✅ Note any scope or priority changes
- Every project starts with a comprehensive plan
- AI assistants create plans when missing
- No work proceeds without plan consultation
- Approval-based workflow prevents reckless changes
- Surgical modifications maintain code stability
- Comprehensive testing including edge cases
- Document approach before coding
- Explain all decisions along the way
- Keep project documentation current
- Commit message standards
- Branch naming conventions
- Documentation synchronization
- Package Management: Uses
uv
as default for Python projects - Virtual Environment: Automated setup and management
- Best Practices: Following Python-specific conventions
- Clear development methodology
- Automatic progress documentation
- Integrated quality control
- Consistent project structure
- Always current project status
- Documented decisions and changes
- Clear milestone tracking
- Proactive conflict resolution
- Clear, actionable instructions
- Structured workflow to follow
- Consistent quality standards
- Technology-specific guidance
Use the import scripts to set up rules in your projects. The AI assistant will automatically follow the imported rules.
These .mdc
files work automatically with AI assistants that support Cursor rules. The assistant will:
- Plan - Start with or create a project plan
- Analyze - Check requests for conflicts or alignment issues
- Approve - Get explicit approval before making changes
- Execute - Make surgical, well-tested modifications
- Document - Update plans and maintain current documentation
The result is a disciplined, quality-focused development process that maintains project direction while ensuring code quality and documentation.