JavaScript TypeScript Code Quality .cursorrules prompt file
About .cursorrules prompt file
What you can build
Code Review Platform: Create a platform where developers can submit their code for peer reviews, based on best practices like simplicity, readability, and maintainability. This platform can provide automated suggestions using AI about how to make code cleaner and more efficient.
Refactoring Assistant: Develop an IDE plugin that provides live feedback on code writing, suggesting refactoring opportunities that adhere to the coding guidelines such as DRY principles, early returns, and functional style.
Code Quality Analyzer: Launch a tool that analyzes existing codebases for adherence to coding guidelines, identifies potential areas of improvement, and generates reports with actionable insights for developers.
JSDoc Generator: Create an automated documentation tool that generates JSDoc comments from code, ensuring that all functions have a clear and concise description, aiding in better understanding and maintainability of code.
Best Practices Learning Platform: Offer an online learning platform with interactive tutorials and exercises that teach developers about best coding practices, focusing on simplicity, readability, performance, and testability.
Bug Tracking and Fixing Tool: Develop a tool that not only tracks bugs but also analyzes code to suggest optimal places for TODO comments, alerting developers when potential issues or complexities arise in codebases.
Reusable Component Library: Create a library of highly reusable and maintainable components that follow guidelines like functional and immutable styles, allowing developers to easily integrate these components into their projects.
Performance Optimization Service: Launch a service that reviews application performance without compromising readability, providing tailored suggestions for improving the speed and efficiency of web applications.
Function Ordering Tool: Build a tool that automatically organizes functions in script files based on dependency hierarchy, maintaining clear and logical ordering that aids in comprehension and debugging.
Interactive Code Clinic: Establish an online clinic where developers can receive one-on-one guidance or workshops from senior developers focused on live coding sessions to enforce clean and sustainable coding practices.
Benefits
10x Developer Persona: The prompt assumes the role of a highly skilled 10x developer, offering insights into effective coding practices for top-tier development.
Minimal Code Alteration: Emphasizes minimal code changes to avoid introducing bugs or increasing technical debt, underscoring efficiency and precision in code adjustments.
Key Mindsets Focus: Highlights core development principles like simplicity, readability, and testability, ensuring code is straightforward and maintainable.
Synopsis
This prompt benefits junior developers by providing a framework to build clean, maintainable, and efficient full-stack applications while enhancing their coding skills.
Overview of .cursorrules prompt
The .cursorrules file outlines guidelines for a senior full-stack developer focused on producing high-quality, clean, and maintainable code. Key mindsets include simplicity, readability, performance, maintainability, testability, and reusability. Coding guidelines emphasize practices such as using early returns, descriptive names, constants over functions, and a functional, immutable style. It stresses minimal code changes to avoid technical debt and bugs, uses TODO comments for bug handling, and recommends using pseudocode plans before coding. Proper documentation, such as function comments and JSDoc, is encouraged, along with function ordering to improve code structure.