[{"data":1,"prerenderedAt":4362},["ShallowReactive",2],{"article-/topics/ai/ai-agent-dag-node-contracts-input-output-boundaries":3,"related-ai":893,"content-query-0cTkUDkzx4":3660},{"_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":887,"_id":888,"_source":889,"_file":890,"_stem":891,"_extension":892},"/topics/ai/ai-agent-dag-node-contracts-input-output-boundaries","ai",false,"","AI agent DAG Node Contracts：输入输出边界不清，是工作流漂移的根因","工作流失控常见根因不是模型能力不足，而是节点契约缺失。本文讲清 DAG 节点输入输出边界、前后条件和版本治理。","2026-05-30","HTMLPAGE 团队",[13,14,15,16],"AI agent","DAG","Node Contract","Workflow Reliability","/images/articles/ai-agent-dag-node-contracts-input-output-boundaries-featured.jpg","software architecture diagram nodes connections screen",4425112,"https://www.pexels.com/photo/anonymous-person-working-on-computer-in-office-4425112/",14,{"type":23,"children":24,"toc":871},"root",[25,33,38,45,50,137,142,147,152,230,242,316,321,327,332,351,356,361,409,414,420,441,446,451,469,475,480,498,503,508,513,531,536,541,546,558,571,577,582,625,630,636,649,654,717,722,728,733,761,766,772,835,840],{"type":26,"tag":27,"props":28,"children":29},"element","p",{},[30],{"type":31,"value":32},"text","很多团队有 DAG，但没有真正的节点契约。节点看起来能跑，系统却经常在跨节点交接时出错：字段缺失、状态歧义、重放失败。",{"type":26,"tag":27,"props":34,"children":35},{},[36],{"type":31,"value":37},"如果把这件事讲得更直白：多数“工作流漂移”不是模型在胡说，而是节点边界从未被系统正式定义。",{"type":26,"tag":39,"props":40,"children":42},"h2",{"id":41},"契约不是一层而是三层",[43],{"type":31,"value":44},"契约不是一层，而是三层",{"type":26,"tag":27,"props":46,"children":47},{},[48],{"type":31,"value":49},"实际落地里，节点契约至少分为三层：",{"type":26,"tag":51,"props":52,"children":53},"table",{},[54,78],{"type":26,"tag":55,"props":56,"children":57},"thead",{},[58],{"type":26,"tag":59,"props":60,"children":61},"tr",{},[62,68,73],{"type":26,"tag":63,"props":64,"children":65},"th",{},[66],{"type":31,"value":67},"层级",{"type":26,"tag":63,"props":69,"children":70},{},[71],{"type":31,"value":72},"关注点",{"type":26,"tag":63,"props":74,"children":75},{},[76],{"type":31,"value":77},"由谁维护",{"type":26,"tag":79,"props":80,"children":81},"tbody",{},[82,101,119],{"type":26,"tag":59,"props":83,"children":84},{},[85,91,96],{"type":26,"tag":86,"props":87,"children":88},"td",{},[89],{"type":31,"value":90},"数据契约",{"type":26,"tag":86,"props":92,"children":93},{},[94],{"type":31,"value":95},"输入/输出字段与类型",{"type":26,"tag":86,"props":97,"children":98},{},[99],{"type":31,"value":100},"工程团队",{"type":26,"tag":59,"props":102,"children":103},{},[104,109,114],{"type":26,"tag":86,"props":105,"children":106},{},[107],{"type":31,"value":108},"执行契约",{"type":26,"tag":86,"props":110,"children":111},{},[112],{"type":31,"value":113},"前置条件、重试、超时",{"type":26,"tag":86,"props":115,"children":116},{},[117],{"type":31,"value":118},"平台团队",{"type":26,"tag":59,"props":120,"children":121},{},[122,127,132],{"type":26,"tag":86,"props":123,"children":124},{},[125],{"type":31,"value":126},"风险契约",{"type":26,"tag":86,"props":128,"children":129},{},[130],{"type":31,"value":131},"副作用、补偿、审批",{"type":26,"tag":86,"props":133,"children":134},{},[135],{"type":31,"value":136},"治理/业务团队",{"type":26,"tag":27,"props":138,"children":139},{},[140],{"type":31,"value":141},"只做数据契约，系统仍会在执行与风险层面失控。",{"type":26,"tag":39,"props":143,"children":145},{"id":144},"最小节点契约模板",[146],{"type":31,"value":144},{"type":26,"tag":27,"props":148,"children":149},{},[150],{"type":31,"value":151},"建议每个节点都具备以下字段：",{"type":26,"tag":153,"props":154,"children":155},"ul",{},[156,167,176,185,194,203,212,221],{"type":26,"tag":157,"props":158,"children":159},"li",{},[160],{"type":26,"tag":161,"props":162,"children":164},"code",{"className":163},[],[165],{"type":31,"value":166},"inputSchema",{"type":26,"tag":157,"props":168,"children":169},{},[170],{"type":26,"tag":161,"props":171,"children":173},{"className":172},[],[174],{"type":31,"value":175},"outputSchema",{"type":26,"tag":157,"props":177,"children":178},{},[179],{"type":26,"tag":161,"props":180,"children":182},{"className":181},[],[183],{"type":31,"value":184},"preconditions",{"type":26,"tag":157,"props":186,"children":187},{},[188],{"type":26,"tag":161,"props":189,"children":191},{"className":190},[],[192],{"type":31,"value":193},"postconditions",{"type":26,"tag":157,"props":195,"children":196},{},[197],{"type":26,"tag":161,"props":198,"children":200},{"className":199},[],[201],{"type":31,"value":202},"timeoutMs",{"type":26,"tag":157,"props":204,"children":205},{},[206],{"type":26,"tag":161,"props":207,"children":209},{"className":208},[],[210],{"type":31,"value":211},"retryPolicy",{"type":26,"tag":157,"props":213,"children":214},{},[215],{"type":26,"tag":161,"props":216,"children":218},{"className":217},[],[219],{"type":31,"value":220},"sideEffects",{"type":26,"tag":157,"props":222,"children":223},{},[224],{"type":26,"tag":161,"props":225,"children":227},{"className":226},[],[228],{"type":31,"value":229},"compensationPolicy",{"type":26,"tag":27,"props":231,"children":232},{},[233,235,240],{"type":31,"value":234},"其中 ",{"type":26,"tag":161,"props":236,"children":238},{"className":237},[],[239],{"type":31,"value":220},{"type":31,"value":241}," 建议强制结构化，例如：",{"type":26,"tag":51,"props":243,"children":244},{},[245,261],{"type":26,"tag":55,"props":246,"children":247},{},[248],{"type":26,"tag":59,"props":249,"children":250},{},[251,256],{"type":26,"tag":63,"props":252,"children":253},{},[254],{"type":31,"value":255},"字段",{"type":26,"tag":63,"props":257,"children":258},{},[259],{"type":31,"value":260},"含义",{"type":26,"tag":79,"props":262,"children":263},{},[264,277,290,303],{"type":26,"tag":59,"props":265,"children":266},{},[267,272],{"type":26,"tag":86,"props":268,"children":269},{},[270],{"type":31,"value":271},"effectType",{"type":26,"tag":86,"props":273,"children":274},{},[275],{"type":31,"value":276},"写库、外发、状态变更",{"type":26,"tag":59,"props":278,"children":279},{},[280,285],{"type":26,"tag":86,"props":281,"children":282},{},[283],{"type":31,"value":284},"target",{"type":26,"tag":86,"props":286,"children":287},{},[288],{"type":31,"value":289},"影响对象",{"type":26,"tag":59,"props":291,"children":292},{},[293,298],{"type":26,"tag":86,"props":294,"children":295},{},[296],{"type":31,"value":297},"idempotencyKey",{"type":26,"tag":86,"props":299,"children":300},{},[301],{"type":31,"value":302},"幂等识别",{"type":26,"tag":59,"props":304,"children":305},{},[306,311],{"type":26,"tag":86,"props":307,"children":308},{},[309],{"type":31,"value":310},"reversible",{"type":26,"tag":86,"props":312,"children":313},{},[314],{"type":31,"value":315},"是否可逆",{"type":26,"tag":27,"props":317,"children":318},{},[319],{"type":31,"value":320},"没有这些字段，平台无法做统一补偿治理。",{"type":26,"tag":39,"props":322,"children":324},{"id":323},"常见边界错位不是偶发-bug",[325],{"type":31,"value":326},"常见边界错位，不是“偶发 bug”",{"type":26,"tag":27,"props":328,"children":329},{},[330],{"type":31,"value":331},"以下三类问题最常见，且会反复出现：",{"type":26,"tag":333,"props":334,"children":335},"ol",{},[336,341,346],{"type":26,"tag":157,"props":337,"children":338},{},[339],{"type":31,"value":340},"推断字段污染：上游把可选字段当推断结果，下游当必填输入。",{"type":26,"tag":157,"props":342,"children":343},{},[344],{"type":31,"value":345},"输出落地不一致：输出写在临时上下文而非共享状态，导致重放丢失。",{"type":26,"tag":157,"props":347,"children":348},{},[349],{"type":31,"value":350},"异常语义不一致：有的节点返回错误码，有的只返回文本。",{"type":26,"tag":27,"props":352,"children":353},{},[354],{"type":31,"value":355},"这些问题本质上都是契约未被 runtime 强制执行。",{"type":26,"tag":39,"props":357,"children":359},{"id":358},"契约验证应在两个时机执行",[360],{"type":31,"value":358},{"type":26,"tag":51,"props":362,"children":363},{},[364,380],{"type":26,"tag":55,"props":365,"children":366},{},[367],{"type":26,"tag":59,"props":368,"children":369},{},[370,375],{"type":26,"tag":63,"props":371,"children":372},{},[373],{"type":31,"value":374},"时机",{"type":26,"tag":63,"props":376,"children":377},{},[378],{"type":31,"value":379},"目标",{"type":26,"tag":79,"props":381,"children":382},{},[383,396],{"type":26,"tag":59,"props":384,"children":385},{},[386,391],{"type":26,"tag":86,"props":387,"children":388},{},[389],{"type":31,"value":390},"发布前（静态验证）",{"type":26,"tag":86,"props":392,"children":393},{},[394],{"type":31,"value":395},"schema、前后条件、策略配置完整性",{"type":26,"tag":59,"props":397,"children":398},{},[399,404],{"type":26,"tag":86,"props":400,"children":401},{},[402],{"type":31,"value":403},"运行时（动态验证）",{"type":26,"tag":86,"props":405,"children":406},{},[407],{"type":31,"value":408},"输入合法性、状态合法性、副作用合法性",{"type":26,"tag":27,"props":410,"children":411},{},[412],{"type":31,"value":413},"只做静态验证会漏掉状态类问题；只做运行时验证会把低级错误带到线上。",{"type":26,"tag":39,"props":415,"children":417},{"id":416},"失败案例版本升级后兼容成功业务却失真",[418],{"type":31,"value":419},"失败案例：版本升级后“兼容成功”，业务却失真",{"type":26,"tag":27,"props":421,"children":422},{},[423,425,431,433,439],{"type":31,"value":424},"某团队将节点输出字段 ",{"type":26,"tag":161,"props":426,"children":428},{"className":427},[],[429],{"type":31,"value":430},"risk_score",{"type":31,"value":432}," 改为 ",{"type":26,"tag":161,"props":434,"children":436},{"className":435},[],[437],{"type":31,"value":438},"risk.level",{"type":31,"value":440},"，并加了兼容适配层，技术上未报错。问题是下游审批规则仍读取旧字段，导致高风险内容被当低风险通过。这个问题持续两周才被业务发现。",{"type":26,"tag":27,"props":442,"children":443},{},[444],{"type":31,"value":445},"根因不是字段重命名，而是契约变更缺少“语义级回归”。",{"type":26,"tag":27,"props":447,"children":448},{},[449],{"type":31,"value":450},"修复动作：",{"type":26,"tag":153,"props":452,"children":453},{},[454,459,464],{"type":26,"tag":157,"props":455,"children":456},{},[457],{"type":31,"value":458},"在契约变更流程中引入语义回归样本。",{"type":26,"tag":157,"props":460,"children":461},{},[462],{"type":31,"value":463},"将关键字段标记为“策略依赖字段”。",{"type":26,"tag":157,"props":465,"children":466},{},[467],{"type":31,"value":468},"变更后自动验证相关规则命中情况。",{"type":26,"tag":39,"props":470,"children":472},{"id":471},"契约发布治理像-api-一样治理节点",[473],{"type":31,"value":474},"契约发布治理：像 API 一样治理节点",{"type":26,"tag":27,"props":476,"children":477},{},[478],{"type":31,"value":479},"建议引入以下规则：",{"type":26,"tag":153,"props":481,"children":482},{},[483,488,493],{"type":26,"tag":157,"props":484,"children":485},{},[486],{"type":31,"value":487},"向后兼容：新增字段可选，删除字段走废弃周期。",{"type":26,"tag":157,"props":489,"children":490},{},[491],{"type":31,"value":492},"版本语义：major 破坏性、minor 增量、patch 修复。",{"type":26,"tag":157,"props":494,"children":495},{},[496],{"type":31,"value":497},"依赖声明：下游节点声明依赖字段与语义。",{"type":26,"tag":27,"props":499,"children":500},{},[501],{"type":31,"value":502},"这样做的结果，是节点不再是“局部实现细节”，而是平台级可治理接口。",{"type":26,"tag":39,"props":504,"children":506},{"id":505},"看板应直接暴露契约健康度",[507],{"type":31,"value":505},{"type":26,"tag":27,"props":509,"children":510},{},[511],{"type":31,"value":512},"推荐新增三类指标：",{"type":26,"tag":153,"props":514,"children":515},{},[516,521,526],{"type":26,"tag":157,"props":517,"children":518},{},[519],{"type":31,"value":520},"契约校验失败率",{"type":26,"tag":157,"props":522,"children":523},{},[524],{"type":31,"value":525},"语义回归失败率",{"type":26,"tag":157,"props":527,"children":528},{},[529],{"type":31,"value":530},"兼容适配触发率",{"type":26,"tag":27,"props":532,"children":533},{},[534],{"type":31,"value":535},"兼容适配触发率长期高，通常说明该进入正式迁移，而不是无限期临时兼容。",{"type":26,"tag":39,"props":537,"children":539},{"id":538},"一个节点契约示例",[540],{"type":31,"value":538},{"type":26,"tag":27,"props":542,"children":543},{},[544],{"type":31,"value":545},"下面是一个“风险评估节点”的简化契约。重点不是字段形式，而是它把输入、输出、前置条件和副作用分开声明：",{"type":26,"tag":547,"props":548,"children":553},"pre",{"className":549,"code":551,"language":552,"meta":7},[550],"language-json","{\n  \"nodeId\": \"risk_review.v2\",\n  \"inputSchema\": {\n    \"draftArtifactId\": \"string\",\n    \"evidencePackId\": \"string\",\n    \"tenantPolicyVersion\": \"string\"\n  },\n  \"outputSchema\": {\n    \"riskLevel\": \"low | medium | high\",\n    \"blockedReasons\": \"string[]\",\n    \"requiresHumanApproval\": \"boolean\"\n  },\n  \"preconditions\": [\n    \"draftArtifact.status == 'ready'\",\n    \"evidencePack.status == 'verified'\"\n  ],\n  \"postconditions\": [\n    \"riskDecisionId is persisted\"\n  ],\n  \"sideEffects\": [],\n  \"failurePolicy\": {\n    \"validation_error\": \"stop\",\n    \"policy_timeout\": \"human_review\"\n  }\n}\n","json",[554],{"type":26,"tag":161,"props":555,"children":556},{"__ignoreMap":7},[557],{"type":31,"value":551},{"type":26,"tag":27,"props":559,"children":560},{},[561,563,569],{"type":31,"value":562},"这里最重要的设计是：风险评估节点不直接发布、不改客户状态、不写外部系统。它只产出可审计的 ",{"type":26,"tag":161,"props":564,"children":566},{"className":565},[],[567],{"type":31,"value":568},"riskDecisionId",{"type":31,"value":570},"。这样下游审批和发布节点可以引用同一个稳定事实，而不是重新解释一段文本。",{"type":26,"tag":39,"props":572,"children":574},{"id":573},"契约评审应该问的-8-个问题",[575],{"type":31,"value":576},"契约评审应该问的 8 个问题",{"type":26,"tag":27,"props":578,"children":579},{},[580],{"type":31,"value":581},"每个新节点上线前，至少要过一轮契约评审：",{"type":26,"tag":333,"props":583,"children":584},{},[585,590,595,600,605,610,615,620],{"type":26,"tag":157,"props":586,"children":587},{},[588],{"type":31,"value":589},"这个节点是否真的需要独立存在？",{"type":26,"tag":157,"props":591,"children":592},{},[593],{"type":31,"value":594},"它的输出是否会被两个以上下游节点复用？",{"type":26,"tag":157,"props":596,"children":597},{},[598],{"type":31,"value":599},"输入字段里哪些是用户提供，哪些是系统推断？",{"type":26,"tag":157,"props":601,"children":602},{},[603],{"type":31,"value":604},"输出字段里哪些会影响策略或计费？",{"type":26,"tag":157,"props":606,"children":607},{},[608],{"type":31,"value":609},"失败时是否返回结构化错误？",{"type":26,"tag":157,"props":611,"children":612},{},[613],{"type":31,"value":614},"是否产生外部副作用？如果有，补偿动作是什么？",{"type":26,"tag":157,"props":616,"children":617},{},[618],{"type":31,"value":619},"契约升级是否影响旧 run 恢复？",{"type":26,"tag":157,"props":621,"children":622},{},[623],{"type":31,"value":624},"是否有语义回归样本覆盖关键字段？",{"type":26,"tag":27,"props":626,"children":627},{},[628],{"type":31,"value":629},"这 8 个问题能拦住很多“写起来方便，跑起来混乱”的节点。",{"type":26,"tag":39,"props":631,"children":633},{"id":632},"版本兼容不要只看字段是否存在",[634],{"type":31,"value":635},"版本兼容：不要只看字段是否存在",{"type":26,"tag":27,"props":637,"children":638},{},[639,641,647],{"type":31,"value":640},"很多团队以为字段还在就是兼容。实际上，语义变化比字段变化更危险。例如 ",{"type":26,"tag":161,"props":642,"children":644},{"className":643},[],[645],{"type":31,"value":646},"riskLevel: medium",{"type":31,"value":648}," 在 v1 表示“需要人工复核”，在 v2 表示“允许自动发布但记录风险”，字段没变，业务后果完全变了。",{"type":26,"tag":27,"props":650,"children":651},{},[652],{"type":31,"value":653},"因此，节点契约版本至少要区分两类变化：",{"type":26,"tag":51,"props":655,"children":656},{},[657,678],{"type":26,"tag":55,"props":658,"children":659},{},[660],{"type":26,"tag":59,"props":661,"children":662},{},[663,668,673],{"type":26,"tag":63,"props":664,"children":665},{},[666],{"type":31,"value":667},"变化类型",{"type":26,"tag":63,"props":669,"children":670},{},[671],{"type":31,"value":672},"示例",{"type":26,"tag":63,"props":674,"children":675},{},[676],{"type":31,"value":677},"处理方式",{"type":26,"tag":79,"props":679,"children":680},{},[681,699],{"type":26,"tag":59,"props":682,"children":683},{},[684,689,694],{"type":26,"tag":86,"props":685,"children":686},{},[687],{"type":31,"value":688},"结构变化",{"type":26,"tag":86,"props":690,"children":691},{},[692],{"type":31,"value":693},"新增字段、重命名字段",{"type":26,"tag":86,"props":695,"children":696},{},[697],{"type":31,"value":698},"schema 兼容与适配层",{"type":26,"tag":59,"props":700,"children":701},{},[702,707,712],{"type":26,"tag":86,"props":703,"children":704},{},[705],{"type":31,"value":706},"语义变化",{"type":26,"tag":86,"props":708,"children":709},{},[710],{"type":31,"value":711},"风险等级含义变化",{"type":26,"tag":86,"props":713,"children":714},{},[715],{"type":31,"value":716},"major 版本 + 回归样本",{"type":26,"tag":27,"props":718,"children":719},{},[720],{"type":31,"value":721},"语义变化必须走更严格发布流程，不应该混在 patch 里悄悄上线。",{"type":26,"tag":39,"props":723,"children":725},{"id":724},"contract-registry-的作用",[726],{"type":31,"value":727},"Contract Registry 的作用",{"type":26,"tag":27,"props":729,"children":730},{},[731],{"type":31,"value":732},"当节点数量超过十几个时，建议建立 contract registry。它至少提供：",{"type":26,"tag":153,"props":734,"children":735},{},[736,741,746,751,756],{"type":26,"tag":157,"props":737,"children":738},{},[739],{"type":31,"value":740},"节点契约版本查询",{"type":26,"tag":157,"props":742,"children":743},{},[744],{"type":31,"value":745},"上下游依赖图",{"type":26,"tag":157,"props":747,"children":748},{},[749],{"type":31,"value":750},"废弃字段和废弃节点列表",{"type":26,"tag":157,"props":752,"children":753},{},[754],{"type":31,"value":755},"契约变更历史",{"type":26,"tag":157,"props":757,"children":758},{},[759],{"type":31,"value":760},"回归样本绑定关系",{"type":26,"tag":27,"props":762,"children":763},{},[764],{"type":31,"value":765},"没有 registry，团队会很快失去对“哪些节点依赖哪些字段”的判断力。到那时，每次改节点都像在拆一座看不见结构的楼。",{"type":26,"tag":39,"props":767,"children":769},{"id":768},"契约治理-checklist",[770],{"type":31,"value":771},"契约治理 Checklist",{"type":26,"tag":153,"props":773,"children":776},{"className":774},[775],"contains-task-list",[777,790,799,808,817,826],{"type":26,"tag":157,"props":778,"children":781},{"className":779},[780],"task-list-item",[782,788],{"type":26,"tag":783,"props":784,"children":787},"input",{"disabled":785,"type":786},true,"checkbox",[],{"type":31,"value":789}," 节点输入输出均可 schema 校验",{"type":26,"tag":157,"props":791,"children":793},{"className":792},[780],[794,797],{"type":26,"tag":783,"props":795,"children":796},{"disabled":785,"type":786},[],{"type":31,"value":798}," pre/post 条件由 runtime 强制检查",{"type":26,"tag":157,"props":800,"children":802},{"className":801},[780],[803,806],{"type":26,"tag":783,"props":804,"children":805},{"disabled":785,"type":786},[],{"type":31,"value":807}," 失败输出同样结构化，不混杂自由文本",{"type":26,"tag":157,"props":809,"children":811},{"className":810},[780],[812,815],{"type":26,"tag":783,"props":813,"children":814},{"disabled":785,"type":786},[],{"type":31,"value":816}," side effect 和补偿策略可验证",{"type":26,"tag":157,"props":818,"children":820},{"className":819},[780],[821,824],{"type":26,"tag":783,"props":822,"children":823},{"disabled":785,"type":786},[],{"type":31,"value":825}," 节点契约变更有版本化与废弃周期",{"type":26,"tag":157,"props":827,"children":829},{"className":828},[780],[830,833],{"type":26,"tag":783,"props":831,"children":832},{"disabled":785,"type":786},[],{"type":31,"value":834}," 关键字段变更触发语义回归测试",{"type":26,"tag":27,"props":836,"children":837},{},[838],{"type":31,"value":839},"延伸阅读：",{"type":26,"tag":153,"props":841,"children":842},{},[843,853,862],{"type":26,"tag":157,"props":844,"children":845},{},[846],{"type":26,"tag":847,"props":848,"children":850},"a",{"href":849},"/topics/ai/ai-agent-conversation-to-dag-workflow-engine",[851],{"type":31,"value":852},"Conversation to DAG Workflow Engine",{"type":26,"tag":157,"props":854,"children":855},{},[856],{"type":26,"tag":847,"props":857,"children":859},{"href":858},"/topics/ai/ai-agent-tool-result-normalization-guide",[860],{"type":31,"value":861},"AI agent 工具结果标准化",{"type":26,"tag":157,"props":863,"children":864},{},[865],{"type":26,"tag":847,"props":866,"children":868},{"href":867},"/topics/ai/ai-agent-tool-schema-evolution-compatibility",[869],{"type":31,"value":870},"AI agent Tool Schema 演进兼容",{"title":7,"searchDepth":872,"depth":872,"links":873},3,[874,876,877,878,879,880,881,882,883,884,885,886],{"id":41,"depth":875,"text":44},2,{"id":144,"depth":875,"text":144},{"id":323,"depth":875,"text":326},{"id":358,"depth":875,"text":358},{"id":416,"depth":875,"text":419},{"id":471,"depth":875,"text":474},{"id":505,"depth":875,"text":505},{"id":538,"depth":875,"text":538},{"id":573,"depth":875,"text":576},{"id":632,"depth":875,"text":635},{"id":724,"depth":875,"text":727},{"id":768,"depth":875,"text":771},"markdown","content:topics:ai:ai-agent-dag-node-contracts-input-output-boundaries.md","content","topics/ai/ai-agent-dag-node-contracts-input-output-boundaries.md","topics/ai/ai-agent-dag-node-contracts-input-output-boundaries","md",[894,2048,2998],{"_path":895,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":896,"description":897,"date":898,"topic":5,"author":11,"tags":899,"image":905,"imageAlt":906,"pexelsPhotoId":907,"pexelsUrl":908,"readingTime":909,"body":910,"_type":887,"_id":2045,"_source":889,"_file":2046,"_stem":2047,"_extension":892},"/topics/ai/cursor-keyboard-shortcuts-cheatsheet","Cursor 快捷键速查表（macOS/Windows）：从“会用”到“能提效”的 10 个工作流","把 Cursor 常用快捷键按任务分组（查代码、改代码、多文件、对话、审查与回滚），给出可直接照抄的工作流与最小回归清单，避免“快捷键背了也没变快”。","2026-03-02",[900,901,902,903,904],"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":911,"toc":2019},[912,917,935,940,968,973,1009,1013,1019,1024,1057,1062,1085,1088,1094,1099,1317,1326,1329,1335,1342,1361,1369,1390,1395,1401,1416,1447,1452,1465,1471,1490,1508,1516,1521,1527,1532,1553,1561,1567,1572,1595,1600,1606,1619,1625,1643,1661,1667,1678,1696,1702,1713,1719,1724,1767,1770,1776,1784,1837,1840,1846,1852,1857,1862,1885,1903,1908,1933,1936,1942,1948,1953,1959,1964,1970,1975,1978,1984],{"type":26,"tag":27,"props":913,"children":914},{},[915],{"type":31,"value":916},"如果你在搜“Cursor 快捷键”，你大概率不是想背一张表，而是想解决这类问题：",{"type":26,"tag":153,"props":918,"children":919},{},[920,925,930],{"type":26,"tag":157,"props":921,"children":922},{},[923],{"type":31,"value":924},"为什么我用了 AI，还是很慢？（对话来回太多、改动不可控）",{"type":26,"tag":157,"props":926,"children":927},{},[928],{"type":31,"value":929},"为什么它“看起来懂了”，却改错文件/改出回归？（上下文与范围没锁住）",{"type":26,"tag":157,"props":931,"children":932},{},[933],{"type":31,"value":934},"多文件改动怎么做得安全？（验收、回滚、最小回归集）",{"type":26,"tag":27,"props":936,"children":937},{},[938],{"type":31,"value":939},"这篇文章给你两份东西：",{"type":26,"tag":333,"props":941,"children":942},{},[943,956],{"type":26,"tag":157,"props":944,"children":945},{},[946,948,954],{"type":31,"value":947},"一张",{"type":26,"tag":949,"props":950,"children":951},"strong",{},[952],{"type":31,"value":953},"按任务分组",{"type":31,"value":955},"的快捷键表（不是按功能堆在一起）",{"type":26,"tag":157,"props":957,"children":958},{},[959,961,966],{"type":31,"value":960},"一套“从需求到落地”的",{"type":26,"tag":949,"props":962,"children":963},{},[964],{"type":31,"value":965},"最小闭环工作流",{"type":31,"value":967},"（每一步都有快捷键）",{"type":26,"tag":27,"props":969,"children":970},{},[971],{"type":31,"value":972},"想看系统玩法：",{"type":26,"tag":153,"props":974,"children":975},{},[976,987,998],{"type":26,"tag":157,"props":977,"children":978},{},[979,981],{"type":31,"value":980},"入门教程看：",{"type":26,"tag":847,"props":982,"children":984},{"href":983},"/topics/ai/cursor-tutorial",[985],{"type":31,"value":986},"Cursor 使用教程（2026）",{"type":26,"tag":157,"props":988,"children":989},{},[990,992],{"type":31,"value":991},"进阶玩法看：",{"type":26,"tag":847,"props":993,"children":995},{"href":994},"/topics/ai/cursor-editor-guide",[996],{"type":31,"value":997},"Cursor 编辑器深度玩法",{"type":26,"tag":157,"props":999,"children":1000},{},[1001,1003],{"type":31,"value":1002},"规则与忽略看：",{"type":26,"tag":847,"props":1004,"children":1006},{"href":1005},"/topics/ai/cursor-rules-cursorrules",[1007],{"type":31,"value":1008},"Cursor Rules 与 .cursorrules",{"type":26,"tag":1010,"props":1011,"children":1012},"hr",{},[],{"type":26,"tag":39,"props":1014,"children":1016},{"id":1015},"先给结论提效不是按得快而是闭环更短",[1017],{"type":31,"value":1018},"先给结论：提效不是“按得快”，而是“闭环更短”",{"type":26,"tag":27,"props":1020,"children":1021},{},[1022],{"type":31,"value":1023},"你可以把 Cursor 的快捷键理解为 3 条流水线：",{"type":26,"tag":153,"props":1025,"children":1026},{},[1027,1037,1047],{"type":26,"tag":157,"props":1028,"children":1029},{},[1030,1035],{"type":26,"tag":949,"props":1031,"children":1032},{},[1033],{"type":31,"value":1034},"改一小段",{"type":31,"value":1036},"（内联编辑）：把改动限制在一个函数/一段样式",{"type":26,"tag":157,"props":1038,"children":1039},{},[1040,1045],{"type":26,"tag":949,"props":1041,"children":1042},{},[1043],{"type":31,"value":1044},"改一组文件",{"type":31,"value":1046},"（Composer）：把改动限制在一组明确文件，并要求输出 diff + 验收点",{"type":26,"tag":157,"props":1048,"children":1049},{},[1050,1055],{"type":26,"tag":949,"props":1051,"children":1052},{},[1053],{"type":31,"value":1054},"聊清楚再动手",{"type":31,"value":1056},"（侧边对话）：先对齐目标、范围、验收、回滚",{"type":26,"tag":27,"props":1058,"children":1059},{},[1060],{"type":31,"value":1061},"当你觉得“它乱改/改太大”时，往往不是快捷键没记住，而是缺了两件事：",{"type":26,"tag":153,"props":1063,"children":1064},{},[1065,1075],{"type":26,"tag":157,"props":1066,"children":1067},{},[1068,1070],{"type":31,"value":1069},"没有在动手前锁定",{"type":26,"tag":949,"props":1071,"children":1072},{},[1073],{"type":31,"value":1074},"范围",{"type":26,"tag":157,"props":1076,"children":1077},{},[1078,1080],{"type":31,"value":1079},"没有在接受改动前准备",{"type":26,"tag":949,"props":1081,"children":1082},{},[1083],{"type":31,"value":1084},"验收/回滚",{"type":26,"tag":1010,"props":1086,"children":1087},{},[],{"type":26,"tag":39,"props":1089,"children":1091},{"id":1090},"快捷键速查表按任务分组",[1092],{"type":31,"value":1093},"快捷键速查表（按任务分组）",{"type":26,"tag":27,"props":1095,"children":1096},{},[1097],{"type":31,"value":1098},"说明：下表按“你正在做什么”组织，而不是按“功能名字”组织。不同版本快捷键可能略有差异，但核心逻辑一致。",{"type":26,"tag":51,"props":1100,"children":1101},{},[1102,1128],{"type":26,"tag":55,"props":1103,"children":1104},{},[1105],{"type":26,"tag":59,"props":1106,"children":1107},{},[1108,1113,1118,1123],{"type":26,"tag":63,"props":1109,"children":1110},{},[1111],{"type":31,"value":1112},"任务",{"type":26,"tag":63,"props":1114,"children":1115},{},[1116],{"type":31,"value":1117},"macOS",{"type":26,"tag":63,"props":1119,"children":1120},{},[1121],{"type":31,"value":1122},"Windows",{"type":26,"tag":63,"props":1124,"children":1125},{},[1126],{"type":31,"value":1127},"你该在什么时候用",{"type":26,"tag":79,"props":1129,"children":1130},{},[1131,1162,1193,1224,1255,1286],{"type":26,"tag":59,"props":1132,"children":1133},{},[1134,1139,1148,1157],{"type":26,"tag":86,"props":1135,"children":1136},{},[1137],{"type":31,"value":1138},"改一小段（最安全）",{"type":26,"tag":86,"props":1140,"children":1141},{},[1142],{"type":26,"tag":161,"props":1143,"children":1145},{"className":1144},[],[1146],{"type":31,"value":1147},"Cmd + K",{"type":26,"tag":86,"props":1149,"children":1150},{},[1151],{"type":26,"tag":161,"props":1152,"children":1154},{"className":1153},[],[1155],{"type":31,"value":1156},"Ctrl + K",{"type":26,"tag":86,"props":1158,"children":1159},{},[1160],{"type":31,"value":1161},"只想改一个函数/一段 CSS，不想动别的",{"type":26,"tag":59,"props":1163,"children":1164},{},[1165,1170,1179,1188],{"type":26,"tag":86,"props":1166,"children":1167},{},[1168],{"type":31,"value":1169},"打开 AI 对话（先对齐再动手）",{"type":26,"tag":86,"props":1171,"children":1172},{},[1173],{"type":26,"tag":161,"props":1174,"children":1176},{"className":1175},[],[1177],{"type":31,"value":1178},"Cmd + L",{"type":26,"tag":86,"props":1180,"children":1181},{},[1182],{"type":26,"tag":161,"props":1183,"children":1185},{"className":1184},[],[1186],{"type":31,"value":1187},"Ctrl + L",{"type":26,"tag":86,"props":1189,"children":1190},{},[1191],{"type":31,"value":1192},"需要澄清目标、制定步骤、给验收点",{"type":26,"tag":59,"props":1194,"children":1195},{},[1196,1201,1210,1219],{"type":26,"tag":86,"props":1197,"children":1198},{},[1199],{"type":31,"value":1200},"多文件编辑（有组织地改一组文件）",{"type":26,"tag":86,"props":1202,"children":1203},{},[1204],{"type":26,"tag":161,"props":1205,"children":1207},{"className":1206},[],[1208],{"type":31,"value":1209},"Cmd + I",{"type":26,"tag":86,"props":1211,"children":1212},{},[1213],{"type":26,"tag":161,"props":1214,"children":1216},{"className":1215},[],[1217],{"type":31,"value":1218},"Ctrl + I",{"type":26,"tag":86,"props":1220,"children":1221},{},[1222],{"type":31,"value":1223},"改动涉及多个文件：组件+样式+测试",{"type":26,"tag":59,"props":1225,"children":1226},{},[1227,1232,1241,1250],{"type":26,"tag":86,"props":1228,"children":1229},{},[1230],{"type":31,"value":1231},"把选中代码加入对话上下文",{"type":26,"tag":86,"props":1233,"children":1234},{},[1235],{"type":26,"tag":161,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":31,"value":1240},"Cmd + Shift + L",{"type":26,"tag":86,"props":1242,"children":1243},{},[1244],{"type":26,"tag":161,"props":1245,"children":1247},{"className":1246},[],[1248],{"type":31,"value":1249},"Ctrl + Shift + L",{"type":26,"tag":86,"props":1251,"children":1252},{},[1253],{"type":31,"value":1254},"让 AI 只看你选的片段（降低噪音）",{"type":26,"tag":59,"props":1256,"children":1257},{},[1258,1263,1272,1281],{"type":26,"tag":86,"props":1259,"children":1260},{},[1261],{"type":31,"value":1262},"接受当前建议",{"type":26,"tag":86,"props":1264,"children":1265},{},[1266],{"type":26,"tag":161,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":31,"value":1271},"Cmd + Y",{"type":26,"tag":86,"props":1273,"children":1274},{},[1275],{"type":26,"tag":161,"props":1276,"children":1278},{"className":1277},[],[1279],{"type":31,"value":1280},"Ctrl + Y",{"type":26,"tag":86,"props":1282,"children":1283},{},[1284],{"type":31,"value":1285},"你已经准备好验收/回滚，并确认改动范围",{"type":26,"tag":59,"props":1287,"children":1288},{},[1289,1294,1303,1312],{"type":26,"tag":86,"props":1290,"children":1291},{},[1292],{"type":31,"value":1293},"拒绝当前建议",{"type":26,"tag":86,"props":1295,"children":1296},{},[1297],{"type":26,"tag":161,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":31,"value":1302},"Cmd + N",{"type":26,"tag":86,"props":1304,"children":1305},{},[1306],{"type":26,"tag":161,"props":1307,"children":1309},{"className":1308},[],[1310],{"type":31,"value":1311},"Ctrl + N",{"type":26,"tag":86,"props":1313,"children":1314},{},[1315],{"type":31,"value":1316},"改得太大、改错方向，立刻收手",{"type":26,"tag":1318,"props":1319,"children":1320},"blockquote",{},[1321],{"type":26,"tag":27,"props":1322,"children":1323},{},[1324],{"type":31,"value":1325},"小技巧：把“改一小段”当默认路径。只有当你能清晰写出“会改哪几类文件、怎么验收”时再进入多文件。",{"type":26,"tag":1010,"props":1327,"children":1328},{},[],{"type":26,"tag":39,"props":1330,"children":1332},{"id":1331},"_10-个可直接照抄的提效工作流每个都能闭环",[1333],{"type":31,"value":1334},"10 个可直接照抄的提效工作流（每个都能闭环）",{"type":26,"tag":1336,"props":1337,"children":1339},"h3",{"id":1338},"工作流-1需求计划小步改新手最稳",[1340],{"type":31,"value":1341},"工作流 1：需求→计划→小步改（新手最稳）",{"type":26,"tag":333,"props":1343,"children":1344},{},[1345,1356],{"type":26,"tag":157,"props":1346,"children":1347},{},[1348,1354],{"type":26,"tag":161,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":31,"value":1353},"Cmd/Ctrl + L",{"type":31,"value":1355}," 打开对话",{"type":26,"tag":157,"props":1357,"children":1358},{},[1359],{"type":31,"value":1360},"先发这段（可复制）：",{"type":26,"tag":1318,"props":1362,"children":1363},{},[1364],{"type":26,"tag":27,"props":1365,"children":1366},{},[1367],{"type":31,"value":1368},"目标：……\n范围：只修改以下文件/模块：……\n非目标：……（明确不做）\n验收：……（可测试/可手动检查）\n输出格式：先给计划，再逐步执行；每一步写出 diff 摘要。",{"type":26,"tag":333,"props":1370,"children":1371},{"start":872},[1372,1377],{"type":26,"tag":157,"props":1373,"children":1374},{},[1375],{"type":31,"value":1376},"让 AI 先给“计划（3~6 步）”，你确认后再执行",{"type":26,"tag":157,"props":1378,"children":1379},{},[1380,1382,1388],{"type":31,"value":1381},"任何一步涉及改代码：优先回到编辑区，选中片段用 ",{"type":26,"tag":161,"props":1383,"children":1385},{"className":1384},[],[1386],{"type":31,"value":1387},"Cmd/Ctrl + K",{"type":31,"value":1389}," 小步改",{"type":26,"tag":27,"props":1391,"children":1392},{},[1393],{"type":31,"value":1394},"为什么有效：你把“想法”变成了“可执行约束”，这就是 GEO（面向 AI/模型的可理解结构）。",{"type":26,"tag":1336,"props":1396,"children":1398},{"id":1397},"工作流-2只改一个函数高频低风险",[1399],{"type":31,"value":1400},"工作流 2：只改一个函数（高频、低风险）",{"type":26,"tag":153,"props":1402,"children":1403},{},[1404],{"type":26,"tag":157,"props":1405,"children":1406},{},[1407,1409,1414],{"type":31,"value":1408},"选中函数 → ",{"type":26,"tag":161,"props":1410,"children":1412},{"className":1411},[],[1413],{"type":31,"value":1387},{"type":31,"value":1415}," → 输入指令：",{"type":26,"tag":1318,"props":1417,"children":1418},{},[1419,1424],{"type":26,"tag":27,"props":1420,"children":1421},{},[1422],{"type":31,"value":1423},"把这段改成更可读：",{"type":26,"tag":153,"props":1425,"children":1426},{},[1427,1432,1437,1442],{"type":26,"tag":157,"props":1428,"children":1429},{},[1430],{"type":31,"value":1431},"用 async/await",{"type":26,"tag":157,"props":1433,"children":1434},{},[1435],{"type":31,"value":1436},"错误处理不要吞掉",{"type":26,"tag":157,"props":1438,"children":1439},{},[1440],{"type":31,"value":1441},"添加类型（若可推断）",{"type":26,"tag":157,"props":1443,"children":1444},{},[1445],{"type":31,"value":1446},"不要改函数签名",{"type":26,"tag":27,"props":1448,"children":1449},{},[1450],{"type":31,"value":1451},"验收方式（强制）：",{"type":26,"tag":153,"props":1453,"children":1454},{},[1455,1460],{"type":26,"tag":157,"props":1456,"children":1457},{},[1458],{"type":31,"value":1459},"输出前后函数行为一致（输入/输出）",{"type":26,"tag":157,"props":1461,"children":1462},{},[1463],{"type":31,"value":1464},"失败分支有可观测日志（不要悄悄 return null）",{"type":26,"tag":1336,"props":1466,"children":1468},{"id":1467},"工作流-3多文件改动先定文件清单",[1469],{"type":31,"value":1470},"工作流 3：多文件改动（先定“文件清单”）",{"type":26,"tag":333,"props":1472,"children":1473},{},[1474,1485],{"type":26,"tag":157,"props":1475,"children":1476},{},[1477,1483],{"type":26,"tag":161,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":31,"value":1482},"Cmd/Ctrl + I",{"type":31,"value":1484}," 进入多文件",{"type":26,"tag":157,"props":1486,"children":1487},{},[1488],{"type":31,"value":1489},"先让 AI 输出：",{"type":26,"tag":153,"props":1491,"children":1492},{},[1493,1498,1503],{"type":26,"tag":157,"props":1494,"children":1495},{},[1496],{"type":31,"value":1497},"预计会改哪些文件（最多 5 个）",{"type":26,"tag":157,"props":1499,"children":1500},{},[1501],{"type":31,"value":1502},"每个文件改什么",{"type":26,"tag":157,"props":1504,"children":1505},{},[1506],{"type":31,"value":1507},"每一步怎么验收",{"type":26,"tag":333,"props":1509,"children":1510},{"start":872},[1511],{"type":26,"tag":157,"props":1512,"children":1513},{},[1514],{"type":31,"value":1515},"你确认文件清单后再开始生成改动",{"type":26,"tag":27,"props":1517,"children":1518},{},[1519],{"type":31,"value":1520},"关键点：多文件最容易翻车的是“它把你没想到的文件也改了”。所以文件清单是第一道闸门。",{"type":26,"tag":1336,"props":1522,"children":1524},{"id":1523},"工作流-4把上下文噪音砍掉防跑偏",[1525],{"type":31,"value":1526},"工作流 4：把“上下文噪音”砍掉（防跑偏）",{"type":26,"tag":27,"props":1528,"children":1529},{},[1530],{"type":31,"value":1531},"当你怀疑它在胡说/乱改时：",{"type":26,"tag":153,"props":1533,"children":1534},{},[1535,1548],{"type":26,"tag":157,"props":1536,"children":1537},{},[1538,1540,1546],{"type":31,"value":1539},"只选择关键代码片段 → ",{"type":26,"tag":161,"props":1541,"children":1543},{"className":1542},[],[1544],{"type":31,"value":1545},"Cmd/Ctrl + Shift + L",{"type":31,"value":1547}," 加入对话",{"type":26,"tag":157,"props":1549,"children":1550},{},[1551],{"type":31,"value":1552},"然后在对话里要求：",{"type":26,"tag":1318,"props":1554,"children":1555},{},[1556],{"type":26,"tag":27,"props":1557,"children":1558},{},[1559],{"type":31,"value":1560},"只基于我提供的代码片段回答，不要假设其它文件存在。",{"type":26,"tag":1336,"props":1562,"children":1564},{"id":1563},"工作流-5生成变更说明让-code-review-变快",[1565],{"type":31,"value":1566},"工作流 5：生成变更说明（让 code review 变快）",{"type":26,"tag":27,"props":1568,"children":1569},{},[1570],{"type":31,"value":1571},"改完后在对话里让它输出：",{"type":26,"tag":153,"props":1573,"children":1574},{},[1575,1580,1585,1590],{"type":26,"tag":157,"props":1576,"children":1577},{},[1578],{"type":31,"value":1579},"改动摘要（3~7 条）",{"type":26,"tag":157,"props":1581,"children":1582},{},[1583],{"type":31,"value":1584},"风险点（依赖/边界条件）",{"type":26,"tag":157,"props":1586,"children":1587},{},[1588],{"type":31,"value":1589},"回滚方式",{"type":26,"tag":157,"props":1591,"children":1592},{},[1593],{"type":31,"value":1594},"验收步骤",{"type":26,"tag":27,"props":1596,"children":1597},{},[1598],{"type":31,"value":1599},"这套结构能直接贴进 PR 描述。",{"type":26,"tag":1336,"props":1601,"children":1603},{"id":1602},"工作流-6写最小回归集不写回归-等事故",[1604],{"type":31,"value":1605},"工作流 6：写“最小回归集”（不写回归 = 等事故）",{"type":26,"tag":27,"props":1607,"children":1608},{},[1609,1611,1617],{"type":31,"value":1610},"每次改动都至少做 10 条最小回归（见下文清单）。你可以把它写在 ",{"type":26,"tag":161,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":31,"value":1616},"README",{"type":31,"value":1618}," 或团队 wiki。",{"type":26,"tag":1336,"props":1620,"children":1622},{"id":1621},"工作流-7把接受建议变成最后一步",[1623],{"type":31,"value":1624},"工作流 7：把“接受建议”变成最后一步",{"type":26,"tag":27,"props":1626,"children":1627},{},[1628,1634,1636,1641],{"type":26,"tag":161,"props":1629,"children":1631},{"className":1630},[],[1632],{"type":31,"value":1633},"Cmd/Ctrl + Y",{"type":31,"value":1635}," 应该是",{"type":26,"tag":949,"props":1637,"children":1638},{},[1639],{"type":31,"value":1640},"最后一步",{"type":31,"value":1642},"：",{"type":26,"tag":153,"props":1644,"children":1645},{},[1646,1651,1656],{"type":26,"tag":157,"props":1647,"children":1648},{},[1649],{"type":31,"value":1650},"你已经看过 diff",{"type":26,"tag":157,"props":1652,"children":1653},{},[1654],{"type":31,"value":1655},"你能说清楚“怎么验收”",{"type":26,"tag":157,"props":1657,"children":1658},{},[1659],{"type":31,"value":1660},"你知道“怎么回滚”",{"type":26,"tag":1336,"props":1662,"children":1664},{"id":1663},"工作流-8拒绝建议不是失败是风控动作",[1665],{"type":31,"value":1666},"工作流 8：拒绝建议不是失败，是风控动作",{"type":26,"tag":27,"props":1668,"children":1669},{},[1670,1676],{"type":26,"tag":161,"props":1671,"children":1673},{"className":1672},[],[1674],{"type":31,"value":1675},"Cmd/Ctrl + N",{"type":31,"value":1677}," 的使用时机：",{"type":26,"tag":153,"props":1679,"children":1680},{},[1681,1686,1691],{"type":26,"tag":157,"props":1682,"children":1683},{},[1684],{"type":31,"value":1685},"它开始改你没提过的东西（范围漂移）",{"type":26,"tag":157,"props":1687,"children":1688},{},[1689],{"type":31,"value":1690},"它改了 10 个文件但你只想改 1 个",{"type":26,"tag":157,"props":1692,"children":1693},{},[1694],{"type":31,"value":1695},"它为了“更优雅”引入新依赖/新抽象",{"type":26,"tag":1336,"props":1697,"children":1699},{"id":1698},"工作流-9重复任务做成模板提示词不是一次性",[1700],{"type":31,"value":1701},"工作流 9：重复任务做成模板（提示词不是一次性）",{"type":26,"tag":27,"props":1703,"children":1704},{},[1705,1707,1711],{"type":31,"value":1706},"把高频任务（比如“写组件+样式+验收”）固化成模板，放进 Rules（见：",{"type":26,"tag":847,"props":1708,"children":1709},{"href":1005},[1710],{"type":31,"value":1008},{"type":31,"value":1712},"）。",{"type":26,"tag":1336,"props":1714,"children":1716},{"id":1715},"工作流-10把快捷键表做成你自己的任务表",[1717],{"type":31,"value":1718},"工作流 10：把“快捷键表”做成你自己的任务表",{"type":26,"tag":27,"props":1720,"children":1721},{},[1722],{"type":31,"value":1723},"你不需要记住所有快捷键，只需要记住：",{"type":26,"tag":153,"props":1725,"children":1726},{},[1727,1737,1747,1757],{"type":26,"tag":157,"props":1728,"children":1729},{},[1730,1732],{"type":31,"value":1731},"小步改：",{"type":26,"tag":161,"props":1733,"children":1735},{"className":1734},[],[1736],{"type":31,"value":1387},{"type":26,"tag":157,"props":1738,"children":1739},{},[1740,1742],{"type":31,"value":1741},"先对齐：",{"type":26,"tag":161,"props":1743,"children":1745},{"className":1744},[],[1746],{"type":31,"value":1353},{"type":26,"tag":157,"props":1748,"children":1749},{},[1750,1752],{"type":31,"value":1751},"多文件：",{"type":26,"tag":161,"props":1753,"children":1755},{"className":1754},[],[1756],{"type":31,"value":1482},{"type":26,"tag":157,"props":1758,"children":1759},{},[1760,1762],{"type":31,"value":1761},"上下文聚焦：",{"type":26,"tag":161,"props":1763,"children":1765},{"className":1764},[],[1766],{"type":31,"value":1545},{"type":26,"tag":1010,"props":1768,"children":1769},{},[],{"type":26,"tag":39,"props":1771,"children":1773},{"id":1772},"必交付物-1最小回归任务清单10-条通用",[1774],{"type":31,"value":1775},"必交付物 1：最小回归任务清单（10 条，通用）",{"type":26,"tag":1318,"props":1777,"children":1778},{},[1779],{"type":26,"tag":27,"props":1780,"children":1781},{},[1782],{"type":31,"value":1783},"这份清单的意义：让每次 AI 改动都能“被验证”。否则你只是把不可控变成了更快的不可控。",{"type":26,"tag":333,"props":1785,"children":1786},{},[1787,1792,1797,1802,1807,1812,1817,1822,1827,1832],{"type":26,"tag":157,"props":1788,"children":1789},{},[1790],{"type":31,"value":1791},"关键路径能跑通（手动点击/请求一次）",{"type":26,"tag":157,"props":1793,"children":1794},{},[1795],{"type":31,"value":1796},"错误路径能触发（模拟一次失败输入）",{"type":26,"tag":157,"props":1798,"children":1799},{},[1800],{"type":31,"value":1801},"控制台无新增错误（至少关注 1 次真实操作）",{"type":26,"tag":157,"props":1803,"children":1804},{},[1805],{"type":31,"value":1806},"关键 UI 未错位（移动端/桌面端各看一眼）",{"type":26,"tag":157,"props":1808,"children":1809},{},[1810],{"type":31,"value":1811},"刷新后状态正确（尤其是表单/列表）",{"type":26,"tag":157,"props":1813,"children":1814},{},[1815],{"type":31,"value":1816},"路由跳转没断（从入口到目标页）",{"type":26,"tag":157,"props":1818,"children":1819},{},[1820],{"type":31,"value":1821},"相关接口未改变契约（字段名/类型）",{"type":26,"tag":157,"props":1823,"children":1824},{},[1825],{"type":31,"value":1826},"性能没有明显退化（首屏、交互卡顿）",{"type":26,"tag":157,"props":1828,"children":1829},{},[1830],{"type":31,"value":1831},"回滚方案可执行（知道回滚哪几个文件/commit）",{"type":26,"tag":157,"props":1833,"children":1834},{},[1835],{"type":31,"value":1836},"写下“这次改动解决了什么、风险是什么”（可贴 PR）",{"type":26,"tag":1010,"props":1838,"children":1839},{},[],{"type":26,"tag":39,"props":1841,"children":1843},{"id":1842},"必交付物-2失败案例复盘真实会发生",[1844],{"type":31,"value":1845},"必交付物 2：失败案例复盘（真实会发生）",{"type":26,"tag":1336,"props":1847,"children":1849},{"id":1848},"现象快捷键用得很熟但交付还是慢",[1850],{"type":31,"value":1851},"现象：快捷键用得很熟，但交付还是慢",{"type":26,"tag":27,"props":1853,"children":1854},{},[1855],{"type":31,"value":1856},"典型原因：你把 Cursor 当成“更聪明的搜索框”，不断对话，直到它给出你想要的答案。",{"type":26,"tag":27,"props":1858,"children":1859},{},[1860],{"type":31,"value":1861},"复现路径：",{"type":26,"tag":153,"props":1863,"children":1864},{},[1865,1870,1875,1880],{"type":26,"tag":157,"props":1866,"children":1867},{},[1868],{"type":31,"value":1869},"你直接说“把页面做得更好看、更高级”",{"type":26,"tag":157,"props":1871,"children":1872},{},[1873],{"type":31,"value":1874},"AI 开始大改样式、抽象组件、甚至引入新依赖",{"type":26,"tag":157,"props":1876,"children":1877},{},[1878],{"type":31,"value":1879},"你为了省事按了“接受建议”",{"type":26,"tag":157,"props":1881,"children":1882},{},[1883],{"type":31,"value":1884},"最后发现：设计没统一、移动端崩、甚至埋了性能问题",{"type":26,"tag":27,"props":1886,"children":1887},{},[1888,1890,1894,1896,1901],{"type":31,"value":1889},"根因：缺少",{"type":26,"tag":949,"props":1891,"children":1892},{},[1893],{"type":31,"value":1074},{"type":31,"value":1895},"与",{"type":26,"tag":949,"props":1897,"children":1898},{},[1899],{"type":31,"value":1900},"验收",{"type":31,"value":1902},"。",{"type":26,"tag":27,"props":1904,"children":1905},{},[1906],{"type":31,"value":1907},"修复方式（可照抄）：",{"type":26,"tag":153,"props":1909,"children":1910},{},[1911,1916,1928],{"type":26,"tag":157,"props":1912,"children":1913},{},[1914],{"type":31,"value":1915},"把需求拆成 3 个可验证目标：例如“按钮样式统一”“首屏 CTA 更明显”“移动端间距不挤”",{"type":26,"tag":157,"props":1917,"children":1918},{},[1919,1921,1926],{"type":31,"value":1920},"每个目标只用 ",{"type":26,"tag":161,"props":1922,"children":1924},{"className":1923},[],[1925],{"type":31,"value":1387},{"type":31,"value":1927}," 改一个局部",{"type":26,"tag":157,"props":1929,"children":1930},{},[1931],{"type":31,"value":1932},"每次接受建议前跑一遍“最小回归集”",{"type":26,"tag":1010,"props":1934,"children":1935},{},[],{"type":26,"tag":39,"props":1937,"children":1939},{"id":1938},"faq高频问题",[1940],{"type":31,"value":1941},"FAQ（高频问题）",{"type":26,"tag":1336,"props":1943,"children":1945},{"id":1944},"q1我应该先记快捷键还是先学工作流",[1946],{"type":31,"value":1947},"Q1：我应该先记快捷键还是先学工作流？",{"type":26,"tag":27,"props":1949,"children":1950},{},[1951],{"type":31,"value":1952},"先学工作流。快捷键只是把工作流的步骤变短。",{"type":26,"tag":1336,"props":1954,"children":1956},{"id":1955},"q2为什么我一用多文件就容易翻车",[1957],{"type":31,"value":1958},"Q2：为什么我一用多文件就容易翻车？",{"type":26,"tag":27,"props":1960,"children":1961},{},[1962],{"type":31,"value":1963},"因为多文件意味着范围更大、依赖更多、验收更难。先锁定“文件清单 + 每步验收”，再让它动手。",{"type":26,"tag":1336,"props":1965,"children":1967},{"id":1966},"q3有没有万能提示词",[1968],{"type":31,"value":1969},"Q3：有没有“万能提示词”？",{"type":26,"tag":27,"props":1971,"children":1972},{},[1973],{"type":31,"value":1974},"没有，但有“万能结构”：目标、范围、非目标、验收、输出格式。",{"type":26,"tag":1010,"props":1976,"children":1977},{},[],{"type":26,"tag":39,"props":1979,"children":1981},{"id":1980},"延伸阅读建议按顺序",[1982],{"type":31,"value":1983},"延伸阅读（建议按顺序）",{"type":26,"tag":153,"props":1985,"children":1986},{},[1987,1994,2001,2008],{"type":26,"tag":157,"props":1988,"children":1989},{},[1990],{"type":26,"tag":847,"props":1991,"children":1992},{"href":983},[1993],{"type":31,"value":986},{"type":26,"tag":157,"props":1995,"children":1996},{},[1997],{"type":26,"tag":847,"props":1998,"children":1999},{"href":994},[2000],{"type":31,"value":997},{"type":26,"tag":157,"props":2002,"children":2003},{},[2004],{"type":26,"tag":847,"props":2005,"children":2006},{"href":1005},[2007],{"type":31,"value":1008},{"type":26,"tag":157,"props":2009,"children":2010},{},[2011,2013],{"type":31,"value":2012},"如果你更关心“网页制作落地”：看这篇 ",{"type":26,"tag":847,"props":2014,"children":2016},{"href":2015},"/topics/practical-tips/htmlpage-quick-landing-page",[2017],{"type":31,"value":2018},"3 分钟用 HTMLPAGE 做落地页",{"title":7,"searchDepth":872,"depth":872,"links":2020},[2021,2022,2023,2035,2036,2039,2044],{"id":1015,"depth":875,"text":1018},{"id":1090,"depth":875,"text":1093},{"id":1331,"depth":875,"text":1334,"children":2024},[2025,2026,2027,2028,2029,2030,2031,2032,2033,2034],{"id":1338,"depth":872,"text":1341},{"id":1397,"depth":872,"text":1400},{"id":1467,"depth":872,"text":1470},{"id":1523,"depth":872,"text":1526},{"id":1563,"depth":872,"text":1566},{"id":1602,"depth":872,"text":1605},{"id":1621,"depth":872,"text":1624},{"id":1663,"depth":872,"text":1666},{"id":1698,"depth":872,"text":1701},{"id":1715,"depth":872,"text":1718},{"id":1772,"depth":875,"text":1775},{"id":1842,"depth":875,"text":1845,"children":2037},[2038],{"id":1848,"depth":872,"text":1851},{"id":1938,"depth":875,"text":1941,"children":2040},[2041,2042,2043],{"id":1944,"depth":872,"text":1947},{"id":1955,"depth":872,"text":1958},{"id":1966,"depth":872,"text":1969},{"id":1980,"depth":875,"text":1983},"content:topics:ai:cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet",{"_path":2049,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":2050,"description":2051,"date":2052,"topic":5,"author":11,"tags":2053,"image":2057,"imageAlt":2058,"pexelsPhotoId":2059,"pexelsUrl":2060,"readingTime":2061,"body":2062,"_type":887,"_id":2995,"_source":889,"_file":2996,"_stem":2997,"_extension":892},"/topics/ai/cursor-vs-copilot-vscode-workflow","Cursor vs GitHub Copilot vs VS Code：怎么选、怎么搭配、怎么把风险关在笼子里","用“任务类型×风险×验收成本”的选择矩阵解释 Cursor/Copilot/VS Code 的差异，并给出一套可落地的协作工作流（范围闸门、最小回归集、回滚策略）。","2026-03-01",[900,2054,903,2055,2056],"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":2063,"toc":2973},[2064,2069,2074,2092,2097,2115,2118,2124,2129,2160,2165,2168,2174,2182,2386,2394,2407,2410,2416,2422,2435,2440,2453,2459,2464,2497,2503,2508,2526,2529,2535,2540,2546,2551,2584,2590,2603,2608,2621,2627,2639,2645,2650,2663,2668,2671,2677,2682,2803,2806,2812,2822,2831,2849,2858,2866,2875,2893,2896,2902,2908,2913,2919,2924,2927,2932],{"type":26,"tag":27,"props":2065,"children":2066},{},[2067],{"type":31,"value":2068},"“Cursor 和 Copilot 到底有什么区别？”",{"type":26,"tag":27,"props":2070,"children":2071},{},[2072],{"type":31,"value":2073},"这个问题问得越早越好，因为你一旦把工具选错，后面所有痛苦都不是“提示词不够好”，而是：",{"type":26,"tag":153,"props":2075,"children":2076},{},[2077,2082,2087],{"type":26,"tag":157,"props":2078,"children":2079},{},[2080],{"type":31,"value":2081},"改动不可控（范围漂移、改错文件）",{"type":26,"tag":157,"props":2083,"children":2084},{},[2085],{"type":31,"value":2086},"验收成本爆炸（不知道要测什么）",{"type":26,"tag":157,"props":2088,"children":2089},{},[2090],{"type":31,"value":2091},"团队协作崩盘（没有闸门、没有回滚）",{"type":26,"tag":27,"props":2093,"children":2094},{},[2095],{"type":31,"value":2096},"这篇文章用一张选择矩阵 + 一套可执行工作流，帮你做到两件事：",{"type":26,"tag":333,"props":2098,"children":2099},{},[2100,2105],{"type":26,"tag":157,"props":2101,"children":2102},{},[2103],{"type":31,"value":2104},"知道什么时候用 Cursor、什么时候用 Copilot、什么时候“纯 VS Code 更快”",{"type":26,"tag":157,"props":2106,"children":2107},{},[2108,2110],{"type":31,"value":2109},"就算用 AI，也能把风险关在笼子里：",{"type":26,"tag":949,"props":2111,"children":2112},{},[2113],{"type":31,"value":2114},"可审查、可验证、可回滚",{"type":26,"tag":1010,"props":2116,"children":2117},{},[],{"type":26,"tag":39,"props":2119,"children":2121},{"id":2120},"结论先说三者不是互斥而是分工",[2122],{"type":31,"value":2123},"结论先说：三者不是互斥，而是分工",{"type":26,"tag":27,"props":2125,"children":2126},{},[2127],{"type":31,"value":2128},"你可以把它们看成三层能力：",{"type":26,"tag":153,"props":2130,"children":2131},{},[2132,2141,2151],{"type":26,"tag":157,"props":2133,"children":2134},{},[2135,2139],{"type":26,"tag":949,"props":2136,"children":2137},{},[2138],{"type":31,"value":903},{"type":31,"value":2140},"：编辑器与生态（调试、插件、任务、终端、语言服务）",{"type":26,"tag":157,"props":2142,"children":2143},{},[2144,2149],{"type":26,"tag":949,"props":2145,"children":2146},{},[2147],{"type":31,"value":2148},"Copilot",{"type":31,"value":2150},"：代码补全与局部建议（“我正在写这一行/这一段”）",{"type":26,"tag":157,"props":2152,"children":2153},{},[2154,2158],{"type":26,"tag":949,"props":2155,"children":2156},{},[2157],{"type":31,"value":900},{"type":31,"value":2159},"：以项目为单位的 AI 协作（对话、索引、多文件编辑、规则）",{"type":26,"tag":27,"props":2161,"children":2162},{},[2163],{"type":31,"value":2164},"最常见的误区是：把“局部补全能力”当作“能做架构与多文件落地”。",{"type":26,"tag":1010,"props":2166,"children":2167},{},[],{"type":26,"tag":39,"props":2169,"children":2171},{"id":2170},"选择矩阵按任务类型选工具不是按偏好",[2172],{"type":31,"value":2173},"选择矩阵：按任务类型选工具（不是按偏好）",{"type":26,"tag":1318,"props":2175,"children":2176},{},[2177],{"type":26,"tag":27,"props":2178,"children":2179},{},[2180],{"type":31,"value":2181},"你只要把自己的任务放进表格，就能得到推荐路径。",{"type":26,"tag":51,"props":2183,"children":2184},{},[2185,2217],{"type":26,"tag":55,"props":2186,"children":2187},{},[2188],{"type":26,"tag":59,"props":2189,"children":2190},{},[2191,2196,2202,2207,2212],{"type":26,"tag":63,"props":2192,"children":2193},{},[2194],{"type":31,"value":2195},"任务类型",{"type":26,"tag":63,"props":2197,"children":2199},{"align":2198},"right",[2200],{"type":31,"value":2201},"风险",{"type":26,"tag":63,"props":2203,"children":2204},{"align":2198},[2205],{"type":31,"value":2206},"验收成本",{"type":26,"tag":63,"props":2208,"children":2209},{},[2210],{"type":31,"value":2211},"更推荐",{"type":26,"tag":63,"props":2213,"children":2214},{},[2215],{"type":31,"value":2216},"为什么",{"type":26,"tag":79,"props":2218,"children":2219},{},[2220,2247,2280,2306,2333,2360],{"type":26,"tag":59,"props":2221,"children":2222},{},[2223,2228,2233,2237,2242],{"type":26,"tag":86,"props":2224,"children":2225},{},[2226],{"type":31,"value":2227},"写一段代码/补一个 if",{"type":26,"tag":86,"props":2229,"children":2230},{"align":2198},[2231],{"type":31,"value":2232},"低",{"type":26,"tag":86,"props":2234,"children":2235},{"align":2198},[2236],{"type":31,"value":2232},{"type":26,"tag":86,"props":2238,"children":2239},{},[2240],{"type":31,"value":2241},"Copilot / Cursor 内联编辑",{"type":26,"tag":86,"props":2243,"children":2244},{},[2245],{"type":31,"value":2246},"局部建议足够，成本最低",{"type":26,"tag":59,"props":2248,"children":2249},{},[2250,2255,2260,2264,2275],{"type":26,"tag":86,"props":2251,"children":2252},{},[2253],{"type":31,"value":2254},"重构一个函数",{"type":26,"tag":86,"props":2256,"children":2257},{"align":2198},[2258],{"type":31,"value":2259},"中",{"type":26,"tag":86,"props":2261,"children":2262},{"align":2198},[2263],{"type":31,"value":2259},{"type":26,"tag":86,"props":2265,"children":2266},{},[2267,2269],{"type":31,"value":2268},"Cursor ",{"type":26,"tag":161,"props":2270,"children":2272},{"className":2271},[],[2273],{"type":31,"value":2274},"内联编辑",{"type":26,"tag":86,"props":2276,"children":2277},{},[2278],{"type":31,"value":2279},"需要解释、需要约束输出",{"type":26,"tag":59,"props":2281,"children":2282},{},[2283,2288,2292,2296,2301],{"type":26,"tag":86,"props":2284,"children":2285},{},[2286],{"type":31,"value":2287},"改一个组件 + 样式",{"type":26,"tag":86,"props":2289,"children":2290},{"align":2198},[2291],{"type":31,"value":2259},{"type":26,"tag":86,"props":2293,"children":2294},{"align":2198},[2295],{"type":31,"value":2259},{"type":26,"tag":86,"props":2297,"children":2298},{},[2299],{"type":31,"value":2300},"Cursor（小范围多文件）",{"type":26,"tag":86,"props":2302,"children":2303},{},[2304],{"type":31,"value":2305},"需要同时改模板与样式",{"type":26,"tag":59,"props":2307,"children":2308},{},[2309,2314,2319,2323,2328],{"type":26,"tag":86,"props":2310,"children":2311},{},[2312],{"type":31,"value":2313},"改 3~5 个文件（组件+api+测试）",{"type":26,"tag":86,"props":2315,"children":2316},{"align":2198},[2317],{"type":31,"value":2318},"高",{"type":26,"tag":86,"props":2320,"children":2321},{"align":2198},[2322],{"type":31,"value":2318},{"type":26,"tag":86,"props":2324,"children":2325},{},[2326],{"type":31,"value":2327},"Cursor Composer + 闸门",{"type":26,"tag":86,"props":2329,"children":2330},{},[2331],{"type":31,"value":2332},"需要计划、验收、回滚",{"type":26,"tag":59,"props":2334,"children":2335},{},[2336,2341,2346,2350,2355],{"type":26,"tag":86,"props":2337,"children":2338},{},[2339],{"type":31,"value":2340},"重写一段架构/引入新依赖",{"type":26,"tag":86,"props":2342,"children":2343},{"align":2198},[2344],{"type":31,"value":2345},"很高",{"type":26,"tag":86,"props":2347,"children":2348},{"align":2198},[2349],{"type":31,"value":2345},{"type":26,"tag":86,"props":2351,"children":2352},{},[2353],{"type":31,"value":2354},"先人脑设计 + VS Code 实现",{"type":26,"tag":86,"props":2356,"children":2357},{},[2358],{"type":31,"value":2359},"AI 易发散，最好先设计再执行",{"type":26,"tag":59,"props":2361,"children":2362},{},[2363,2368,2372,2376,2381],{"type":26,"tag":86,"props":2364,"children":2365},{},[2366],{"type":31,"value":2367},"排查线上问题/性能抖动",{"type":26,"tag":86,"props":2369,"children":2370},{"align":2198},[2371],{"type":31,"value":2318},{"type":26,"tag":86,"props":2373,"children":2374},{"align":2198},[2375],{"type":31,"value":2345},{"type":26,"tag":86,"props":2377,"children":2378},{},[2379],{"type":31,"value":2380},"VS Code + 工具链优先，AI 辅助归纳",{"type":26,"tag":86,"props":2382,"children":2383},{},[2384],{"type":31,"value":2385},"需要证据，不要“猜”",{"type":26,"tag":27,"props":2387,"children":2388},{},[2389],{"type":26,"tag":949,"props":2390,"children":2391},{},[2392],{"type":31,"value":2393},"一句话规则：",{"type":26,"tag":153,"props":2395,"children":2396},{},[2397,2402],{"type":26,"tag":157,"props":2398,"children":2399},{},[2400],{"type":31,"value":2401},"当你的改动可以用“10 条最小回归集”覆盖时，用 Cursor。",{"type":26,"tag":157,"props":2403,"children":2404},{},[2405],{"type":31,"value":2406},"当你的改动无法验证时，先别让 AI 动手。",{"type":26,"tag":1010,"props":2408,"children":2409},{},[],{"type":26,"tag":39,"props":2411,"children":2413},{"id":2412},"差异拆解到底差在哪里",[2414],{"type":31,"value":2415},"差异拆解：到底差在哪里？",{"type":26,"tag":1336,"props":2417,"children":2419},{"id":2418},"_1-上下文来源补全-vs-项目索引",[2420],{"type":31,"value":2421},"1) 上下文来源：补全 vs 项目索引",{"type":26,"tag":153,"props":2423,"children":2424},{},[2425,2430],{"type":26,"tag":157,"props":2426,"children":2427},{},[2428],{"type":31,"value":2429},"Copilot 更擅长：你正在写的这几行、当前文件的局部上下文",{"type":26,"tag":157,"props":2431,"children":2432},{},[2433],{"type":31,"value":2434},"Cursor 更擅长：项目级索引 + 多文件关联理解",{"type":26,"tag":27,"props":2436,"children":2437},{},[2438],{"type":31,"value":2439},"因此：",{"type":26,"tag":153,"props":2441,"children":2442},{},[2443,2448],{"type":26,"tag":157,"props":2444,"children":2445},{},[2446],{"type":31,"value":2447},"写代码片段：Copilot 速度更快",{"type":26,"tag":157,"props":2449,"children":2450},{},[2451],{"type":31,"value":2452},"改一坨工程：Cursor 更有胜算（但更需要闸门）",{"type":26,"tag":1336,"props":2454,"children":2456},{"id":2455},"_2-交互方式你能不能控制范围",[2457],{"type":31,"value":2458},"2) 交互方式：你能不能控制范围",{"type":26,"tag":27,"props":2460,"children":2461},{},[2462],{"type":31,"value":2463},"范围控制的三个层级：",{"type":26,"tag":333,"props":2465,"children":2466},{},[2467,2477,2487],{"type":26,"tag":157,"props":2468,"children":2469},{},[2470,2472],{"type":31,"value":2471},"内联编辑（选中一段）→ ",{"type":26,"tag":949,"props":2473,"children":2474},{},[2475],{"type":31,"value":2476},"最强范围控制",{"type":26,"tag":157,"props":2478,"children":2479},{},[2480,2482],{"type":31,"value":2481},"Composer 多文件（先列文件清单）→ ",{"type":26,"tag":949,"props":2483,"children":2484},{},[2485],{"type":31,"value":2486},"可控但要闸门",{"type":26,"tag":157,"props":2488,"children":2489},{},[2490,2492],{"type":31,"value":2491},"大对话（泛目标）→ ",{"type":26,"tag":949,"props":2493,"children":2494},{},[2495],{"type":31,"value":2496},"最容易跑偏",{"type":26,"tag":1336,"props":2498,"children":2500},{"id":2499},"_3-输出形态建议-vs-可审查的变更",[2501],{"type":31,"value":2502},"3) 输出形态：建议 vs 可审查的变更",{"type":26,"tag":27,"props":2504,"children":2505},{},[2506],{"type":31,"value":2507},"最好的 AI 输出不是“给我一段代码”，而是：",{"type":26,"tag":153,"props":2509,"children":2510},{},[2511,2516,2521],{"type":26,"tag":157,"props":2512,"children":2513},{},[2514],{"type":31,"value":2515},"改动摘要（做了什么）",{"type":26,"tag":157,"props":2517,"children":2518},{},[2519],{"type":31,"value":2520},"diff 级别的可审查变更",{"type":26,"tag":157,"props":2522,"children":2523},{},[2524],{"type":31,"value":2525},"验收步骤与回滚方案",{"type":26,"tag":1010,"props":2527,"children":2528},{},[],{"type":26,"tag":39,"props":2530,"children":2532},{"id":2531},"一套可落地的团队工作流把风险关住",[2533],{"type":31,"value":2534},"一套可落地的团队工作流（把风险关住）",{"type":26,"tag":27,"props":2536,"children":2537},{},[2538],{"type":31,"value":2539},"下面这套流程，你可以直接写进团队规范：",{"type":26,"tag":1336,"props":2541,"children":2543},{"id":2542},"step-1先写任务单geo-友好结构",[2544],{"type":31,"value":2545},"Step 1：先写任务单（GEO 友好结构）",{"type":26,"tag":27,"props":2547,"children":2548},{},[2549],{"type":31,"value":2550},"模板：",{"type":26,"tag":153,"props":2552,"children":2553},{},[2554,2559,2564,2569,2574,2579],{"type":26,"tag":157,"props":2555,"children":2556},{},[2557],{"type":31,"value":2558},"目标：……",{"type":26,"tag":157,"props":2560,"children":2561},{},[2562],{"type":31,"value":2563},"背景：……",{"type":26,"tag":157,"props":2565,"children":2566},{},[2567],{"type":31,"value":2568},"范围：只改这些文件/模块：……",{"type":26,"tag":157,"props":2570,"children":2571},{},[2572],{"type":31,"value":2573},"非目标：不做哪些事情：……",{"type":26,"tag":157,"props":2575,"children":2576},{},[2577],{"type":31,"value":2578},"验收：如何判断完成（可测试/可观察）：……",{"type":26,"tag":157,"props":2580,"children":2581},{},[2582],{"type":31,"value":2583},"回滚：如果失败怎么撤回：……",{"type":26,"tag":1336,"props":2585,"children":2587},{"id":2586},"step-2用范围闸门限制-ai",[2588],{"type":31,"value":2589},"Step 2：用“范围闸门”限制 AI",{"type":26,"tag":153,"props":2591,"children":2592},{},[2593,2598],{"type":26,"tag":157,"props":2594,"children":2595},{},[2596],{"type":31,"value":2597},"单文件改动：优先 Cursor 内联编辑",{"type":26,"tag":157,"props":2599,"children":2600},{},[2601],{"type":31,"value":2602},"多文件改动：必须先让 AI 输出“文件清单（≤5）+ 每步验收”",{"type":26,"tag":27,"props":2604,"children":2605},{},[2606],{"type":31,"value":2607},"如果 AI 输出的文件清单超过 5 个：",{"type":26,"tag":153,"props":2609,"children":2610},{},[2611,2616],{"type":26,"tag":157,"props":2612,"children":2613},{},[2614],{"type":31,"value":2615},"不是它太强，是任务太大",{"type":26,"tag":157,"props":2617,"children":2618},{},[2619],{"type":31,"value":2620},"你需要拆任务，而不是继续推进",{"type":26,"tag":1336,"props":2622,"children":2624},{"id":2623},"step-3最小回归集10-条",[2625],{"type":31,"value":2626},"Step 3：最小回归集（10 条）",{"type":26,"tag":27,"props":2628,"children":2629},{},[2630,2632,2637],{"type":31,"value":2631},"每次接受改动前必须跑（可参考：",{"type":26,"tag":847,"props":2633,"children":2634},{"href":895},[2635],{"type":31,"value":2636},"Cursor 快捷键速查表",{"type":31,"value":2638}," 里的清单）。",{"type":26,"tag":1336,"props":2640,"children":2642},{"id":2641},"step-4回滚策略不用等事故才想",[2643],{"type":31,"value":2644},"Step 4：回滚策略（不用等事故才想）",{"type":26,"tag":27,"props":2646,"children":2647},{},[2648],{"type":31,"value":2649},"回滚最常见的两条路：",{"type":26,"tag":153,"props":2651,"children":2652},{},[2653,2658],{"type":26,"tag":157,"props":2654,"children":2655},{},[2656],{"type":31,"value":2657},"git 回滚 commit",{"type":26,"tag":157,"props":2659,"children":2660},{},[2661],{"type":31,"value":2662},"对关键文件保留前版本（至少能快速恢复）",{"type":26,"tag":27,"props":2664,"children":2665},{},[2666],{"type":31,"value":2667},"你需要做到：任何一轮 AI 改动都能在 5 分钟内撤回。",{"type":26,"tag":1010,"props":2669,"children":2670},{},[],{"type":26,"tag":39,"props":2672,"children":2674},{"id":2673},"必交付物对比矩阵可复制",[2675],{"type":31,"value":2676},"必交付物：对比矩阵（可复制）",{"type":26,"tag":27,"props":2678,"children":2679},{},[2680],{"type":31,"value":2681},"下面这张表可以直接贴到你的团队 wiki：",{"type":26,"tag":51,"props":2683,"children":2684},{},[2685,2708],{"type":26,"tag":55,"props":2686,"children":2687},{},[2688],{"type":26,"tag":59,"props":2689,"children":2690},{},[2691,2696,2700,2704],{"type":26,"tag":63,"props":2692,"children":2693},{},[2694],{"type":31,"value":2695},"维度",{"type":26,"tag":63,"props":2697,"children":2698},{},[2699],{"type":31,"value":903},{"type":26,"tag":63,"props":2701,"children":2702},{},[2703],{"type":31,"value":2148},{"type":26,"tag":63,"props":2705,"children":2706},{},[2707],{"type":31,"value":900},{"type":26,"tag":79,"props":2709,"children":2710},{},[2711,2734,2757,2780],{"type":26,"tag":59,"props":2712,"children":2713},{},[2714,2719,2724,2729],{"type":26,"tag":86,"props":2715,"children":2716},{},[2717],{"type":31,"value":2718},"强项",{"type":26,"tag":86,"props":2720,"children":2721},{},[2722],{"type":31,"value":2723},"工具链、调试、生态",{"type":26,"tag":86,"props":2725,"children":2726},{},[2727],{"type":31,"value":2728},"补全与局部建议",{"type":26,"tag":86,"props":2730,"children":2731},{},[2732],{"type":31,"value":2733},"项目上下文、多文件落地",{"type":26,"tag":59,"props":2735,"children":2736},{},[2737,2742,2747,2752],{"type":26,"tag":86,"props":2738,"children":2739},{},[2740],{"type":31,"value":2741},"适合任务",{"type":26,"tag":86,"props":2743,"children":2744},{},[2745],{"type":31,"value":2746},"排查、调试、验证",{"type":26,"tag":86,"props":2748,"children":2749},{},[2750],{"type":31,"value":2751},"写一段、补一段",{"type":26,"tag":86,"props":2753,"children":2754},{},[2755],{"type":31,"value":2756},"改一段、改一组文件",{"type":26,"tag":59,"props":2758,"children":2759},{},[2760,2765,2770,2775],{"type":26,"tag":86,"props":2761,"children":2762},{},[2763],{"type":31,"value":2764},"最大风险",{"type":26,"tag":86,"props":2766,"children":2767},{},[2768],{"type":31,"value":2769},"无",{"type":26,"tag":86,"props":2771,"children":2772},{},[2773],{"type":31,"value":2774},"过度依赖建议",{"type":26,"tag":86,"props":2776,"children":2777},{},[2778],{"type":31,"value":2779},"范围漂移、多文件回归",{"type":26,"tag":59,"props":2781,"children":2782},{},[2783,2788,2793,2798],{"type":26,"tag":86,"props":2784,"children":2785},{},[2786],{"type":31,"value":2787},"必须搭配",{"type":26,"tag":86,"props":2789,"children":2790},{},[2791],{"type":31,"value":2792},"规范与检查",{"type":26,"tag":86,"props":2794,"children":2795},{},[2796],{"type":31,"value":2797},"代码评审",{"type":26,"tag":86,"props":2799,"children":2800},{},[2801],{"type":31,"value":2802},"闸门 + 最小回归集",{"type":26,"tag":1010,"props":2804,"children":2805},{},[],{"type":26,"tag":39,"props":2807,"children":2809},{"id":2808},"失败案例多文件看似成功实际埋雷",[2810],{"type":31,"value":2811},"失败案例：多文件“看似成功”，实际埋雷",{"type":26,"tag":27,"props":2813,"children":2814},{},[2815,2820],{"type":26,"tag":949,"props":2816,"children":2817},{},[2818],{"type":31,"value":2819},"现象",{"type":31,"value":2821},"：AI 说“我已经把所有地方都改了”，你也接受了，结果上线后 404 或样式错位。",{"type":26,"tag":27,"props":2823,"children":2824},{},[2825,2830],{"type":26,"tag":949,"props":2826,"children":2827},{},[2828],{"type":31,"value":2829},"复现条件",{"type":31,"value":1642},{"type":26,"tag":153,"props":2832,"children":2833},{},[2834,2839,2844],{"type":26,"tag":157,"props":2835,"children":2836},{},[2837],{"type":31,"value":2838},"你给了一个大目标（例如“把所有按钮统一成主题色”）",{"type":26,"tag":157,"props":2840,"children":2841},{},[2842],{"type":31,"value":2843},"它改了组件、样式、甚至主题配置",{"type":26,"tag":157,"props":2845,"children":2846},{},[2847],{"type":31,"value":2848},"你没有按页面模块走一遍，直接合并",{"type":26,"tag":27,"props":2850,"children":2851},{},[2852,2857],{"type":26,"tag":949,"props":2853,"children":2854},{},[2855],{"type":31,"value":2856},"根因",{"type":31,"value":1642},{"type":26,"tag":153,"props":2859,"children":2860},{},[2861],{"type":26,"tag":157,"props":2862,"children":2863},{},[2864],{"type":31,"value":2865},"改动范围大，但验收仍按“小改动”的方式做（只看一处）",{"type":26,"tag":27,"props":2867,"children":2868},{},[2869,2874],{"type":26,"tag":949,"props":2870,"children":2871},{},[2872],{"type":31,"value":2873},"修复",{"type":31,"value":1642},{"type":26,"tag":153,"props":2876,"children":2877},{},[2878,2883,2888],{"type":26,"tag":157,"props":2879,"children":2880},{},[2881],{"type":31,"value":2882},"强制把任务拆成“模块级目标”：Hero、Feature、Pricing、Form",{"type":26,"tag":157,"props":2884,"children":2885},{},[2886],{"type":31,"value":2887},"每个模块改完就验收一次",{"type":26,"tag":157,"props":2889,"children":2890},{},[2891],{"type":31,"value":2892},"验收通过再进入下一个模块",{"type":26,"tag":1010,"props":2894,"children":2895},{},[],{"type":26,"tag":39,"props":2897,"children":2899},{"id":2898},"faq",[2900],{"type":31,"value":2901},"FAQ",{"type":26,"tag":1336,"props":2903,"children":2905},{"id":2904},"q1我已经用了-cursor为什么还要用-copilot",[2906],{"type":31,"value":2907},"Q1：我已经用了 Cursor，为什么还要用 Copilot？",{"type":26,"tag":27,"props":2909,"children":2910},{},[2911],{"type":31,"value":2912},"因为“补全”这种高频低风险任务，Copilot 的交互成本更低；Cursor 更适合需要解释与约束的改动。",{"type":26,"tag":1336,"props":2914,"children":2916},{"id":2915},"q2什么时候应该完全不用-ai",[2917],{"type":31,"value":2918},"Q2：什么时候应该完全不用 AI？",{"type":26,"tag":27,"props":2920,"children":2921},{},[2922],{"type":31,"value":2923},"当你无法定义验收标准时。比如“更高级”“更好看”这种目标，先做信息结构与设计规则，再让 AI 帮你落地局部。",{"type":26,"tag":1010,"props":2925,"children":2926},{},[],{"type":26,"tag":39,"props":2928,"children":2930},{"id":2929},"延伸阅读",[2931],{"type":31,"value":2929},{"type":26,"tag":153,"props":2933,"children":2934},{},[2935,2944,2953,2962],{"type":26,"tag":157,"props":2936,"children":2937},{},[2938,2940],{"type":31,"value":2939},"Cursor 入门：",{"type":26,"tag":847,"props":2941,"children":2942},{"href":983},[2943],{"type":31,"value":986},{"type":26,"tag":157,"props":2945,"children":2946},{},[2947,2949],{"type":31,"value":2948},"Cursor 进阶：",{"type":26,"tag":847,"props":2950,"children":2951},{"href":994},[2952],{"type":31,"value":997},{"type":26,"tag":157,"props":2954,"children":2955},{},[2956,2958],{"type":31,"value":2957},"规则配置：",{"type":26,"tag":847,"props":2959,"children":2960},{"href":1005},[2961],{"type":31,"value":1008},{"type":26,"tag":157,"props":2963,"children":2964},{},[2965,2967],{"type":31,"value":2966},"Copilot 实战：",{"type":26,"tag":847,"props":2968,"children":2970},{"href":2969},"/topics/ai/github-copilot-tips",[2971],{"type":31,"value":2972},"GitHub Copilot 实用技巧",{"title":7,"searchDepth":872,"depth":872,"links":2974},[2975,2976,2977,2982,2988,2989,2990,2994],{"id":2120,"depth":875,"text":2123},{"id":2170,"depth":875,"text":2173},{"id":2412,"depth":875,"text":2415,"children":2978},[2979,2980,2981],{"id":2418,"depth":872,"text":2421},{"id":2455,"depth":872,"text":2458},{"id":2499,"depth":872,"text":2502},{"id":2531,"depth":875,"text":2534,"children":2983},[2984,2985,2986,2987],{"id":2542,"depth":872,"text":2545},{"id":2586,"depth":872,"text":2589},{"id":2623,"depth":872,"text":2626},{"id":2641,"depth":872,"text":2644},{"id":2673,"depth":875,"text":2676},{"id":2808,"depth":875,"text":2811},{"id":2898,"depth":875,"text":2901,"children":2991},[2992,2993],{"id":2904,"depth":872,"text":2907},{"id":2915,"depth":872,"text":2918},{"id":2929,"depth":875,"text":2929},"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":2999,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":3000,"description":3001,"date":3002,"topic":5,"author":11,"tags":3003,"image":3008,"featured":785,"readingTime":2061,"body":3009,"_type":887,"_id":3657,"_source":889,"_file":3658,"_stem":3659,"_extension":892},"/topics/ai/ai-debugging-troubleshooting-guide","AI 辅助调试与问题排查：让 AI 成为你的调试搭档","深入探讨如何利用 AI 工具提升调试效率，包括错误信息分析、日志解读、性能问题定位、复杂 bug 排查等实战场景，构建 AI 驱动的调试工作流。","2026-01-18",[3004,3005,3006,904,3007],"AI 调试","问题排查","Debug","错误处理","/images/topics/ai/ai-debugging-guide.jpg",{"type":23,"children":3010,"toc":3628},[3011,3017,3023,3028,3033,3038,3044,3050,3055,3063,3091,3099,3122,3128,3138,3147,3155,3163,3196,3204,3234,3247,3255,3260,3268,3276,3287,3293,3301,3312,3320,3329,3335,3341,3346,3355,3361,3366,3375,3381,3387,3396,3402,3411,3417,3428,3434,3440,3449,3455,3464,3470,3476,3484,3490,3499,3507,3515,3518,3524,3529,3548,3560,3563,3569,3574,3583,3588,3591,3597,3602,3620],{"type":26,"tag":39,"props":3012,"children":3014},{"id":3013},"ai-辅助调试与问题排查",[3015],{"type":31,"value":3016},"AI 辅助调试与问题排查",{"type":26,"tag":39,"props":3018,"children":3020},{"id":3019},"引言调试的痛与-ai-的解药",[3021],{"type":31,"value":3022},"引言：调试的痛与 AI 的解药",{"type":26,"tag":27,"props":3024,"children":3025},{},[3026],{"type":31,"value":3027},"调试是每个程序员的日常，也是最消耗时间和精力的工作之一。我们都有过这样的经历：盯着一个莫名其妙的错误信息，翻遍 Stack Overflow，尝试各种方案，几个小时后才发现是一个愚蠢的拼写错误。",{"type":26,"tag":27,"props":3029,"children":3030},{},[3031],{"type":31,"value":3032},"AI 工具的出现，正在改变调试的方式。不是替代你的思考，而是加速你的分析过程——帮你快速理解错误、缩小排查范围、验证假设。",{"type":26,"tag":27,"props":3034,"children":3035},{},[3036],{"type":31,"value":3037},"这篇文章分享我在实际项目中使用 AI 辅助调试的经验和方法论。",{"type":26,"tag":39,"props":3039,"children":3041},{"id":3040},"第一部分建立-ai-调试的思维模型",[3042],{"type":31,"value":3043},"第一部分：建立 AI 调试的思维模型",{"type":26,"tag":1336,"props":3045,"children":3047},{"id":3046},"_11-ai-在调试中的角色",[3048],{"type":31,"value":3049},"1.1 AI 在调试中的角色",{"type":26,"tag":27,"props":3051,"children":3052},{},[3053],{"type":31,"value":3054},"把 AI 想象成一个经验丰富但不了解你项目的高级工程师。它：",{"type":26,"tag":27,"props":3056,"children":3057},{},[3058],{"type":26,"tag":949,"props":3059,"children":3060},{},[3061],{"type":31,"value":3062},"擅长的事情：",{"type":26,"tag":153,"props":3064,"children":3065},{},[3066,3071,3076,3081,3086],{"type":26,"tag":157,"props":3067,"children":3068},{},[3069],{"type":31,"value":3070},"解读错误信息的含义",{"type":26,"tag":157,"props":3072,"children":3073},{},[3074],{"type":31,"value":3075},"提供可能的原因列表",{"type":26,"tag":157,"props":3077,"children":3078},{},[3079],{"type":31,"value":3080},"给出排查方向建议",{"type":26,"tag":157,"props":3082,"children":3083},{},[3084],{"type":31,"value":3085},"解释复杂的技术概念",{"type":26,"tag":157,"props":3087,"children":3088},{},[3089],{"type":31,"value":3090},"生成调试代码片段",{"type":26,"tag":27,"props":3092,"children":3093},{},[3094],{"type":26,"tag":949,"props":3095,"children":3096},{},[3097],{"type":31,"value":3098},"不擅长的事情：",{"type":26,"tag":153,"props":3100,"children":3101},{},[3102,3107,3112,3117],{"type":26,"tag":157,"props":3103,"children":3104},{},[3105],{"type":31,"value":3106},"了解你的业务逻辑",{"type":26,"tag":157,"props":3108,"children":3109},{},[3110],{"type":31,"value":3111},"知道你的代码历史",{"type":26,"tag":157,"props":3113,"children":3114},{},[3115],{"type":31,"value":3116},"理解项目特定的约定",{"type":26,"tag":157,"props":3118,"children":3119},{},[3120],{"type":31,"value":3121},"做出架构级判断",{"type":26,"tag":1336,"props":3123,"children":3125},{"id":3124},"_12-有效提问的结构",[3126],{"type":31,"value":3127},"1.2 有效提问的结构",{"type":26,"tag":547,"props":3129,"children":3133},{"code":3130,"language":887,"meta":7,"className":3131},"## 高效的调试提问模板\n\n**问题描述**\n[简洁描述遇到的问题]\n\n**错误信息**\n",[3132],"language-markdown",[3134],{"type":26,"tag":161,"props":3135,"children":3136},{"__ignoreMap":7},[3137],{"type":31,"value":3130},{"type":26,"tag":27,"props":3139,"children":3140},{},[3141],{"type":26,"tag":3142,"props":3143,"children":3144},"span",{},[3145],{"type":31,"value":3146},"完整的错误信息，不要截断",{"type":26,"tag":547,"props":3148,"children":3150},{"code":3149},"\n**相关代码**\n```javascript\n[精简但完整的相关代码]\n",[3151],{"type":26,"tag":161,"props":3152,"children":3153},{"__ignoreMap":7},[3154],{"type":31,"value":3149},{"type":26,"tag":27,"props":3156,"children":3157},{},[3158],{"type":26,"tag":949,"props":3159,"children":3160},{},[3161],{"type":31,"value":3162},"环境信息",{"type":26,"tag":153,"props":3164,"children":3165},{},[3166,3176,3186],{"type":26,"tag":157,"props":3167,"children":3168},{},[3169,3171],{"type":31,"value":3170},"运行环境：",{"type":26,"tag":3142,"props":3172,"children":3173},{},[3174],{"type":31,"value":3175},"Node 版本/浏览器版本",{"type":26,"tag":157,"props":3177,"children":3178},{},[3179,3181],{"type":31,"value":3180},"框架版本：",{"type":26,"tag":3142,"props":3182,"children":3183},{},[3184],{"type":31,"value":3185},"相关框架版本",{"type":26,"tag":157,"props":3187,"children":3188},{},[3189,3191],{"type":31,"value":3190},"操作系统：",{"type":26,"tag":3142,"props":3192,"children":3193},{},[3194],{"type":31,"value":3195},"如果相关",{"type":26,"tag":27,"props":3197,"children":3198},{},[3199],{"type":26,"tag":949,"props":3200,"children":3201},{},[3202],{"type":31,"value":3203},"已尝试的方案",{"type":26,"tag":153,"props":3205,"children":3206},{},[3207,3221],{"type":26,"tag":157,"props":3208,"children":3209},{},[3210,3215,3216],{"type":26,"tag":3142,"props":3211,"children":3212},{},[3213],{"type":31,"value":3214},"方案1",{"type":31,"value":1642},{"type":26,"tag":3142,"props":3217,"children":3218},{},[3219],{"type":31,"value":3220},"结果",{"type":26,"tag":157,"props":3222,"children":3223},{},[3224,3229,3230],{"type":26,"tag":3142,"props":3225,"children":3226},{},[3227],{"type":31,"value":3228},"方案2",{"type":31,"value":1642},{"type":26,"tag":3142,"props":3231,"children":3232},{},[3233],{"type":31,"value":3220},{"type":26,"tag":27,"props":3235,"children":3236},{},[3237,3242],{"type":26,"tag":949,"props":3238,"children":3239},{},[3240],{"type":31,"value":3241},"期望的结果",{"type":26,"tag":3142,"props":3243,"children":3244},{},[3245],{"type":31,"value":3246},"描述期望的行为",{"type":26,"tag":547,"props":3248,"children":3250},{"code":3249},"\n### 1.3 分级调试策略\n\n",[3251],{"type":26,"tag":161,"props":3252,"children":3253},{"__ignoreMap":7},[3254],{"type":31,"value":3249},{"type":26,"tag":27,"props":3256,"children":3257},{},[3258],{"type":31,"value":3259},"┌───────────────────────────────────────────────────────────┐\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":547,"props":3261,"children":3263},{"code":3262},"\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",[3264],{"type":26,"tag":161,"props":3265,"children":3266},{"__ignoreMap":7},[3267],{"type":31,"value":3262},{"type":26,"tag":27,"props":3269,"children":3270},{},[3271],{"type":26,"tag":949,"props":3272,"children":3273},{},[3274],{"type":31,"value":3275},"场景 2：Vue 响应式警告",{"type":26,"tag":547,"props":3277,"children":3282},{"code":3278,"language":3279,"meta":7,"className":3280},"// 警告信息：\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",[3281],"language-typescript",[3283],{"type":26,"tag":161,"props":3284,"children":3285},{"__ignoreMap":7},[3286],{"type":31,"value":3278},{"type":26,"tag":1336,"props":3288,"children":3290},{"id":3289},"_22-后端错误分析",[3291],{"type":31,"value":3292},"2.2 后端错误分析",{"type":26,"tag":27,"props":3294,"children":3295},{},[3296],{"type":26,"tag":949,"props":3297,"children":3298},{},[3299],{"type":31,"value":3300},"场景 1：Node.js 内存问题",{"type":26,"tag":547,"props":3302,"children":3307},{"code":3303,"language":3304,"meta":7,"className":3305},"// 错误信息：\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",[3306],"language-javascript",[3308],{"type":26,"tag":161,"props":3309,"children":3310},{"__ignoreMap":7},[3311],{"type":31,"value":3303},{"type":26,"tag":27,"props":3313,"children":3314},{},[3315],{"type":26,"tag":949,"props":3316,"children":3317},{},[3318],{"type":31,"value":3319},"场景 2：数据库连接问题",{"type":26,"tag":547,"props":3321,"children":3324},{"code":3322,"language":3279,"meta":7,"className":3323},"// 错误信息：\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",[3281],[3325],{"type":26,"tag":161,"props":3326,"children":3327},{"__ignoreMap":7},[3328],{"type":31,"value":3322},{"type":26,"tag":39,"props":3330,"children":3332},{"id":3331},"第三部分日志分析与问题定位",[3333],{"type":31,"value":3334},"第三部分：日志分析与问题定位",{"type":26,"tag":1336,"props":3336,"children":3338},{"id":3337},"_31-结构化日志分析",[3339],{"type":31,"value":3340},"3.1 结构化日志分析",{"type":26,"tag":27,"props":3342,"children":3343},{},[3344],{"type":31,"value":3345},"当面对大量日志时，让 AI 帮你快速定位问题：",{"type":26,"tag":547,"props":3347,"children":3350},{"code":3348,"language":3304,"meta":7,"className":3349},"// 提问示例：\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",[3306],[3351],{"type":26,"tag":161,"props":3352,"children":3353},{"__ignoreMap":7},[3354],{"type":31,"value":3348},{"type":26,"tag":1336,"props":3356,"children":3358},{"id":3357},"_32-创建调试日志",[3359],{"type":31,"value":3360},"3.2 创建调试日志",{"type":26,"tag":27,"props":3362,"children":3363},{},[3364],{"type":31,"value":3365},"让 AI 帮你生成调试用的日志代码：",{"type":26,"tag":547,"props":3367,"children":3370},{"code":3368,"language":3279,"meta":7,"className":3369},"// 请求：\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",[3281],[3371],{"type":26,"tag":161,"props":3372,"children":3373},{"__ignoreMap":7},[3374],{"type":31,"value":3368},{"type":26,"tag":39,"props":3376,"children":3378},{"id":3377},"第四部分性能问题排查",[3379],{"type":31,"value":3380},"第四部分：性能问题排查",{"type":26,"tag":1336,"props":3382,"children":3384},{"id":3383},"_41-前端性能分析",[3385],{"type":31,"value":3386},"4.1 前端性能分析",{"type":26,"tag":547,"props":3388,"children":3391},{"code":3389,"language":3279,"meta":7,"className":3390},"// 场景：页面加载慢，需要分析原因\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",[3281],[3392],{"type":26,"tag":161,"props":3393,"children":3394},{"__ignoreMap":7},[3395],{"type":31,"value":3389},{"type":26,"tag":1336,"props":3397,"children":3399},{"id":3398},"_42-内存泄漏排查",[3400],{"type":31,"value":3401},"4.2 内存泄漏排查",{"type":26,"tag":547,"props":3403,"children":3406},{"code":3404,"language":3279,"meta":7,"className":3405},"// 场景：应用运行一段时间后变卡\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",[3281],[3407],{"type":26,"tag":161,"props":3408,"children":3409},{"__ignoreMap":7},[3410],{"type":31,"value":3404},{"type":26,"tag":1336,"props":3412,"children":3414},{"id":3413},"_43-数据库查询优化",[3415],{"type":31,"value":3416},"4.3 数据库查询优化",{"type":26,"tag":547,"props":3418,"children":3423},{"code":3419,"language":3420,"meta":7,"className":3421},"-- 场景：查询很慢，让 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",[3422],"language-sql",[3424],{"type":26,"tag":161,"props":3425,"children":3426},{"__ignoreMap":7},[3427],{"type":31,"value":3419},{"type":26,"tag":39,"props":3429,"children":3431},{"id":3430},"第五部分复杂-bug-排查",[3432],{"type":31,"value":3433},"第五部分：复杂 Bug 排查",{"type":26,"tag":1336,"props":3435,"children":3437},{"id":3436},"_51-竞态条件",[3438],{"type":31,"value":3439},"5.1 竞态条件",{"type":26,"tag":547,"props":3441,"children":3444},{"code":3442,"language":3279,"meta":7,"className":3443},"// 场景：偶发的数据不一致问题\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",[3281],[3445],{"type":26,"tag":161,"props":3446,"children":3447},{"__ignoreMap":7},[3448],{"type":31,"value":3442},{"type":26,"tag":1336,"props":3450,"children":3452},{"id":3451},"_52-分布式系统问题",[3453],{"type":31,"value":3454},"5.2 分布式系统问题",{"type":26,"tag":547,"props":3456,"children":3459},{"code":3457,"language":3279,"meta":7,"className":3458},"// 场景：微服务间的数据不一致\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",[3281],[3460],{"type":26,"tag":161,"props":3461,"children":3462},{"__ignoreMap":7},[3463],{"type":31,"value":3457},{"type":26,"tag":39,"props":3465,"children":3467},{"id":3466},"第六部分ai-调试工作流",[3468],{"type":31,"value":3469},"第六部分：AI 调试工作流",{"type":26,"tag":1336,"props":3471,"children":3473},{"id":3472},"_61-我的调试流程",[3474],{"type":31,"value":3475},"6.1 我的调试流程",{"type":26,"tag":547,"props":3477,"children":3479},{"code":3478},"┌────────────────────────────────────────────────────────────┐\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",[3480],{"type":26,"tag":161,"props":3481,"children":3482},{"__ignoreMap":7},[3483],{"type":31,"value":3478},{"type":26,"tag":1336,"props":3485,"children":3487},{"id":3486},"_62-调试对话模板",[3488],{"type":31,"value":3489},"6.2 调试对话模板",{"type":26,"tag":547,"props":3491,"children":3494},{"code":3492,"language":887,"meta":7,"className":3493},"## 第一轮：问题描述\n\n我遇到了一个问题：[简述问题]\n\n错误信息：\n",[3132],[3495],{"type":26,"tag":161,"props":3496,"children":3497},{"__ignoreMap":7},[3498],{"type":31,"value":3492},{"type":26,"tag":27,"props":3500,"children":3501},{},[3502],{"type":26,"tag":3142,"props":3503,"children":3504},{},[3505],{"type":31,"value":3506},"粘贴完整错误",{"type":26,"tag":547,"props":3508,"children":3510},{"code":3509},"\n相关代码：\n```javascript\n[粘贴代码]\n",[3511],{"type":26,"tag":161,"props":3512,"children":3513},{"__ignoreMap":7},[3514],{"type":31,"value":3509},{"type":26,"tag":1010,"props":3516,"children":3517},{},[],{"type":26,"tag":39,"props":3519,"children":3521},{"id":3520},"第二轮补充信息",[3522],{"type":31,"value":3523},"第二轮：补充信息",{"type":26,"tag":27,"props":3525,"children":3526},{},[3527],{"type":31,"value":3528},"根据你的建议，我添加了日志，发现：",{"type":26,"tag":153,"props":3530,"children":3531},{},[3532,3540],{"type":26,"tag":157,"props":3533,"children":3534},{},[3535],{"type":26,"tag":3142,"props":3536,"children":3537},{},[3538],{"type":31,"value":3539},"发现 1",{"type":26,"tag":157,"props":3541,"children":3542},{},[3543],{"type":26,"tag":3142,"props":3544,"children":3545},{},[3546],{"type":31,"value":3547},"发现 2",{"type":26,"tag":27,"props":3549,"children":3550},{},[3551,3553,3558],{"type":31,"value":3552},"这是否说明问题出在 ",{"type":26,"tag":3142,"props":3554,"children":3555},{},[3556],{"type":31,"value":3557},"你的猜测",{"type":31,"value":3559},"？",{"type":26,"tag":1010,"props":3561,"children":3562},{},[],{"type":26,"tag":39,"props":3564,"children":3566},{"id":3565},"第三轮确认修复",[3567],{"type":31,"value":3568},"第三轮：确认修复",{"type":26,"tag":27,"props":3570,"children":3571},{},[3572],{"type":31,"value":3573},"我按照你的建议修改了代码：",{"type":26,"tag":547,"props":3575,"children":3578},{"code":3576,"language":3304,"meta":7,"className":3577},"[粘贴修改后的代码]\n",[3306],[3579],{"type":26,"tag":161,"props":3580,"children":3581},{"__ignoreMap":7},[3582],{"type":31,"value":3576},{"type":26,"tag":27,"props":3584,"children":3585},{},[3586],{"type":31,"value":3587},"请确认这个修复是否正确，以及是否有其他潜在问题。",{"type":26,"tag":1010,"props":3589,"children":3590},{},[],{"type":26,"tag":39,"props":3592,"children":3594},{"id":3593},"第四轮预防",[3595],{"type":31,"value":3596},"第四轮：预防",{"type":26,"tag":27,"props":3598,"children":3599},{},[3600],{"type":31,"value":3601},"这个问题已解决。请建议：",{"type":26,"tag":333,"props":3603,"children":3604},{},[3605,3610,3615],{"type":26,"tag":157,"props":3606,"children":3607},{},[3608],{"type":31,"value":3609},"如何防止类似问题再次发生？",{"type":26,"tag":157,"props":3611,"children":3612},{},[3613],{"type":31,"value":3614},"应该添加什么测试用例？",{"type":26,"tag":157,"props":3616,"children":3617},{},[3618],{"type":31,"value":3619},"有什么最佳实践可以参考？",{"type":26,"tag":547,"props":3621,"children":3623},{"code":3622},"\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",[3624],{"type":26,"tag":161,"props":3625,"children":3626},{"__ignoreMap":7},[3627],{"type":31,"value":3622},{"title":7,"searchDepth":872,"depth":872,"links":3629},[3630,3631,3632,3637,3641,3646,3650,3654,3655,3656],{"id":3013,"depth":875,"text":3016},{"id":3019,"depth":875,"text":3022},{"id":3040,"depth":875,"text":3043,"children":3633},[3634,3635,3636],{"id":3046,"depth":872,"text":3049},{"id":3124,"depth":872,"text":3127},{"id":3289,"depth":872,"text":3292},{"id":3331,"depth":875,"text":3334,"children":3638},[3639,3640],{"id":3337,"depth":872,"text":3340},{"id":3357,"depth":872,"text":3360},{"id":3377,"depth":875,"text":3380,"children":3642},[3643,3644,3645],{"id":3383,"depth":872,"text":3386},{"id":3398,"depth":872,"text":3401},{"id":3413,"depth":872,"text":3416},{"id":3430,"depth":875,"text":3433,"children":3647},[3648,3649],{"id":3436,"depth":872,"text":3439},{"id":3451,"depth":872,"text":3454},{"id":3466,"depth":875,"text":3469,"children":3651},[3652,3653],{"id":3472,"depth":872,"text":3475},{"id":3486,"depth":872,"text":3489},{"id":3520,"depth":875,"text":3523},{"id":3565,"depth":875,"text":3568},{"id":3593,"depth":875,"text":3596},"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":3661,"image":17,"imageQuery":18,"pexelsPhotoId":19,"pexelsUrl":20,"featured":6,"readingTime":21,"body":3662,"_type":887,"_id":888,"_source":889,"_file":890,"_stem":891,"_extension":892},[13,14,15,16],{"type":23,"children":3663,"toc":4348},[3664,3668,3672,3676,3680,3749,3753,3757,3761,3828,3838,3902,3906,3910,3914,3929,3933,3937,3979,3983,3987,4003,4007,4011,4026,4030,4034,4049,4053,4057,4061,4076,4080,4084,4088,4096,4106,4110,4114,4149,4153,4157,4167,4171,4225,4229,4233,4237,4260,4264,4268,4320,4324],{"type":26,"tag":27,"props":3665,"children":3666},{},[3667],{"type":31,"value":32},{"type":26,"tag":27,"props":3669,"children":3670},{},[3671],{"type":31,"value":37},{"type":26,"tag":39,"props":3673,"children":3674},{"id":41},[3675],{"type":31,"value":44},{"type":26,"tag":27,"props":3677,"children":3678},{},[3679],{"type":31,"value":49},{"type":26,"tag":51,"props":3681,"children":3682},{},[3683,3701],{"type":26,"tag":55,"props":3684,"children":3685},{},[3686],{"type":26,"tag":59,"props":3687,"children":3688},{},[3689,3693,3697],{"type":26,"tag":63,"props":3690,"children":3691},{},[3692],{"type":31,"value":67},{"type":26,"tag":63,"props":3694,"children":3695},{},[3696],{"type":31,"value":72},{"type":26,"tag":63,"props":3698,"children":3699},{},[3700],{"type":31,"value":77},{"type":26,"tag":79,"props":3702,"children":3703},{},[3704,3719,3734],{"type":26,"tag":59,"props":3705,"children":3706},{},[3707,3711,3715],{"type":26,"tag":86,"props":3708,"children":3709},{},[3710],{"type":31,"value":90},{"type":26,"tag":86,"props":3712,"children":3713},{},[3714],{"type":31,"value":95},{"type":26,"tag":86,"props":3716,"children":3717},{},[3718],{"type":31,"value":100},{"type":26,"tag":59,"props":3720,"children":3721},{},[3722,3726,3730],{"type":26,"tag":86,"props":3723,"children":3724},{},[3725],{"type":31,"value":108},{"type":26,"tag":86,"props":3727,"children":3728},{},[3729],{"type":31,"value":113},{"type":26,"tag":86,"props":3731,"children":3732},{},[3733],{"type":31,"value":118},{"type":26,"tag":59,"props":3735,"children":3736},{},[3737,3741,3745],{"type":26,"tag":86,"props":3738,"children":3739},{},[3740],{"type":31,"value":126},{"type":26,"tag":86,"props":3742,"children":3743},{},[3744],{"type":31,"value":131},{"type":26,"tag":86,"props":3746,"children":3747},{},[3748],{"type":31,"value":136},{"type":26,"tag":27,"props":3750,"children":3751},{},[3752],{"type":31,"value":141},{"type":26,"tag":39,"props":3754,"children":3755},{"id":144},[3756],{"type":31,"value":144},{"type":26,"tag":27,"props":3758,"children":3759},{},[3760],{"type":31,"value":151},{"type":26,"tag":153,"props":3762,"children":3763},{},[3764,3772,3780,3788,3796,3804,3812,3820],{"type":26,"tag":157,"props":3765,"children":3766},{},[3767],{"type":26,"tag":161,"props":3768,"children":3770},{"className":3769},[],[3771],{"type":31,"value":166},{"type":26,"tag":157,"props":3773,"children":3774},{},[3775],{"type":26,"tag":161,"props":3776,"children":3778},{"className":3777},[],[3779],{"type":31,"value":175},{"type":26,"tag":157,"props":3781,"children":3782},{},[3783],{"type":26,"tag":161,"props":3784,"children":3786},{"className":3785},[],[3787],{"type":31,"value":184},{"type":26,"tag":157,"props":3789,"children":3790},{},[3791],{"type":26,"tag":161,"props":3792,"children":3794},{"className":3793},[],[3795],{"type":31,"value":193},{"type":26,"tag":157,"props":3797,"children":3798},{},[3799],{"type":26,"tag":161,"props":3800,"children":3802},{"className":3801},[],[3803],{"type":31,"value":202},{"type":26,"tag":157,"props":3805,"children":3806},{},[3807],{"type":26,"tag":161,"props":3808,"children":3810},{"className":3809},[],[3811],{"type":31,"value":211},{"type":26,"tag":157,"props":3813,"children":3814},{},[3815],{"type":26,"tag":161,"props":3816,"children":3818},{"className":3817},[],[3819],{"type":31,"value":220},{"type":26,"tag":157,"props":3821,"children":3822},{},[3823],{"type":26,"tag":161,"props":3824,"children":3826},{"className":3825},[],[3827],{"type":31,"value":229},{"type":26,"tag":27,"props":3829,"children":3830},{},[3831,3832,3837],{"type":31,"value":234},{"type":26,"tag":161,"props":3833,"children":3835},{"className":3834},[],[3836],{"type":31,"value":220},{"type":31,"value":241},{"type":26,"tag":51,"props":3839,"children":3840},{},[3841,3855],{"type":26,"tag":55,"props":3842,"children":3843},{},[3844],{"type":26,"tag":59,"props":3845,"children":3846},{},[3847,3851],{"type":26,"tag":63,"props":3848,"children":3849},{},[3850],{"type":31,"value":255},{"type":26,"tag":63,"props":3852,"children":3853},{},[3854],{"type":31,"value":260},{"type":26,"tag":79,"props":3856,"children":3857},{},[3858,3869,3880,3891],{"type":26,"tag":59,"props":3859,"children":3860},{},[3861,3865],{"type":26,"tag":86,"props":3862,"children":3863},{},[3864],{"type":31,"value":271},{"type":26,"tag":86,"props":3866,"children":3867},{},[3868],{"type":31,"value":276},{"type":26,"tag":59,"props":3870,"children":3871},{},[3872,3876],{"type":26,"tag":86,"props":3873,"children":3874},{},[3875],{"type":31,"value":284},{"type":26,"tag":86,"props":3877,"children":3878},{},[3879],{"type":31,"value":289},{"type":26,"tag":59,"props":3881,"children":3882},{},[3883,3887],{"type":26,"tag":86,"props":3884,"children":3885},{},[3886],{"type":31,"value":297},{"type":26,"tag":86,"props":3888,"children":3889},{},[3890],{"type":31,"value":302},{"type":26,"tag":59,"props":3892,"children":3893},{},[3894,3898],{"type":26,"tag":86,"props":3895,"children":3896},{},[3897],{"type":31,"value":310},{"type":26,"tag":86,"props":3899,"children":3900},{},[3901],{"type":31,"value":315},{"type":26,"tag":27,"props":3903,"children":3904},{},[3905],{"type":31,"value":320},{"type":26,"tag":39,"props":3907,"children":3908},{"id":323},[3909],{"type":31,"value":326},{"type":26,"tag":27,"props":3911,"children":3912},{},[3913],{"type":31,"value":331},{"type":26,"tag":333,"props":3915,"children":3916},{},[3917,3921,3925],{"type":26,"tag":157,"props":3918,"children":3919},{},[3920],{"type":31,"value":340},{"type":26,"tag":157,"props":3922,"children":3923},{},[3924],{"type":31,"value":345},{"type":26,"tag":157,"props":3926,"children":3927},{},[3928],{"type":31,"value":350},{"type":26,"tag":27,"props":3930,"children":3931},{},[3932],{"type":31,"value":355},{"type":26,"tag":39,"props":3934,"children":3935},{"id":358},[3936],{"type":31,"value":358},{"type":26,"tag":51,"props":3938,"children":3939},{},[3940,3954],{"type":26,"tag":55,"props":3941,"children":3942},{},[3943],{"type":26,"tag":59,"props":3944,"children":3945},{},[3946,3950],{"type":26,"tag":63,"props":3947,"children":3948},{},[3949],{"type":31,"value":374},{"type":26,"tag":63,"props":3951,"children":3952},{},[3953],{"type":31,"value":379},{"type":26,"tag":79,"props":3955,"children":3956},{},[3957,3968],{"type":26,"tag":59,"props":3958,"children":3959},{},[3960,3964],{"type":26,"tag":86,"props":3961,"children":3962},{},[3963],{"type":31,"value":390},{"type":26,"tag":86,"props":3965,"children":3966},{},[3967],{"type":31,"value":395},{"type":26,"tag":59,"props":3969,"children":3970},{},[3971,3975],{"type":26,"tag":86,"props":3972,"children":3973},{},[3974],{"type":31,"value":403},{"type":26,"tag":86,"props":3976,"children":3977},{},[3978],{"type":31,"value":408},{"type":26,"tag":27,"props":3980,"children":3981},{},[3982],{"type":31,"value":413},{"type":26,"tag":39,"props":3984,"children":3985},{"id":416},[3986],{"type":31,"value":419},{"type":26,"tag":27,"props":3988,"children":3989},{},[3990,3991,3996,3997,4002],{"type":31,"value":424},{"type":26,"tag":161,"props":3992,"children":3994},{"className":3993},[],[3995],{"type":31,"value":430},{"type":31,"value":432},{"type":26,"tag":161,"props":3998,"children":4000},{"className":3999},[],[4001],{"type":31,"value":438},{"type":31,"value":440},{"type":26,"tag":27,"props":4004,"children":4005},{},[4006],{"type":31,"value":445},{"type":26,"tag":27,"props":4008,"children":4009},{},[4010],{"type":31,"value":450},{"type":26,"tag":153,"props":4012,"children":4013},{},[4014,4018,4022],{"type":26,"tag":157,"props":4015,"children":4016},{},[4017],{"type":31,"value":458},{"type":26,"tag":157,"props":4019,"children":4020},{},[4021],{"type":31,"value":463},{"type":26,"tag":157,"props":4023,"children":4024},{},[4025],{"type":31,"value":468},{"type":26,"tag":39,"props":4027,"children":4028},{"id":471},[4029],{"type":31,"value":474},{"type":26,"tag":27,"props":4031,"children":4032},{},[4033],{"type":31,"value":479},{"type":26,"tag":153,"props":4035,"children":4036},{},[4037,4041,4045],{"type":26,"tag":157,"props":4038,"children":4039},{},[4040],{"type":31,"value":487},{"type":26,"tag":157,"props":4042,"children":4043},{},[4044],{"type":31,"value":492},{"type":26,"tag":157,"props":4046,"children":4047},{},[4048],{"type":31,"value":497},{"type":26,"tag":27,"props":4050,"children":4051},{},[4052],{"type":31,"value":502},{"type":26,"tag":39,"props":4054,"children":4055},{"id":505},[4056],{"type":31,"value":505},{"type":26,"tag":27,"props":4058,"children":4059},{},[4060],{"type":31,"value":512},{"type":26,"tag":153,"props":4062,"children":4063},{},[4064,4068,4072],{"type":26,"tag":157,"props":4065,"children":4066},{},[4067],{"type":31,"value":520},{"type":26,"tag":157,"props":4069,"children":4070},{},[4071],{"type":31,"value":525},{"type":26,"tag":157,"props":4073,"children":4074},{},[4075],{"type":31,"value":530},{"type":26,"tag":27,"props":4077,"children":4078},{},[4079],{"type":31,"value":535},{"type":26,"tag":39,"props":4081,"children":4082},{"id":538},[4083],{"type":31,"value":538},{"type":26,"tag":27,"props":4085,"children":4086},{},[4087],{"type":31,"value":545},{"type":26,"tag":547,"props":4089,"children":4091},{"className":4090,"code":551,"language":552,"meta":7},[550],[4092],{"type":26,"tag":161,"props":4093,"children":4094},{"__ignoreMap":7},[4095],{"type":31,"value":551},{"type":26,"tag":27,"props":4097,"children":4098},{},[4099,4100,4105],{"type":31,"value":562},{"type":26,"tag":161,"props":4101,"children":4103},{"className":4102},[],[4104],{"type":31,"value":568},{"type":31,"value":570},{"type":26,"tag":39,"props":4107,"children":4108},{"id":573},[4109],{"type":31,"value":576},{"type":26,"tag":27,"props":4111,"children":4112},{},[4113],{"type":31,"value":581},{"type":26,"tag":333,"props":4115,"children":4116},{},[4117,4121,4125,4129,4133,4137,4141,4145],{"type":26,"tag":157,"props":4118,"children":4119},{},[4120],{"type":31,"value":589},{"type":26,"tag":157,"props":4122,"children":4123},{},[4124],{"type":31,"value":594},{"type":26,"tag":157,"props":4126,"children":4127},{},[4128],{"type":31,"value":599},{"type":26,"tag":157,"props":4130,"children":4131},{},[4132],{"type":31,"value":604},{"type":26,"tag":157,"props":4134,"children":4135},{},[4136],{"type":31,"value":609},{"type":26,"tag":157,"props":4138,"children":4139},{},[4140],{"type":31,"value":614},{"type":26,"tag":157,"props":4142,"children":4143},{},[4144],{"type":31,"value":619},{"type":26,"tag":157,"props":4146,"children":4147},{},[4148],{"type":31,"value":624},{"type":26,"tag":27,"props":4150,"children":4151},{},[4152],{"type":31,"value":629},{"type":26,"tag":39,"props":4154,"children":4155},{"id":632},[4156],{"type":31,"value":635},{"type":26,"tag":27,"props":4158,"children":4159},{},[4160,4161,4166],{"type":31,"value":640},{"type":26,"tag":161,"props":4162,"children":4164},{"className":4163},[],[4165],{"type":31,"value":646},{"type":31,"value":648},{"type":26,"tag":27,"props":4168,"children":4169},{},[4170],{"type":31,"value":653},{"type":26,"tag":51,"props":4172,"children":4173},{},[4174,4192],{"type":26,"tag":55,"props":4175,"children":4176},{},[4177],{"type":26,"tag":59,"props":4178,"children":4179},{},[4180,4184,4188],{"type":26,"tag":63,"props":4181,"children":4182},{},[4183],{"type":31,"value":667},{"type":26,"tag":63,"props":4185,"children":4186},{},[4187],{"type":31,"value":672},{"type":26,"tag":63,"props":4189,"children":4190},{},[4191],{"type":31,"value":677},{"type":26,"tag":79,"props":4193,"children":4194},{},[4195,4210],{"type":26,"tag":59,"props":4196,"children":4197},{},[4198,4202,4206],{"type":26,"tag":86,"props":4199,"children":4200},{},[4201],{"type":31,"value":688},{"type":26,"tag":86,"props":4203,"children":4204},{},[4205],{"type":31,"value":693},{"type":26,"tag":86,"props":4207,"children":4208},{},[4209],{"type":31,"value":698},{"type":26,"tag":59,"props":4211,"children":4212},{},[4213,4217,4221],{"type":26,"tag":86,"props":4214,"children":4215},{},[4216],{"type":31,"value":706},{"type":26,"tag":86,"props":4218,"children":4219},{},[4220],{"type":31,"value":711},{"type":26,"tag":86,"props":4222,"children":4223},{},[4224],{"type":31,"value":716},{"type":26,"tag":27,"props":4226,"children":4227},{},[4228],{"type":31,"value":721},{"type":26,"tag":39,"props":4230,"children":4231},{"id":724},[4232],{"type":31,"value":727},{"type":26,"tag":27,"props":4234,"children":4235},{},[4236],{"type":31,"value":732},{"type":26,"tag":153,"props":4238,"children":4239},{},[4240,4244,4248,4252,4256],{"type":26,"tag":157,"props":4241,"children":4242},{},[4243],{"type":31,"value":740},{"type":26,"tag":157,"props":4245,"children":4246},{},[4247],{"type":31,"value":745},{"type":26,"tag":157,"props":4249,"children":4250},{},[4251],{"type":31,"value":750},{"type":26,"tag":157,"props":4253,"children":4254},{},[4255],{"type":31,"value":755},{"type":26,"tag":157,"props":4257,"children":4258},{},[4259],{"type":31,"value":760},{"type":26,"tag":27,"props":4261,"children":4262},{},[4263],{"type":31,"value":765},{"type":26,"tag":39,"props":4265,"children":4266},{"id":768},[4267],{"type":31,"value":771},{"type":26,"tag":153,"props":4269,"children":4271},{"className":4270},[775],[4272,4280,4288,4296,4304,4312],{"type":26,"tag":157,"props":4273,"children":4275},{"className":4274},[780],[4276,4279],{"type":26,"tag":783,"props":4277,"children":4278},{"disabled":785,"type":786},[],{"type":31,"value":789},{"type":26,"tag":157,"props":4281,"children":4283},{"className":4282},[780],[4284,4287],{"type":26,"tag":783,"props":4285,"children":4286},{"disabled":785,"type":786},[],{"type":31,"value":798},{"type":26,"tag":157,"props":4289,"children":4291},{"className":4290},[780],[4292,4295],{"type":26,"tag":783,"props":4293,"children":4294},{"disabled":785,"type":786},[],{"type":31,"value":807},{"type":26,"tag":157,"props":4297,"children":4299},{"className":4298},[780],[4300,4303],{"type":26,"tag":783,"props":4301,"children":4302},{"disabled":785,"type":786},[],{"type":31,"value":816},{"type":26,"tag":157,"props":4305,"children":4307},{"className":4306},[780],[4308,4311],{"type":26,"tag":783,"props":4309,"children":4310},{"disabled":785,"type":786},[],{"type":31,"value":825},{"type":26,"tag":157,"props":4313,"children":4315},{"className":4314},[780],[4316,4319],{"type":26,"tag":783,"props":4317,"children":4318},{"disabled":785,"type":786},[],{"type":31,"value":834},{"type":26,"tag":27,"props":4321,"children":4322},{},[4323],{"type":31,"value":839},{"type":26,"tag":153,"props":4325,"children":4326},{},[4327,4334,4341],{"type":26,"tag":157,"props":4328,"children":4329},{},[4330],{"type":26,"tag":847,"props":4331,"children":4332},{"href":849},[4333],{"type":31,"value":852},{"type":26,"tag":157,"props":4335,"children":4336},{},[4337],{"type":26,"tag":847,"props":4338,"children":4339},{"href":858},[4340],{"type":31,"value":861},{"type":26,"tag":157,"props":4342,"children":4343},{},[4344],{"type":26,"tag":847,"props":4345,"children":4346},{"href":867},[4347],{"type":31,"value":870},{"title":7,"searchDepth":872,"depth":872,"links":4349},[4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361],{"id":41,"depth":875,"text":44},{"id":144,"depth":875,"text":144},{"id":323,"depth":875,"text":326},{"id":358,"depth":875,"text":358},{"id":416,"depth":875,"text":419},{"id":471,"depth":875,"text":474},{"id":505,"depth":875,"text":505},{"id":538,"depth":875,"text":538},{"id":573,"depth":875,"text":576},{"id":632,"depth":875,"text":635},{"id":724,"depth":875,"text":727},{"id":768,"depth":875,"text":771},1780533121460]