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