How to make Cursor understand the project better

Optimize Cursor's understanding of the project and improve the efficiency of large model project management.
Core content:
1. The importance and method of Cursor output project structure
2. RepoPrompt software comparison and script implementation
3. Detailed explanation of script installation and running steps
Let the cursor output the project structure to better understand the large model. Some software can also achieve this effect, such as RepoPrompt. If we want to implement it in Cursor, we can do it.
The requirements are as follows
When I add or change a file, the following project structure can be automatically output and maintained:
When I add or change a directory, the following project directory structure can be automatically output and maintained:
Create a script
This script is used to output such a structure, which is convenient for the subsequent large model to understand the project and carry the project structure to the large model. The two scripts have too much content, click to read the original text to get the script content.
Here you need to install tree
Command, the installation command on Mac is as follows:
brew install tree
Creating an MDC file
Here, alwaysApply is set to true, and each request will determine whether the project structure needs to be updated.
---
description:
globs:
alwaysApply: true
---
# Agent Instructions
If you create a new file(s), please run the following command afterwards to update the project documentation.
```bash ~/.scripts/update_structure.sh```
If you create a new folder(s), please run the following command afterwards to update the project documentation.
```bash ~/.scripts/update_structure_folder.sh```
run
Be sure to select Agent mode. After entering the requirements, Cursor will automatically execute the script and output the MDC file of the project structure.