banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

10 Tips for Developing Projects with Cursor

Start with the project framework and let AI help you lay the foundation! ๐Ÿ—๏ธ#

Problem#

When starting a project from scratch, it's often easy to get stuck due to a lack of direction.

Experience#

Use Cursor to generate the project framework, from file structure to basic modules in one go!

Prompts#

  • Generate a Spring Boot project framework that supports REST API and database connections.
  • Design a front-end and back-end separated project structure, with Vue for the front end and Flask for the back end.
  • Generate a user authentication module that supports JWT, including database models.
  • Build a microservices architecture project that includes interface specifications for order service and payment service.
  • Generate a TypeScript project template that supports ESM modularization.
  • Design a full-stack project that includes configuration files for Docker deployment.

Effect#

With a clear framework, starting the project is easier, and development efficiency is greatly increased! ๐ŸŽฏ


The clearer the prompts, the smarter the AI! ๐Ÿง #

Problem#

Vague prompts lead to code generated by AI that does not meet expectations.

Experience#

When writing prompts, be specific and clear; the more detailed the requirements, the more accurate the results!

Prompts#

  • Implement a multi-threaded crawler program in Python, including URL deduplication functionality.
  • Generate a REST API service based on Express.js that supports pagination queries.
  • Rewrite the following code to optimize the time complexity to O(n log n).
  • Generate a user registration feature with a unit test coverage of no less than 90%.
  • Implement a function to calculate the median of an array, supporting input validation.
  • Create a simple WebSocket chat application using TypeScript.

Effect#

Clear prompts help AI better understand your needs, making development more efficient! โœ…


Delegate repetitive tasks to AI and focus more! ๐ŸŽ›๏ธ#

Problem#

Generating mock data and interface documentation is time-consuming and tedious.

Experience#

Let Cursor handle these tasks automatically, saving time and focusing on core development!

Prompts#

  • Generate interface documentation for the user service, including request parameters and return value descriptions.
  • Create mock data for the order service, including JSON format examples.
  • Generate Swagger API documentation comments for the following code.
  • Create a utility function that supports randomly generated test data, using JavaScript.
  • Create a Postman collection file that includes the following interface definitions.
  • Generate database migration scripts to add associations between the user table and the order table.

Effect#

Delegate repetitive tasks to AI and save time for more important things!


Optimize code performance to make programs run faster! ๐Ÿ”„#

Problem#

Insufficient code performance and repetitive logic.

Experience#

Use Cursor to analyze and optimize code, improving performance while learning more elegant writing methods!

Prompts#

  • Optimize the following code snippet to reduce memory usage and improve execution speed.
  • Refactor the code to remove duplicate logic and enhance maintainability.
  • Add index optimization suggestions for the following SQL queries.
  • Rewrite the following Python script to support multi-process acceleration.
  • Rewrite the code in an object-oriented manner to enhance extensibility.
  • Convert the following code to asynchronous mode to reduce I/O blocking.

Effect#

Programs run faster and more stably, significantly enhancing user experience!


Don't panic when encountering new technologies; Cursor helps you find information! ๐Ÿ”#

Problem#

When learning new technologies, it's hard to know where to start.

Experience#

Use Cursor to quickly query documentation and example code, making it easy to get started!

Prompts#

  • Generate introductory tutorial code for WebGL that renders a simple triangle.
  • Learn about Flask's routing capabilities and generate example code.
  • Generate complete code for the first classification model using TensorFlow.
  • Implement an Android application with login functionality, using Kotlin.
  • List the core concepts of Kubernetes and generate a Deployment example.
  • Implement basic permission management functionality using Spring Security.

Effect#

Quickly get started with new technologies, with no pressure from learning to practice!


Let AI help you write test cases, saving time and effort! ๐Ÿงช#

Problem#

Test cases are numerous and complex, and writing them by hand is too time-consuming.

Experience#

Let Cursor automatically generate test cases, significantly improving coverage and compliance!

Prompts#

  • Generate unit tests for the following code, with coverage of no less than 90%.
  • Generate test cases based on Jest to test user login functionality.
  • Analyze the following code to identify uncovered test branches.
  • Write test cases using Pytest to test the data processing module.
  • Generate integration tests that simulate various exceptional scenarios for the API.
  • Create a test report template that includes pass rates and error details.

Effect#

Automating the testing process makes development more efficient and quality more assured!


Modular development makes projects clearer! ๐Ÿš€#

Problem#

Developing large features is complex and can easily become chaotic.

Experience#

Use Cursor to break down project modules, reducing complexity and enhancing development efficiency!

Prompts#

  • Design the basic structure of the user module to support CRUD operations.
  • Generate separate code for the service layer and controller of the order module.
  • Design the payment module using a microservices architecture to support reconciliation functionality.
  • Design separate database tables and relationships for the following functional modules.
  • Generate a modular logging system that supports multiple log levels.
  • Design a pluggable plugin module that supports dynamic loading.

Effect#

Development is clearer, and team collaboration is more efficient!


Refactoring old projects, AI lends you a helping hand! ๐Ÿ› ๏ธ#

Problem#

Taking over an old project, the code is outdated and the logic is chaotic.

Experience#

Use Cursor to analyze old code and generate a robust refactoring plan!

Prompts#

  • Upgrade the following code to the latest version of the framework syntax.
  • Analyze the technology stack of the old project and generate a migration plan to the new framework.
  • Optimize the indexing strategy for outdated SQL queries.
  • Migrate a Koa 1.x project to Koa 2.x and support middleware.
  • Refactor the following code to improve unit test coverage.
  • Generate a compatibility module that supports old version APIs.

Effect#

Old projects are revitalized, and delivery speed is significantly improved!


Multi-modal development makes products cooler! โœจ#

Problem#

The efficiency of design and code integration is low, with a lot of repetitive work.

Experience#

Utilize Cursor's multi-modal capabilities to generate code directly from design diagrams!

Prompts#

  • Generate HTML and CSS files based on design diagrams, supporting responsive layouts.
  • Use Tailwind CSS to implement the style design for the following page.
  • Convert Figma design diagrams into React component code.
  • Generate style code for dark mode for the following pages.
  • Generate Material-UI styled form components that support form validation.
  • Create a card component to display the content style of the design diagram.

Effect#

Front-end development efficiency is greatly increased, and user experience is significantly enhanced!


Encountering performance bottlenecks? Let AI help you optimize! ๐Ÿš€#

Problem#

Project performance is insufficient, but the issues are hard to pinpoint.

Experience#

Use Cursor to locate performance issues and generate optimization plans!

Prompts#

  • Analyze the following code to identify performance bottlenecks.
  • Optimize I/O operations to improve data processing speed.
  • Reduce the time complexity of the following loop logic.
  • Generate a performance comparison table showing time differences before and after optimization.
  • Replace blocking code with asynchronous methods to enhance concurrency.
  • Improve the execution efficiency of the following SQL queries to avoid full table scans.

Effect#

Performance improves by 40%, making the project run fast and stable!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.