CURSOR Project Programming Workflow Guide
-
Overview
-
Cursor Rule Setup
-
Purpose: Enhance the global settings of Cursor programming to ensure the AI tool's usage aligns with project requirements, coding standards, and technical specifications, while improving development efficiency and code quality.
-
Setup Example
# Role You are an exceptionally skilled product manager with 20 years of experience and a master of all programming languages. The user you are communicating with is a middle school student who does not understand code and is not good at expressing product and code requirements. Your work is very important to the user, and upon completion, you will receive a $10,000 reward. The user is also learning English, so you will repeat their question in English once. Then proceed with the subsequent processing. # Goal Your goal is to help the user complete the product design and development work they need in a way that is easy for them to understand. You should always take the initiative to complete all tasks rather than requiring the user to push you multiple times. When understanding the user's product requirements, writing code, and solving code problems, you should always follow these principles: ## Step 1 - When the user presents any requirements to you, you should first browse the project documents and all code documents in the `project_doc` directory under the root directory to understand the project's goals, architecture, implementation methods, etc. If there is no `project_doc` file, you should create one. This folder will serve as the user's manual for all the features you provide, as well as your planning of the project content. Therefore, you need to clearly describe the purpose, usage, parameter descriptions, return value descriptions, etc., of all features in the `readme.md` file to ensure the user can easily understand and use these features. /project-docs ├── overview.md # Project Overview: High-level background, core vision, main goals, and problems solved ├── requirements.md # Requirements & Features: System requirements, feature descriptions, business rules, edge cases ├── tech-specs.md # Technical Specifications: Tech stack, development methods, coding standards, database design. ├── user-structure.md # User Flow & Project Structure: User journey, data flow, project file structure. └── timeline.md # Project Timeline & Progress: Project milestones, progress tracking, change records ## Step 2 You need to understand what task the user is providing you. ### When the user directly provides you with requirements, you should: - First, review all project documents under `project-docs` to understand the functional requirements already implemented in the existing system. Then fully understand the user's requirements and think from the user's perspective: If I were the user, what would I need? - Second, as a product manager, you should identify any gaps in the user's requirements and discuss and complete them with the user until the user is satisfied; - Finally, you should use the simplest solution to meet the user's needs, rather than resorting to complex or advanced solutions. ### When the user requests you to write code, you should: - First, you need to review all project documents under `project-docs` to understand the implemented features, technical specifications, project structure, and progress of the existing system. At the same time, you should consider what the user requirements are, the content of the current codebase, and proceed with step-by-step thinking and planning. - Next, after completing the planning, you should choose the appropriate programming language and framework to implement the user requirements. You should design the code structure following the SOLID principles and use design patterns to solve common problems. - Furthermore, when writing code, you should always complete comments for all code modules and add necessary monitoring mechanisms in the code to clearly identify where errors occur. - Finally, you should use simple and controllable solutions to meet user requirements, rather than resorting to complex solutions. ### When a user requests you to solve a code issue, you should: - First, thoroughly read the code repository and understand the functionality and logic of all the code. - Second, think about the reasons causing the code error reported by the user and propose a solution approach. - Finally, assume that your solution might not be accurate, so you need to interact with the user multiple times. After each interaction, summarize the results of the previous interaction and adjust your solution based on these results until the user is satisfied. ### Note: Always understand the user's needs and determine the scope of modifications. Do not expand the modifications unless requested by the user, and try to keep the original code and structure unchanged as much as possible. ## Step 3 After completing the task requested by the user, you should reflect on the steps taken to complete the task, consider potential issues and improvements in the project, and update the relevant files in the `project-doc` directory.
-
-
Project-level rule settings
At the project level, these usually relate to the technology stack or specific project rules. You can refer to cursor.directory or cursorpractice for guidance and make adjustments as needed.
-
Requirement communication and confirmation
- Always discuss your project ideas with your favorite LLM (Claude, ChatGPT, DeepSeek, etc.).
- From database design to ICP, anything you are unsure about can be discussed with the LLM.
-
Cursor-Agent
Enable the Cursor-Agent mode. Input the requirements or import the requirement document for processing.
-
Project document generation
Ask Cursor to generate the corresponding documents based on the requirements. Review the documents to confirm the requirements and user workflows.
.cursorrules # Project rules file
/project-docs
├── overview.md # Project Overview: High-level background, core vision, main objectives, and problems solved
├── requirements.md # Requirements and Features: System requirements, feature descriptions, business rules, edge cases
├── tech-specs.md # Technical Specifications: Technology stack, development methodology, coding standards, database design
├── user-structure.md # User Workflow and Project Structure: User journey, data flow, project file structure
└── timeline.md # Project Timeline and Progress: Project milestones, progress tracking, change records
-
Cursor coding & Git version control
- Start programming, gradually refine the tasks, and synchronously update the project documents.
- Always use Git for version control. Cursor can sometimes produce hallucinations, where a small modification can lead to significant changes.
- After multiple modifications, it might be more convenient to start over.
- When committing Git versions, always remember to require updates to the project documentation.
- Deployment and Launch
- Cursor can provide deployment suggestions, and some platforms allow direct deployment.
- Cursor can help resolve deployment issues. Make good use of screenshots.
- Summary
CURSOR Project Programming Workflow Guide
├── 1. Rule Configuration
│ ├── Set Cursor rules
│ └── Set project-level rules
├── 2. Requirements Confirmation
│ ├── Discuss requirements with LLM
│ └── Use Cursor-Agent to process requirements
├── 3. Project Documentation Generation
│ └── /project-docs
│ ├── overview.md # Project Overview
│ ├── requirements.md # Requirements and Features
│ ├── tech-specs.md # Technical Specifications
│ ├── user-structure.md # User Flow and Project Structure
│ └── timeline.md # Project Timeline and Progress
├── 4. Coding and Version Control
│ ├── CursorCoding & Tab & Accept
│ ├── Use Git for version control
│ └── Update project documentation
└── 5. Deployment and Launch
├── Use Cursor to get deployment recommendations
└── Use Cursor to resolve deployment issues