Clean Coding Guidelines .cursorrules prompt file
About .cursorrules prompt file
What you can build
Simplified Code Review Platform: Create a web-based platform that allows developers to upload code snippets and receive feedback on simplicity, readability, and maintainability, incorporating automated suggestions to improve these aspects.
Bug Tracking and Documentation Tool: Develop a service that integrates with popular IDEs to automatically add TODO comments for identified bugs, and generate JSDoc comments to maintain consistent documentation across JavaScript projects.
Reusable Code Snippet Library: Build a repository website focused on reusable functions and components that adhere to DRY principles, allowing developers to easily find and integrate these into their projects.
Testability Checker Service: Design a tool that analyzes codebases for testability, providing metrics and suggestions for improving test structures and coverage while ensuring minimal code changes.
Performance Optimizer Plugin: Create an IDE plugin that highlights areas of the code that may be over-optimized, suggesting alternatives that balance performance and readability.
Immutable Style Analyzer: Offer a service that reviews code to assess adherence to functional and immutable styles, providing guidance on maintaining concise yet readable code.
Effective Function Ordering Assistant: Develop an assistant tool that aids developers in ordering functions logically within their code files, ensuring compositional functions appear first for better structure.
Early Return Enforcement Tool: Implement a code linter feature that detects nested conditions and suggests the use of early returns to simplify code logic and improve readability.
Complexity Reduction Dashboard: Provide a dashboard app that shows complexity metrics of a codebase with recommendations on how to reduce complexity, emphasizing importance of minimal modifications.
Variable and Function Name Advisor: Build a smart naming advisor that suggests descriptive and meaningful names for variables and functions, enhancing code clarity and maintainability.
Benefits
- Emphasizes minimal code changes to reduce technical debt and avoid bugs.
- Strong focus on simplicity, readability, and maintainability for long-term code quality.
- Promotes functional, immutable style and descriptive naming for enhanced clarity and reusability.
Synopsis
Developers can benefit from this prompt by building clean, maintainable, and performant applications with minimalistic and readable code.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines for writing clean, maintainable, and efficient code, targeted at senior full-stack developers. It emphasizes simplicity, readability, performance, maintainability, testability, and reusability of code. Developers are encouraged to use early returns, prefer constants over functions, and write descriptive names for functions and variables. The guidelines also stress the use of functional and immutable coding styles and suggest minimal code modifications to prevent bugs and technical debt. Additionally, it outlines practices for comments and documentation, function ordering, and handling bugs. Lastly, it promotes writing detailed pseudocode plans before implementation to ensure clarity and quality.