- Add this .cursorrules to the root of your directory.
Cursor Operation Rules
Edit Handling
- Single-Pass Editing
- Make all necessary changes in a single pass
- Group related edits together
- Avoid multiple iterations over the same file
- Use clear edit markers and comments
- Edit Format
// Format for edit blocks:
````language:path/to/file
// ... existing code ...
{{ edited_code }}
// ... existing code ...
Tool Usage Guidelines
- File Operations
- Verify file exists before attempting operations
- Check file permissions
- Use absolute paths when possible
- Handle file not found scenarios
- Search Operations
- Use specific search terms
- Verify search results before acting
- Handle empty search results gracefully
- Cache search results when appropriate
- Code Analysis
- Verify syntax before making changes
- Check for dependencies
- Validate type safety
- Ensure consistent formatting
Error Prevention
- Pre-Edit Checks
- Verify file context
- Validate syntax
- Check dependencies
- Confirm file permissions
- Post-Edit Validation
- Verify syntax after changes
- Check for introduced errors
- Validate type safety
- Ensure formatting consistency
Performance Optimization
- Operation Batching
- Group related operations
- Minimize file reads/writes
- Cache frequently accessed data
- Use bulk operations when possible
- Resource Management
- Release resources promptly
- Clean up temporary files
- Manage memory efficiently
- Handle large files appropriately
Best Practices
- Documentation
- Comment all significant changes
- Explain edit rationale
- Mark skipped sections clearly
- Include context when necessary
- Error Handling
- Provide clear error messages
- Include recovery steps
- Handle edge cases
- Maintain system stability
- Version Control
- Respect source control
- Handle conflicts gracefully
- Preserve file history
- Support rollback capability
Operational Constraints
- File Limits
- Max file size: 10MB
- Max line count: 10,000
- Max edit size: 1,000 lines
- Max search depth: 5 directories
- Performance Targets
- Edit response: < 100ms
- Search response: < 200ms
- File operations: < 50ms
- Validation: < 150ms
- Use NOTEPADS to start but not during your project since they are 1-way edit only (you to Cursor). Tips:
- Ensure your project is well structured and has logical sections of what your codebase/application does.
- Assuming most of you are using AI regularly already, ask Claude or Gemini (large context) to contextualize and provide a MECE (mutually exclusive, collectively exhaustive) set of context notes grouped by functionality type.
- Ask Claude to make a Build Checklist and a Build Tracker to start the project and create a working directory with the notes to transition your notepads to the new files. Then delete your Notebooks (optional but I like to free up the context and remove redundancies right away to maintain version control on the latest project status)
- Ask Claude to use tools. Type to it like you would to an intern or to yourself. Tell it about your project and ask it to look up context.