测试
Cursor的Rule(中文版)
在软件开发中,代码规约和问题解决策略是非常重要的。以下是Cursor的Rule(中文版),以帮助开发者更好地编写代码和解决问题。
代码规约
- 重复代码共通化处理:对于重复代码,要进行共通化处理,以减少代码的冗余性。
- 代码拆分和引用:代码要合理使用代码拆分,采用引用的方式,保证每个代码文件的行数不允许超过600行。
- 删除代码时要确认:删除代码时,要确认代码没有使用后才能删除。
- 添加代码时要确认:添加代码时,要确认你的代码不会对其他代码产生影响。
- 添加新功能时要确认:添加新功能时,要确认代码中没有相关功能代码的存在,不允许重复代码。
- 添加画面CSS样式时要确认:添加画面CSS样式的时候,要确保你添加的CSS不对对全局CSS产生影响。
- 重新代码时要确认:重新代码的时候,要确保新代码和原来的代码的功能,画面样式一致。
- 保证代码设计和design.md一致:保证代码的设计和design.md的设计一致。
解决问题策略
- 检索整个workspace:当出现问题的时候,你要检索整个workspace来解决这个问题,要以整个项目的角度来看。
- 换一个思路:当问题超过两次没有解决时,你要换一个思路来解决问题,启动二重思考。
- 通过更多的日志:当出现问题,你要通过更多的日志来确定问题发生的原因。
- 报告新功能或问题解决进度:每次对话结束,你都要报告新功能或者问题解决当前的进度,如果有推荐做的功能优化,要进行报告确认,不允许自己擅自做出其他优化。
Cursor的Rule(英文版)
以下是Cursor的Rule(英文版),以帮助开发者更好地编写代码和解决问题。
Code Specifications
- Duplicate code should be made common:Duplicate code should be made common.
- The number of lines in each code file is not allowed to exceed 600:The number of lines in each code file is not allowed to exceed 600.
- Before deleting code, confirm that it is not in use:Before deleting code, confirm that it is not in use.
- When adding code, ensure that your code will not impact other code:When adding code, ensure that your code will not impact other code.
- When adding new features, confirm that there is no relevant functional code present in the code:When adding new features, confirm that there is no relevant functional code present in the code. Duplicate code is not permitted.
- When adding CSS styles for the screen, make sure that the CSS you add does not affect the global CSS:When adding CSS styles for the screen, make sure that the CSS you add does not affect the global CSS.
- When recoding, ensure that the new code has the same functionality and screen style the original code:When recoding, ensure that the new code has the same functionality and screen style as the original code.
- Ensure that the code design is consistent with the design in design.md:Ensure that the code design is consistent with the design in design.md.
Problem - Solving Strategies
- Search the entire workspace:When a problem occurs, you should search the entire workspace to solve it, taking an overall view of the project.
- Approach from a different perspective:When a problem remains unsolved after more than two attempts, you should approach it from a different perspective and initiate a second - level of thinking.
- Use more logs to determine the cause of the problem:When a problem occurs, you should use more logs to determine the cause of the problem.
使用方法
以下是使用方法,包括如何使用Cursor的Rule来编写代码和解决问题。
代码共通化处理
- 重复代码共通化处理:对于重复代码,要进行共通化处理,以减少代码的冗余性。
- 代码拆分和引用:代码要合理使用代码拆分,采用引用的方式,保证每个代码文件的行数不允许超过600行。
问题解决策略
- 检索整个workspace:当出现问题的时候,你要检索整个workspace来解决这个问题,要以整个项目的角度来看。
- 换一个思路:当问题超过两次没有解决时,你要换一个思路来解决问题,启动二重思考。
- 通过更多的日志:当出现问题,你要通过更多的日志来确定问题发生的原因。
报告新功能或问题解决进度
- 每次对话结束:每次对话结束,你都要报告新功能或者问题解决当前的进度,如果有推荐做的功能优化,要进行报告确认,不允许自己擅自做出其他优化。
Cursor的Rule(中文版)
在软件开发中,代码规约和问题解决策略是非常重要的。以下是Cursor的Rule(中文版),以帮助开发者更好地编写代码和解决问题。
代码规约
- 重复代码共通化处理:对于重复代码,要进行共通化处理,以减少代码的冗余性。
- 代码拆分和引用:代码要合理使用代码拆分,采用引用的方式,保证每个代码文件的行数不允许超过600行。
- 删除代码时要确认:删除代码时,要确认代码没有使用后才能删除。
- 添加代码时要确认:添加代码时,要确认你的代码不会对其他代码产生影响。
- 添加新功能时要确认:添加新功能时,要确认代码中没有相关功能代码的存在,不允许重复代码。
- 添加画面CSS样式时要确认:添加画面CSS样式的时候,要确保你添加的CSS不对对全局CSS产生影响。
- 重新代码时要确认:重新代码的时候,要确保新代码和原来的代码的功能,画面样式一致。
- 保证代码设计和design.md一致:保证代码的设计和design.md的设计一致。
解决问题策略
- 检索整个workspace:当出现问题的时候,你要检索整个workspace来解决这个问题,要以整个项目的角度来看。
- 换一个思路:当问题超过两次没有解决时,你要换一个思路来解决问题,启动二重思考。
- 通过更多的日志:当出现问题,你要通过更多的日志来确定问题发生的原因。
- 报告新功能或问题解决进度:每次对话结束,你都要报告新功能或者问题解决当前的进度,如果有推荐做的功能优化,要进行报告确认,不允许自己擅自做出其他优化。
Cursor的Rule(英文版)
以下是Cursor的Rule(英文版),以帮助开发者更好地编写代码和解决问题。
Code Specifications
- Duplicate code should be made common:Duplicate code should be made common.
- The number of lines in each code file is not allowed to exceed 600:The number of lines in each code file is not allowed to exceed 600.
- Before deleting code, confirm that it is not in use:Before deleting code, confirm that it is not in use.
- When adding code, ensure that your code will not impact other code:When adding code, ensure that your code will not impact other code.
- When adding new features, confirm that there is no relevant functional code present in the code:When adding new features, confirm that there is no relevant functional code present in the code. Duplicate code is not permitted.
- When adding CSS styles for the screen, make sure that the CSS you add does not affect the global CSS:When adding CSS styles for the screen, make sure that the CSS you add does not affect the global CSS.
- When recoding, ensure that the new code has the same functionality and screen style original code:When recoding, ensure that the new code has the same functionality and screen style as the original code.
- Ensure that the code design is consistent with the design in design.md:Ensure that the code design is consistent with the design in design.md.
Problem - Solving Strategies
- Search the entire workspace:When a problem occurs, you should search the entire workspace to solve it, taking an overall view of the project.
- Approach from a different perspective:When a problem remains unsolved after more than two attempts, you should approach it from a different perspective and initiate a second - level of thinking.
- Use more logs to determine the cause of the problem:When a problem occurs, you should use more logs to determine the cause of the problem.
使用方法
以下是使用方法,包括如何使用Cursor的Rule来编写代码和解决问题。
代码共通化处理
- 重复代码共通化处理:对于重复代码,要进行共通化处理,以减少代码的冗余性。
- 代码拆分和引用:代码要合理使用代码拆分,采用引用的方式,保证每个代码文件的行数不允许超过600行。
问题解决策略
- 检索整个workspace:当出现问题的时候,你要检索整个workspace来解决这个问题,要以整个项目的角度来看。
- 换一个思路:当问题超过两次没有解决时,你要换一个思路来解决问题,启动二重思考。
- 通过更多的日志:当出现问题,你要通过更多的日志来确定问题发生的原因。
报告新功能或问题解决进度
- 每次对话结束:每次对话结束,你都要报告新功能或者问题解决当前的进度,如果有推荐做的功能优化,要进行报告确认,不允许自己擅自做出其他优化。
Q&A
以下是关于Cursor的Rule的常见问题和答案。
Q1:什么是Cursor的Rule?
A1:Cursor的Rule是一套代码规约和问题解决策略,旨在帮助开发者更好地编写代码和解决问题。
Q2:如何使用Cursor的Rule?
A2:可以通过阅读Cursor的Rule的文档和使用方法来学习如何使用它。
Q3:什么是代码共通化处理?
A3:代码共通化处理是指将重复代码进行共通化处理,以减少代码的冗余性。
Q4:什么是代码拆分和引用?
A4:代码拆分和引用是指将代码拆分成多个文件,并使用引用的方式来引用这些文件。
Q5:如何解决问题?
A5:可以通过检索整个workspace、换一个思路和通过更多的日志来解决问题。
Q6:什么是报告新功能或问题解决进度?
A6:报告新功能或问题解决进度是指每次对话结束时报告功能或者问题解决当前的进度。
Q7:如何保证代码设计和design.md一致?
A7:可以通过阅读design.md并保证代码设计与之一致来保证代码设计和design.md一致。
Q8:什么是二重思考?
A8:二重思考是指在解决问题时,换一个思路并启动第二层次的思考。
Q9:如何使用更多的日志来确定问题发生的原因?
A9:可以通过阅读更多的日志来确定问题发生的原因。
Q10:什么是推荐做的功能优化?
A10:推荐做的功能优化是指在解决问题时,推荐的优化方案。