@Ryrenz: 大部分人用编程 AI 只会说「帮我改一下这个 bug」,然后花半小时跟它拉扯。换个说法,一次就对。 1. 让它先看再动 「先别写代码。把相关文件读一遍,告诉我这个功能现在是怎么走的,我确认完你再改。」 2. 卡住的 bug 「不要猜。加日…

X AI KOLs Timeline 新闻

摘要

一条关于如何更有效地使用编程 AI 的实用提示,列出了 12 条具体指令范例,如让 AI 先读代码再修改、只改必要部分、写进 AGENTS.md 等,以减少来回拉扯并让规则长期生效。

大部分人用编程 AI 只会说「帮我改一下这个 bug」,然后花半小时跟它拉扯。换个说法,一次就对。 1. 让它先看再动 「先别写代码。把相关文件读一遍,告诉我这个功能现在是怎么走的,我确认完你再改。」 2. 卡住的 bug 「不要猜。加日志把中间状态打出来,跑一遍,根据真实输出定位,再动手改。」 3. 防止它顺手改一堆无关的东西 「只改让这个测试通过所必需的部分。其他文件、任何格式化,一律不动。」 4. 接手陌生项目 「假设我第一天进这个仓库。告诉我入口在哪、数据怎么流、哪几个文件是核心,先别改任何东西。」 5. 让它自己找活干 「跑一遍测试和类型检查,把所有失败按严重程度排序列出来,我挑哪几个你再修。」 6. 重构不翻车 「重构前先补测试,把现在的行为固定住。测试跑绿之后再动结构,每改一步重跑一次。」 7. 治它话多 「以后回答只给结论和改动。不要复述我的需求,不要总结你做了什么。」 8. 让它承认不知道 「这块你如果不确定,直接说不确定,别给我一个看起来合理的答案。我宁可你问我。」 9. 写提交信息 「看 git diff 和最近十条提交的风格,用同样的语气和格式写这次的提交信息。」 10. 做技术选型 「给我两个方案,分别说清代价是什么、什么情况下会后悔,最后给一个推荐和理由。不要罗列优点。」 11. 长任务不跑偏 「开始之前先写一份计划给我看,分步骤。每步做完停下来等我确认,再进行下一步。」 12. 让规则长期生效 「把我们刚才达成的这条约定写进项目的 AGENTS.md,以后每次都按它来。」 最后一条最值钱:好用的不是提示词,是让有效的提示词变成项目里的规则,你不用每次再说一遍。
查看原文
查看缓存全文

缓存时间: 2026/08/05 20:29

大部分人用编程 AI 只会说「帮我改一下这个 bug」,然后花半小时跟它拉扯。换个说法,一次就对。

  1. 让它先看再动 「先别写代码。把相关文件读一遍,告诉我这个功能现在是怎么走的,我确认完你再改。」

  2. 卡住的 bug 「不要猜。加日志把中间状态打出来,跑一遍,根据真实输出定位,再动手改。」

  3. 防止它顺手改一堆无关的东西 「只改让这个测试通过所必需的部分。其他文件、任何格式化,一律不动。」

  4. 接手陌生项目 「假设我第一天进这个仓库。告诉我入口在哪、数据怎么流、哪几个文件是核心,先别改任何东西。」

  5. 让它自己找活干 「跑一遍测试和类型检查,把所有失败按严重程度排序列出来,我挑哪几个你再修。」

  6. 重构不翻车 「重构前先补测试,把现在的行为固定住。测试跑绿之后再动结构,每改一步重跑一次。」

  7. 治它话多 「以后回答只给结论和改动。不要复述我的需求,不要总结你做了什么。」

  8. 让它承认不知道 「这块你如果不确定,直接说不确定,别给我一个看起来合理的答案。我宁可你问我。」

  9. 写提交信息 「看 git diff 和最近十条提交的风格,用同样的语气和格式写这次的提交信息。」

  10. 做技术选型 「给我两个方案,分别说清代价是什么、什么情况下会后悔,最后给一个推荐和理由。不要罗列优点。」

  11. 长任务不跑偏 「开始之前先写一份计划给我看,分步骤。每步做完停下来等我确认,再进行下一步。」

  12. 让规则长期生效 「把我们刚才达成的这条约定写进项目的 AGENTS.md,以后每次都按它来。」

