即刻App年轻人的同好社区
下载
App内打开
1个迷途小书童
167关注35被关注0夸夸
全栈工程师🧑‍💼
分享AI编程、成长类话题
目前作品:https://cursor101.com 一个 Cursor 教程网站。
1个迷途小书童
09:48
@mckaywrigley 分享了一个Cursor 技巧:用Cursor 在代码中添加方便 AI 理解的注释。

只需要创建 add-comments.md 文件,在 chat 中引用它。

同理还可以写:
new-component.md
new-api-endpoint.md
fix-bugs.md
refactor.md

提示词示例如下:

add-comments.md
You are tasked with adding comments to a piece of code to make it more understandable for AI systems or human developers. The code will be provided to you, and you should analyze it and add appropriate comments.

To add comments to this code, follow these steps:

1. Analyze the code to understand its structure and functionality.
2. Identify key components, functions, loops, conditionals, and any complex logic.
3. Add comments that explain:
- The purpose of functions or code blocks
- How complex algorithms or logic work
- Any assumptions or limitations in the code
- The meaning of important variables or data structures
- Any potential edge cases or error handling

When adding comments, follow these guidelines:

- Use clear and concise language
- Avoid stating the obvious (e.g., don't just restate what the code does)
- Focus on the "why" and "how" rather than just the "what"
- Use single-line comments for brief explanations
- Use multi-line comments for longer explanations or function/class descriptions

Your output should be the original code with your added comments. Make sure to preserve the original code's formatting and structure.

Remember, the goal is to make the code more understandable without changing its functionality. Your comments should provide insight into the code's purpose, logic, and any important considerations for future developers or AI systems working with this code.

gist:gist.github.com
00
1个迷途小书童
2天前
从对待 Cursor 的言论,我能感觉到 linux.do 社区比 v2ex 更加开放。v2ex 有很多不肯迈出一步去探索的人,有违社区的 explore 精神。
00
1个迷途小书童
3天前
Cursor 0.4 更新两个好用的功能:

1. Composer Checkpoint 。这个功能至关重要,因为 Composer 步子迈得太大了,有可能把项目改得更糟糕。万一 composer 跑飞了,通过 checkpoint 回退代码。

2. Composer NotePad。用来保存常用上下文模板,在 Chat Composer 里面可以 @ 新建的 notepad。
00
1个迷途小书童
4天前
社交网络真神奇。上周开始做的 Cursor 101(cursor101.com),被X上面博主推了一把,突然来了上千个新用户。接着又在上面认识到新朋友 @SunnyHumorDay ,最后邀请到 Cursor 101 发布 Cursor 教程。这是系列教程的第0篇 《Cursor入门教程0 - 为什么放弃Github Copilot?》。

Cursor入门教程0 - 为什么放弃Github Copilot? | cursor101.com

43
1个迷途小书童
7天前
分享一个 V0 的提示词。有哪些可以借鉴的地方呢?

TheBigPromptLibrary/SystemPrompts/V0.dev/20240904-V0.md at main · lucasmrdt/TheBigPromptLibrary

00