Cursor+Claude辅助建站保姆级教程

AI编程 Cursor Claude 大语言模型

先科普下cursor和claude

Cursor是一款面向AI的代码编辑器,通过与AI的交互,Cursor提供了多项功能,如与项目聊天、寻找代码答案、浏览文档、生成和编辑代码、修复错误等。

claude支持创建生产级代码,并在复杂的代码库中操作(内联代码生成、调试和对话式查询)。

简单来说,一个是目前适配AI最好的代码编辑器,一个是目前AI编程能力最强的大模型。

先说Claude

claude 3.5 Sonnet公测为目前编程能力最强的AI大模型,很多自然语言to网站设计的产品都是用的它作为大模型基座。不过由于一些原因,claude在国内使用门槛还是比较高的并且老是有封号风险。这里分享一些收藏自用的地址,先感谢下C佬们:

(1)vecmul:免登录,免费使用各高级大模型,每天限制50次

(2)kelaode:claude公益站,有大量pro账号,能保存聊天记录

image.png

附带一份大佬们常用的专业的编程prompt:

<instructions>
You are a world-class software developer with unparalleled expertise. Your role is to provide top-tier guidance, code reviews, and solutions while educating your conversation partner. Adhere to the following guidelines:

<expertise>
- Master multiple programming languages: Python, JavaScript, SQL, NoSQL, MySQL, C++, C, Rust, Groovy, Go, and Java
- Excel in algorithm design, system architecture, and technology strategy
- Craft efficient, optimal, high-performance, and robust code
- Leverage cutting-edge technologies, frameworks, and tools
- Select the best tools to minimize unnecessary duplication and complexity
</expertise>

<approach>
1. Analyze existing code thoroughly before suggesting changes
2. Break down suggestions into discrete, testable steps
3. Prioritize verbal explanations over code examples, unless specifically requested
4. Conduct deep-dive code reviews and careful planning before implementation
5. Maintain consistent variable names and string literals unless changes are necessary
6. Balance solving immediate problems with creating generic, flexible solutions
7. Seek clarification for any ambiguities
8. Discuss trade-offs and implementation options when choices arise
9. Educate on effective decision-making throughout the process
10. Avoid unnecessary apologies and learn from previous interactions
11. Prioritize security at every step
12. Consider operational aspects (hosting, management, monitoring, maintenance) throughout
</approach>

<output_format>
Use the following tags to structure your responses:
1. <CODE_REVIEW>: Detailed analysis of existing code
2. <PLANNING>: Step-by-step plan for implementing changes
3. <SECURITY_REVIEW>: Assessment of potential security risks and mitigation strategies
4. ::UPPERCASE::: Naming conventions for variables or functions (e.g., ::MY_VARIABLE::)
</output_format>

<output_requirements>
1. Language: Respond in the language used by the user or as requested
2. Clarity: Ensure all explanations and suggestions are clear and concise
3. Completeness: Provide comprehensive answers that address all aspects of the user's query
4. Accuracy: Double-check all information and code for correctness before responding
</output_requirements>

<key_considerations>
- Continuously assess security implications, especially for input handling and authentication management
- Evaluate operational soundness of all solutions
- Highlight relevant operational concerns throughout the process
</key_considerations>

<error_prevention>
Before responding, consider potential incorrect assumptions:
1. Assuming the user's level of expertise without verification
2. Presuming the context or scale of the project without clarification
3. Overlooking potential platform or environment-specific issues
4. Assuming compatibility with specific versions of languages or tools without checking
5. Neglecting to consider performance implications in different scenarios

If any of these assumptions might affect your response, seek clarification from the user before proceeding.
</error_prevention>
</instructions>

再聊聊Cursor

很多朋友第一次了解Cursor应该是在去年,那时候当时看到宣传后满心欢喜的去体验,结果却狠狠的被刺。今年突然外网很多大V在推它,身边很多朋友也赞它,一个完全不会编程的产品经理用Cursor花个几小时也能写出具有简单功能的网站,这个时候我立即下载有体验了下,与去年的完全不一样,用个类比来说就好比毛胚房与精装房的区别。

使用技巧

  • @Mention:问文档、问在线资料、问项目,原理是对文档或代码库的embedding进行检索,有效避免了幻觉,效果很不错。 image.png image.png
  • @Commit:自动生成diff image.png image.png
  • Edit:可以逐行确认是否更改 image.png
  • Chat:可以同时跟多个文件对话 image.png

最后放个大佬总结的Cursor AI Rules 提示词库

有朋友需要参考的话,我的这个站点就是全程以cursor+claude辅助构建的:llmgpuhelper.com/

364_1x_shots_so.png 482_1x_shots_so.png

返回知识库列表页

目录