[{"data":1,"prerenderedAt":629},["ShallowReactive",2],{"content-query-2FGJroGNvP":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"lastUpdated":10,"body":11,"_type":623,"_id":624,"_source":625,"_file":626,"_stem":627,"_extension":628},"\u002Fmethodology\u002Fplan-mode","methodology",false,"","Plan 模式","让AI先规划再执行，减少返工和修改","2026-04-23",{"type":12,"children":13,"toc":605},"root",[14,23,30,44,48,54,176,182,192,195,200,208,211,217,223,236,244,250,255,275,281,286,304,307,313,407,410,415,468,471,476,510,513,518],{"type":15,"tag":16,"props":17,"children":19},"element","h1",{"id":18},"plan-模式计划模式",[20],{"type":21,"value":22},"text","Plan 模式（计划模式）",{"type":15,"tag":24,"props":25,"children":27},"h2",{"id":26},"什么是-plan-模式",[28],{"type":21,"value":29},"什么是 Plan 模式",{"type":15,"tag":31,"props":32,"children":33},"p",{},[34,36,42],{"type":21,"value":35},"Plan 模式的核心原则：",{"type":15,"tag":37,"props":38,"children":39},"strong",{},[40],{"type":21,"value":41},"让 AI 先输出完整计划，经人类确认后再执行",{"type":21,"value":43},"。与直接让 AI 写代码不同，Plan 模式强制加入\"思考 → 确认 → 执行\"的中间环节，有效减少返工。",{"type":15,"tag":45,"props":46,"children":47},"hr",{},[],{"type":15,"tag":24,"props":49,"children":51},{"id":50},"plan-vs-chat-核心区别",[52],{"type":21,"value":53},"Plan vs Chat 核心区别",{"type":15,"tag":55,"props":56,"children":57},"table",{},[58,81],{"type":15,"tag":59,"props":60,"children":61},"thead",{},[62],{"type":15,"tag":63,"props":64,"children":65},"tr",{},[66,72,77],{"type":15,"tag":67,"props":68,"children":69},"th",{},[70],{"type":21,"value":71},"维度",{"type":15,"tag":67,"props":73,"children":74},{},[75],{"type":21,"value":76},"Chat 模式",{"type":15,"tag":67,"props":78,"children":79},{},[80],{"type":21,"value":8},{"type":15,"tag":82,"props":83,"children":84},"tbody",{},[85,104,122,140,158],{"type":15,"tag":63,"props":86,"children":87},{},[88,94,99],{"type":15,"tag":89,"props":90,"children":91},"td",{},[92],{"type":21,"value":93},"工作方式",{"type":15,"tag":89,"props":95,"children":96},{},[97],{"type":21,"value":98},"直接回答\u002F生成",{"type":15,"tag":89,"props":100,"children":101},{},[102],{"type":21,"value":103},"先出计划，确认后执行",{"type":15,"tag":63,"props":105,"children":106},{},[107,112,117],{"type":15,"tag":89,"props":108,"children":109},{},[110],{"type":21,"value":111},"适合场景",{"type":15,"tag":89,"props":113,"children":114},{},[115],{"type":21,"value":116},"单点问题、快速咨询",{"type":15,"tag":89,"props":118,"children":119},{},[120],{"type":21,"value":121},"中等复杂度、多步骤任务",{"type":15,"tag":63,"props":123,"children":124},{},[125,130,135],{"type":15,"tag":89,"props":126,"children":127},{},[128],{"type":21,"value":129},"返工率",{"type":15,"tag":89,"props":131,"children":132},{},[133],{"type":21,"value":134},"较高（可能方向错误）",{"type":15,"tag":89,"props":136,"children":137},{},[138],{"type":21,"value":139},"较低（计划阶段已校准）",{"type":15,"tag":63,"props":141,"children":142},{},[143,148,153],{"type":15,"tag":89,"props":144,"children":145},{},[146],{"type":21,"value":147},"人类介入点",{"type":15,"tag":89,"props":149,"children":150},{},[151],{"type":21,"value":152},"结果审查",{"type":15,"tag":89,"props":154,"children":155},{},[156],{"type":21,"value":157},"计划审查 + 结果审查",{"type":15,"tag":63,"props":159,"children":160},{},[161,166,171],{"type":15,"tag":89,"props":162,"children":163},{},[164],{"type":21,"value":165},"典型示例",{"type":15,"tag":89,"props":167,"children":168},{},[169],{"type":21,"value":170},"\"重构这个函数\"",{"type":15,"tag":89,"props":172,"children":173},{},[174],{"type":21,"value":175},"\"设计一个用户注册模块\"",{"type":15,"tag":177,"props":178,"children":180},"h3",{"id":179},"对比例子",[181],{"type":21,"value":179},{"type":15,"tag":183,"props":184,"children":186},"pre",{"code":185},"场景：重构一个函数\n→ 用 Chat 模式\n  \"这个函数有性能问题，请优化\"\n  AI 直接给出优化后的代码\n\n场景：设计一个用户注册模块\n→ 用 Plan 模式\n  \"实现用户注册功能，包含邮箱验证\"\n  AI 先输出：\n    1. 数据模型设计\n    2. API 接口列表\n    3. 安全措施\n    4. 测试计划\n  人类确认后，AI 再逐步执行\n",[187],{"type":15,"tag":188,"props":189,"children":190},"code",{"__ignoreMap":7},[191],{"type":21,"value":185},{"type":15,"tag":45,"props":193,"children":194},{},[],{"type":15,"tag":24,"props":196,"children":198},{"id":197},"工作流程",[199],{"type":21,"value":197},{"type":15,"tag":183,"props":201,"children":203},{"code":202},"用户描述需求\n    ↓\nAI 输出执行计划（不写代码）\n    ↓\n人类审查计划 → 不通过 → 反馈修改\n    ↓ 通过\nAI 按计划逐步执行\n    ↓\n人类验收结果\n",[204],{"type":15,"tag":188,"props":205,"children":206},{"__ignoreMap":7},[207],{"type":21,"value":202},{"type":15,"tag":45,"props":209,"children":210},{},[],{"type":15,"tag":24,"props":212,"children":214},{"id":213},"各工具的-plan-模式",[215],{"type":21,"value":216},"各工具的 Plan 模式",{"type":15,"tag":177,"props":218,"children":220},{"id":219},"claude-code-plan-mode",[221],{"type":21,"value":222},"Claude Code — Plan Mode",{"type":15,"tag":31,"props":224,"children":225},{},[226,228,234],{"type":21,"value":227},"Claude Code 内置 Plan 模式，使用 ",{"type":15,"tag":188,"props":229,"children":231},{"className":230},[],[232],{"type":21,"value":233},"\u002Fplan",{"type":21,"value":235}," 命令进入：",{"type":15,"tag":183,"props":237,"children":239},{"code":238},"\u002Fplan 实现一个用户注册功能，包含邮箱验证\n\nAI 输出：\n## 执行计划\n\n### 1. 数据模型设计\n- 创建 User 模型（id, email, password_hash, verified, created_at）\n- 创建 VerificationToken 模型\n\n### 2. API 接口\n- POST \u002Fapi\u002Fauth\u002Fregister — 注册\n- GET \u002Fapi\u002Fauth\u002Fverify\u002F:token — 邮箱验证\n\n### 3. 安全措施\n- 密码使用 bcrypt 加密\n- Token 有效期 24 小时\n- 邮件发送使用队列异步处理\n\n### 4. 测试\n- 单元测试：密码加密、Token 生成\n- 集成测试：注册流程、验证流程\n\n确认后开始执行？\n",[240],{"type":15,"tag":188,"props":241,"children":242},{"__ignoreMap":7},[243],{"type":21,"value":238},{"type":15,"tag":177,"props":245,"children":247},{"id":246},"cursor-ask-composer",[248],{"type":21,"value":249},"Cursor — Ask + Composer",{"type":15,"tag":31,"props":251,"children":252},{},[253],{"type":21,"value":254},"在 Cursor 中，先用 Ask 模式让 AI 规划：",{"type":15,"tag":256,"props":257,"children":258},"ol",{},[259,265,270],{"type":15,"tag":260,"props":261,"children":262},"li",{},[263],{"type":21,"value":264},"打开 Ask 模式（非 Composer）",{"type":15,"tag":260,"props":266,"children":267},{},[268],{"type":21,"value":269},"描述需求，要求 AI 输出计划",{"type":15,"tag":260,"props":271,"children":272},{},[273],{"type":21,"value":274},"审查计划后，切换到 Composer 执行",{"type":15,"tag":177,"props":276,"children":278},{"id":277},"trae-builder-模式",[279],{"type":21,"value":280},"Trae — Builder 模式",{"type":15,"tag":31,"props":282,"children":283},{},[284],{"type":21,"value":285},"Trae 的 Builder 模式天然支持 Plan：",{"type":15,"tag":256,"props":287,"children":288},{},[289,294,299],{"type":15,"tag":260,"props":290,"children":291},{},[292],{"type":21,"value":293},"描述需求",{"type":15,"tag":260,"props":295,"children":296},{},[297],{"type":21,"value":298},"AI 自动生成任务拆解",{"type":15,"tag":260,"props":300,"children":301},{},[302],{"type":21,"value":303},"逐步确认并执行",{"type":15,"tag":45,"props":305,"children":306},{},[],{"type":15,"tag":24,"props":308,"children":310},{"id":309},"plan-模式的优势",[311],{"type":21,"value":312},"Plan 模式的优势",{"type":15,"tag":55,"props":314,"children":315},{},[316,335],{"type":15,"tag":59,"props":317,"children":318},{},[319],{"type":15,"tag":63,"props":320,"children":321},{},[322,326,331],{"type":15,"tag":67,"props":323,"children":324},{},[325],{"type":21,"value":71},{"type":15,"tag":67,"props":327,"children":328},{},[329],{"type":21,"value":330},"直接执行",{"type":15,"tag":67,"props":332,"children":333},{},[334],{"type":21,"value":8},{"type":15,"tag":82,"props":336,"children":337},{},[338,355,373,390],{"type":15,"tag":63,"props":339,"children":340},{},[341,345,350],{"type":15,"tag":89,"props":342,"children":343},{},[344],{"type":21,"value":129},{"type":15,"tag":89,"props":346,"children":347},{},[348],{"type":21,"value":349},"高（30-50%）",{"type":15,"tag":89,"props":351,"children":352},{},[353],{"type":21,"value":354},"低（5-10%）",{"type":15,"tag":63,"props":356,"children":357},{},[358,363,368],{"type":15,"tag":89,"props":359,"children":360},{},[361],{"type":21,"value":362},"可控性",{"type":15,"tag":89,"props":364,"children":365},{},[366],{"type":21,"value":367},"低",{"type":15,"tag":89,"props":369,"children":370},{},[371],{"type":21,"value":372},"高",{"type":15,"tag":63,"props":374,"children":375},{},[376,380,385],{"type":15,"tag":89,"props":377,"children":378},{},[379],{"type":21,"value":111},{"type":15,"tag":89,"props":381,"children":382},{},[383],{"type":21,"value":384},"简单修改",{"type":15,"tag":89,"props":386,"children":387},{},[388],{"type":21,"value":389},"复杂功能",{"type":15,"tag":63,"props":391,"children":392},{},[393,398,403],{"type":15,"tag":89,"props":394,"children":395},{},[396],{"type":21,"value":397},"学习成本",{"type":15,"tag":89,"props":399,"children":400},{},[401],{"type":21,"value":402},"无",{"type":15,"tag":89,"props":404,"children":405},{},[406],{"type":21,"value":367},{"type":15,"tag":45,"props":408,"children":409},{},[],{"type":15,"tag":24,"props":411,"children":413},{"id":412},"最佳实践",[414],{"type":21,"value":412},{"type":15,"tag":256,"props":416,"children":417},{},[418,428,438,448,458],{"type":15,"tag":260,"props":419,"children":420},{},[421,426],{"type":15,"tag":37,"props":422,"children":423},{},[424],{"type":21,"value":425},"计划要具体",{"type":21,"value":427},"：要求 AI 列出文件名、函数名、数据结构，而非模糊描述",{"type":15,"tag":260,"props":429,"children":430},{},[431,436],{"type":15,"tag":37,"props":432,"children":433},{},[434],{"type":21,"value":435},"分步确认",{"type":21,"value":437},"：大任务拆成多个小步骤，逐步确认",{"type":15,"tag":260,"props":439,"children":440},{},[441,446],{"type":15,"tag":37,"props":442,"children":443},{},[444],{"type":21,"value":445},"保留计划",{"type":21,"value":447},"：将确认后的计划保存为文档，便于后续追溯",{"type":15,"tag":260,"props":449,"children":450},{},[451,456],{"type":15,"tag":37,"props":452,"children":453},{},[454],{"type":21,"value":455},"灵活调整",{"type":21,"value":457},"：执行中发现计划不合理，及时暂停并调整",{"type":15,"tag":260,"props":459,"children":460},{},[461,466],{"type":15,"tag":37,"props":462,"children":463},{},[464],{"type":21,"value":465},"结合 Spec",{"type":21,"value":467},"：Plan 模式 + Spec 文档 = 更强的可控性",{"type":15,"tag":45,"props":469,"children":470},{},[],{"type":15,"tag":24,"props":472,"children":474},{"id":473},"适用与不适用",[475],{"type":21,"value":473},{"type":15,"tag":477,"props":478,"children":479},"ul",{},[480,485,490,495,500,505],{"type":15,"tag":260,"props":481,"children":482},{},[483],{"type":21,"value":484},"✅ 新功能开发（涉及多个文件）",{"type":15,"tag":260,"props":486,"children":487},{},[488],{"type":21,"value":489},"✅ 架构重构",{"type":15,"tag":260,"props":491,"children":492},{},[493],{"type":21,"value":494},"✅ 数据库 schema 变更",{"type":15,"tag":260,"props":496,"children":497},{},[498],{"type":21,"value":499},"✅ API 接口设计",{"type":15,"tag":260,"props":501,"children":502},{},[503],{"type":21,"value":504},"❌ 简单的 bug 修复（杀鸡用牛刀）",{"type":15,"tag":260,"props":506,"children":507},{},[508],{"type":21,"value":509},"❌ 一行代码的修改",{"type":15,"tag":45,"props":511,"children":512},{},[],{"type":15,"tag":24,"props":514,"children":516},{"id":515},"常见问题",[517],{"type":21,"value":515},{"type":15,"tag":55,"props":519,"children":520},{},[521,537],{"type":15,"tag":59,"props":522,"children":523},{},[524],{"type":15,"tag":63,"props":525,"children":526},{},[527,532],{"type":15,"tag":67,"props":528,"children":529},{},[530],{"type":21,"value":531},"问题",{"type":15,"tag":67,"props":533,"children":534},{},[535],{"type":21,"value":536},"解决方案",{"type":15,"tag":82,"props":538,"children":539},{},[540,553,566,579,592],{"type":15,"tag":63,"props":541,"children":542},{},[543,548],{"type":15,"tag":89,"props":544,"children":545},{},[546],{"type":21,"value":547},"AI 跳过计划直接写代码",{"type":15,"tag":89,"props":549,"children":550},{},[551],{"type":21,"value":552},"明确要求\"先输出计划，不要写代码\"",{"type":15,"tag":63,"props":554,"children":555},{},[556,561],{"type":15,"tag":89,"props":557,"children":558},{},[559],{"type":21,"value":560},"计划太粗，缺乏细节",{"type":15,"tag":89,"props":562,"children":563},{},[564],{"type":21,"value":565},"要求 AI 列出具体的文件名和函数签名",{"type":15,"tag":63,"props":567,"children":568},{},[569,574],{"type":15,"tag":89,"props":570,"children":571},{},[572],{"type":21,"value":573},"计划太细，执行缓慢",{"type":15,"tag":89,"props":575,"children":576},{},[577],{"type":21,"value":578},"要求 AI 只列关键步骤，跳过实现细节",{"type":15,"tag":63,"props":580,"children":581},{},[582,587],{"type":15,"tag":89,"props":583,"children":584},{},[585],{"type":21,"value":586},"执行中偏离计划",{"type":15,"tag":89,"props":588,"children":589},{},[590],{"type":21,"value":591},"暂停执行，重新对齐计划",{"type":15,"tag":63,"props":593,"children":594},{},[595,600],{"type":15,"tag":89,"props":596,"children":597},{},[598],{"type":21,"value":599},"不确定该用 Chat 还用 Plan",{"type":15,"tag":89,"props":601,"children":602},{},[603],{"type":21,"value":604},"涉及 2 个以上文件的任务用 Plan，否则用 Chat",{"title":7,"searchDepth":606,"depth":606,"links":607},3,[608,610,613,614,619,620,621,622],{"id":26,"depth":609,"text":29},2,{"id":50,"depth":609,"text":53,"children":611},[612],{"id":179,"depth":606,"text":179},{"id":197,"depth":609,"text":197},{"id":213,"depth":609,"text":216,"children":615},[616,617,618],{"id":219,"depth":606,"text":222},{"id":246,"depth":606,"text":249},{"id":277,"depth":606,"text":280},{"id":309,"depth":609,"text":312},{"id":412,"depth":609,"text":412},{"id":473,"depth":609,"text":473},{"id":515,"depth":609,"text":515},"markdown","content:methodology:plan-mode.md","content","methodology\u002Fplan-mode.md","methodology\u002Fplan-mode","md",1777287374683]