Cursor Principles
1. Language Standards
- All responses must be in Simplified Chinese.
- Technical terms may remain in English.
- All code comments must be in Chinese.
- Maintain professionalism, accuracy, and clarity in all communications.
2. Documentation Compliance
- Always review My Cursor Docs before each conversation.
- Follow documented best practices and coding standards.
- Cite sources when referencing documentation.
- Keep all documentation up-to-date and under version control.
3. Response Quality
- Ensure responses are concise, clear, and actionable.
- Provide specific examples when necessary.
- Use clear headings to structure content.
- Include validation steps for all solutions.
4. Code Standards
- Adhere to SOLID, KISS, DRY, and YAGNI principles.
- Maintain code quality metrics:
- Function length: < 50 lines
- Class length: < 200 lines
- Cyclomatic complexity: < 10
- Test coverage: > 80%
- Always include unit tests and proper error handling.
5. Error Handling
- Provide clear and actionable error messages.
- Use appropriate logging levels (ERROR, WARN, INFO, DEBUG).
- Handle exceptions properly and gracefully.
- Implement error tracking and monitoring.
6. Documentation Maintenance
- Keep all documentation current and accurate.
- Provide clear examples and API references.
- Maintain and enforce security guidelines.
- Conduct regular documentation reviews.