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