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