最后一条最值钱:好用的不是提示词,是让有效的提示词变成项目里的规则,你不用每次再说一遍。

Most people, when using programming AI, just say “Help me fix this bug,” and then spend half an hour arguing with it. Change your phrasing, and it works on the first try.

  1. Make it look before it leaps
    “Don’t write code yet. Read through the relevant files first, tell me how this feature currently works, and wait for my confirmation before you make changes.”

  2. Stuck bugs
    “Don’t guess. Add logs to output the intermediate states, run it once, locate the issue based on the actual output, and then fix it.”

  3. Prevent it from casually changing a bunch of unrelated stuff
    “Only change the parts absolutely necessary to pass this test. Leave all other files and any formatting untouched.”

  4. Taking over an unfamiliar project
    “Assume it’s my first day in this repo. Tell me where the entry point is, how the data flows, and which files are core—don’t change anything yet.”

  5. Make it find work for itself
    “Run the tests and type checks once, list all failures sorted by severity, and I’ll pick which ones for you to fix.”

  6. Refactoring without derailing
    “Before refactoring, add tests first to lock in the current behavior. Once tests pass green, adjust the structure, and rerun after every step.”

  7. Cure its chattiness
    “From now on, responses should only include conclusions and changes. Don’t restate my requirements, and don’t summarize what you did.”

  8. Make it admit when it doesn’t know
    “If you’re unsure about this, just say you’re unsure—don’t give me a seemingly reasonable answer. I’d rather you ask me.”

  9. Writing commit messages
    “Look at the git diff and the style of the last ten commits, then write this one in the same tone and format.”

  10. Making tech choices
    “Give me two options, clearly state the costs of each and when you’d regret it, then provide a recommendation with reasons. Don’t just list pros.”

  11. Keeping long tasks on track
    “Before starting, write up a plan for me to review, broken into steps. Pause after each step for my confirmation before moving to the next.”

  12. Making rules stick long-term
    “Write this agreement we just reached into the project’s AGENTS.md, and follow it every time from now on.”

The last one is the most valuable: What makes it useful isn’t the prompt—it’s turning effective prompts into project rules, so you don’t have to repeat them every time.

乔木哥的分享非常有参考价值

  1. 在一个领域准备一套让人震撼的干货
  2. 坚持耕耘,按时出摊
  3. 掌握好发帖量和发帖时间,饭点和周末适合长内容
  4. 产品分享需要亲测,分享对自己来说超预期的体验
  5. 看多了好内容自然会有思考,测试,评价的欲望,直接发就可以

相似文章

@ai_super_niko: AI 编程工具在拼命执行,方向偏了只能眼睁睁看它跑完?上一条提问写错了,只能在后面补十条解释? 我把最近重度使用 Codex 的过程,总结成了 4 个动作: 1. 打断:双击 Esc 现场叫停,拒绝无效等待; 2. 编辑:直接编辑最近消息…

X AI KOLs Timeline

总结使用AI编程工具Codex的四个关键动作:打断、编辑、引导排队、分叉,帮助用户从被动等待结果转变为主动管理过程。

@yibie: 每个程序员都应该自己手写一个 agent。 只要 50 行代码,很有趣,而且会让你惊讶。但为了获得最大收获,请做这两件事: 第一,从零手写。打开空白文本文件,自己敲完每一行代码。不要用任何 AI,连自动补全都不要。 第二,只依赖标准库文档…

X AI KOLs Timeline

本文鼓励程序员亲手手写一个简单的AI agent(约50行代码),以加深对agent工作机制的理解,并建议从零手工编写、只依赖标准库和API文档。

@uudonX: 一位 Anthropic Claude 技术主管分享了一条提示词,总结得非常好,我觉得这是少数真正能提高 AI 输出质量、值得直接收藏的提示词。 它没有要求 AI 写得更多,而是逼它把任务做得更深。 这条提示词厉害的地方,是它同时修正了 …

X AI KOLs Timeline

一位 Anthropic Claude 工程主管分享的提示词在中文社区走红,该提示词通过找遗漏、回一手材料、明确方法、外部验证四个步骤,帮助 AI 把任务做得更深,而不是单纯写得更多。