修改提示词,增强Cline代码生成能力

103次阅读
没有评论

共计 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”中,然后保存。

修改提示词,增强 Cline 代码生成能力

正文完
 0
admin
版权声明:本站原创文章,由 admin 于2025-01-17发表,共计957字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码