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