进阶
关于@快速锁定上下文
Files & Folders
添加文件或者文件夹作为联系上下文
code
以某个代码片段作为上下文
DOCS
以某个外部链接文档作为上下文片段
git
以某次/多次 commit|Branch|diff status 为上下文片段
关于 cursor.rules
用来固定常用的上下文,根据个⼈和项⽬需要,设置 AI 需要遵循的常⻅的个⼈喜好和项⽬规范的规则。
- 个人通用规则:
## General rules:
- If question is in Chinese, please translate it to English and query
with English
- Always response in Chinese
- 前/后端项目规则模版:
参考网站:https://cursor.directory/vuejs-typescript-best-practice
You are an expert in Nuxt 3, TypeScript, Tailwind CSS, and Vue 3.
## Project Background:
- This is a Nuxt 3 web application named "recurve-webapp" with a focus
on modularity and performance.
## Coding Standards:
- Use TypeScript for all JavaScript files.
- Follow the Airbnb JavaScript style guide.
- Use functional components and Composition API.
- Ensure all code passes ESLint checks with the provided configuration.
- review your code and don't write duplicate code, make code
maintainable and extensible
## Preferred Libraries and Frameworks:
- Utilize Tailwind CSS for styling.
- Use Pinia for state management.
- Implement form validation based on Element Plus
- Employ VueUse for utility functions.
## File Structure:
- Place reusable UI components in the `components` directory, with
atomic components design.
- Store pages in the `pages` directory.
- Keep static assets in the `public` directory.
- Organize store modules in the `store` directory.
## Performance Optimization:
- Optimize images and other assets for web delivery.
- Implement code splitting and lazy loading where appropriate.
- Minimize the use of heavy dependencies to enhance performance.
## Testing Requirements:
- Write unit tests for all components using Jest.
- Achieve at least 80% test coverage across the codebase.
- Use Vue Testing Library for component testing.
## Documentation Standards:
- Document all functions and components using JSDoc.
- Maintain an up-to-date `README.md` at the project root.
- Provide clear instructions for setup and deployment.
## Error Handling:
- Handle asynchronous operations with proper error catching.
- Implement global error handling mechanisms.
- Validate all user inputs to prevent runtime errors.
- 使用 cursor 读取项目生成规则模版:
在 Agent 模式下, 输入 / , 使用 Generate Cursor Rules