对Cursor首席设计师12条黄金法则的深度解读
[
[
Cursor’s chief designer Ryo Lu posted on X yesterday, personally teaching how to use Cursor effectively. Mastering these rules will make Cursor operate as smoothly as taking off!
Cursor 的首席设计师 Ryo Lu 昨天在 X 上发布,亲自教授如何有效使用 Cursor。掌握这些规则将使 Cursor 的操作如同起飞般顺畅!
Proper Cursor usage = fast, clean code. Improper usage = AI spaghetti code that takes a week to fix. Original post: https://x.com/ryolu_/status/1914384195138511142
正确使用 Cursor = 快速、干净的代码。错误使用 = AI 意大利面条代码,修复需要一周时间。原始帖子: https://x.com/ryolu_/status/1914384195138511142
- Set 5–10 clear project rules upfront so Cursor knows your structure and constraints. Try /generate rules for existing codebases.
- 提前设定 5-10 条明确的项目规则,以便 Cursor 了解你的结构和约束。尝试 /generate 规则以适用于现有代码库。
- Be specific in prompts. Spell out tech stack, behavior, and constraints like a mini spec.
- 在提示中要具体。详细说明技术栈、行为和约束,就像一个迷你规格。
- Work file by file; generate, test, and review in small, focused chunks.
- 逐个文件工作;以小而集中的块生成、测试和审查。
- Write tests first, lock them, and generate code until all tests pass.
- 首先编写测试,锁定它们,然后生成代码直到所有测试通过。
- Always review AI output and hard-fix anything that breaks, then tell Cursor to use them as examples.
- 始终审查 AI 输出,并对任何破损的部分进行硬修复,然后告诉 Cursor 将它们用作示例。
- Use @ file, @ folders, @ git to scope Cursor’s attention to the right parts of your codebase.
- 使用 @ 文件, @ 文件夹, @ git 将 Cursor 的注意力集中在代码库的正确部分。
- Keep design docs and checklists in .cursor/ so the agent has full context on next steps.
- 将设计文档和检查清单保存在 .cursor/ 中,以便代理能够全面了解下一步。
- If code is wrong, just write it yourself. Cursor learns faster from edits than explanations.
- 如果代码错误,就自己写。Cursor 从编辑中学习的速度比从解释中快。
- Use chat history to iterate on old prompts without starting over.
- 利用聊天记录在旧提示上进行迭代,而无需重新开始。
- Choose models intentionally. Gemini for precision, Claude for breadth.
- 有意选择模型。Gemini 用于精确,Claude 用于广度。