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