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