[{"data":1,"prerenderedAt":3223},["ShallowReactive",2],{"article-/topics/ai/ai-agent-low-temperature-not-equal-high-reliability":3,"related-ai":268,"content-query-H6fHcVJ66T":3037},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":12,"image":17,"imageQuery":18,"pexelsPhotoId":19,"pexelsUrl":20,"featured":6,"readingTime":21,"body":22,"_type":262,"_id":263,"_source":264,"_file":265,"_stem":266,"_extension":267},"/topics/ai/ai-agent-low-temperature-not-equal-high-reliability","ai",false,"","Low Temperature Not Equal High Reliability：温度调低不等于系统更可靠","不少团队把 temperature 调低当作可靠性方案。本文解释为什么低温只能降低随机性，不能替代评测、约束与治理。","2026-05-28","HTMLPAGE 团队",[13,14,15,16],"AI agent","Reliability","Temperature","评测治理","/images/articles/ai-agent-low-temperature-not-equal-high-reliability-featured.jpg","quality assurance testing checklist software team",7971357,"https://www.pexels.com/photo/people-in-the-office-7971357/",12,{"type":23,"children":24,"toc":254},"root",[25,33,40,107,112,117,142,147,153,158,164,218,223],{"type":26,"tag":27,"props":28,"children":29},"element","p",{},[30],{"type":31,"value":32},"text","把 temperature 从 0.7 调到 0.1，输出可能更一致，但这不代表系统更可靠。可靠性是“在约束内持续产出可执行结果”，不是“句式更稳定”。",{"type":26,"tag":34,"props":35,"children":37},"h2",{"id":36},"低温能解决什么不能解决什么",[38],{"type":31,"value":39},"低温能解决什么，不能解决什么",{"type":26,"tag":41,"props":42,"children":43},"table",{},[44,63],{"type":26,"tag":45,"props":46,"children":47},"thead",{},[48],{"type":26,"tag":49,"props":50,"children":51},"tr",{},[52,58],{"type":26,"tag":53,"props":54,"children":55},"th",{},[56],{"type":31,"value":57},"低温能改善",{"type":26,"tag":53,"props":59,"children":60},{},[61],{"type":31,"value":62},"低温不能解决",{"type":26,"tag":64,"props":65,"children":66},"tbody",{},[67,81,94],{"type":26,"tag":49,"props":68,"children":69},{},[70,76],{"type":26,"tag":71,"props":72,"children":73},"td",{},[74],{"type":31,"value":75},"输出随机性下降",{"type":26,"tag":71,"props":77,"children":78},{},[79],{"type":31,"value":80},"事实错误与工具误用",{"type":26,"tag":49,"props":82,"children":83},{},[84,89],{"type":26,"tag":71,"props":85,"children":86},{},[87],{"type":31,"value":88},"格式更稳定",{"type":26,"tag":71,"props":90,"children":91},{},[92],{"type":31,"value":93},"权限越界与策略失守",{"type":26,"tag":49,"props":95,"children":96},{},[97,102],{"type":26,"tag":71,"props":98,"children":99},{},[100],{"type":31,"value":101},"复现更容易",{"type":26,"tag":71,"props":103,"children":104},{},[105],{"type":31,"value":106},"上下文遗漏与流程缺陷",{"type":26,"tag":27,"props":108,"children":109},{},[110],{"type":31,"value":111},"低温是参数调优，不是治理体系。",{"type":26,"tag":34,"props":113,"children":115},{"id":114},"可靠性的真正来源",[116],{"type":31,"value":114},{"type":26,"tag":118,"props":119,"children":120},"ul",{},[121,127,132,137],{"type":26,"tag":122,"props":123,"children":124},"li",{},[125],{"type":31,"value":126},"明确的 Prompt Contract",{"type":26,"tag":122,"props":128,"children":129},{},[130],{"type":31,"value":131},"可执行的工具 schema 与权限边界",{"type":26,"tag":122,"props":133,"children":134},{},[135],{"type":31,"value":136},"稳定的评测集与发布门禁",{"type":26,"tag":122,"props":138,"children":139},{},[140],{"type":31,"value":141},"可观测、可回滚的运行控制",{"type":26,"tag":27,"props":143,"children":144},{},[145],{"type":31,"value":146},"如果这些不完善，再低的 temperature 也只是“稳定地产生错误”。",{"type":26,"tag":34,"props":148,"children":150},{"id":149},"失败案例低温后通过率短期上升线上投诉反增",[151],{"type":31,"value":152},"失败案例：低温后通过率短期上升，线上投诉反增",{"type":26,"tag":27,"props":154,"children":155},{},[156],{"type":31,"value":157},"某团队将温度下调后离线格式通过率提升，但线上投诉增加。原因是系统仍缺少边界约束，低温让错误更一致地重复出现。后续通过 policy 层拦截和评测集补洞才恢复稳定。",{"type":26,"tag":34,"props":159,"children":161},{"id":160},"可靠性-checklist",[162],{"type":31,"value":163},"可靠性 Checklist",{"type":26,"tag":118,"props":165,"children":168},{"className":166},[167],"contains-task-list",[169,182,191,200,209],{"type":26,"tag":122,"props":170,"children":173},{"className":171},[172],"task-list-item",[174,180],{"type":26,"tag":175,"props":176,"children":179},"input",{"disabled":177,"type":178},true,"checkbox",[],{"type":31,"value":181}," 不把 temperature 当唯一可靠性手段",{"type":26,"tag":122,"props":183,"children":185},{"className":184},[172],[186,189],{"type":26,"tag":175,"props":187,"children":188},{"disabled":177,"type":178},[],{"type":31,"value":190}," 高风险场景有独立策略约束",{"type":26,"tag":122,"props":192,"children":194},{"className":193},[172],[195,198],{"type":26,"tag":175,"props":196,"children":197},{"disabled":177,"type":178},[],{"type":31,"value":199}," 评测门禁覆盖真实用户样本",{"type":26,"tag":122,"props":201,"children":203},{"className":202},[172],[204,207],{"type":26,"tag":175,"props":205,"children":206},{"disabled":177,"type":178},[],{"type":31,"value":208}," 发布后监控 FRHR 与接管率",{"type":26,"tag":122,"props":210,"children":212},{"className":211},[172],[213,216],{"type":26,"tag":175,"props":214,"children":215},{"disabled":177,"type":178},[],{"type":31,"value":217}," 出现一致性错误时优先查流程而非参数",{"type":26,"tag":27,"props":219,"children":220},{},[221],{"type":31,"value":222},"延伸阅读：",{"type":26,"tag":118,"props":224,"children":225},{},[226,236,245],{"type":26,"tag":122,"props":227,"children":228},{},[229],{"type":26,"tag":230,"props":231,"children":233},"a",{"href":232},"/topics/ai/ai-agent-evaluation-framework-playbook",[234],{"type":31,"value":235},"AI agent 评估框架完全指南",{"type":26,"tag":122,"props":237,"children":238},{},[239],{"type":26,"tag":230,"props":240,"children":242},{"href":241},"/topics/ai/ai-agent-policy-engine-rule-layering",[243],{"type":31,"value":244},"AI agent Policy Engine 规则分层",{"type":26,"tag":122,"props":246,"children":247},{},[248],{"type":26,"tag":230,"props":249,"children":251},{"href":250},"/topics/ai/ai-agent-prompt-contract-interface-spec",[252],{"type":31,"value":253},"AI agent Prompt Contract 接口规范",{"title":7,"searchDepth":255,"depth":255,"links":256},3,[257,259,260,261],{"id":36,"depth":258,"text":39},2,{"id":114,"depth":258,"text":114},{"id":149,"depth":258,"text":152},{"id":160,"depth":258,"text":163},"markdown","content:topics:ai:ai-agent-low-temperature-not-equal-high-reliability.md","content","topics/ai/ai-agent-low-temperature-not-equal-high-reliability.md","topics/ai/ai-agent-low-temperature-not-equal-high-reliability","md",[269,1424,2374],{"_path":270,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":271,"description":272,"date":273,"topic":5,"author":11,"tags":274,"image":280,"imageAlt":281,"pexelsPhotoId":282,"pexelsUrl":283,"readingTime":21,"body":284,"_type":262,"_id":1421,"_source":264,"_file":1422,"_stem":1423,"_extension":267},"/topics/ai/cursor-keyboard-shortcuts-cheatsheet","Cursor 快捷键速查表（macOS/Windows）：从“会用”到“能提效”的 10 个工作流","把 Cursor 常用快捷键按任务分组（查代码、改代码、多文件、对话、审查与回滚），给出可直接照抄的工作流与最小回归清单，避免“快捷键背了也没变快”。","2026-03-02",[275,276,277,278,279],"Cursor","快捷键","AI IDE","VS Code","开发效率","/images/topics/ai/cursor-keyboard-shortcuts-cheatsheet.jpg","彩色机械键盘与鼠标的工作台面",34563105,"https://www.pexels.com/photo/colorful-mechanical-keyboard-and-mouse-setup-34563105/",{"type":23,"children":285,"toc":1395},[286,291,309,314,343,348,384,388,394,399,432,437,460,463,469,474,693,702,705,711,718,737,745,766,771,777,792,823,828,841,847,866,884,892,897,903,908,929,937,943,948,971,976,982,995,1001,1019,1037,1043,1054,1072,1078,1089,1095,1100,1143,1146,1152,1160,1213,1216,1222,1228,1233,1238,1261,1279,1284,1309,1312,1318,1324,1329,1335,1340,1346,1351,1354,1360],{"type":26,"tag":27,"props":287,"children":288},{},[289],{"type":31,"value":290},"如果你在搜“Cursor 快捷键”，你大概率不是想背一张表，而是想解决这类问题：",{"type":26,"tag":118,"props":292,"children":293},{},[294,299,304],{"type":26,"tag":122,"props":295,"children":296},{},[297],{"type":31,"value":298},"为什么我用了 AI，还是很慢？（对话来回太多、改动不可控）",{"type":26,"tag":122,"props":300,"children":301},{},[302],{"type":31,"value":303},"为什么它“看起来懂了”，却改错文件/改出回归？（上下文与范围没锁住）",{"type":26,"tag":122,"props":305,"children":306},{},[307],{"type":31,"value":308},"多文件改动怎么做得安全？（验收、回滚、最小回归集）",{"type":26,"tag":27,"props":310,"children":311},{},[312],{"type":31,"value":313},"这篇文章给你两份东西：",{"type":26,"tag":315,"props":316,"children":317},"ol",{},[318,331],{"type":26,"tag":122,"props":319,"children":320},{},[321,323,329],{"type":31,"value":322},"一张",{"type":26,"tag":324,"props":325,"children":326},"strong",{},[327],{"type":31,"value":328},"按任务分组",{"type":31,"value":330},"的快捷键表（不是按功能堆在一起）",{"type":26,"tag":122,"props":332,"children":333},{},[334,336,341],{"type":31,"value":335},"一套“从需求到落地”的",{"type":26,"tag":324,"props":337,"children":338},{},[339],{"type":31,"value":340},"最小闭环工作流",{"type":31,"value":342},"（每一步都有快捷键）",{"type":26,"tag":27,"props":344,"children":345},{},[346],{"type":31,"value":347},"想看系统玩法：",{"type":26,"tag":118,"props":349,"children":350},{},[351,362,373],{"type":26,"tag":122,"props":352,"children":353},{},[354,356],{"type":31,"value":355},"入门教程看：",{"type":26,"tag":230,"props":357,"children":359},{"href":358},"/topics/ai/cursor-tutorial",[360],{"type":31,"value":361},"Cursor 使用教程（2026）",{"type":26,"tag":122,"props":363,"children":364},{},[365,367],{"type":31,"value":366},"进阶玩法看：",{"type":26,"tag":230,"props":368,"children":370},{"href":369},"/topics/ai/cursor-editor-guide",[371],{"type":31,"value":372},"Cursor 编辑器深度玩法",{"type":26,"tag":122,"props":374,"children":375},{},[376,378],{"type":31,"value":377},"规则与忽略看：",{"type":26,"tag":230,"props":379,"children":381},{"href":380},"/topics/ai/cursor-rules-cursorrules",[382],{"type":31,"value":383},"Cursor Rules 与 .cursorrules",{"type":26,"tag":385,"props":386,"children":387},"hr",{},[],{"type":26,"tag":34,"props":389,"children":391},{"id":390},"先给结论提效不是按得快而是闭环更短",[392],{"type":31,"value":393},"先给结论：提效不是“按得快”，而是“闭环更短”",{"type":26,"tag":27,"props":395,"children":396},{},[397],{"type":31,"value":398},"你可以把 Cursor 的快捷键理解为 3 条流水线：",{"type":26,"tag":118,"props":400,"children":401},{},[402,412,422],{"type":26,"tag":122,"props":403,"children":404},{},[405,410],{"type":26,"tag":324,"props":406,"children":407},{},[408],{"type":31,"value":409},"改一小段",{"type":31,"value":411},"（内联编辑）：把改动限制在一个函数/一段样式",{"type":26,"tag":122,"props":413,"children":414},{},[415,420],{"type":26,"tag":324,"props":416,"children":417},{},[418],{"type":31,"value":419},"改一组文件",{"type":31,"value":421},"（Composer）：把改动限制在一组明确文件，并要求输出 diff + 验收点",{"type":26,"tag":122,"props":423,"children":424},{},[425,430],{"type":26,"tag":324,"props":426,"children":427},{},[428],{"type":31,"value":429},"聊清楚再动手",{"type":31,"value":431},"（侧边对话）：先对齐目标、范围、验收、回滚",{"type":26,"tag":27,"props":433,"children":434},{},[435],{"type":31,"value":436},"当你觉得“它乱改/改太大”时，往往不是快捷键没记住，而是缺了两件事：",{"type":26,"tag":118,"props":438,"children":439},{},[440,450],{"type":26,"tag":122,"props":441,"children":442},{},[443,445],{"type":31,"value":444},"没有在动手前锁定",{"type":26,"tag":324,"props":446,"children":447},{},[448],{"type":31,"value":449},"范围",{"type":26,"tag":122,"props":451,"children":452},{},[453,455],{"type":31,"value":454},"没有在接受改动前准备",{"type":26,"tag":324,"props":456,"children":457},{},[458],{"type":31,"value":459},"验收/回滚",{"type":26,"tag":385,"props":461,"children":462},{},[],{"type":26,"tag":34,"props":464,"children":466},{"id":465},"快捷键速查表按任务分组",[467],{"type":31,"value":468},"快捷键速查表（按任务分组）",{"type":26,"tag":27,"props":470,"children":471},{},[472],{"type":31,"value":473},"说明：下表按“你正在做什么”组织，而不是按“功能名字”组织。不同版本快捷键可能略有差异，但核心逻辑一致。",{"type":26,"tag":41,"props":475,"children":476},{},[477,503],{"type":26,"tag":45,"props":478,"children":479},{},[480],{"type":26,"tag":49,"props":481,"children":482},{},[483,488,493,498],{"type":26,"tag":53,"props":484,"children":485},{},[486],{"type":31,"value":487},"任务",{"type":26,"tag":53,"props":489,"children":490},{},[491],{"type":31,"value":492},"macOS",{"type":26,"tag":53,"props":494,"children":495},{},[496],{"type":31,"value":497},"Windows",{"type":26,"tag":53,"props":499,"children":500},{},[501],{"type":31,"value":502},"你该在什么时候用",{"type":26,"tag":64,"props":504,"children":505},{},[506,538,569,600,631,662],{"type":26,"tag":49,"props":507,"children":508},{},[509,514,524,533],{"type":26,"tag":71,"props":510,"children":511},{},[512],{"type":31,"value":513},"改一小段（最安全）",{"type":26,"tag":71,"props":515,"children":516},{},[517],{"type":26,"tag":518,"props":519,"children":521},"code",{"className":520},[],[522],{"type":31,"value":523},"Cmd + K",{"type":26,"tag":71,"props":525,"children":526},{},[527],{"type":26,"tag":518,"props":528,"children":530},{"className":529},[],[531],{"type":31,"value":532},"Ctrl + K",{"type":26,"tag":71,"props":534,"children":535},{},[536],{"type":31,"value":537},"只想改一个函数/一段 CSS，不想动别的",{"type":26,"tag":49,"props":539,"children":540},{},[541,546,555,564],{"type":26,"tag":71,"props":542,"children":543},{},[544],{"type":31,"value":545},"打开 AI 对话（先对齐再动手）",{"type":26,"tag":71,"props":547,"children":548},{},[549],{"type":26,"tag":518,"props":550,"children":552},{"className":551},[],[553],{"type":31,"value":554},"Cmd + L",{"type":26,"tag":71,"props":556,"children":557},{},[558],{"type":26,"tag":518,"props":559,"children":561},{"className":560},[],[562],{"type":31,"value":563},"Ctrl + L",{"type":26,"tag":71,"props":565,"children":566},{},[567],{"type":31,"value":568},"需要澄清目标、制定步骤、给验收点",{"type":26,"tag":49,"props":570,"children":571},{},[572,577,586,595],{"type":26,"tag":71,"props":573,"children":574},{},[575],{"type":31,"value":576},"多文件编辑（有组织地改一组文件）",{"type":26,"tag":71,"props":578,"children":579},{},[580],{"type":26,"tag":518,"props":581,"children":583},{"className":582},[],[584],{"type":31,"value":585},"Cmd + I",{"type":26,"tag":71,"props":587,"children":588},{},[589],{"type":26,"tag":518,"props":590,"children":592},{"className":591},[],[593],{"type":31,"value":594},"Ctrl + I",{"type":26,"tag":71,"props":596,"children":597},{},[598],{"type":31,"value":599},"改动涉及多个文件：组件+样式+测试",{"type":26,"tag":49,"props":601,"children":602},{},[603,608,617,626],{"type":26,"tag":71,"props":604,"children":605},{},[606],{"type":31,"value":607},"把选中代码加入对话上下文",{"type":26,"tag":71,"props":609,"children":610},{},[611],{"type":26,"tag":518,"props":612,"children":614},{"className":613},[],[615],{"type":31,"value":616},"Cmd + Shift + L",{"type":26,"tag":71,"props":618,"children":619},{},[620],{"type":26,"tag":518,"props":621,"children":623},{"className":622},[],[624],{"type":31,"value":625},"Ctrl + Shift + L",{"type":26,"tag":71,"props":627,"children":628},{},[629],{"type":31,"value":630},"让 AI 只看你选的片段（降低噪音）",{"type":26,"tag":49,"props":632,"children":633},{},[634,639,648,657],{"type":26,"tag":71,"props":635,"children":636},{},[637],{"type":31,"value":638},"接受当前建议",{"type":26,"tag":71,"props":640,"children":641},{},[642],{"type":26,"tag":518,"props":643,"children":645},{"className":644},[],[646],{"type":31,"value":647},"Cmd + Y",{"type":26,"tag":71,"props":649,"children":650},{},[651],{"type":26,"tag":518,"props":652,"children":654},{"className":653},[],[655],{"type":31,"value":656},"Ctrl + Y",{"type":26,"tag":71,"props":658,"children":659},{},[660],{"type":31,"value":661},"你已经准备好验收/回滚，并确认改动范围",{"type":26,"tag":49,"props":663,"children":664},{},[665,670,679,688],{"type":26,"tag":71,"props":666,"children":667},{},[668],{"type":31,"value":669},"拒绝当前建议",{"type":26,"tag":71,"props":671,"children":672},{},[673],{"type":26,"tag":518,"props":674,"children":676},{"className":675},[],[677],{"type":31,"value":678},"Cmd + N",{"type":26,"tag":71,"props":680,"children":681},{},[682],{"type":26,"tag":518,"props":683,"children":685},{"className":684},[],[686],{"type":31,"value":687},"Ctrl + N",{"type":26,"tag":71,"props":689,"children":690},{},[691],{"type":31,"value":692},"改得太大、改错方向，立刻收手",{"type":26,"tag":694,"props":695,"children":696},"blockquote",{},[697],{"type":26,"tag":27,"props":698,"children":699},{},[700],{"type":31,"value":701},"小技巧：把“改一小段”当默认路径。只有当你能清晰写出“会改哪几类文件、怎么验收”时再进入多文件。",{"type":26,"tag":385,"props":703,"children":704},{},[],{"type":26,"tag":34,"props":706,"children":708},{"id":707},"_10-个可直接照抄的提效工作流每个都能闭环",[709],{"type":31,"value":710},"10 个可直接照抄的提效工作流（每个都能闭环）",{"type":26,"tag":712,"props":713,"children":715},"h3",{"id":714},"工作流-1需求计划小步改新手最稳",[716],{"type":31,"value":717},"工作流 1：需求→计划→小步改（新手最稳）",{"type":26,"tag":315,"props":719,"children":720},{},[721,732],{"type":26,"tag":122,"props":722,"children":723},{},[724,730],{"type":26,"tag":518,"props":725,"children":727},{"className":726},[],[728],{"type":31,"value":729},"Cmd/Ctrl + L",{"type":31,"value":731}," 打开对话",{"type":26,"tag":122,"props":733,"children":734},{},[735],{"type":31,"value":736},"先发这段（可复制）：",{"type":26,"tag":694,"props":738,"children":739},{},[740],{"type":26,"tag":27,"props":741,"children":742},{},[743],{"type":31,"value":744},"目标：……\n范围：只修改以下文件/模块：……\n非目标：……（明确不做）\n验收：……（可测试/可手动检查）\n输出格式：先给计划，再逐步执行；每一步写出 diff 摘要。",{"type":26,"tag":315,"props":746,"children":747},{"start":255},[748,753],{"type":26,"tag":122,"props":749,"children":750},{},[751],{"type":31,"value":752},"让 AI 先给“计划（3~6 步）”，你确认后再执行",{"type":26,"tag":122,"props":754,"children":755},{},[756,758,764],{"type":31,"value":757},"任何一步涉及改代码：优先回到编辑区，选中片段用 ",{"type":26,"tag":518,"props":759,"children":761},{"className":760},[],[762],{"type":31,"value":763},"Cmd/Ctrl + K",{"type":31,"value":765}," 小步改",{"type":26,"tag":27,"props":767,"children":768},{},[769],{"type":31,"value":770},"为什么有效：你把“想法”变成了“可执行约束”，这就是 GEO（面向 AI/模型的可理解结构）。",{"type":26,"tag":712,"props":772,"children":774},{"id":773},"工作流-2只改一个函数高频低风险",[775],{"type":31,"value":776},"工作流 2：只改一个函数（高频、低风险）",{"type":26,"tag":118,"props":778,"children":779},{},[780],{"type":26,"tag":122,"props":781,"children":782},{},[783,785,790],{"type":31,"value":784},"选中函数 → ",{"type":26,"tag":518,"props":786,"children":788},{"className":787},[],[789],{"type":31,"value":763},{"type":31,"value":791}," → 输入指令：",{"type":26,"tag":694,"props":793,"children":794},{},[795,800],{"type":26,"tag":27,"props":796,"children":797},{},[798],{"type":31,"value":799},"把这段改成更可读：",{"type":26,"tag":118,"props":801,"children":802},{},[803,808,813,818],{"type":26,"tag":122,"props":804,"children":805},{},[806],{"type":31,"value":807},"用 async/await",{"type":26,"tag":122,"props":809,"children":810},{},[811],{"type":31,"value":812},"错误处理不要吞掉",{"type":26,"tag":122,"props":814,"children":815},{},[816],{"type":31,"value":817},"添加类型（若可推断）",{"type":26,"tag":122,"props":819,"children":820},{},[821],{"type":31,"value":822},"不要改函数签名",{"type":26,"tag":27,"props":824,"children":825},{},[826],{"type":31,"value":827},"验收方式（强制）：",{"type":26,"tag":118,"props":829,"children":830},{},[831,836],{"type":26,"tag":122,"props":832,"children":833},{},[834],{"type":31,"value":835},"输出前后函数行为一致（输入/输出）",{"type":26,"tag":122,"props":837,"children":838},{},[839],{"type":31,"value":840},"失败分支有可观测日志（不要悄悄 return null）",{"type":26,"tag":712,"props":842,"children":844},{"id":843},"工作流-3多文件改动先定文件清单",[845],{"type":31,"value":846},"工作流 3：多文件改动（先定“文件清单”）",{"type":26,"tag":315,"props":848,"children":849},{},[850,861],{"type":26,"tag":122,"props":851,"children":852},{},[853,859],{"type":26,"tag":518,"props":854,"children":856},{"className":855},[],[857],{"type":31,"value":858},"Cmd/Ctrl + I",{"type":31,"value":860}," 进入多文件",{"type":26,"tag":122,"props":862,"children":863},{},[864],{"type":31,"value":865},"先让 AI 输出：",{"type":26,"tag":118,"props":867,"children":868},{},[869,874,879],{"type":26,"tag":122,"props":870,"children":871},{},[872],{"type":31,"value":873},"预计会改哪些文件（最多 5 个）",{"type":26,"tag":122,"props":875,"children":876},{},[877],{"type":31,"value":878},"每个文件改什么",{"type":26,"tag":122,"props":880,"children":881},{},[882],{"type":31,"value":883},"每一步怎么验收",{"type":26,"tag":315,"props":885,"children":886},{"start":255},[887],{"type":26,"tag":122,"props":888,"children":889},{},[890],{"type":31,"value":891},"你确认文件清单后再开始生成改动",{"type":26,"tag":27,"props":893,"children":894},{},[895],{"type":31,"value":896},"关键点：多文件最容易翻车的是“它把你没想到的文件也改了”。所以文件清单是第一道闸门。",{"type":26,"tag":712,"props":898,"children":900},{"id":899},"工作流-4把上下文噪音砍掉防跑偏",[901],{"type":31,"value":902},"工作流 4：把“上下文噪音”砍掉（防跑偏）",{"type":26,"tag":27,"props":904,"children":905},{},[906],{"type":31,"value":907},"当你怀疑它在胡说/乱改时：",{"type":26,"tag":118,"props":909,"children":910},{},[911,924],{"type":26,"tag":122,"props":912,"children":913},{},[914,916,922],{"type":31,"value":915},"只选择关键代码片段 → ",{"type":26,"tag":518,"props":917,"children":919},{"className":918},[],[920],{"type":31,"value":921},"Cmd/Ctrl + Shift + L",{"type":31,"value":923}," 加入对话",{"type":26,"tag":122,"props":925,"children":926},{},[927],{"type":31,"value":928},"然后在对话里要求：",{"type":26,"tag":694,"props":930,"children":931},{},[932],{"type":26,"tag":27,"props":933,"children":934},{},[935],{"type":31,"value":936},"只基于我提供的代码片段回答，不要假设其它文件存在。",{"type":26,"tag":712,"props":938,"children":940},{"id":939},"工作流-5生成变更说明让-code-review-变快",[941],{"type":31,"value":942},"工作流 5：生成变更说明（让 code review 变快）",{"type":26,"tag":27,"props":944,"children":945},{},[946],{"type":31,"value":947},"改完后在对话里让它输出：",{"type":26,"tag":118,"props":949,"children":950},{},[951,956,961,966],{"type":26,"tag":122,"props":952,"children":953},{},[954],{"type":31,"value":955},"改动摘要（3~7 条）",{"type":26,"tag":122,"props":957,"children":958},{},[959],{"type":31,"value":960},"风险点（依赖/边界条件）",{"type":26,"tag":122,"props":962,"children":963},{},[964],{"type":31,"value":965},"回滚方式",{"type":26,"tag":122,"props":967,"children":968},{},[969],{"type":31,"value":970},"验收步骤",{"type":26,"tag":27,"props":972,"children":973},{},[974],{"type":31,"value":975},"这套结构能直接贴进 PR 描述。",{"type":26,"tag":712,"props":977,"children":979},{"id":978},"工作流-6写最小回归集不写回归-等事故",[980],{"type":31,"value":981},"工作流 6：写“最小回归集”（不写回归 = 等事故）",{"type":26,"tag":27,"props":983,"children":984},{},[985,987,993],{"type":31,"value":986},"每次改动都至少做 10 条最小回归（见下文清单）。你可以把它写在 ",{"type":26,"tag":518,"props":988,"children":990},{"className":989},[],[991],{"type":31,"value":992},"README",{"type":31,"value":994}," 或团队 wiki。",{"type":26,"tag":712,"props":996,"children":998},{"id":997},"工作流-7把接受建议变成最后一步",[999],{"type":31,"value":1000},"工作流 7：把“接受建议”变成最后一步",{"type":26,"tag":27,"props":1002,"children":1003},{},[1004,1010,1012,1017],{"type":26,"tag":518,"props":1005,"children":1007},{"className":1006},[],[1008],{"type":31,"value":1009},"Cmd/Ctrl + Y",{"type":31,"value":1011}," 应该是",{"type":26,"tag":324,"props":1013,"children":1014},{},[1015],{"type":31,"value":1016},"最后一步",{"type":31,"value":1018},"：",{"type":26,"tag":118,"props":1020,"children":1021},{},[1022,1027,1032],{"type":26,"tag":122,"props":1023,"children":1024},{},[1025],{"type":31,"value":1026},"你已经看过 diff",{"type":26,"tag":122,"props":1028,"children":1029},{},[1030],{"type":31,"value":1031},"你能说清楚“怎么验收”",{"type":26,"tag":122,"props":1033,"children":1034},{},[1035],{"type":31,"value":1036},"你知道“怎么回滚”",{"type":26,"tag":712,"props":1038,"children":1040},{"id":1039},"工作流-8拒绝建议不是失败是风控动作",[1041],{"type":31,"value":1042},"工作流 8：拒绝建议不是失败，是风控动作",{"type":26,"tag":27,"props":1044,"children":1045},{},[1046,1052],{"type":26,"tag":518,"props":1047,"children":1049},{"className":1048},[],[1050],{"type":31,"value":1051},"Cmd/Ctrl + N",{"type":31,"value":1053}," 的使用时机：",{"type":26,"tag":118,"props":1055,"children":1056},{},[1057,1062,1067],{"type":26,"tag":122,"props":1058,"children":1059},{},[1060],{"type":31,"value":1061},"它开始改你没提过的东西（范围漂移）",{"type":26,"tag":122,"props":1063,"children":1064},{},[1065],{"type":31,"value":1066},"它改了 10 个文件但你只想改 1 个",{"type":26,"tag":122,"props":1068,"children":1069},{},[1070],{"type":31,"value":1071},"它为了“更优雅”引入新依赖/新抽象",{"type":26,"tag":712,"props":1073,"children":1075},{"id":1074},"工作流-9重复任务做成模板提示词不是一次性",[1076],{"type":31,"value":1077},"工作流 9：重复任务做成模板（提示词不是一次性）",{"type":26,"tag":27,"props":1079,"children":1080},{},[1081,1083,1087],{"type":31,"value":1082},"把高频任务（比如“写组件+样式+验收”）固化成模板，放进 Rules（见：",{"type":26,"tag":230,"props":1084,"children":1085},{"href":380},[1086],{"type":31,"value":383},{"type":31,"value":1088},"）。",{"type":26,"tag":712,"props":1090,"children":1092},{"id":1091},"工作流-10把快捷键表做成你自己的任务表",[1093],{"type":31,"value":1094},"工作流 10：把“快捷键表”做成你自己的任务表",{"type":26,"tag":27,"props":1096,"children":1097},{},[1098],{"type":31,"value":1099},"你不需要记住所有快捷键，只需要记住：",{"type":26,"tag":118,"props":1101,"children":1102},{},[1103,1113,1123,1133],{"type":26,"tag":122,"props":1104,"children":1105},{},[1106,1108],{"type":31,"value":1107},"小步改：",{"type":26,"tag":518,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":31,"value":763},{"type":26,"tag":122,"props":1114,"children":1115},{},[1116,1118],{"type":31,"value":1117},"先对齐：",{"type":26,"tag":518,"props":1119,"children":1121},{"className":1120},[],[1122],{"type":31,"value":729},{"type":26,"tag":122,"props":1124,"children":1125},{},[1126,1128],{"type":31,"value":1127},"多文件：",{"type":26,"tag":518,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":31,"value":858},{"type":26,"tag":122,"props":1134,"children":1135},{},[1136,1138],{"type":31,"value":1137},"上下文聚焦：",{"type":26,"tag":518,"props":1139,"children":1141},{"className":1140},[],[1142],{"type":31,"value":921},{"type":26,"tag":385,"props":1144,"children":1145},{},[],{"type":26,"tag":34,"props":1147,"children":1149},{"id":1148},"必交付物-1最小回归任务清单10-条通用",[1150],{"type":31,"value":1151},"必交付物 1：最小回归任务清单（10 条，通用）",{"type":26,"tag":694,"props":1153,"children":1154},{},[1155],{"type":26,"tag":27,"props":1156,"children":1157},{},[1158],{"type":31,"value":1159},"这份清单的意义：让每次 AI 改动都能“被验证”。否则你只是把不可控变成了更快的不可控。",{"type":26,"tag":315,"props":1161,"children":1162},{},[1163,1168,1173,1178,1183,1188,1193,1198,1203,1208],{"type":26,"tag":122,"props":1164,"children":1165},{},[1166],{"type":31,"value":1167},"关键路径能跑通（手动点击/请求一次）",{"type":26,"tag":122,"props":1169,"children":1170},{},[1171],{"type":31,"value":1172},"错误路径能触发（模拟一次失败输入）",{"type":26,"tag":122,"props":1174,"children":1175},{},[1176],{"type":31,"value":1177},"控制台无新增错误（至少关注 1 次真实操作）",{"type":26,"tag":122,"props":1179,"children":1180},{},[1181],{"type":31,"value":1182},"关键 UI 未错位（移动端/桌面端各看一眼）",{"type":26,"tag":122,"props":1184,"children":1185},{},[1186],{"type":31,"value":1187},"刷新后状态正确（尤其是表单/列表）",{"type":26,"tag":122,"props":1189,"children":1190},{},[1191],{"type":31,"value":1192},"路由跳转没断（从入口到目标页）",{"type":26,"tag":122,"props":1194,"children":1195},{},[1196],{"type":31,"value":1197},"相关接口未改变契约（字段名/类型）",{"type":26,"tag":122,"props":1199,"children":1200},{},[1201],{"type":31,"value":1202},"性能没有明显退化（首屏、交互卡顿）",{"type":26,"tag":122,"props":1204,"children":1205},{},[1206],{"type":31,"value":1207},"回滚方案可执行（知道回滚哪几个文件/commit）",{"type":26,"tag":122,"props":1209,"children":1210},{},[1211],{"type":31,"value":1212},"写下“这次改动解决了什么、风险是什么”（可贴 PR）",{"type":26,"tag":385,"props":1214,"children":1215},{},[],{"type":26,"tag":34,"props":1217,"children":1219},{"id":1218},"必交付物-2失败案例复盘真实会发生",[1220],{"type":31,"value":1221},"必交付物 2：失败案例复盘（真实会发生）",{"type":26,"tag":712,"props":1223,"children":1225},{"id":1224},"现象快捷键用得很熟但交付还是慢",[1226],{"type":31,"value":1227},"现象：快捷键用得很熟，但交付还是慢",{"type":26,"tag":27,"props":1229,"children":1230},{},[1231],{"type":31,"value":1232},"典型原因：你把 Cursor 当成“更聪明的搜索框”，不断对话，直到它给出你想要的答案。",{"type":26,"tag":27,"props":1234,"children":1235},{},[1236],{"type":31,"value":1237},"复现路径：",{"type":26,"tag":118,"props":1239,"children":1240},{},[1241,1246,1251,1256],{"type":26,"tag":122,"props":1242,"children":1243},{},[1244],{"type":31,"value":1245},"你直接说“把页面做得更好看、更高级”",{"type":26,"tag":122,"props":1247,"children":1248},{},[1249],{"type":31,"value":1250},"AI 开始大改样式、抽象组件、甚至引入新依赖",{"type":26,"tag":122,"props":1252,"children":1253},{},[1254],{"type":31,"value":1255},"你为了省事按了“接受建议”",{"type":26,"tag":122,"props":1257,"children":1258},{},[1259],{"type":31,"value":1260},"最后发现：设计没统一、移动端崩、甚至埋了性能问题",{"type":26,"tag":27,"props":1262,"children":1263},{},[1264,1266,1270,1272,1277],{"type":31,"value":1265},"根因：缺少",{"type":26,"tag":324,"props":1267,"children":1268},{},[1269],{"type":31,"value":449},{"type":31,"value":1271},"与",{"type":26,"tag":324,"props":1273,"children":1274},{},[1275],{"type":31,"value":1276},"验收",{"type":31,"value":1278},"。",{"type":26,"tag":27,"props":1280,"children":1281},{},[1282],{"type":31,"value":1283},"修复方式（可照抄）：",{"type":26,"tag":118,"props":1285,"children":1286},{},[1287,1292,1304],{"type":26,"tag":122,"props":1288,"children":1289},{},[1290],{"type":31,"value":1291},"把需求拆成 3 个可验证目标：例如“按钮样式统一”“首屏 CTA 更明显”“移动端间距不挤”",{"type":26,"tag":122,"props":1293,"children":1294},{},[1295,1297,1302],{"type":31,"value":1296},"每个目标只用 ",{"type":26,"tag":518,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":31,"value":763},{"type":31,"value":1303}," 改一个局部",{"type":26,"tag":122,"props":1305,"children":1306},{},[1307],{"type":31,"value":1308},"每次接受建议前跑一遍“最小回归集”",{"type":26,"tag":385,"props":1310,"children":1311},{},[],{"type":26,"tag":34,"props":1313,"children":1315},{"id":1314},"faq高频问题",[1316],{"type":31,"value":1317},"FAQ（高频问题）",{"type":26,"tag":712,"props":1319,"children":1321},{"id":1320},"q1我应该先记快捷键还是先学工作流",[1322],{"type":31,"value":1323},"Q1：我应该先记快捷键还是先学工作流？",{"type":26,"tag":27,"props":1325,"children":1326},{},[1327],{"type":31,"value":1328},"先学工作流。快捷键只是把工作流的步骤变短。",{"type":26,"tag":712,"props":1330,"children":1332},{"id":1331},"q2为什么我一用多文件就容易翻车",[1333],{"type":31,"value":1334},"Q2：为什么我一用多文件就容易翻车？",{"type":26,"tag":27,"props":1336,"children":1337},{},[1338],{"type":31,"value":1339},"因为多文件意味着范围更大、依赖更多、验收更难。先锁定“文件清单 + 每步验收”，再让它动手。",{"type":26,"tag":712,"props":1341,"children":1343},{"id":1342},"q3有没有万能提示词",[1344],{"type":31,"value":1345},"Q3：有没有“万能提示词”？",{"type":26,"tag":27,"props":1347,"children":1348},{},[1349],{"type":31,"value":1350},"没有，但有“万能结构”：目标、范围、非目标、验收、输出格式。",{"type":26,"tag":385,"props":1352,"children":1353},{},[],{"type":26,"tag":34,"props":1355,"children":1357},{"id":1356},"延伸阅读建议按顺序",[1358],{"type":31,"value":1359},"延伸阅读（建议按顺序）",{"type":26,"tag":118,"props":1361,"children":1362},{},[1363,1370,1377,1384],{"type":26,"tag":122,"props":1364,"children":1365},{},[1366],{"type":26,"tag":230,"props":1367,"children":1368},{"href":358},[1369],{"type":31,"value":361},{"type":26,"tag":122,"props":1371,"children":1372},{},[1373],{"type":26,"tag":230,"props":1374,"children":1375},{"href":369},[1376],{"type":31,"value":372},{"type":26,"tag":122,"props":1378,"children":1379},{},[1380],{"type":26,"tag":230,"props":1381,"children":1382},{"href":380},[1383],{"type":31,"value":383},{"type":26,"tag":122,"props":1385,"children":1386},{},[1387,1389],{"type":31,"value":1388},"如果你更关心“网页制作落地”：看这篇 ",{"type":26,"tag":230,"props":1390,"children":1392},{"href":1391},"/topics/practical-tips/htmlpage-quick-landing-page",[1393],{"type":31,"value":1394},"3 分钟用 HTMLPAGE 做落地页",{"title":7,"searchDepth":255,"depth":255,"links":1396},[1397,1398,1399,1411,1412,1415,1420],{"id":390,"depth":258,"text":393},{"id":465,"depth":258,"text":468},{"id":707,"depth":258,"text":710,"children":1400},[1401,1402,1403,1404,1405,1406,1407,1408,1409,1410],{"id":714,"depth":255,"text":717},{"id":773,"depth":255,"text":776},{"id":843,"depth":255,"text":846},{"id":899,"depth":255,"text":902},{"id":939,"depth":255,"text":942},{"id":978,"depth":255,"text":981},{"id":997,"depth":255,"text":1000},{"id":1039,"depth":255,"text":1042},{"id":1074,"depth":255,"text":1077},{"id":1091,"depth":255,"text":1094},{"id":1148,"depth":258,"text":1151},{"id":1218,"depth":258,"text":1221,"children":1413},[1414],{"id":1224,"depth":255,"text":1227},{"id":1314,"depth":258,"text":1317,"children":1416},[1417,1418,1419],{"id":1320,"depth":255,"text":1323},{"id":1331,"depth":255,"text":1334},{"id":1342,"depth":255,"text":1345},{"id":1356,"depth":258,"text":1359},"content:topics:ai:cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet",{"_path":1425,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1426,"description":1427,"date":1428,"topic":5,"author":11,"tags":1429,"image":1433,"imageAlt":1434,"pexelsPhotoId":1435,"pexelsUrl":1436,"readingTime":1437,"body":1438,"_type":262,"_id":2371,"_source":264,"_file":2372,"_stem":2373,"_extension":267},"/topics/ai/cursor-vs-copilot-vscode-workflow","Cursor vs GitHub Copilot vs VS Code：怎么选、怎么搭配、怎么把风险关在笼子里","用“任务类型×风险×验收成本”的选择矩阵解释 Cursor/Copilot/VS Code 的差异，并给出一套可落地的协作工作流（范围闸门、最小回归集、回滚策略）。","2026-03-01",[275,1430,278,1431,1432],"GitHub Copilot","AI 编程","工作流","/images/topics/ai/cursor-vs-copilot-vscode-workflow.jpg","团队在电脑前进行协作讨论",1181371,"https://www.pexels.com/photo/man-wearing-blue-dress-shirt-1181371/",15,{"type":23,"children":1439,"toc":2349},[1440,1445,1450,1468,1473,1491,1494,1500,1505,1536,1541,1544,1550,1558,1762,1770,1783,1786,1792,1798,1811,1816,1829,1835,1840,1873,1879,1884,1902,1905,1911,1916,1922,1927,1960,1966,1979,1984,1997,2003,2015,2021,2026,2039,2044,2047,2053,2058,2179,2182,2188,2198,2207,2225,2234,2242,2251,2269,2272,2278,2284,2289,2295,2300,2303,2308],{"type":26,"tag":27,"props":1441,"children":1442},{},[1443],{"type":31,"value":1444},"“Cursor 和 Copilot 到底有什么区别？”",{"type":26,"tag":27,"props":1446,"children":1447},{},[1448],{"type":31,"value":1449},"这个问题问得越早越好，因为你一旦把工具选错，后面所有痛苦都不是“提示词不够好”，而是：",{"type":26,"tag":118,"props":1451,"children":1452},{},[1453,1458,1463],{"type":26,"tag":122,"props":1454,"children":1455},{},[1456],{"type":31,"value":1457},"改动不可控（范围漂移、改错文件）",{"type":26,"tag":122,"props":1459,"children":1460},{},[1461],{"type":31,"value":1462},"验收成本爆炸（不知道要测什么）",{"type":26,"tag":122,"props":1464,"children":1465},{},[1466],{"type":31,"value":1467},"团队协作崩盘（没有闸门、没有回滚）",{"type":26,"tag":27,"props":1469,"children":1470},{},[1471],{"type":31,"value":1472},"这篇文章用一张选择矩阵 + 一套可执行工作流，帮你做到两件事：",{"type":26,"tag":315,"props":1474,"children":1475},{},[1476,1481],{"type":26,"tag":122,"props":1477,"children":1478},{},[1479],{"type":31,"value":1480},"知道什么时候用 Cursor、什么时候用 Copilot、什么时候“纯 VS Code 更快”",{"type":26,"tag":122,"props":1482,"children":1483},{},[1484,1486],{"type":31,"value":1485},"就算用 AI，也能把风险关在笼子里：",{"type":26,"tag":324,"props":1487,"children":1488},{},[1489],{"type":31,"value":1490},"可审查、可验证、可回滚",{"type":26,"tag":385,"props":1492,"children":1493},{},[],{"type":26,"tag":34,"props":1495,"children":1497},{"id":1496},"结论先说三者不是互斥而是分工",[1498],{"type":31,"value":1499},"结论先说：三者不是互斥，而是分工",{"type":26,"tag":27,"props":1501,"children":1502},{},[1503],{"type":31,"value":1504},"你可以把它们看成三层能力：",{"type":26,"tag":118,"props":1506,"children":1507},{},[1508,1517,1527],{"type":26,"tag":122,"props":1509,"children":1510},{},[1511,1515],{"type":26,"tag":324,"props":1512,"children":1513},{},[1514],{"type":31,"value":278},{"type":31,"value":1516},"：编辑器与生态（调试、插件、任务、终端、语言服务）",{"type":26,"tag":122,"props":1518,"children":1519},{},[1520,1525],{"type":26,"tag":324,"props":1521,"children":1522},{},[1523],{"type":31,"value":1524},"Copilot",{"type":31,"value":1526},"：代码补全与局部建议（“我正在写这一行/这一段”）",{"type":26,"tag":122,"props":1528,"children":1529},{},[1530,1534],{"type":26,"tag":324,"props":1531,"children":1532},{},[1533],{"type":31,"value":275},{"type":31,"value":1535},"：以项目为单位的 AI 协作（对话、索引、多文件编辑、规则）",{"type":26,"tag":27,"props":1537,"children":1538},{},[1539],{"type":31,"value":1540},"最常见的误区是：把“局部补全能力”当作“能做架构与多文件落地”。",{"type":26,"tag":385,"props":1542,"children":1543},{},[],{"type":26,"tag":34,"props":1545,"children":1547},{"id":1546},"选择矩阵按任务类型选工具不是按偏好",[1548],{"type":31,"value":1549},"选择矩阵：按任务类型选工具（不是按偏好）",{"type":26,"tag":694,"props":1551,"children":1552},{},[1553],{"type":26,"tag":27,"props":1554,"children":1555},{},[1556],{"type":31,"value":1557},"你只要把自己的任务放进表格，就能得到推荐路径。",{"type":26,"tag":41,"props":1559,"children":1560},{},[1561,1593],{"type":26,"tag":45,"props":1562,"children":1563},{},[1564],{"type":26,"tag":49,"props":1565,"children":1566},{},[1567,1572,1578,1583,1588],{"type":26,"tag":53,"props":1568,"children":1569},{},[1570],{"type":31,"value":1571},"任务类型",{"type":26,"tag":53,"props":1573,"children":1575},{"align":1574},"right",[1576],{"type":31,"value":1577},"风险",{"type":26,"tag":53,"props":1579,"children":1580},{"align":1574},[1581],{"type":31,"value":1582},"验收成本",{"type":26,"tag":53,"props":1584,"children":1585},{},[1586],{"type":31,"value":1587},"更推荐",{"type":26,"tag":53,"props":1589,"children":1590},{},[1591],{"type":31,"value":1592},"为什么",{"type":26,"tag":64,"props":1594,"children":1595},{},[1596,1623,1656,1682,1709,1736],{"type":26,"tag":49,"props":1597,"children":1598},{},[1599,1604,1609,1613,1618],{"type":26,"tag":71,"props":1600,"children":1601},{},[1602],{"type":31,"value":1603},"写一段代码/补一个 if",{"type":26,"tag":71,"props":1605,"children":1606},{"align":1574},[1607],{"type":31,"value":1608},"低",{"type":26,"tag":71,"props":1610,"children":1611},{"align":1574},[1612],{"type":31,"value":1608},{"type":26,"tag":71,"props":1614,"children":1615},{},[1616],{"type":31,"value":1617},"Copilot / Cursor 内联编辑",{"type":26,"tag":71,"props":1619,"children":1620},{},[1621],{"type":31,"value":1622},"局部建议足够，成本最低",{"type":26,"tag":49,"props":1624,"children":1625},{},[1626,1631,1636,1640,1651],{"type":26,"tag":71,"props":1627,"children":1628},{},[1629],{"type":31,"value":1630},"重构一个函数",{"type":26,"tag":71,"props":1632,"children":1633},{"align":1574},[1634],{"type":31,"value":1635},"中",{"type":26,"tag":71,"props":1637,"children":1638},{"align":1574},[1639],{"type":31,"value":1635},{"type":26,"tag":71,"props":1641,"children":1642},{},[1643,1645],{"type":31,"value":1644},"Cursor ",{"type":26,"tag":518,"props":1646,"children":1648},{"className":1647},[],[1649],{"type":31,"value":1650},"内联编辑",{"type":26,"tag":71,"props":1652,"children":1653},{},[1654],{"type":31,"value":1655},"需要解释、需要约束输出",{"type":26,"tag":49,"props":1657,"children":1658},{},[1659,1664,1668,1672,1677],{"type":26,"tag":71,"props":1660,"children":1661},{},[1662],{"type":31,"value":1663},"改一个组件 + 样式",{"type":26,"tag":71,"props":1665,"children":1666},{"align":1574},[1667],{"type":31,"value":1635},{"type":26,"tag":71,"props":1669,"children":1670},{"align":1574},[1671],{"type":31,"value":1635},{"type":26,"tag":71,"props":1673,"children":1674},{},[1675],{"type":31,"value":1676},"Cursor（小范围多文件）",{"type":26,"tag":71,"props":1678,"children":1679},{},[1680],{"type":31,"value":1681},"需要同时改模板与样式",{"type":26,"tag":49,"props":1683,"children":1684},{},[1685,1690,1695,1699,1704],{"type":26,"tag":71,"props":1686,"children":1687},{},[1688],{"type":31,"value":1689},"改 3~5 个文件（组件+api+测试）",{"type":26,"tag":71,"props":1691,"children":1692},{"align":1574},[1693],{"type":31,"value":1694},"高",{"type":26,"tag":71,"props":1696,"children":1697},{"align":1574},[1698],{"type":31,"value":1694},{"type":26,"tag":71,"props":1700,"children":1701},{},[1702],{"type":31,"value":1703},"Cursor Composer + 闸门",{"type":26,"tag":71,"props":1705,"children":1706},{},[1707],{"type":31,"value":1708},"需要计划、验收、回滚",{"type":26,"tag":49,"props":1710,"children":1711},{},[1712,1717,1722,1726,1731],{"type":26,"tag":71,"props":1713,"children":1714},{},[1715],{"type":31,"value":1716},"重写一段架构/引入新依赖",{"type":26,"tag":71,"props":1718,"children":1719},{"align":1574},[1720],{"type":31,"value":1721},"很高",{"type":26,"tag":71,"props":1723,"children":1724},{"align":1574},[1725],{"type":31,"value":1721},{"type":26,"tag":71,"props":1727,"children":1728},{},[1729],{"type":31,"value":1730},"先人脑设计 + VS Code 实现",{"type":26,"tag":71,"props":1732,"children":1733},{},[1734],{"type":31,"value":1735},"AI 易发散，最好先设计再执行",{"type":26,"tag":49,"props":1737,"children":1738},{},[1739,1744,1748,1752,1757],{"type":26,"tag":71,"props":1740,"children":1741},{},[1742],{"type":31,"value":1743},"排查线上问题/性能抖动",{"type":26,"tag":71,"props":1745,"children":1746},{"align":1574},[1747],{"type":31,"value":1694},{"type":26,"tag":71,"props":1749,"children":1750},{"align":1574},[1751],{"type":31,"value":1721},{"type":26,"tag":71,"props":1753,"children":1754},{},[1755],{"type":31,"value":1756},"VS Code + 工具链优先，AI 辅助归纳",{"type":26,"tag":71,"props":1758,"children":1759},{},[1760],{"type":31,"value":1761},"需要证据，不要“猜”",{"type":26,"tag":27,"props":1763,"children":1764},{},[1765],{"type":26,"tag":324,"props":1766,"children":1767},{},[1768],{"type":31,"value":1769},"一句话规则：",{"type":26,"tag":118,"props":1771,"children":1772},{},[1773,1778],{"type":26,"tag":122,"props":1774,"children":1775},{},[1776],{"type":31,"value":1777},"当你的改动可以用“10 条最小回归集”覆盖时，用 Cursor。",{"type":26,"tag":122,"props":1779,"children":1780},{},[1781],{"type":31,"value":1782},"当你的改动无法验证时，先别让 AI 动手。",{"type":26,"tag":385,"props":1784,"children":1785},{},[],{"type":26,"tag":34,"props":1787,"children":1789},{"id":1788},"差异拆解到底差在哪里",[1790],{"type":31,"value":1791},"差异拆解：到底差在哪里？",{"type":26,"tag":712,"props":1793,"children":1795},{"id":1794},"_1-上下文来源补全-vs-项目索引",[1796],{"type":31,"value":1797},"1) 上下文来源：补全 vs 项目索引",{"type":26,"tag":118,"props":1799,"children":1800},{},[1801,1806],{"type":26,"tag":122,"props":1802,"children":1803},{},[1804],{"type":31,"value":1805},"Copilot 更擅长：你正在写的这几行、当前文件的局部上下文",{"type":26,"tag":122,"props":1807,"children":1808},{},[1809],{"type":31,"value":1810},"Cursor 更擅长：项目级索引 + 多文件关联理解",{"type":26,"tag":27,"props":1812,"children":1813},{},[1814],{"type":31,"value":1815},"因此：",{"type":26,"tag":118,"props":1817,"children":1818},{},[1819,1824],{"type":26,"tag":122,"props":1820,"children":1821},{},[1822],{"type":31,"value":1823},"写代码片段：Copilot 速度更快",{"type":26,"tag":122,"props":1825,"children":1826},{},[1827],{"type":31,"value":1828},"改一坨工程：Cursor 更有胜算（但更需要闸门）",{"type":26,"tag":712,"props":1830,"children":1832},{"id":1831},"_2-交互方式你能不能控制范围",[1833],{"type":31,"value":1834},"2) 交互方式：你能不能控制范围",{"type":26,"tag":27,"props":1836,"children":1837},{},[1838],{"type":31,"value":1839},"范围控制的三个层级：",{"type":26,"tag":315,"props":1841,"children":1842},{},[1843,1853,1863],{"type":26,"tag":122,"props":1844,"children":1845},{},[1846,1848],{"type":31,"value":1847},"内联编辑（选中一段）→ ",{"type":26,"tag":324,"props":1849,"children":1850},{},[1851],{"type":31,"value":1852},"最强范围控制",{"type":26,"tag":122,"props":1854,"children":1855},{},[1856,1858],{"type":31,"value":1857},"Composer 多文件（先列文件清单）→ ",{"type":26,"tag":324,"props":1859,"children":1860},{},[1861],{"type":31,"value":1862},"可控但要闸门",{"type":26,"tag":122,"props":1864,"children":1865},{},[1866,1868],{"type":31,"value":1867},"大对话（泛目标）→ ",{"type":26,"tag":324,"props":1869,"children":1870},{},[1871],{"type":31,"value":1872},"最容易跑偏",{"type":26,"tag":712,"props":1874,"children":1876},{"id":1875},"_3-输出形态建议-vs-可审查的变更",[1877],{"type":31,"value":1878},"3) 输出形态：建议 vs 可审查的变更",{"type":26,"tag":27,"props":1880,"children":1881},{},[1882],{"type":31,"value":1883},"最好的 AI 输出不是“给我一段代码”，而是：",{"type":26,"tag":118,"props":1885,"children":1886},{},[1887,1892,1897],{"type":26,"tag":122,"props":1888,"children":1889},{},[1890],{"type":31,"value":1891},"改动摘要（做了什么）",{"type":26,"tag":122,"props":1893,"children":1894},{},[1895],{"type":31,"value":1896},"diff 级别的可审查变更",{"type":26,"tag":122,"props":1898,"children":1899},{},[1900],{"type":31,"value":1901},"验收步骤与回滚方案",{"type":26,"tag":385,"props":1903,"children":1904},{},[],{"type":26,"tag":34,"props":1906,"children":1908},{"id":1907},"一套可落地的团队工作流把风险关住",[1909],{"type":31,"value":1910},"一套可落地的团队工作流（把风险关住）",{"type":26,"tag":27,"props":1912,"children":1913},{},[1914],{"type":31,"value":1915},"下面这套流程，你可以直接写进团队规范：",{"type":26,"tag":712,"props":1917,"children":1919},{"id":1918},"step-1先写任务单geo-友好结构",[1920],{"type":31,"value":1921},"Step 1：先写任务单（GEO 友好结构）",{"type":26,"tag":27,"props":1923,"children":1924},{},[1925],{"type":31,"value":1926},"模板：",{"type":26,"tag":118,"props":1928,"children":1929},{},[1930,1935,1940,1945,1950,1955],{"type":26,"tag":122,"props":1931,"children":1932},{},[1933],{"type":31,"value":1934},"目标：……",{"type":26,"tag":122,"props":1936,"children":1937},{},[1938],{"type":31,"value":1939},"背景：……",{"type":26,"tag":122,"props":1941,"children":1942},{},[1943],{"type":31,"value":1944},"范围：只改这些文件/模块：……",{"type":26,"tag":122,"props":1946,"children":1947},{},[1948],{"type":31,"value":1949},"非目标：不做哪些事情：……",{"type":26,"tag":122,"props":1951,"children":1952},{},[1953],{"type":31,"value":1954},"验收：如何判断完成（可测试/可观察）：……",{"type":26,"tag":122,"props":1956,"children":1957},{},[1958],{"type":31,"value":1959},"回滚：如果失败怎么撤回：……",{"type":26,"tag":712,"props":1961,"children":1963},{"id":1962},"step-2用范围闸门限制-ai",[1964],{"type":31,"value":1965},"Step 2：用“范围闸门”限制 AI",{"type":26,"tag":118,"props":1967,"children":1968},{},[1969,1974],{"type":26,"tag":122,"props":1970,"children":1971},{},[1972],{"type":31,"value":1973},"单文件改动：优先 Cursor 内联编辑",{"type":26,"tag":122,"props":1975,"children":1976},{},[1977],{"type":31,"value":1978},"多文件改动：必须先让 AI 输出“文件清单（≤5）+ 每步验收”",{"type":26,"tag":27,"props":1980,"children":1981},{},[1982],{"type":31,"value":1983},"如果 AI 输出的文件清单超过 5 个：",{"type":26,"tag":118,"props":1985,"children":1986},{},[1987,1992],{"type":26,"tag":122,"props":1988,"children":1989},{},[1990],{"type":31,"value":1991},"不是它太强，是任务太大",{"type":26,"tag":122,"props":1993,"children":1994},{},[1995],{"type":31,"value":1996},"你需要拆任务，而不是继续推进",{"type":26,"tag":712,"props":1998,"children":2000},{"id":1999},"step-3最小回归集10-条",[2001],{"type":31,"value":2002},"Step 3：最小回归集（10 条）",{"type":26,"tag":27,"props":2004,"children":2005},{},[2006,2008,2013],{"type":31,"value":2007},"每次接受改动前必须跑（可参考：",{"type":26,"tag":230,"props":2009,"children":2010},{"href":270},[2011],{"type":31,"value":2012},"Cursor 快捷键速查表",{"type":31,"value":2014}," 里的清单）。",{"type":26,"tag":712,"props":2016,"children":2018},{"id":2017},"step-4回滚策略不用等事故才想",[2019],{"type":31,"value":2020},"Step 4：回滚策略（不用等事故才想）",{"type":26,"tag":27,"props":2022,"children":2023},{},[2024],{"type":31,"value":2025},"回滚最常见的两条路：",{"type":26,"tag":118,"props":2027,"children":2028},{},[2029,2034],{"type":26,"tag":122,"props":2030,"children":2031},{},[2032],{"type":31,"value":2033},"git 回滚 commit",{"type":26,"tag":122,"props":2035,"children":2036},{},[2037],{"type":31,"value":2038},"对关键文件保留前版本（至少能快速恢复）",{"type":26,"tag":27,"props":2040,"children":2041},{},[2042],{"type":31,"value":2043},"你需要做到：任何一轮 AI 改动都能在 5 分钟内撤回。",{"type":26,"tag":385,"props":2045,"children":2046},{},[],{"type":26,"tag":34,"props":2048,"children":2050},{"id":2049},"必交付物对比矩阵可复制",[2051],{"type":31,"value":2052},"必交付物：对比矩阵（可复制）",{"type":26,"tag":27,"props":2054,"children":2055},{},[2056],{"type":31,"value":2057},"下面这张表可以直接贴到你的团队 wiki：",{"type":26,"tag":41,"props":2059,"children":2060},{},[2061,2084],{"type":26,"tag":45,"props":2062,"children":2063},{},[2064],{"type":26,"tag":49,"props":2065,"children":2066},{},[2067,2072,2076,2080],{"type":26,"tag":53,"props":2068,"children":2069},{},[2070],{"type":31,"value":2071},"维度",{"type":26,"tag":53,"props":2073,"children":2074},{},[2075],{"type":31,"value":278},{"type":26,"tag":53,"props":2077,"children":2078},{},[2079],{"type":31,"value":1524},{"type":26,"tag":53,"props":2081,"children":2082},{},[2083],{"type":31,"value":275},{"type":26,"tag":64,"props":2085,"children":2086},{},[2087,2110,2133,2156],{"type":26,"tag":49,"props":2088,"children":2089},{},[2090,2095,2100,2105],{"type":26,"tag":71,"props":2091,"children":2092},{},[2093],{"type":31,"value":2094},"强项",{"type":26,"tag":71,"props":2096,"children":2097},{},[2098],{"type":31,"value":2099},"工具链、调试、生态",{"type":26,"tag":71,"props":2101,"children":2102},{},[2103],{"type":31,"value":2104},"补全与局部建议",{"type":26,"tag":71,"props":2106,"children":2107},{},[2108],{"type":31,"value":2109},"项目上下文、多文件落地",{"type":26,"tag":49,"props":2111,"children":2112},{},[2113,2118,2123,2128],{"type":26,"tag":71,"props":2114,"children":2115},{},[2116],{"type":31,"value":2117},"适合任务",{"type":26,"tag":71,"props":2119,"children":2120},{},[2121],{"type":31,"value":2122},"排查、调试、验证",{"type":26,"tag":71,"props":2124,"children":2125},{},[2126],{"type":31,"value":2127},"写一段、补一段",{"type":26,"tag":71,"props":2129,"children":2130},{},[2131],{"type":31,"value":2132},"改一段、改一组文件",{"type":26,"tag":49,"props":2134,"children":2135},{},[2136,2141,2146,2151],{"type":26,"tag":71,"props":2137,"children":2138},{},[2139],{"type":31,"value":2140},"最大风险",{"type":26,"tag":71,"props":2142,"children":2143},{},[2144],{"type":31,"value":2145},"无",{"type":26,"tag":71,"props":2147,"children":2148},{},[2149],{"type":31,"value":2150},"过度依赖建议",{"type":26,"tag":71,"props":2152,"children":2153},{},[2154],{"type":31,"value":2155},"范围漂移、多文件回归",{"type":26,"tag":49,"props":2157,"children":2158},{},[2159,2164,2169,2174],{"type":26,"tag":71,"props":2160,"children":2161},{},[2162],{"type":31,"value":2163},"必须搭配",{"type":26,"tag":71,"props":2165,"children":2166},{},[2167],{"type":31,"value":2168},"规范与检查",{"type":26,"tag":71,"props":2170,"children":2171},{},[2172],{"type":31,"value":2173},"代码评审",{"type":26,"tag":71,"props":2175,"children":2176},{},[2177],{"type":31,"value":2178},"闸门 + 最小回归集",{"type":26,"tag":385,"props":2180,"children":2181},{},[],{"type":26,"tag":34,"props":2183,"children":2185},{"id":2184},"失败案例多文件看似成功实际埋雷",[2186],{"type":31,"value":2187},"失败案例：多文件“看似成功”，实际埋雷",{"type":26,"tag":27,"props":2189,"children":2190},{},[2191,2196],{"type":26,"tag":324,"props":2192,"children":2193},{},[2194],{"type":31,"value":2195},"现象",{"type":31,"value":2197},"：AI 说“我已经把所有地方都改了”，你也接受了，结果上线后 404 或样式错位。",{"type":26,"tag":27,"props":2199,"children":2200},{},[2201,2206],{"type":26,"tag":324,"props":2202,"children":2203},{},[2204],{"type":31,"value":2205},"复现条件",{"type":31,"value":1018},{"type":26,"tag":118,"props":2208,"children":2209},{},[2210,2215,2220],{"type":26,"tag":122,"props":2211,"children":2212},{},[2213],{"type":31,"value":2214},"你给了一个大目标（例如“把所有按钮统一成主题色”）",{"type":26,"tag":122,"props":2216,"children":2217},{},[2218],{"type":31,"value":2219},"它改了组件、样式、甚至主题配置",{"type":26,"tag":122,"props":2221,"children":2222},{},[2223],{"type":31,"value":2224},"你没有按页面模块走一遍，直接合并",{"type":26,"tag":27,"props":2226,"children":2227},{},[2228,2233],{"type":26,"tag":324,"props":2229,"children":2230},{},[2231],{"type":31,"value":2232},"根因",{"type":31,"value":1018},{"type":26,"tag":118,"props":2235,"children":2236},{},[2237],{"type":26,"tag":122,"props":2238,"children":2239},{},[2240],{"type":31,"value":2241},"改动范围大，但验收仍按“小改动”的方式做（只看一处）",{"type":26,"tag":27,"props":2243,"children":2244},{},[2245,2250],{"type":26,"tag":324,"props":2246,"children":2247},{},[2248],{"type":31,"value":2249},"修复",{"type":31,"value":1018},{"type":26,"tag":118,"props":2252,"children":2253},{},[2254,2259,2264],{"type":26,"tag":122,"props":2255,"children":2256},{},[2257],{"type":31,"value":2258},"强制把任务拆成“模块级目标”：Hero、Feature、Pricing、Form",{"type":26,"tag":122,"props":2260,"children":2261},{},[2262],{"type":31,"value":2263},"每个模块改完就验收一次",{"type":26,"tag":122,"props":2265,"children":2266},{},[2267],{"type":31,"value":2268},"验收通过再进入下一个模块",{"type":26,"tag":385,"props":2270,"children":2271},{},[],{"type":26,"tag":34,"props":2273,"children":2275},{"id":2274},"faq",[2276],{"type":31,"value":2277},"FAQ",{"type":26,"tag":712,"props":2279,"children":2281},{"id":2280},"q1我已经用了-cursor为什么还要用-copilot",[2282],{"type":31,"value":2283},"Q1：我已经用了 Cursor，为什么还要用 Copilot？",{"type":26,"tag":27,"props":2285,"children":2286},{},[2287],{"type":31,"value":2288},"因为“补全”这种高频低风险任务，Copilot 的交互成本更低；Cursor 更适合需要解释与约束的改动。",{"type":26,"tag":712,"props":2290,"children":2292},{"id":2291},"q2什么时候应该完全不用-ai",[2293],{"type":31,"value":2294},"Q2：什么时候应该完全不用 AI？",{"type":26,"tag":27,"props":2296,"children":2297},{},[2298],{"type":31,"value":2299},"当你无法定义验收标准时。比如“更高级”“更好看”这种目标，先做信息结构与设计规则，再让 AI 帮你落地局部。",{"type":26,"tag":385,"props":2301,"children":2302},{},[],{"type":26,"tag":34,"props":2304,"children":2306},{"id":2305},"延伸阅读",[2307],{"type":31,"value":2305},{"type":26,"tag":118,"props":2309,"children":2310},{},[2311,2320,2329,2338],{"type":26,"tag":122,"props":2312,"children":2313},{},[2314,2316],{"type":31,"value":2315},"Cursor 入门：",{"type":26,"tag":230,"props":2317,"children":2318},{"href":358},[2319],{"type":31,"value":361},{"type":26,"tag":122,"props":2321,"children":2322},{},[2323,2325],{"type":31,"value":2324},"Cursor 进阶：",{"type":26,"tag":230,"props":2326,"children":2327},{"href":369},[2328],{"type":31,"value":372},{"type":26,"tag":122,"props":2330,"children":2331},{},[2332,2334],{"type":31,"value":2333},"规则配置：",{"type":26,"tag":230,"props":2335,"children":2336},{"href":380},[2337],{"type":31,"value":383},{"type":26,"tag":122,"props":2339,"children":2340},{},[2341,2343],{"type":31,"value":2342},"Copilot 实战：",{"type":26,"tag":230,"props":2344,"children":2346},{"href":2345},"/topics/ai/github-copilot-tips",[2347],{"type":31,"value":2348},"GitHub Copilot 实用技巧",{"title":7,"searchDepth":255,"depth":255,"links":2350},[2351,2352,2353,2358,2364,2365,2366,2370],{"id":1496,"depth":258,"text":1499},{"id":1546,"depth":258,"text":1549},{"id":1788,"depth":258,"text":1791,"children":2354},[2355,2356,2357],{"id":1794,"depth":255,"text":1797},{"id":1831,"depth":255,"text":1834},{"id":1875,"depth":255,"text":1878},{"id":1907,"depth":258,"text":1910,"children":2359},[2360,2361,2362,2363],{"id":1918,"depth":255,"text":1921},{"id":1962,"depth":255,"text":1965},{"id":1999,"depth":255,"text":2002},{"id":2017,"depth":255,"text":2020},{"id":2049,"depth":258,"text":2052},{"id":2184,"depth":258,"text":2187},{"id":2274,"depth":258,"text":2277,"children":2367},[2368,2369],{"id":2280,"depth":255,"text":2283},{"id":2291,"depth":255,"text":2294},{"id":2305,"depth":258,"text":2305},"content:topics:ai:cursor-vs-copilot-vscode-workflow.md","topics/ai/cursor-vs-copilot-vscode-workflow.md","topics/ai/cursor-vs-copilot-vscode-workflow",{"_path":2375,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":2376,"description":2377,"date":2378,"topic":5,"author":11,"tags":2379,"image":2384,"featured":177,"readingTime":1437,"body":2385,"_type":262,"_id":3034,"_source":264,"_file":3035,"_stem":3036,"_extension":267},"/topics/ai/ai-debugging-troubleshooting-guide","AI 辅助调试与问题排查：让 AI 成为你的调试搭档","深入探讨如何利用 AI 工具提升调试效率，包括错误信息分析、日志解读、性能问题定位、复杂 bug 排查等实战场景，构建 AI 驱动的调试工作流。","2026-01-18",[2380,2381,2382,279,2383],"AI 调试","问题排查","Debug","错误处理","/images/topics/ai/ai-debugging-guide.jpg",{"type":23,"children":2386,"toc":3005},[2387,2393,2399,2404,2409,2414,2420,2426,2431,2439,2467,2475,2498,2504,2515,2524,2532,2540,2573,2581,2611,2624,2632,2637,2645,2653,2664,2670,2678,2689,2697,2706,2712,2718,2723,2732,2738,2743,2752,2758,2764,2773,2779,2788,2794,2805,2811,2817,2826,2832,2841,2847,2853,2861,2867,2876,2884,2892,2895,2901,2906,2925,2937,2940,2946,2951,2960,2965,2968,2974,2979,2997],{"type":26,"tag":34,"props":2388,"children":2390},{"id":2389},"ai-辅助调试与问题排查",[2391],{"type":31,"value":2392},"AI 辅助调试与问题排查",{"type":26,"tag":34,"props":2394,"children":2396},{"id":2395},"引言调试的痛与-ai-的解药",[2397],{"type":31,"value":2398},"引言：调试的痛与 AI 的解药",{"type":26,"tag":27,"props":2400,"children":2401},{},[2402],{"type":31,"value":2403},"调试是每个程序员的日常，也是最消耗时间和精力的工作之一。我们都有过这样的经历：盯着一个莫名其妙的错误信息，翻遍 Stack Overflow，尝试各种方案，几个小时后才发现是一个愚蠢的拼写错误。",{"type":26,"tag":27,"props":2405,"children":2406},{},[2407],{"type":31,"value":2408},"AI 工具的出现，正在改变调试的方式。不是替代你的思考，而是加速你的分析过程——帮你快速理解错误、缩小排查范围、验证假设。",{"type":26,"tag":27,"props":2410,"children":2411},{},[2412],{"type":31,"value":2413},"这篇文章分享我在实际项目中使用 AI 辅助调试的经验和方法论。",{"type":26,"tag":34,"props":2415,"children":2417},{"id":2416},"第一部分建立-ai-调试的思维模型",[2418],{"type":31,"value":2419},"第一部分：建立 AI 调试的思维模型",{"type":26,"tag":712,"props":2421,"children":2423},{"id":2422},"_11-ai-在调试中的角色",[2424],{"type":31,"value":2425},"1.1 AI 在调试中的角色",{"type":26,"tag":27,"props":2427,"children":2428},{},[2429],{"type":31,"value":2430},"把 AI 想象成一个经验丰富但不了解你项目的高级工程师。它：",{"type":26,"tag":27,"props":2432,"children":2433},{},[2434],{"type":26,"tag":324,"props":2435,"children":2436},{},[2437],{"type":31,"value":2438},"擅长的事情：",{"type":26,"tag":118,"props":2440,"children":2441},{},[2442,2447,2452,2457,2462],{"type":26,"tag":122,"props":2443,"children":2444},{},[2445],{"type":31,"value":2446},"解读错误信息的含义",{"type":26,"tag":122,"props":2448,"children":2449},{},[2450],{"type":31,"value":2451},"提供可能的原因列表",{"type":26,"tag":122,"props":2453,"children":2454},{},[2455],{"type":31,"value":2456},"给出排查方向建议",{"type":26,"tag":122,"props":2458,"children":2459},{},[2460],{"type":31,"value":2461},"解释复杂的技术概念",{"type":26,"tag":122,"props":2463,"children":2464},{},[2465],{"type":31,"value":2466},"生成调试代码片段",{"type":26,"tag":27,"props":2468,"children":2469},{},[2470],{"type":26,"tag":324,"props":2471,"children":2472},{},[2473],{"type":31,"value":2474},"不擅长的事情：",{"type":26,"tag":118,"props":2476,"children":2477},{},[2478,2483,2488,2493],{"type":26,"tag":122,"props":2479,"children":2480},{},[2481],{"type":31,"value":2482},"了解你的业务逻辑",{"type":26,"tag":122,"props":2484,"children":2485},{},[2486],{"type":31,"value":2487},"知道你的代码历史",{"type":26,"tag":122,"props":2489,"children":2490},{},[2491],{"type":31,"value":2492},"理解项目特定的约定",{"type":26,"tag":122,"props":2494,"children":2495},{},[2496],{"type":31,"value":2497},"做出架构级判断",{"type":26,"tag":712,"props":2499,"children":2501},{"id":2500},"_12-有效提问的结构",[2502],{"type":31,"value":2503},"1.2 有效提问的结构",{"type":26,"tag":2505,"props":2506,"children":2510},"pre",{"code":2507,"language":262,"meta":7,"className":2508},"## 高效的调试提问模板\n\n**问题描述**\n[简洁描述遇到的问题]\n\n**错误信息**\n",[2509],"language-markdown",[2511],{"type":26,"tag":518,"props":2512,"children":2513},{"__ignoreMap":7},[2514],{"type":31,"value":2507},{"type":26,"tag":27,"props":2516,"children":2517},{},[2518],{"type":26,"tag":2519,"props":2520,"children":2521},"span",{},[2522],{"type":31,"value":2523},"完整的错误信息，不要截断",{"type":26,"tag":2505,"props":2525,"children":2527},{"code":2526},"\n**相关代码**\n```javascript\n[精简但完整的相关代码]\n",[2528],{"type":26,"tag":518,"props":2529,"children":2530},{"__ignoreMap":7},[2531],{"type":31,"value":2526},{"type":26,"tag":27,"props":2533,"children":2534},{},[2535],{"type":26,"tag":324,"props":2536,"children":2537},{},[2538],{"type":31,"value":2539},"环境信息",{"type":26,"tag":118,"props":2541,"children":2542},{},[2543,2553,2563],{"type":26,"tag":122,"props":2544,"children":2545},{},[2546,2548],{"type":31,"value":2547},"运行环境：",{"type":26,"tag":2519,"props":2549,"children":2550},{},[2551],{"type":31,"value":2552},"Node 版本/浏览器版本",{"type":26,"tag":122,"props":2554,"children":2555},{},[2556,2558],{"type":31,"value":2557},"框架版本：",{"type":26,"tag":2519,"props":2559,"children":2560},{},[2561],{"type":31,"value":2562},"相关框架版本",{"type":26,"tag":122,"props":2564,"children":2565},{},[2566,2568],{"type":31,"value":2567},"操作系统：",{"type":26,"tag":2519,"props":2569,"children":2570},{},[2571],{"type":31,"value":2572},"如果相关",{"type":26,"tag":27,"props":2574,"children":2575},{},[2576],{"type":26,"tag":324,"props":2577,"children":2578},{},[2579],{"type":31,"value":2580},"已尝试的方案",{"type":26,"tag":118,"props":2582,"children":2583},{},[2584,2598],{"type":26,"tag":122,"props":2585,"children":2586},{},[2587,2592,2593],{"type":26,"tag":2519,"props":2588,"children":2589},{},[2590],{"type":31,"value":2591},"方案1",{"type":31,"value":1018},{"type":26,"tag":2519,"props":2594,"children":2595},{},[2596],{"type":31,"value":2597},"结果",{"type":26,"tag":122,"props":2599,"children":2600},{},[2601,2606,2607],{"type":26,"tag":2519,"props":2602,"children":2603},{},[2604],{"type":31,"value":2605},"方案2",{"type":31,"value":1018},{"type":26,"tag":2519,"props":2608,"children":2609},{},[2610],{"type":31,"value":2597},{"type":26,"tag":27,"props":2612,"children":2613},{},[2614,2619],{"type":26,"tag":324,"props":2615,"children":2616},{},[2617],{"type":31,"value":2618},"期望的结果",{"type":26,"tag":2519,"props":2620,"children":2621},{},[2622],{"type":31,"value":2623},"描述期望的行为",{"type":26,"tag":2505,"props":2625,"children":2627},{"code":2626},"\n### 1.3 分级调试策略\n\n",[2628],{"type":26,"tag":518,"props":2629,"children":2630},{"__ignoreMap":7},[2631],{"type":31,"value":2626},{"type":26,"tag":27,"props":2633,"children":2634},{},[2635],{"type":31,"value":2636},"┌───────────────────────────────────────────────────────────┐\n│                    AI 辅助调试决策树                        │\n├───────────────────────────────────────────────────────────┤\n│                                                           │\n│  Level 1：简单错误（5分钟内解决）                           │\n│  ├── 语法错误、拼写错误                                    │\n│  ├── 方法：直接复制错误信息给 AI                           │\n│  └── 工具：Copilot Chat / ChatGPT                        │\n│                                                           │\n│  Level 2：中等复杂度（30分钟内解决）                        │\n│  ├── 类型错误、逻辑错误、API 使用错误                      │\n│  ├── 方法：提供错误信息 + 相关代码 + 上下文                 │\n│  └── 工具：Cursor Chat / Claude                          │\n│                                                           │\n│  Level 3：复杂问题（需要深入分析）                          │\n│  ├── 竞态条件、内存泄漏、性能问题                          │\n│  ├── 方法：详细描述场景 + 提供多个文件 + 讨论               │\n│  └── 工具：Cursor Composer / 专门的 AI 会话                │\n│                                                           │\n│  Level 4：架构级问题                                       │\n│  ├── 设计缺陷、技术债务                                    │\n│  ├── 方法：AI 辅助分析 + 人工判断                          │\n│  └── 工具：与团队讨论 + AI 作为顾问                        │\n│                                                           │\n└───────────────────────────────────────────────────────────┘",{"type":26,"tag":2505,"props":2638,"children":2640},{"code":2639},"\n## 第二部分：错误信息分析\n\n### 2.1 前端错误分析\n\n**场景 1：React 错误边界触发**\n\n```typescript\n// 错误信息：\n// Error: Hydration failed because the initial UI does not match \n// what was rendered on the server.\n\n// 提问方式：\n/**\n * 我在 Next.js 14 App Router 项目中遇到这个错误：\n * \n * Error: Hydration failed because the initial UI does not match \n * what was rendered on the server.\n * \n * 相关代码：\n */\nfunction UserStatus() {\n  const [isLoggedIn, setIsLoggedIn] = useState(false);\n  \n  useEffect(() => {\n    setIsLoggedIn(localStorage.getItem('token') !== null);\n  }, []);\n  \n  return \u003Cdiv>{isLoggedIn ? '已登录' : '未登录'}\u003C/div>;\n}\n\n// AI 会分析出：\n// 1. 服务端渲染时 localStorage 不可用，默认 false\n// 2. 客户端 hydration 时可能是 true\n// 3. 导致服务端和客户端渲染结果不一致\n\n// AI 建议的解决方案：\nfunction UserStatus() {\n  const [isLoggedIn, setIsLoggedIn] = useState\u003Cboolean | null>(null);\n  \n  useEffect(() => {\n    setIsLoggedIn(localStorage.getItem('token') !== null);\n  }, []);\n  \n  // 初始状态显示加载中，避免 hydration 不匹配\n  if (isLoggedIn === null) {\n    return \u003Cdiv>加载中...\u003C/div>;\n  }\n  \n  return \u003Cdiv>{isLoggedIn ? '已登录' : '未登录'}\u003C/div>;\n}\n",[2641],{"type":26,"tag":518,"props":2642,"children":2643},{"__ignoreMap":7},[2644],{"type":31,"value":2639},{"type":26,"tag":27,"props":2646,"children":2647},{},[2648],{"type":26,"tag":324,"props":2649,"children":2650},{},[2651],{"type":31,"value":2652},"场景 2：Vue 响应式警告",{"type":26,"tag":2505,"props":2654,"children":2659},{"code":2655,"language":2656,"meta":7,"className":2657},"// 警告信息：\n// [Vue warn]: Property \"xxx\" was accessed during render but is not \n// defined on instance.\n\n// 提问方式：\n/**\n * Vue 3 项目中出现这个警告：\n * [Vue warn]: Property \"userInfo\" was accessed during render \n * but is not defined on instance.\n * \n * 组件代码：\n */\n\u003Ctemplate>\n  \u003Cdiv>{{ userInfo.name }}\u003C/div>\n\u003C/template>\n\n\u003Cscript setup>\nconst { data: userInfo } = await useFetch('/api/user');\n\u003C/script>\n\n// AI 分析：\n// 1. useFetch 是异步的，初始渲染时 userInfo 可能是 undefined\n// 2. 直接访问 userInfo.name 会报错\n\n// AI 建议：\n\u003Ctemplate>\n  \u003Cdiv v-if=\"userInfo\">{{ userInfo.name }}\u003C/div>\n  \u003Cdiv v-else>加载中...\u003C/div>\n\u003C/template>\n\n\u003Cscript setup>\nconst { data: userInfo, pending } = await useFetch('/api/user');\n\u003C/script>\n","typescript",[2658],"language-typescript",[2660],{"type":26,"tag":518,"props":2661,"children":2662},{"__ignoreMap":7},[2663],{"type":31,"value":2655},{"type":26,"tag":712,"props":2665,"children":2667},{"id":2666},"_22-后端错误分析",[2668],{"type":31,"value":2669},"2.2 后端错误分析",{"type":26,"tag":27,"props":2671,"children":2672},{},[2673],{"type":26,"tag":324,"props":2674,"children":2675},{},[2676],{"type":31,"value":2677},"场景 1：Node.js 内存问题",{"type":26,"tag":2505,"props":2679,"children":2684},{"code":2680,"language":2681,"meta":7,"className":2682},"// 错误信息：\n// FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - \n// JavaScript heap out of memory\n\n// 提问方式（包含上下文）：\n/**\n * Node.js 服务运行几小时后崩溃，错误信息：\n * FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - \n * JavaScript heap out of memory\n * \n * 服务功能：处理 CSV 文件上传，每次约 100MB\n * \n * 处理代码：\n */\nasync function processCSV(filePath) {\n  const content = fs.readFileSync(filePath, 'utf-8');\n  const rows = content.split('\\n');\n  const results = [];\n  \n  for (const row of rows) {\n    const processed = await processRow(row);\n    results.push(processed);\n  }\n  \n  return results;\n}\n\n// AI 分析会指出：\n// 1. 一次性读取整个文件到内存\n// 2. 所有处理结果累积在 results 数组\n// 3. 建议使用流式处理\n\n// AI 提供的优化方案：\nconst { createReadStream } = require('fs');\nconst { createInterface } = require('readline');\n\nasync function processCSVStream(filePath, onRow) {\n  const fileStream = createReadStream(filePath);\n  const rl = createInterface({\n    input: fileStream,\n    crlfDelay: Infinity\n  });\n  \n  let count = 0;\n  for await (const line of rl) {\n    await onRow(line);\n    count++;\n    \n    // 每处理 1000 行，给 GC 机会运行\n    if (count % 1000 === 0) {\n      await new Promise(r => setImmediate(r));\n    }\n  }\n}\n","javascript",[2683],"language-javascript",[2685],{"type":26,"tag":518,"props":2686,"children":2687},{"__ignoreMap":7},[2688],{"type":31,"value":2680},{"type":26,"tag":27,"props":2690,"children":2691},{},[2692],{"type":26,"tag":324,"props":2693,"children":2694},{},[2695],{"type":31,"value":2696},"场景 2：数据库连接问题",{"type":26,"tag":2505,"props":2698,"children":2701},{"code":2699,"language":2656,"meta":7,"className":2700},"// 错误信息：\n// Error: Connection pool exhausted - \n// max connections (10) already in use\n\n// 提问方式：\n/**\n * PostgreSQL 连接池耗尽错误，高并发时出现：\n * Error: Connection pool exhausted\n * \n * 当前配置：\n * - max connections: 10\n * - 并发请求: 约 100/秒\n * \n * 数据库调用代码：\n */\nasync function getUserData(userId: string) {\n  const client = await pool.connect();\n  try {\n    const user = await client.query('SELECT * FROM users WHERE id = $1', [userId]);\n    const orders = await client.query('SELECT * FROM orders WHERE user_id = $1', [userId]);\n    const payments = await client.query('SELECT * FROM payments WHERE user_id = $1', [userId]);\n    return { user: user.rows[0], orders: orders.rows, payments: payments.rows };\n  } finally {\n    client.release();\n  }\n}\n\n// AI 会分析出多个可能原因并给出综合方案\n",[2658],[2702],{"type":26,"tag":518,"props":2703,"children":2704},{"__ignoreMap":7},[2705],{"type":31,"value":2699},{"type":26,"tag":34,"props":2707,"children":2709},{"id":2708},"第三部分日志分析与问题定位",[2710],{"type":31,"value":2711},"第三部分：日志分析与问题定位",{"type":26,"tag":712,"props":2713,"children":2715},{"id":2714},"_31-结构化日志分析",[2716],{"type":31,"value":2717},"3.1 结构化日志分析",{"type":26,"tag":27,"props":2719,"children":2720},{},[2721],{"type":31,"value":2722},"当面对大量日志时，让 AI 帮你快速定位问题：",{"type":26,"tag":2505,"props":2724,"children":2727},{"code":2725,"language":2681,"meta":7,"className":2726},"// 提问示例：\n/**\n * 分析以下日志，找出导致请求失败的原因：\n * \n * 日志片段：\n */\nconst logs = `\n2024-01-15 10:23:45.123 INFO  [req-abc123] 收到请求 POST /api/order\n2024-01-15 10:23:45.125 DEBUG [req-abc123] 用户认证通过 userId=u001\n2024-01-15 10:23:45.130 DEBUG [req-abc123] 开始库存检查 productId=p001\n2024-01-15 10:23:45.145 DEBUG [req-abc123] 库存检查通过 available=50\n2024-01-15 10:23:45.150 DEBUG [req-abc123] 开始创建订单\n2024-01-15 10:23:45.200 DEBUG [req-abc123] 数据库连接获取成功\n2024-01-15 10:23:45.250 ERROR [req-abc123] 订单创建失败 error=\"deadlock detected\"\n2024-01-15 10:23:45.251 WARN  [req-abc123] 事务回滚\n2024-01-15 10:23:45.255 INFO  [req-abc123] 响应 500 耗时 132ms\n`;\n\n// AI 分析结果会包括：\n// 1. 问题定位：数据库死锁\n// 2. 可能原因：并发订单创建导致锁竞争\n// 3. 排查建议：检查事务隔离级别、锁顺序\n",[2683],[2728],{"type":26,"tag":518,"props":2729,"children":2730},{"__ignoreMap":7},[2731],{"type":31,"value":2725},{"type":26,"tag":712,"props":2733,"children":2735},{"id":2734},"_32-创建调试日志",[2736],{"type":31,"value":2737},"3.2 创建调试日志",{"type":26,"tag":27,"props":2739,"children":2740},{},[2741],{"type":31,"value":2742},"让 AI 帮你生成调试用的日志代码：",{"type":26,"tag":2505,"props":2744,"children":2747},{"code":2745,"language":2656,"meta":7,"className":2746},"// 请求：\n// \"为这个函数添加详细的调试日志，包括入参、关键步骤、耗时和结果\"\n\n// 原代码：\nasync function processOrder(order: Order): Promise\u003COrderResult> {\n  const inventory = await checkInventory(order.items);\n  const payment = await processPayment(order.userId, order.total);\n  const result = await createOrder(order, payment.transactionId);\n  return result;\n}\n\n// AI 生成的带日志版本：\nasync function processOrder(order: Order): Promise\u003COrderResult> {\n  const requestId = generateRequestId();\n  const startTime = performance.now();\n  \n  logger.info({\n    requestId,\n    event: 'order_processing_start',\n    orderId: order.id,\n    userId: order.userId,\n    itemCount: order.items.length,\n    total: order.total\n  });\n  \n  try {\n    // 库存检查\n    const inventoryStart = performance.now();\n    const inventory = await checkInventory(order.items);\n    logger.debug({\n      requestId,\n      event: 'inventory_check_complete',\n      duration: performance.now() - inventoryStart,\n      available: inventory.allAvailable\n    });\n    \n    // 支付处理\n    const paymentStart = performance.now();\n    const payment = await processPayment(order.userId, order.total);\n    logger.debug({\n      requestId,\n      event: 'payment_complete',\n      duration: performance.now() - paymentStart,\n      transactionId: payment.transactionId\n    });\n    \n    // 创建订单\n    const createStart = performance.now();\n    const result = await createOrder(order, payment.transactionId);\n    logger.debug({\n      requestId,\n      event: 'order_created',\n      duration: performance.now() - createStart,\n      resultOrderId: result.orderId\n    });\n    \n    logger.info({\n      requestId,\n      event: 'order_processing_complete',\n      duration: performance.now() - startTime,\n      success: true\n    });\n    \n    return result;\n  } catch (error) {\n    logger.error({\n      requestId,\n      event: 'order_processing_failed',\n      duration: performance.now() - startTime,\n      error: error.message,\n      stack: error.stack\n    });\n    throw error;\n  }\n}\n",[2658],[2748],{"type":26,"tag":518,"props":2749,"children":2750},{"__ignoreMap":7},[2751],{"type":31,"value":2745},{"type":26,"tag":34,"props":2753,"children":2755},{"id":2754},"第四部分性能问题排查",[2756],{"type":31,"value":2757},"第四部分：性能问题排查",{"type":26,"tag":712,"props":2759,"children":2761},{"id":2760},"_41-前端性能分析",[2762],{"type":31,"value":2763},"4.1 前端性能分析",{"type":26,"tag":2505,"props":2765,"children":2768},{"code":2766,"language":2656,"meta":7,"className":2767},"// 场景：页面加载慢，需要分析原因\n\n// 提问方式：\n/**\n * 页面首屏加载需要 5 秒，以下是 Performance API 数据，\n * 请分析性能瓶颈：\n */\nconst performanceData = {\n  // Navigation Timing\n  dns: 50,           // DNS 查询\n  tcp: 100,          // TCP 连接\n  ttfb: 800,         // 首字节时间\n  download: 200,     // 文档下载\n  domParsing: 300,   // DOM 解析\n  domContentLoaded: 1500,\n  load: 5000,\n  \n  // Resource Timing (主要资源)\n  resources: [\n    { name: 'main.js', size: '2.5MB', duration: 1200 },\n    { name: 'vendor.js', size: '1.8MB', duration: 900 },\n    { name: 'styles.css', size: '500KB', duration: 300 },\n    { name: 'hero-image.jpg', size: '3MB', duration: 1500 },\n  ],\n  \n  // Long Tasks\n  longTasks: [\n    { startTime: 1600, duration: 800, name: 'script-evaluation' },\n    { startTime: 2500, duration: 400, name: 'layout' }\n  ]\n};\n\n// AI 会分析出：\n// 1. JS bundle 过大（4.3MB），需要代码分割\n// 2. 图片未优化（3MB 的 hero 图片）\n// 3. 存在长任务阻塞主线程\n// 并给出具体优化建议\n",[2658],[2769],{"type":26,"tag":518,"props":2770,"children":2771},{"__ignoreMap":7},[2772],{"type":31,"value":2766},{"type":26,"tag":712,"props":2774,"children":2776},{"id":2775},"_42-内存泄漏排查",[2777],{"type":31,"value":2778},"4.2 内存泄漏排查",{"type":26,"tag":2505,"props":2780,"children":2783},{"code":2781,"language":2656,"meta":7,"className":2782},"// 场景：应用运行一段时间后变卡\n\n// 提问方式：\n/**\n * React 应用运行一段时间后内存持续增长，以下是 Heap Snapshot 对比：\n * \n * 初始状态：50MB\n * 运行 1 小时后：150MB\n * 运行 2 小时后：280MB\n * \n * Retained objects 增长最快的：\n * - (closure) - 增长 50MB\n * - HTMLDivElement - 增长 30MB\n * - Array - 增长 20MB\n * \n * 可疑代码：\n */\nfunction DataDashboard() {\n  const [data, setData] = useState([]);\n  const chartRef = useRef(null);\n  \n  useEffect(() => {\n    // 每秒刷新数据\n    const interval = setInterval(async () => {\n      const newData = await fetchLatestData();\n      setData(prev => [...prev, ...newData]);  // 数据不断累积\n    }, 1000);\n    \n    // 初始化图表\n    const chart = new Chart(chartRef.current, {\n      // 配置...\n    });\n    \n    // 没有 cleanup！\n  }, []);\n  \n  return \u003Ccanvas ref={chartRef} />;\n}\n\n// AI 会指出：\n// 1. interval 没有清理\n// 2. Chart 实例没有销毁\n// 3. data 无限增长\n// 并提供修复代码\n",[2658],[2784],{"type":26,"tag":518,"props":2785,"children":2786},{"__ignoreMap":7},[2787],{"type":31,"value":2781},{"type":26,"tag":712,"props":2789,"children":2791},{"id":2790},"_43-数据库查询优化",[2792],{"type":31,"value":2793},"4.3 数据库查询优化",{"type":26,"tag":2505,"props":2795,"children":2800},{"code":2796,"language":2797,"meta":7,"className":2798},"-- 场景：查询很慢，让 AI 分析执行计划\n\n-- 提问方式：\n-- 以下查询在数据量大时很慢（orders 表 1000 万行），\n-- 执行计划如下，请分析并优化：\n\nEXPLAIN ANALYZE\nSELECT o.*, u.name, u.email\nFROM orders o\nJOIN users u ON o.user_id = u.id\nWHERE o.status = 'pending'\n  AND o.created_at > '2024-01-01'\nORDER BY o.created_at DESC\nLIMIT 20;\n\n-- 执行计划：\n/*\nSort  (cost=156847.23..157847.23 rows=400000 width=250)\n  Sort Key: o.created_at DESC\n  ->  Hash Join  (cost=1500.00..89847.23 rows=400000 width=250)\n        Hash Cond: (o.user_id = u.id)\n        ->  Seq Scan on orders o  (cost=0.00..85000.00 rows=400000)\n              Filter: ((status = 'pending') AND (created_at > '2024-01-01'))\n        ->  Hash  (cost=1000.00..1000.00 rows=50000 width=100)\n              ->  Seq Scan on users u  (cost=0.00..1000.00 rows=50000)\nPlanning Time: 0.5 ms\nExecution Time: 3500 ms\n*/\n\n-- AI 会分析出问题并建议：\n-- 1. orders 表全表扫描 - 需要复合索引\n-- 2. 建议创建索引：\nCREATE INDEX idx_orders_status_created ON orders(status, created_at DESC);\n\n-- 3. 如果 status 选择性不高，考虑部分索引：\nCREATE INDEX idx_orders_pending ON orders(created_at DESC) \nWHERE status = 'pending';\n","sql",[2799],"language-sql",[2801],{"type":26,"tag":518,"props":2802,"children":2803},{"__ignoreMap":7},[2804],{"type":31,"value":2796},{"type":26,"tag":34,"props":2806,"children":2808},{"id":2807},"第五部分复杂-bug-排查",[2809],{"type":31,"value":2810},"第五部分：复杂 Bug 排查",{"type":26,"tag":712,"props":2812,"children":2814},{"id":2813},"_51-竞态条件",[2815],{"type":31,"value":2816},"5.1 竞态条件",{"type":26,"tag":2505,"props":2818,"children":2821},{"code":2819,"language":2656,"meta":7,"className":2820},"// 场景：偶发的数据不一致问题\n\n// 提问方式：\n/**\n * 用户反馈偶尔看到错误的账户余额，但刷新后正常。\n * 怀疑是竞态条件，以下是相关代码：\n */\nasync function updateBalance(userId: string, amount: number) {\n  // 读取当前余额\n  const user = await db.users.findOne({ id: userId });\n  const newBalance = user.balance + amount;\n  \n  // 更新余额\n  await db.users.update({ id: userId }, { balance: newBalance });\n  \n  // 记录交易\n  await db.transactions.create({\n    userId,\n    amount,\n    balanceAfter: newBalance,\n    createdAt: new Date()\n  });\n  \n  return newBalance;\n}\n\n// 并发调用场景：\n// 用户同时发起两笔交易：+100 和 -50\n// 期望结果：原余额 1000 → 1050\n// 实际可能：原余额 1000 → 1100 或 950\n\n// AI 会分析竞态条件并提供解决方案：\nasync function updateBalanceAtomic(userId: string, amount: number) {\n  // 方案 1：使用数据库原子操作\n  const result = await db.users.findOneAndUpdate(\n    { id: userId },\n    { $inc: { balance: amount } },\n    { returnDocument: 'after' }\n  );\n  \n  await db.transactions.create({\n    userId,\n    amount,\n    balanceAfter: result.balance,\n    createdAt: new Date()\n  });\n  \n  return result.balance;\n}\n\n// 方案 2：使用乐观锁\nasync function updateBalanceOptimistic(userId: string, amount: number) {\n  const maxRetries = 3;\n  \n  for (let i = 0; i \u003C maxRetries; i++) {\n    const user = await db.users.findOne({ id: userId });\n    const newBalance = user.balance + amount;\n    \n    const updated = await db.users.updateOne(\n      { id: userId, version: user.version },\n      { balance: newBalance, version: user.version + 1 }\n    );\n    \n    if (updated.modifiedCount === 1) {\n      await db.transactions.create({...});\n      return newBalance;\n    }\n    \n    // 版本冲突，重试\n    await sleep(10 * (i + 1));\n  }\n  \n  throw new Error('Update failed after retries');\n}\n",[2658],[2822],{"type":26,"tag":518,"props":2823,"children":2824},{"__ignoreMap":7},[2825],{"type":31,"value":2819},{"type":26,"tag":712,"props":2827,"children":2829},{"id":2828},"_52-分布式系统问题",[2830],{"type":31,"value":2831},"5.2 分布式系统问题",{"type":26,"tag":2505,"props":2833,"children":2836},{"code":2834,"language":2656,"meta":7,"className":2835},"// 场景：微服务间的数据不一致\n\n// 提问方式：\n/**\n * 订单服务和库存服务偶尔出现数据不一致：\n * - 订单显示已创建\n * - 库存未扣减\n * \n * 当前流程：\n */\n// Order Service\nasync function createOrder(orderData) {\n  // 1. 调用库存服务扣减库存\n  await inventoryService.deduct(orderData.items);\n  \n  // 2. 创建订单\n  const order = await orderRepository.create(orderData);\n  \n  // 3. 发送订单创建事件\n  await eventBus.publish('order.created', order);\n  \n  return order;\n}\n\n// 问题分析：如果步骤 2 或 3 失败，库存已经扣减但订单未创建\n\n// AI 会建议使用 Saga 模式或事务发件箱模式\n",[2658],[2837],{"type":26,"tag":518,"props":2838,"children":2839},{"__ignoreMap":7},[2840],{"type":31,"value":2834},{"type":26,"tag":34,"props":2842,"children":2844},{"id":2843},"第六部分ai-调试工作流",[2845],{"type":31,"value":2846},"第六部分：AI 调试工作流",{"type":26,"tag":712,"props":2848,"children":2850},{"id":2849},"_61-我的调试流程",[2851],{"type":31,"value":2852},"6.1 我的调试流程",{"type":26,"tag":2505,"props":2854,"children":2856},{"code":2855},"┌────────────────────────────────────────────────────────────┐\n│                    AI 辅助调试工作流                         │\n├────────────────────────────────────────────────────────────┤\n│                                                            │\n│  Step 1: 问题收集                                          │\n│  ├── 复制完整错误信息                                       │\n│  ├── 截图相关日志                                          │\n│  └── 记录复现步骤                                          │\n│                                                            │\n│  Step 2: 快速分析                                          │\n│  ├── 将错误信息发给 AI                                      │\n│  ├── 获取可能原因列表                                       │\n│  └── 评估哪些最可能                                         │\n│                                                            │\n│  Step 3: 深入调查                                          │\n│  ├── 根据 AI 建议添加日志/断点                              │\n│  ├── 收集更多信息                                          │\n│  └── 再次询问 AI（带新信息）                                │\n│                                                            │\n│  Step 4: 验证修复                                          │\n│  ├── AI 生成修复代码                                        │\n│  ├── 人工审查确认                                          │\n│  └── 测试验证                                               │\n│                                                            │\n│  Step 5: 预防措施                                          │\n│  ├── AI 建议类似问题的预防方法                              │\n│  ├── 添加相关测试用例                                       │\n│  └── 更新文档/知识库                                        │\n│                                                            │\n└────────────────────────────────────────────────────────────┘\n",[2857],{"type":26,"tag":518,"props":2858,"children":2859},{"__ignoreMap":7},[2860],{"type":31,"value":2855},{"type":26,"tag":712,"props":2862,"children":2864},{"id":2863},"_62-调试对话模板",[2865],{"type":31,"value":2866},"6.2 调试对话模板",{"type":26,"tag":2505,"props":2868,"children":2871},{"code":2869,"language":262,"meta":7,"className":2870},"## 第一轮：问题描述\n\n我遇到了一个问题：[简述问题]\n\n错误信息：\n",[2509],[2872],{"type":26,"tag":518,"props":2873,"children":2874},{"__ignoreMap":7},[2875],{"type":31,"value":2869},{"type":26,"tag":27,"props":2877,"children":2878},{},[2879],{"type":26,"tag":2519,"props":2880,"children":2881},{},[2882],{"type":31,"value":2883},"粘贴完整错误",{"type":26,"tag":2505,"props":2885,"children":2887},{"code":2886},"\n相关代码：\n```javascript\n[粘贴代码]\n",[2888],{"type":26,"tag":518,"props":2889,"children":2890},{"__ignoreMap":7},[2891],{"type":31,"value":2886},{"type":26,"tag":385,"props":2893,"children":2894},{},[],{"type":26,"tag":34,"props":2896,"children":2898},{"id":2897},"第二轮补充信息",[2899],{"type":31,"value":2900},"第二轮：补充信息",{"type":26,"tag":27,"props":2902,"children":2903},{},[2904],{"type":31,"value":2905},"根据你的建议，我添加了日志，发现：",{"type":26,"tag":118,"props":2907,"children":2908},{},[2909,2917],{"type":26,"tag":122,"props":2910,"children":2911},{},[2912],{"type":26,"tag":2519,"props":2913,"children":2914},{},[2915],{"type":31,"value":2916},"发现 1",{"type":26,"tag":122,"props":2918,"children":2919},{},[2920],{"type":26,"tag":2519,"props":2921,"children":2922},{},[2923],{"type":31,"value":2924},"发现 2",{"type":26,"tag":27,"props":2926,"children":2927},{},[2928,2930,2935],{"type":31,"value":2929},"这是否说明问题出在 ",{"type":26,"tag":2519,"props":2931,"children":2932},{},[2933],{"type":31,"value":2934},"你的猜测",{"type":31,"value":2936},"？",{"type":26,"tag":385,"props":2938,"children":2939},{},[],{"type":26,"tag":34,"props":2941,"children":2943},{"id":2942},"第三轮确认修复",[2944],{"type":31,"value":2945},"第三轮：确认修复",{"type":26,"tag":27,"props":2947,"children":2948},{},[2949],{"type":31,"value":2950},"我按照你的建议修改了代码：",{"type":26,"tag":2505,"props":2952,"children":2955},{"code":2953,"language":2681,"meta":7,"className":2954},"[粘贴修改后的代码]\n",[2683],[2956],{"type":26,"tag":518,"props":2957,"children":2958},{"__ignoreMap":7},[2959],{"type":31,"value":2953},{"type":26,"tag":27,"props":2961,"children":2962},{},[2963],{"type":31,"value":2964},"请确认这个修复是否正确，以及是否有其他潜在问题。",{"type":26,"tag":385,"props":2966,"children":2967},{},[],{"type":26,"tag":34,"props":2969,"children":2971},{"id":2970},"第四轮预防",[2972],{"type":31,"value":2973},"第四轮：预防",{"type":26,"tag":27,"props":2975,"children":2976},{},[2977],{"type":31,"value":2978},"这个问题已解决。请建议：",{"type":26,"tag":315,"props":2980,"children":2981},{},[2982,2987,2992],{"type":26,"tag":122,"props":2983,"children":2984},{},[2985],{"type":31,"value":2986},"如何防止类似问题再次发生？",{"type":26,"tag":122,"props":2988,"children":2989},{},[2990],{"type":31,"value":2991},"应该添加什么测试用例？",{"type":26,"tag":122,"props":2993,"children":2994},{},[2995],{"type":31,"value":2996},"有什么最佳实践可以参考？",{"type":26,"tag":2505,"props":2998,"children":3000},{"code":2999},"\n## 结语：AI 是放大器，不是替代品\n\nAI 调试工具能够显著加速问题排查过程，但它不能替代你的思考。最有价值的能力组合是：\n\n- **你的领域知识** + **AI 的广博见识**\n- **你对项目的理解** + **AI 的分析能力**\n- **你的判断力** + **AI 的执行速度**\n\n调试的本质是假设-验证的循环。AI 帮你更快地生成假设、更高效地验证假设，但做出最终判断的还是你。\n\n学会与 AI 高效协作调试，不是依赖 AI 给你答案，而是让 AI 帮你更快地找到自己的答案。\n\n---\n\n## 参考资源\n\n- [Chrome DevTools 官方文档](https://developer.chrome.com/docs/devtools)\n- [Node.js 调试指南](https://nodejs.org/en/docs/guides/debugging-getting-started)\n- [React DevTools 使用指南](https://react.dev/learn/react-developer-tools)\n",[3001],{"type":26,"tag":518,"props":3002,"children":3003},{"__ignoreMap":7},[3004],{"type":31,"value":2999},{"title":7,"searchDepth":255,"depth":255,"links":3006},[3007,3008,3009,3014,3018,3023,3027,3031,3032,3033],{"id":2389,"depth":258,"text":2392},{"id":2395,"depth":258,"text":2398},{"id":2416,"depth":258,"text":2419,"children":3010},[3011,3012,3013],{"id":2422,"depth":255,"text":2425},{"id":2500,"depth":255,"text":2503},{"id":2666,"depth":255,"text":2669},{"id":2708,"depth":258,"text":2711,"children":3015},[3016,3017],{"id":2714,"depth":255,"text":2717},{"id":2734,"depth":255,"text":2737},{"id":2754,"depth":258,"text":2757,"children":3019},[3020,3021,3022],{"id":2760,"depth":255,"text":2763},{"id":2775,"depth":255,"text":2778},{"id":2790,"depth":255,"text":2793},{"id":2807,"depth":258,"text":2810,"children":3024},[3025,3026],{"id":2813,"depth":255,"text":2816},{"id":2828,"depth":255,"text":2831},{"id":2843,"depth":258,"text":2846,"children":3028},[3029,3030],{"id":2849,"depth":255,"text":2852},{"id":2863,"depth":255,"text":2866},{"id":2897,"depth":258,"text":2900},{"id":2942,"depth":258,"text":2945},{"id":2970,"depth":258,"text":2973},"content:topics:ai:ai-debugging-troubleshooting-guide.md","topics/ai/ai-debugging-troubleshooting-guide.md","topics/ai/ai-debugging-troubleshooting-guide",{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":3038,"image":17,"imageQuery":18,"pexelsPhotoId":19,"pexelsUrl":20,"featured":6,"readingTime":21,"body":3039,"_type":262,"_id":263,"_source":264,"_file":265,"_stem":266,"_extension":267},[13,14,15,16],{"type":23,"children":3040,"toc":3217},[3041,3045,3049,3102,3106,3110,3129,3133,3137,3141,3145,3189,3193],{"type":26,"tag":27,"props":3042,"children":3043},{},[3044],{"type":31,"value":32},{"type":26,"tag":34,"props":3046,"children":3047},{"id":36},[3048],{"type":31,"value":39},{"type":26,"tag":41,"props":3050,"children":3051},{},[3052,3066],{"type":26,"tag":45,"props":3053,"children":3054},{},[3055],{"type":26,"tag":49,"props":3056,"children":3057},{},[3058,3062],{"type":26,"tag":53,"props":3059,"children":3060},{},[3061],{"type":31,"value":57},{"type":26,"tag":53,"props":3063,"children":3064},{},[3065],{"type":31,"value":62},{"type":26,"tag":64,"props":3067,"children":3068},{},[3069,3080,3091],{"type":26,"tag":49,"props":3070,"children":3071},{},[3072,3076],{"type":26,"tag":71,"props":3073,"children":3074},{},[3075],{"type":31,"value":75},{"type":26,"tag":71,"props":3077,"children":3078},{},[3079],{"type":31,"value":80},{"type":26,"tag":49,"props":3081,"children":3082},{},[3083,3087],{"type":26,"tag":71,"props":3084,"children":3085},{},[3086],{"type":31,"value":88},{"type":26,"tag":71,"props":3088,"children":3089},{},[3090],{"type":31,"value":93},{"type":26,"tag":49,"props":3092,"children":3093},{},[3094,3098],{"type":26,"tag":71,"props":3095,"children":3096},{},[3097],{"type":31,"value":101},{"type":26,"tag":71,"props":3099,"children":3100},{},[3101],{"type":31,"value":106},{"type":26,"tag":27,"props":3103,"children":3104},{},[3105],{"type":31,"value":111},{"type":26,"tag":34,"props":3107,"children":3108},{"id":114},[3109],{"type":31,"value":114},{"type":26,"tag":118,"props":3111,"children":3112},{},[3113,3117,3121,3125],{"type":26,"tag":122,"props":3114,"children":3115},{},[3116],{"type":31,"value":126},{"type":26,"tag":122,"props":3118,"children":3119},{},[3120],{"type":31,"value":131},{"type":26,"tag":122,"props":3122,"children":3123},{},[3124],{"type":31,"value":136},{"type":26,"tag":122,"props":3126,"children":3127},{},[3128],{"type":31,"value":141},{"type":26,"tag":27,"props":3130,"children":3131},{},[3132],{"type":31,"value":146},{"type":26,"tag":34,"props":3134,"children":3135},{"id":149},[3136],{"type":31,"value":152},{"type":26,"tag":27,"props":3138,"children":3139},{},[3140],{"type":31,"value":157},{"type":26,"tag":34,"props":3142,"children":3143},{"id":160},[3144],{"type":31,"value":163},{"type":26,"tag":118,"props":3146,"children":3148},{"className":3147},[167],[3149,3157,3165,3173,3181],{"type":26,"tag":122,"props":3150,"children":3152},{"className":3151},[172],[3153,3156],{"type":26,"tag":175,"props":3154,"children":3155},{"disabled":177,"type":178},[],{"type":31,"value":181},{"type":26,"tag":122,"props":3158,"children":3160},{"className":3159},[172],[3161,3164],{"type":26,"tag":175,"props":3162,"children":3163},{"disabled":177,"type":178},[],{"type":31,"value":190},{"type":26,"tag":122,"props":3166,"children":3168},{"className":3167},[172],[3169,3172],{"type":26,"tag":175,"props":3170,"children":3171},{"disabled":177,"type":178},[],{"type":31,"value":199},{"type":26,"tag":122,"props":3174,"children":3176},{"className":3175},[172],[3177,3180],{"type":26,"tag":175,"props":3178,"children":3179},{"disabled":177,"type":178},[],{"type":31,"value":208},{"type":26,"tag":122,"props":3182,"children":3184},{"className":3183},[172],[3185,3188],{"type":26,"tag":175,"props":3186,"children":3187},{"disabled":177,"type":178},[],{"type":31,"value":217},{"type":26,"tag":27,"props":3190,"children":3191},{},[3192],{"type":31,"value":222},{"type":26,"tag":118,"props":3194,"children":3195},{},[3196,3203,3210],{"type":26,"tag":122,"props":3197,"children":3198},{},[3199],{"type":26,"tag":230,"props":3200,"children":3201},{"href":232},[3202],{"type":31,"value":235},{"type":26,"tag":122,"props":3204,"children":3205},{},[3206],{"type":26,"tag":230,"props":3207,"children":3208},{"href":241},[3209],{"type":31,"value":244},{"type":26,"tag":122,"props":3211,"children":3212},{},[3213],{"type":26,"tag":230,"props":3214,"children":3215},{"href":250},[3216],{"type":31,"value":253},{"title":7,"searchDepth":255,"depth":255,"links":3218},[3219,3220,3221,3222],{"id":36,"depth":258,"text":39},{"id":114,"depth":258,"text":114},{"id":149,"depth":258,"text":152},{"id":160,"depth":258,"text":163},1780105145045]