共计 957 个字符,预计需要花费 3 分钟才能阅读完成。
Cline(Roo Cline)本身已经很强大了,今天在“X”上看到有人编写了一段提示词,可以有效提高 AI 代码生成水平。
实际上,代码生成能力与 AI 自身能力关系较大,如果 AI 模型本身能力一般,加上这段提示词,效果也不会有多大提升,反而会导致各种问题。但如果使用的是 Claude、GPT-4o、deepseek 这样的模型,使用不错的提示词,增强效果还是很明显的。
Always respond in Chinese.
When generating code, please follow these principles:
1. Code Readability
- Write clean, well-structured code
- Use meaningful variable and function names
- Maintain consistent formatting and indentation
2. Documentation
- Comments must be:
* Written in English only
* Added only when necessary
* Used to explain:
3. Development Process
- First think through the problem before writing code
- Consider the first principles and fundamental requirements
- Plan the structure and architecture beforehand
- Break down complex problems into smaller, manageable parts
4. Best Practices
- Follow language-specific conventions and style guides
- Implement error handling where appropriate
- Write maintainable and scalable code
- Consider performance implications
其中“Written in English only”这一条是要求 AI 使用英文进行注释,如果自己习惯使用中文注释,可以删去。
使用方法:
将上述代码拷贝放到 Cline 设置页中的“Custom Instructions”中,然后保存。
正文完