要让 AI 写项目申请书,可以参考以下步骤:
此外,还需注意以下几点:
本质上,AI 规则和“.cursorrules”都是对 AI 辅助创作的系统提示词,只是作用范围有所不同。AI 规则影响所有项目,而“.cursorrules”仅影响当前项目。可以将通用要求放在 AI 规则里,项目独有的要求放在“.cursorrules”里,以提高开发效率。
记得我刚开始写.cursorrules时,完全不知道该写什么。经过一段时间的摸索,发现其实就是把项目中影响AI输出方向的"规矩"写下来。上面截图是一张相对全面的.cursorrules写法。我们也可以按照自己的项目需求来优化里面的内容和结构。来看看几个关键部分:一)先说清楚你是谁这就像你找了个技术大牛来帮你,先告诉他"你期待他是什么样的人,拥有什么专业技能"。这样AI就会按照专家的水准来思考和coding。案例:二)告诉AI你要干什么这相当于项目启动前的需求对齐。你告诉AI:"我们这个项目要做成什么样"。AI就会始终围绕这些目标来写代码。案例:三)定好项目的"规矩"这是在强调团队的代码规范。统一的代码风格不仅看着舒服,维护起来也更容易。AI会严格按照这些规范来写代码。案例:四)明确文件放哪就像整理房间要分区一样,代码也需要规划好"位置"。这样AI生成的代码就不会乱放,后期找起来也方便。案例:五)指定用什么"工具"提前说好用什么框架和库,AI就不会随便引入其他依赖,保证项目的整洁和统一。案例:六)告诉AI怎么做测试这就像做菜要试味道一样,写代码也要测试。提前告诉AI测试的标准,它生成的代码就会考虑到可测试性,也会主动帮你写测试用例。案例:七)推荐参考资料这相当于给AI一个"学习资料",它会基于这些最佳实践来写代码,避免一些常见的坑。案例:八)UI的要求是什么最开始的案例中不涉及到任何页面的开发。如果咱们的项目需要画页面,可以补充下UI的要求。案例:
If we ask students to use AI for writing,they need to know what good writing looks like.That takes time.And effort.And a whole bunch of mistakes.If we want students to edit an AI generated text with their own voice,we need them to find their creative voice first.This is true of AI in writing but also AI in math.We don’t want students using AI to check their processes if they haven’t first learned the mathematical process.It’s true of computer coding,where we might start with a Scratch project,then hand-written code,then an AI and coding hybrid.Be Deliberate About What You Off-Load to AIA couple of months ago,I wrote about seven things we should consider when deciding to use AI.People often ask,“When is it okay to use AI?”The short answer is,“It depends on the learning task.”In using AI,we don’t want the machine to do the learning for us.This is why we should start with the learning tasks and then ask,“Does the AI help or hinder the learning in this situation?”The core idea here is that we need to use the learning targets to drive the AI and not the other way around.If you’re teaching a coding class,you might want to be tight with students on using generative AI to create any kind of code.You might want students to learn how to code by hand first and then,after mastering the language,use AI-generated code as a time-saving device.By contrast,if you’re teaching a health class where a student develops an app,you might not care if they use generative AI to help write the code.Instead,your focus is on helping students design a health campaign based on healthy habits.You might not have time to teach students to code by hand.You might not care about coding by hand.The app is merely a way for students to demonstrate their understanding of a health standard.
1.创建文件:在项目的根目录下,新建一个名为.cursorrules的文件。2.编写规则:根据项目需求,明确定义项目目标、编码标准、文件结构等关键规则。3.实时更新:随着项目需求的变化,随时对.cursorrules文件进行更新和优化。[heading2]四、在哪里快速借鉴他人.cursorrules[content]到这里,有人可能会问:有没有好用的文件可以供我们参考学习下?别担心,网上已经有很多开源的.cursorrules文件。一)cursor.directory官方地址:https://cursor.directory/二)awesome-cursorrules地址:https://github.com/PatrickJS/awesome-cursorrules/tree/main/rules我们直接找到对应的编程语言、框架对应的文件,直接拷到本地就可以。另外,我准备了几个常用的中文.cursorrule文件。大家可以在公众号后台回复“cursor规则”领取。[heading2]五、AI规则和.cursorrules有什么区别呢?[content]本质上都是对于AI辅助编程的系统提示词,只是他们的作用范围不一样。Cursor设置里的AI规则影响所有项目,不管你是什么语言,什么架构,什么交互方式,而.cursorrules只会影响当前项目。所以,我们可以把通用的要求放在AI规则里,把项目独有的要求放在各个项目的.cursorrules里,这样就可以最大限度地提高用户的开发效率。