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