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