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