[{"data":1,"prerenderedAt":2271},["ShallowReactive",2],{"content-query-p0sOVyO31h":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"lastUpdated":10,"body":11,"_type":297,"_id":2266,"_source":2267,"_file":2268,"_stem":2269,"_extension":2270},"\u002Fmethodology\u002Fagents-claude-md","methodology",false,"","AGENTS.md 与 CLAUDE.md","理解和定义AI编程的项目指令文件","2026-04-23",{"type":12,"children":13,"toc":2235},"root",[14,23,29,58,63,100,104,109,252,273,276,281,288,293,334,340,345,412,418,423,477,480,485,490,842,847,957,960,965,971,1387,1393,1671,1674,1680,1798,1807,1842,1845,1850,1855,1860,1868,1873,1973,1978,2029,2034,2082,2085,2090,2096,2101,2107,2112,2118,2123,2129,2134,2137,2142,2229],{"type":15,"tag":16,"props":17,"children":19},"element","h1",{"id":18},"agentsmd-与-claudemd-的理解与定义",[20],{"type":21,"value":22},"text","AGENTS.md 与 CLAUDE.md 的理解与定义",{"type":15,"tag":24,"props":25,"children":27},"h2",{"id":26},"什么是项目指令文件",[28],{"type":21,"value":26},{"type":15,"tag":30,"props":31,"children":32},"p",{},[33,40,42,48,50,56],{"type":15,"tag":34,"props":35,"children":37},"code",{"className":36},[],[38],{"type":21,"value":39},"AGENTS.md",{"type":21,"value":41}," 和 ",{"type":15,"tag":34,"props":43,"children":45},{"className":44},[],[46],{"type":21,"value":47},"CLAUDE.md",{"type":21,"value":49}," 是 AI 编程工具中的",{"type":15,"tag":51,"props":52,"children":53},"strong",{},[54],{"type":21,"value":55},"项目级指令文件",{"type":21,"value":57},"，放在项目根目录下，用于告诉 AI \"在这个项目中你应该怎么做\"。",{"type":15,"tag":30,"props":59,"children":60},{},[61],{"type":21,"value":62},"类比理解：",{"type":15,"tag":64,"props":65,"children":66},"ul",{},[67,79,90],{"type":15,"tag":68,"props":69,"children":70},"li",{},[71,77],{"type":15,"tag":34,"props":72,"children":74},{"className":73},[],[75],{"type":21,"value":76},".gitignore",{"type":21,"value":78}," 告诉 Git 哪些文件不该跟踪",{"type":15,"tag":68,"props":80,"children":81},{},[82,88],{"type":15,"tag":34,"props":83,"children":85},{"className":84},[],[86],{"type":21,"value":87},".eslintrc",{"type":21,"value":89}," 告诉 ESLint 该检查哪些规则",{"type":15,"tag":68,"props":91,"children":92},{},[93,98],{"type":15,"tag":34,"props":94,"children":96},{"className":95},[],[97],{"type":21,"value":39},{"type":21,"value":99}," 告诉 AI 该遵循哪些指令",{"type":15,"tag":101,"props":102,"children":103},"hr",{},[],{"type":15,"tag":24,"props":105,"children":107},{"id":106},"不同工具的命名",[108],{"type":21,"value":106},{"type":15,"tag":110,"props":111,"children":112},"table",{},[113,137],{"type":15,"tag":114,"props":115,"children":116},"thead",{},[117],{"type":15,"tag":118,"props":119,"children":120},"tr",{},[121,127,132],{"type":15,"tag":122,"props":123,"children":124},"th",{},[125],{"type":21,"value":126},"工具",{"type":15,"tag":122,"props":128,"children":129},{},[130],{"type":21,"value":131},"文件名",{"type":15,"tag":122,"props":133,"children":134},{},[135],{"type":21,"value":136},"说明",{"type":15,"tag":138,"props":139,"children":140},"tbody",{},[141,163,185,207,231],{"type":15,"tag":118,"props":142,"children":143},{},[144,150,158],{"type":15,"tag":145,"props":146,"children":147},"td",{},[148],{"type":21,"value":149},"Claude Code",{"type":15,"tag":145,"props":151,"children":152},{},[153],{"type":15,"tag":34,"props":154,"children":156},{"className":155},[],[157],{"type":21,"value":47},{"type":15,"tag":145,"props":159,"children":160},{},[161],{"type":21,"value":162},"Anthropic 官方规范",{"type":15,"tag":118,"props":164,"children":165},{},[166,171,180],{"type":15,"tag":145,"props":167,"children":168},{},[169],{"type":21,"value":170},"Cursor",{"type":15,"tag":145,"props":172,"children":173},{},[174],{"type":15,"tag":34,"props":175,"children":177},{"className":176},[],[178],{"type":21,"value":179},".cursorrules",{"type":15,"tag":145,"props":181,"children":182},{},[183],{"type":21,"value":184},"Cursor 专属格式",{"type":15,"tag":118,"props":186,"children":187},{},[188,193,202],{"type":15,"tag":145,"props":189,"children":190},{},[191],{"type":21,"value":192},"GitHub Copilot",{"type":15,"tag":145,"props":194,"children":195},{},[196],{"type":15,"tag":34,"props":197,"children":199},{"className":198},[],[200],{"type":21,"value":201},".github\u002Fcopilot-instructions.md",{"type":15,"tag":145,"props":203,"children":204},{},[205],{"type":21,"value":206},"GitHub 官方规范",{"type":15,"tag":118,"props":208,"children":209},{},[210,215,226],{"type":15,"tag":145,"props":211,"children":212},{},[213],{"type":21,"value":214},"Trae",{"type":15,"tag":145,"props":216,"children":217},{},[218,224],{"type":15,"tag":34,"props":219,"children":221},{"className":220},[],[222],{"type":21,"value":223},".trae\u002Frules.md",{"type":21,"value":225}," 或项目设置",{"type":15,"tag":145,"props":227,"children":228},{},[229],{"type":21,"value":230},"Trae 的规则配置",{"type":15,"tag":118,"props":232,"children":233},{},[234,239,247],{"type":15,"tag":145,"props":235,"children":236},{},[237],{"type":21,"value":238},"通用",{"type":15,"tag":145,"props":240,"children":241},{},[242],{"type":15,"tag":34,"props":243,"children":245},{"className":244},[],[246],{"type":21,"value":39},{"type":15,"tag":145,"props":248,"children":249},{},[250],{"type":21,"value":251},"跨工具通用格式，越来越多工具支持",{"type":15,"tag":253,"props":254,"children":255},"blockquote",{},[256],{"type":15,"tag":30,"props":257,"children":258},{},[259,264,266,271],{"type":15,"tag":51,"props":260,"children":261},{},[262],{"type":21,"value":263},"趋势",{"type":21,"value":265},"：",{"type":15,"tag":34,"props":267,"children":269},{"className":268},[],[270],{"type":21,"value":39},{"type":21,"value":272}," 正在成为跨工具的事实标准，Claude Code、Cursor、Windsurf 等工具都开始支持。",{"type":15,"tag":101,"props":274,"children":275},{},[],{"type":15,"tag":24,"props":277,"children":279},{"id":278},"文件的三大作用",[280],{"type":21,"value":278},{"type":15,"tag":282,"props":283,"children":285},"h3",{"id":284},"_1-上下文注入",[286],{"type":21,"value":287},"1. 上下文注入",{"type":15,"tag":30,"props":289,"children":290},{},[291],{"type":21,"value":292},"AI 每次对话时会自动读取这个文件，相当于给 AI 一个\"项目背景\"：",{"type":15,"tag":294,"props":295,"children":299},"pre",{"code":296,"language":297,"meta":7,"className":298,"style":7},"# 项目背景\n这是一个电商后台管理系统，技术栈是 Vue 3 + Node.js + PostgreSQL。\n用户角色分为：管理员、运营、普通用户。\n","markdown","language-markdown shiki shiki-themes github-dark",[300],{"type":15,"tag":34,"props":301,"children":302},{"__ignoreMap":7},[303,315,325],{"type":15,"tag":304,"props":305,"children":308},"span",{"class":306,"line":307},"line",1,[309],{"type":15,"tag":304,"props":310,"children":312},{"style":311},"--shiki-default:#79B8FF;--shiki-default-font-weight:bold",[313],{"type":21,"value":314},"# 项目背景\n",{"type":15,"tag":304,"props":316,"children":318},{"class":306,"line":317},2,[319],{"type":15,"tag":304,"props":320,"children":322},{"style":321},"--shiki-default:#E1E4E8",[323],{"type":21,"value":324},"这是一个电商后台管理系统，技术栈是 Vue 3 + Node.js + PostgreSQL。\n",{"type":15,"tag":304,"props":326,"children":328},{"class":306,"line":327},3,[329],{"type":15,"tag":304,"props":330,"children":331},{"style":321},[332],{"type":21,"value":333},"用户角色分为：管理员、运营、普通用户。\n",{"type":15,"tag":282,"props":335,"children":337},{"id":336},"_2-行为约束",[338],{"type":21,"value":339},"2. 行为约束",{"type":15,"tag":30,"props":341,"children":342},{},[343],{"type":21,"value":344},"告诉 AI 什么该做、什么不该做：",{"type":15,"tag":294,"props":346,"children":348},{"code":347,"language":297,"meta":7,"className":298,"style":7},"# 行为约束\n- 不要使用 any 类型\n- 不要引入新的第三方库，除非经过团队讨论\n- 所有 API 必须有错误处理\n- 修改数据库 schema 必须创建迁移文件\n",[349],{"type":15,"tag":34,"props":350,"children":351},{"__ignoreMap":7},[352,360,374,386,399],{"type":15,"tag":304,"props":353,"children":354},{"class":306,"line":307},[355],{"type":15,"tag":304,"props":356,"children":357},{"style":311},[358],{"type":21,"value":359},"# 行为约束\n",{"type":15,"tag":304,"props":361,"children":362},{"class":306,"line":317},[363,369],{"type":15,"tag":304,"props":364,"children":366},{"style":365},"--shiki-default:#FFAB70",[367],{"type":21,"value":368},"-",{"type":15,"tag":304,"props":370,"children":371},{"style":321},[372],{"type":21,"value":373}," 不要使用 any 类型\n",{"type":15,"tag":304,"props":375,"children":376},{"class":306,"line":327},[377,381],{"type":15,"tag":304,"props":378,"children":379},{"style":365},[380],{"type":21,"value":368},{"type":15,"tag":304,"props":382,"children":383},{"style":321},[384],{"type":21,"value":385}," 不要引入新的第三方库，除非经过团队讨论\n",{"type":15,"tag":304,"props":387,"children":389},{"class":306,"line":388},4,[390,394],{"type":15,"tag":304,"props":391,"children":392},{"style":365},[393],{"type":21,"value":368},{"type":15,"tag":304,"props":395,"children":396},{"style":321},[397],{"type":21,"value":398}," 所有 API 必须有错误处理\n",{"type":15,"tag":304,"props":400,"children":402},{"class":306,"line":401},5,[403,407],{"type":15,"tag":304,"props":404,"children":405},{"style":365},[406],{"type":21,"value":368},{"type":15,"tag":304,"props":408,"children":409},{"style":321},[410],{"type":21,"value":411}," 修改数据库 schema 必须创建迁移文件\n",{"type":15,"tag":282,"props":413,"children":415},{"id":414},"_3-工作流定义",[416],{"type":21,"value":417},"3. 工作流定义",{"type":15,"tag":30,"props":419,"children":420},{},[421],{"type":21,"value":422},"定义 AI 在这个项目中的工作方式：",{"type":15,"tag":294,"props":424,"children":426},{"code":425,"language":297,"meta":7,"className":298,"style":7},"# 工作流\n1. 修改代码前先阅读相关文件\n2. 修改后自动运行 npm run lint\n3. 如果 lint 报错，自行修复后再提交\n",[427],{"type":15,"tag":34,"props":428,"children":429},{"__ignoreMap":7},[430,438,451,464],{"type":15,"tag":304,"props":431,"children":432},{"class":306,"line":307},[433],{"type":15,"tag":304,"props":434,"children":435},{"style":311},[436],{"type":21,"value":437},"# 工作流\n",{"type":15,"tag":304,"props":439,"children":440},{"class":306,"line":317},[441,446],{"type":15,"tag":304,"props":442,"children":443},{"style":365},[444],{"type":21,"value":445},"1.",{"type":15,"tag":304,"props":447,"children":448},{"style":321},[449],{"type":21,"value":450}," 修改代码前先阅读相关文件\n",{"type":15,"tag":304,"props":452,"children":453},{"class":306,"line":327},[454,459],{"type":15,"tag":304,"props":455,"children":456},{"style":365},[457],{"type":21,"value":458},"2.",{"type":15,"tag":304,"props":460,"children":461},{"style":321},[462],{"type":21,"value":463}," 修改后自动运行 npm run lint\n",{"type":15,"tag":304,"props":465,"children":466},{"class":306,"line":388},[467,472],{"type":15,"tag":304,"props":468,"children":469},{"style":365},[470],{"type":21,"value":471},"3.",{"type":15,"tag":304,"props":473,"children":474},{"style":321},[475],{"type":21,"value":476}," 如果 lint 报错，自行修复后再提交\n",{"type":15,"tag":101,"props":478,"children":479},{},[],{"type":15,"tag":24,"props":481,"children":483},{"id":482},"如何编写高质量指令文件",[484],{"type":21,"value":482},{"type":15,"tag":282,"props":486,"children":488},{"id":487},"结构模板",[489],{"type":21,"value":487},{"type":15,"tag":294,"props":491,"children":493},{"code":492,"language":297,"meta":7,"className":298,"style":7},"# 项目名称\n\n## 项目概述\n一句话描述项目是什么、做什么。\n\n## 技术栈\n- 框架：\n- 语言：\n- 数据库：\n- 部署：\n\n## 命令\n- `npm run dev` — 启动开发\n- `npm run test` — 运行测试\n- `npm run lint` — 代码检查\n- `npm run build` — 构建生产版本\n\n## 代码规范\n- 命名规范：\n- 文件组织：\n- 类型要求：\n- 注释要求：\n\n## 禁止事项\n- 不要 XXX\n- 不要 XXX\n\n## 特殊说明\n- 项目中有 XXX 需要注意\n- XXX 模块的逻辑比较复杂，修改前请先理解\n",[494],{"type":15,"tag":34,"props":495,"children":496},{"__ignoreMap":7},[497,505,514,522,530,537,546,559,572,585,598,606,615,634,652,670,688,696,705,718,731,744,757,765,774,787,799,807,816,829],{"type":15,"tag":304,"props":498,"children":499},{"class":306,"line":307},[500],{"type":15,"tag":304,"props":501,"children":502},{"style":311},[503],{"type":21,"value":504},"# 项目名称\n",{"type":15,"tag":304,"props":506,"children":507},{"class":306,"line":317},[508],{"type":15,"tag":304,"props":509,"children":511},{"emptyLinePlaceholder":510},true,[512],{"type":21,"value":513},"\n",{"type":15,"tag":304,"props":515,"children":516},{"class":306,"line":327},[517],{"type":15,"tag":304,"props":518,"children":519},{"style":311},[520],{"type":21,"value":521},"## 项目概述\n",{"type":15,"tag":304,"props":523,"children":524},{"class":306,"line":388},[525],{"type":15,"tag":304,"props":526,"children":527},{"style":321},[528],{"type":21,"value":529},"一句话描述项目是什么、做什么。\n",{"type":15,"tag":304,"props":531,"children":532},{"class":306,"line":401},[533],{"type":15,"tag":304,"props":534,"children":535},{"emptyLinePlaceholder":510},[536],{"type":21,"value":513},{"type":15,"tag":304,"props":538,"children":540},{"class":306,"line":539},6,[541],{"type":15,"tag":304,"props":542,"children":543},{"style":311},[544],{"type":21,"value":545},"## 技术栈\n",{"type":15,"tag":304,"props":547,"children":549},{"class":306,"line":548},7,[550,554],{"type":15,"tag":304,"props":551,"children":552},{"style":365},[553],{"type":21,"value":368},{"type":15,"tag":304,"props":555,"children":556},{"style":321},[557],{"type":21,"value":558}," 框架：\n",{"type":15,"tag":304,"props":560,"children":562},{"class":306,"line":561},8,[563,567],{"type":15,"tag":304,"props":564,"children":565},{"style":365},[566],{"type":21,"value":368},{"type":15,"tag":304,"props":568,"children":569},{"style":321},[570],{"type":21,"value":571}," 语言：\n",{"type":15,"tag":304,"props":573,"children":575},{"class":306,"line":574},9,[576,580],{"type":15,"tag":304,"props":577,"children":578},{"style":365},[579],{"type":21,"value":368},{"type":15,"tag":304,"props":581,"children":582},{"style":321},[583],{"type":21,"value":584}," 数据库：\n",{"type":15,"tag":304,"props":586,"children":588},{"class":306,"line":587},10,[589,593],{"type":15,"tag":304,"props":590,"children":591},{"style":365},[592],{"type":21,"value":368},{"type":15,"tag":304,"props":594,"children":595},{"style":321},[596],{"type":21,"value":597}," 部署：\n",{"type":15,"tag":304,"props":599,"children":601},{"class":306,"line":600},11,[602],{"type":15,"tag":304,"props":603,"children":604},{"emptyLinePlaceholder":510},[605],{"type":21,"value":513},{"type":15,"tag":304,"props":607,"children":609},{"class":306,"line":608},12,[610],{"type":15,"tag":304,"props":611,"children":612},{"style":311},[613],{"type":21,"value":614},"## 命令\n",{"type":15,"tag":304,"props":616,"children":618},{"class":306,"line":617},13,[619,623,629],{"type":15,"tag":304,"props":620,"children":621},{"style":365},[622],{"type":21,"value":368},{"type":15,"tag":304,"props":624,"children":626},{"style":625},"--shiki-default:#79B8FF",[627],{"type":21,"value":628}," `npm run dev`",{"type":15,"tag":304,"props":630,"children":631},{"style":321},[632],{"type":21,"value":633}," — 启动开发\n",{"type":15,"tag":304,"props":635,"children":637},{"class":306,"line":636},14,[638,642,647],{"type":15,"tag":304,"props":639,"children":640},{"style":365},[641],{"type":21,"value":368},{"type":15,"tag":304,"props":643,"children":644},{"style":625},[645],{"type":21,"value":646}," `npm run test`",{"type":15,"tag":304,"props":648,"children":649},{"style":321},[650],{"type":21,"value":651}," — 运行测试\n",{"type":15,"tag":304,"props":653,"children":655},{"class":306,"line":654},15,[656,660,665],{"type":15,"tag":304,"props":657,"children":658},{"style":365},[659],{"type":21,"value":368},{"type":15,"tag":304,"props":661,"children":662},{"style":625},[663],{"type":21,"value":664}," `npm run lint`",{"type":15,"tag":304,"props":666,"children":667},{"style":321},[668],{"type":21,"value":669}," — 代码检查\n",{"type":15,"tag":304,"props":671,"children":673},{"class":306,"line":672},16,[674,678,683],{"type":15,"tag":304,"props":675,"children":676},{"style":365},[677],{"type":21,"value":368},{"type":15,"tag":304,"props":679,"children":680},{"style":625},[681],{"type":21,"value":682}," `npm run build`",{"type":15,"tag":304,"props":684,"children":685},{"style":321},[686],{"type":21,"value":687}," — 构建生产版本\n",{"type":15,"tag":304,"props":689,"children":691},{"class":306,"line":690},17,[692],{"type":15,"tag":304,"props":693,"children":694},{"emptyLinePlaceholder":510},[695],{"type":21,"value":513},{"type":15,"tag":304,"props":697,"children":699},{"class":306,"line":698},18,[700],{"type":15,"tag":304,"props":701,"children":702},{"style":311},[703],{"type":21,"value":704},"## 代码规范\n",{"type":15,"tag":304,"props":706,"children":708},{"class":306,"line":707},19,[709,713],{"type":15,"tag":304,"props":710,"children":711},{"style":365},[712],{"type":21,"value":368},{"type":15,"tag":304,"props":714,"children":715},{"style":321},[716],{"type":21,"value":717}," 命名规范：\n",{"type":15,"tag":304,"props":719,"children":721},{"class":306,"line":720},20,[722,726],{"type":15,"tag":304,"props":723,"children":724},{"style":365},[725],{"type":21,"value":368},{"type":15,"tag":304,"props":727,"children":728},{"style":321},[729],{"type":21,"value":730}," 文件组织：\n",{"type":15,"tag":304,"props":732,"children":734},{"class":306,"line":733},21,[735,739],{"type":15,"tag":304,"props":736,"children":737},{"style":365},[738],{"type":21,"value":368},{"type":15,"tag":304,"props":740,"children":741},{"style":321},[742],{"type":21,"value":743}," 类型要求：\n",{"type":15,"tag":304,"props":745,"children":747},{"class":306,"line":746},22,[748,752],{"type":15,"tag":304,"props":749,"children":750},{"style":365},[751],{"type":21,"value":368},{"type":15,"tag":304,"props":753,"children":754},{"style":321},[755],{"type":21,"value":756}," 注释要求：\n",{"type":15,"tag":304,"props":758,"children":760},{"class":306,"line":759},23,[761],{"type":15,"tag":304,"props":762,"children":763},{"emptyLinePlaceholder":510},[764],{"type":21,"value":513},{"type":15,"tag":304,"props":766,"children":768},{"class":306,"line":767},24,[769],{"type":15,"tag":304,"props":770,"children":771},{"style":311},[772],{"type":21,"value":773},"## 禁止事项\n",{"type":15,"tag":304,"props":775,"children":777},{"class":306,"line":776},25,[778,782],{"type":15,"tag":304,"props":779,"children":780},{"style":365},[781],{"type":21,"value":368},{"type":15,"tag":304,"props":783,"children":784},{"style":321},[785],{"type":21,"value":786}," 不要 XXX\n",{"type":15,"tag":304,"props":788,"children":790},{"class":306,"line":789},26,[791,795],{"type":15,"tag":304,"props":792,"children":793},{"style":365},[794],{"type":21,"value":368},{"type":15,"tag":304,"props":796,"children":797},{"style":321},[798],{"type":21,"value":786},{"type":15,"tag":304,"props":800,"children":802},{"class":306,"line":801},27,[803],{"type":15,"tag":304,"props":804,"children":805},{"emptyLinePlaceholder":510},[806],{"type":21,"value":513},{"type":15,"tag":304,"props":808,"children":810},{"class":306,"line":809},28,[811],{"type":15,"tag":304,"props":812,"children":813},{"style":311},[814],{"type":21,"value":815},"## 特殊说明\n",{"type":15,"tag":304,"props":817,"children":819},{"class":306,"line":818},29,[820,824],{"type":15,"tag":304,"props":821,"children":822},{"style":365},[823],{"type":21,"value":368},{"type":15,"tag":304,"props":825,"children":826},{"style":321},[827],{"type":21,"value":828}," 项目中有 XXX 需要注意\n",{"type":15,"tag":304,"props":830,"children":832},{"class":306,"line":831},30,[833,837],{"type":15,"tag":304,"props":834,"children":835},{"style":365},[836],{"type":21,"value":368},{"type":15,"tag":304,"props":838,"children":839},{"style":321},[840],{"type":21,"value":841}," XXX 模块的逻辑比较复杂，修改前请先理解\n",{"type":15,"tag":282,"props":843,"children":845},{"id":844},"编写原则",[846],{"type":21,"value":844},{"type":15,"tag":110,"props":848,"children":849},{},[850,870],{"type":15,"tag":114,"props":851,"children":852},{},[853],{"type":15,"tag":118,"props":854,"children":855},{},[856,861,865],{"type":15,"tag":122,"props":857,"children":858},{},[859],{"type":21,"value":860},"原则",{"type":15,"tag":122,"props":862,"children":863},{},[864],{"type":21,"value":136},{"type":15,"tag":122,"props":866,"children":867},{},[868],{"type":21,"value":869},"示例",{"type":15,"tag":138,"props":871,"children":872},{},[873,894,915,936],{"type":15,"tag":118,"props":874,"children":875},{},[876,884,889],{"type":15,"tag":145,"props":877,"children":878},{},[879],{"type":15,"tag":51,"props":880,"children":881},{},[882],{"type":21,"value":883},"具体",{"type":15,"tag":145,"props":885,"children":886},{},[887],{"type":21,"value":888},"避免模糊描述",{"type":15,"tag":145,"props":890,"children":891},{},[892],{"type":21,"value":893},"❌ \"注意代码质量\" ✅ \"所有函数必须有 JSDoc 注释\"",{"type":15,"tag":118,"props":895,"children":896},{},[897,905,910],{"type":15,"tag":145,"props":898,"children":899},{},[900],{"type":15,"tag":51,"props":901,"children":902},{},[903],{"type":21,"value":904},"简洁",{"type":15,"tag":145,"props":906,"children":907},{},[908],{"type":21,"value":909},"控制在 100 行以内",{"type":15,"tag":145,"props":911,"children":912},{},[913],{"type":21,"value":914},"过长会稀释 AI 的注意力",{"type":15,"tag":118,"props":916,"children":917},{},[918,926,931],{"type":15,"tag":145,"props":919,"children":920},{},[921],{"type":15,"tag":51,"props":922,"children":923},{},[924],{"type":21,"value":925},"可执行",{"type":15,"tag":145,"props":927,"children":928},{},[929],{"type":21,"value":930},"规则应该是可验证的",{"type":15,"tag":145,"props":932,"children":933},{},[934],{"type":21,"value":935},"❌ \"写好代码\" ✅ \"npm run lint 通过\"",{"type":15,"tag":118,"props":937,"children":938},{},[939,947,952],{"type":15,"tag":145,"props":940,"children":941},{},[942],{"type":15,"tag":51,"props":943,"children":944},{},[945],{"type":21,"value":946},"正反例",{"type":15,"tag":145,"props":948,"children":949},{},[950],{"type":21,"value":951},"给出应该和不应该的示例",{"type":15,"tag":145,"props":953,"children":954},{},[955],{"type":21,"value":956},"代码块对比展示",{"type":15,"tag":101,"props":958,"children":959},{},[],{"type":15,"tag":24,"props":961,"children":963},{"id":962},"实际案例",[964],{"type":21,"value":962},{"type":15,"tag":282,"props":966,"children":968},{"id":967},"案例-1vue-3-全栈项目",[969],{"type":21,"value":970},"案例 1：Vue 3 全栈项目",{"type":15,"tag":294,"props":972,"children":974},{"code":973,"language":297,"meta":7,"className":298,"style":7},"# 电商后台管理系统\n\n## 技术栈\n- 前端：Vue 3.4 + TypeScript 5.x + Vite + Pinia\n- 后端：Node.js 20 + Express 4.x\n- 数据库：PostgreSQL 16 + Prisma ORM\n- 样式：Tailwind CSS 3.x\n\n## 命令\n- `npm run dev` — 同时启动前后端\n- `npm run test:unit` — 单元测试（Vitest）\n- `npm run test:e2e` — E2E 测试（Playwright）\n- `npm run lint` — ESLint + Prettier 检查\n\n## 代码规范\n- 组件使用 `\u003Cscript setup lang=\"ts\">`\n- 所有 props 必须定义类型接口\n- API 返回值使用 Zod 校验\n- 数据库操作必须通过 Prisma，禁止原生 SQL\n\n## 禁止事项\n- 禁止使用 `any` 类型\n- 禁止在组件中直接操作 DOM\n- 禁止在前端硬编码 API 地址，使用环境变量\n- 禁止修改 prisma\u002Fschema.prisma 而不创建迁移文件\n\n## 文件结构\n- `src\u002Fcomponents\u002F` — 可复用组件（PascalCase 命名）\n- `src\u002Fviews\u002F` — 页面组件\n- `src\u002Fstores\u002F` — Pinia 状态管理\n- `src\u002Fapi\u002F` — API 请求封装\n- `server\u002Froutes\u002F` — Express 路由\n- `server\u002Fmiddleware\u002F` — 中间件\n",[975],{"type":15,"tag":34,"props":976,"children":977},{"__ignoreMap":7},[978,986,993,1000,1012,1024,1036,1048,1055,1062,1078,1095,1112,1128,1135,1142,1159,1171,1183,1195,1202,1209,1231,1243,1255,1267,1274,1282,1299,1316,1333,1351,1369],{"type":15,"tag":304,"props":979,"children":980},{"class":306,"line":307},[981],{"type":15,"tag":304,"props":982,"children":983},{"style":311},[984],{"type":21,"value":985},"# 电商后台管理系统\n",{"type":15,"tag":304,"props":987,"children":988},{"class":306,"line":317},[989],{"type":15,"tag":304,"props":990,"children":991},{"emptyLinePlaceholder":510},[992],{"type":21,"value":513},{"type":15,"tag":304,"props":994,"children":995},{"class":306,"line":327},[996],{"type":15,"tag":304,"props":997,"children":998},{"style":311},[999],{"type":21,"value":545},{"type":15,"tag":304,"props":1001,"children":1002},{"class":306,"line":388},[1003,1007],{"type":15,"tag":304,"props":1004,"children":1005},{"style":365},[1006],{"type":21,"value":368},{"type":15,"tag":304,"props":1008,"children":1009},{"style":321},[1010],{"type":21,"value":1011}," 前端：Vue 3.4 + TypeScript 5.x + Vite + Pinia\n",{"type":15,"tag":304,"props":1013,"children":1014},{"class":306,"line":401},[1015,1019],{"type":15,"tag":304,"props":1016,"children":1017},{"style":365},[1018],{"type":21,"value":368},{"type":15,"tag":304,"props":1020,"children":1021},{"style":321},[1022],{"type":21,"value":1023}," 后端：Node.js 20 + Express 4.x\n",{"type":15,"tag":304,"props":1025,"children":1026},{"class":306,"line":539},[1027,1031],{"type":15,"tag":304,"props":1028,"children":1029},{"style":365},[1030],{"type":21,"value":368},{"type":15,"tag":304,"props":1032,"children":1033},{"style":321},[1034],{"type":21,"value":1035}," 数据库：PostgreSQL 16 + Prisma ORM\n",{"type":15,"tag":304,"props":1037,"children":1038},{"class":306,"line":548},[1039,1043],{"type":15,"tag":304,"props":1040,"children":1041},{"style":365},[1042],{"type":21,"value":368},{"type":15,"tag":304,"props":1044,"children":1045},{"style":321},[1046],{"type":21,"value":1047}," 样式：Tailwind CSS 3.x\n",{"type":15,"tag":304,"props":1049,"children":1050},{"class":306,"line":561},[1051],{"type":15,"tag":304,"props":1052,"children":1053},{"emptyLinePlaceholder":510},[1054],{"type":21,"value":513},{"type":15,"tag":304,"props":1056,"children":1057},{"class":306,"line":574},[1058],{"type":15,"tag":304,"props":1059,"children":1060},{"style":311},[1061],{"type":21,"value":614},{"type":15,"tag":304,"props":1063,"children":1064},{"class":306,"line":587},[1065,1069,1073],{"type":15,"tag":304,"props":1066,"children":1067},{"style":365},[1068],{"type":21,"value":368},{"type":15,"tag":304,"props":1070,"children":1071},{"style":625},[1072],{"type":21,"value":628},{"type":15,"tag":304,"props":1074,"children":1075},{"style":321},[1076],{"type":21,"value":1077}," — 同时启动前后端\n",{"type":15,"tag":304,"props":1079,"children":1080},{"class":306,"line":600},[1081,1085,1090],{"type":15,"tag":304,"props":1082,"children":1083},{"style":365},[1084],{"type":21,"value":368},{"type":15,"tag":304,"props":1086,"children":1087},{"style":625},[1088],{"type":21,"value":1089}," `npm run test:unit`",{"type":15,"tag":304,"props":1091,"children":1092},{"style":321},[1093],{"type":21,"value":1094}," — 单元测试（Vitest）\n",{"type":15,"tag":304,"props":1096,"children":1097},{"class":306,"line":608},[1098,1102,1107],{"type":15,"tag":304,"props":1099,"children":1100},{"style":365},[1101],{"type":21,"value":368},{"type":15,"tag":304,"props":1103,"children":1104},{"style":625},[1105],{"type":21,"value":1106}," `npm run test:e2e`",{"type":15,"tag":304,"props":1108,"children":1109},{"style":321},[1110],{"type":21,"value":1111}," — E2E 测试（Playwright）\n",{"type":15,"tag":304,"props":1113,"children":1114},{"class":306,"line":617},[1115,1119,1123],{"type":15,"tag":304,"props":1116,"children":1117},{"style":365},[1118],{"type":21,"value":368},{"type":15,"tag":304,"props":1120,"children":1121},{"style":625},[1122],{"type":21,"value":664},{"type":15,"tag":304,"props":1124,"children":1125},{"style":321},[1126],{"type":21,"value":1127}," — ESLint + Prettier 检查\n",{"type":15,"tag":304,"props":1129,"children":1130},{"class":306,"line":636},[1131],{"type":15,"tag":304,"props":1132,"children":1133},{"emptyLinePlaceholder":510},[1134],{"type":21,"value":513},{"type":15,"tag":304,"props":1136,"children":1137},{"class":306,"line":654},[1138],{"type":15,"tag":304,"props":1139,"children":1140},{"style":311},[1141],{"type":21,"value":704},{"type":15,"tag":304,"props":1143,"children":1144},{"class":306,"line":672},[1145,1149,1154],{"type":15,"tag":304,"props":1146,"children":1147},{"style":365},[1148],{"type":21,"value":368},{"type":15,"tag":304,"props":1150,"children":1151},{"style":321},[1152],{"type":21,"value":1153}," 组件使用 ",{"type":15,"tag":304,"props":1155,"children":1156},{"style":625},[1157],{"type":21,"value":1158},"`\u003Cscript setup lang=\"ts\">`\n",{"type":15,"tag":304,"props":1160,"children":1161},{"class":306,"line":690},[1162,1166],{"type":15,"tag":304,"props":1163,"children":1164},{"style":365},[1165],{"type":21,"value":368},{"type":15,"tag":304,"props":1167,"children":1168},{"style":321},[1169],{"type":21,"value":1170}," 所有 props 必须定义类型接口\n",{"type":15,"tag":304,"props":1172,"children":1173},{"class":306,"line":698},[1174,1178],{"type":15,"tag":304,"props":1175,"children":1176},{"style":365},[1177],{"type":21,"value":368},{"type":15,"tag":304,"props":1179,"children":1180},{"style":321},[1181],{"type":21,"value":1182}," API 返回值使用 Zod 校验\n",{"type":15,"tag":304,"props":1184,"children":1185},{"class":306,"line":707},[1186,1190],{"type":15,"tag":304,"props":1187,"children":1188},{"style":365},[1189],{"type":21,"value":368},{"type":15,"tag":304,"props":1191,"children":1192},{"style":321},[1193],{"type":21,"value":1194}," 数据库操作必须通过 Prisma，禁止原生 SQL\n",{"type":15,"tag":304,"props":1196,"children":1197},{"class":306,"line":720},[1198],{"type":15,"tag":304,"props":1199,"children":1200},{"emptyLinePlaceholder":510},[1201],{"type":21,"value":513},{"type":15,"tag":304,"props":1203,"children":1204},{"class":306,"line":733},[1205],{"type":15,"tag":304,"props":1206,"children":1207},{"style":311},[1208],{"type":21,"value":773},{"type":15,"tag":304,"props":1210,"children":1211},{"class":306,"line":746},[1212,1216,1221,1226],{"type":15,"tag":304,"props":1213,"children":1214},{"style":365},[1215],{"type":21,"value":368},{"type":15,"tag":304,"props":1217,"children":1218},{"style":321},[1219],{"type":21,"value":1220}," 禁止使用 ",{"type":15,"tag":304,"props":1222,"children":1223},{"style":625},[1224],{"type":21,"value":1225},"`any`",{"type":15,"tag":304,"props":1227,"children":1228},{"style":321},[1229],{"type":21,"value":1230}," 类型\n",{"type":15,"tag":304,"props":1232,"children":1233},{"class":306,"line":759},[1234,1238],{"type":15,"tag":304,"props":1235,"children":1236},{"style":365},[1237],{"type":21,"value":368},{"type":15,"tag":304,"props":1239,"children":1240},{"style":321},[1241],{"type":21,"value":1242}," 禁止在组件中直接操作 DOM\n",{"type":15,"tag":304,"props":1244,"children":1245},{"class":306,"line":767},[1246,1250],{"type":15,"tag":304,"props":1247,"children":1248},{"style":365},[1249],{"type":21,"value":368},{"type":15,"tag":304,"props":1251,"children":1252},{"style":321},[1253],{"type":21,"value":1254}," 禁止在前端硬编码 API 地址，使用环境变量\n",{"type":15,"tag":304,"props":1256,"children":1257},{"class":306,"line":776},[1258,1262],{"type":15,"tag":304,"props":1259,"children":1260},{"style":365},[1261],{"type":21,"value":368},{"type":15,"tag":304,"props":1263,"children":1264},{"style":321},[1265],{"type":21,"value":1266}," 禁止修改 prisma\u002Fschema.prisma 而不创建迁移文件\n",{"type":15,"tag":304,"props":1268,"children":1269},{"class":306,"line":789},[1270],{"type":15,"tag":304,"props":1271,"children":1272},{"emptyLinePlaceholder":510},[1273],{"type":21,"value":513},{"type":15,"tag":304,"props":1275,"children":1276},{"class":306,"line":801},[1277],{"type":15,"tag":304,"props":1278,"children":1279},{"style":311},[1280],{"type":21,"value":1281},"## 文件结构\n",{"type":15,"tag":304,"props":1283,"children":1284},{"class":306,"line":809},[1285,1289,1294],{"type":15,"tag":304,"props":1286,"children":1287},{"style":365},[1288],{"type":21,"value":368},{"type":15,"tag":304,"props":1290,"children":1291},{"style":625},[1292],{"type":21,"value":1293}," `src\u002Fcomponents\u002F`",{"type":15,"tag":304,"props":1295,"children":1296},{"style":321},[1297],{"type":21,"value":1298}," — 可复用组件（PascalCase 命名）\n",{"type":15,"tag":304,"props":1300,"children":1301},{"class":306,"line":818},[1302,1306,1311],{"type":15,"tag":304,"props":1303,"children":1304},{"style":365},[1305],{"type":21,"value":368},{"type":15,"tag":304,"props":1307,"children":1308},{"style":625},[1309],{"type":21,"value":1310}," `src\u002Fviews\u002F`",{"type":15,"tag":304,"props":1312,"children":1313},{"style":321},[1314],{"type":21,"value":1315}," — 页面组件\n",{"type":15,"tag":304,"props":1317,"children":1318},{"class":306,"line":831},[1319,1323,1328],{"type":15,"tag":304,"props":1320,"children":1321},{"style":365},[1322],{"type":21,"value":368},{"type":15,"tag":304,"props":1324,"children":1325},{"style":625},[1326],{"type":21,"value":1327}," `src\u002Fstores\u002F`",{"type":15,"tag":304,"props":1329,"children":1330},{"style":321},[1331],{"type":21,"value":1332}," — Pinia 状态管理\n",{"type":15,"tag":304,"props":1334,"children":1336},{"class":306,"line":1335},31,[1337,1341,1346],{"type":15,"tag":304,"props":1338,"children":1339},{"style":365},[1340],{"type":21,"value":368},{"type":15,"tag":304,"props":1342,"children":1343},{"style":625},[1344],{"type":21,"value":1345}," `src\u002Fapi\u002F`",{"type":15,"tag":304,"props":1347,"children":1348},{"style":321},[1349],{"type":21,"value":1350}," — API 请求封装\n",{"type":15,"tag":304,"props":1352,"children":1354},{"class":306,"line":1353},32,[1355,1359,1364],{"type":15,"tag":304,"props":1356,"children":1357},{"style":365},[1358],{"type":21,"value":368},{"type":15,"tag":304,"props":1360,"children":1361},{"style":625},[1362],{"type":21,"value":1363}," `server\u002Froutes\u002F`",{"type":15,"tag":304,"props":1365,"children":1366},{"style":321},[1367],{"type":21,"value":1368}," — Express 路由\n",{"type":15,"tag":304,"props":1370,"children":1372},{"class":306,"line":1371},33,[1373,1377,1382],{"type":15,"tag":304,"props":1374,"children":1375},{"style":365},[1376],{"type":21,"value":368},{"type":15,"tag":304,"props":1378,"children":1379},{"style":625},[1380],{"type":21,"value":1381}," `server\u002Fmiddleware\u002F`",{"type":15,"tag":304,"props":1383,"children":1384},{"style":321},[1385],{"type":21,"value":1386}," — 中间件\n",{"type":15,"tag":282,"props":1388,"children":1390},{"id":1389},"案例-2python-数据项目",[1391],{"type":21,"value":1392},"案例 2：Python 数据项目",{"type":15,"tag":294,"props":1394,"children":1396},{"code":1395,"language":297,"meta":7,"className":298,"style":7},"# 数据分析平台\n\n## 技术栈\n- Python 3.11 + FastAPI\n- 数据处理：Pandas + Polars\n- 可视化：Plotly\n- 数据库：PostgreSQL + Redis\n\n## 命令\n- `uvicorn main:app --reload` — 启动开发服务器\n- `pytest` — 运行测试\n- `ruff check` — 代码检查\n- `ruff format` — 代码格式化\n\n## 代码规范\n- 类型注解必须完整（mypy strict 模式）\n- 函数必须有 docstring（Google 风格）\n- 数据处理优先使用 Polars，Pandas 仅在必要时使用\n- 所有 DataFrame 操作必须指定数据类型\n\n## 禁止事项\n- 禁止使用 `pd.read_csv` 而不指定 dtype\n- 禁止在循环中逐行处理 DataFrame\n- 禁止将密码、密钥写入代码\n",[1397],{"type":15,"tag":34,"props":1398,"children":1399},{"__ignoreMap":7},[1400,1408,1415,1422,1434,1446,1458,1470,1477,1484,1501,1517,1533,1550,1557,1564,1576,1588,1600,1612,1619,1626,1647,1659],{"type":15,"tag":304,"props":1401,"children":1402},{"class":306,"line":307},[1403],{"type":15,"tag":304,"props":1404,"children":1405},{"style":311},[1406],{"type":21,"value":1407},"# 数据分析平台\n",{"type":15,"tag":304,"props":1409,"children":1410},{"class":306,"line":317},[1411],{"type":15,"tag":304,"props":1412,"children":1413},{"emptyLinePlaceholder":510},[1414],{"type":21,"value":513},{"type":15,"tag":304,"props":1416,"children":1417},{"class":306,"line":327},[1418],{"type":15,"tag":304,"props":1419,"children":1420},{"style":311},[1421],{"type":21,"value":545},{"type":15,"tag":304,"props":1423,"children":1424},{"class":306,"line":388},[1425,1429],{"type":15,"tag":304,"props":1426,"children":1427},{"style":365},[1428],{"type":21,"value":368},{"type":15,"tag":304,"props":1430,"children":1431},{"style":321},[1432],{"type":21,"value":1433}," Python 3.11 + FastAPI\n",{"type":15,"tag":304,"props":1435,"children":1436},{"class":306,"line":401},[1437,1441],{"type":15,"tag":304,"props":1438,"children":1439},{"style":365},[1440],{"type":21,"value":368},{"type":15,"tag":304,"props":1442,"children":1443},{"style":321},[1444],{"type":21,"value":1445}," 数据处理：Pandas + Polars\n",{"type":15,"tag":304,"props":1447,"children":1448},{"class":306,"line":539},[1449,1453],{"type":15,"tag":304,"props":1450,"children":1451},{"style":365},[1452],{"type":21,"value":368},{"type":15,"tag":304,"props":1454,"children":1455},{"style":321},[1456],{"type":21,"value":1457}," 可视化：Plotly\n",{"type":15,"tag":304,"props":1459,"children":1460},{"class":306,"line":548},[1461,1465],{"type":15,"tag":304,"props":1462,"children":1463},{"style":365},[1464],{"type":21,"value":368},{"type":15,"tag":304,"props":1466,"children":1467},{"style":321},[1468],{"type":21,"value":1469}," 数据库：PostgreSQL + Redis\n",{"type":15,"tag":304,"props":1471,"children":1472},{"class":306,"line":561},[1473],{"type":15,"tag":304,"props":1474,"children":1475},{"emptyLinePlaceholder":510},[1476],{"type":21,"value":513},{"type":15,"tag":304,"props":1478,"children":1479},{"class":306,"line":574},[1480],{"type":15,"tag":304,"props":1481,"children":1482},{"style":311},[1483],{"type":21,"value":614},{"type":15,"tag":304,"props":1485,"children":1486},{"class":306,"line":587},[1487,1491,1496],{"type":15,"tag":304,"props":1488,"children":1489},{"style":365},[1490],{"type":21,"value":368},{"type":15,"tag":304,"props":1492,"children":1493},{"style":625},[1494],{"type":21,"value":1495}," `uvicorn main:app --reload`",{"type":15,"tag":304,"props":1497,"children":1498},{"style":321},[1499],{"type":21,"value":1500}," — 启动开发服务器\n",{"type":15,"tag":304,"props":1502,"children":1503},{"class":306,"line":600},[1504,1508,1513],{"type":15,"tag":304,"props":1505,"children":1506},{"style":365},[1507],{"type":21,"value":368},{"type":15,"tag":304,"props":1509,"children":1510},{"style":625},[1511],{"type":21,"value":1512}," `pytest`",{"type":15,"tag":304,"props":1514,"children":1515},{"style":321},[1516],{"type":21,"value":651},{"type":15,"tag":304,"props":1518,"children":1519},{"class":306,"line":608},[1520,1524,1529],{"type":15,"tag":304,"props":1521,"children":1522},{"style":365},[1523],{"type":21,"value":368},{"type":15,"tag":304,"props":1525,"children":1526},{"style":625},[1527],{"type":21,"value":1528}," `ruff check`",{"type":15,"tag":304,"props":1530,"children":1531},{"style":321},[1532],{"type":21,"value":669},{"type":15,"tag":304,"props":1534,"children":1535},{"class":306,"line":617},[1536,1540,1545],{"type":15,"tag":304,"props":1537,"children":1538},{"style":365},[1539],{"type":21,"value":368},{"type":15,"tag":304,"props":1541,"children":1542},{"style":625},[1543],{"type":21,"value":1544}," `ruff format`",{"type":15,"tag":304,"props":1546,"children":1547},{"style":321},[1548],{"type":21,"value":1549}," — 代码格式化\n",{"type":15,"tag":304,"props":1551,"children":1552},{"class":306,"line":636},[1553],{"type":15,"tag":304,"props":1554,"children":1555},{"emptyLinePlaceholder":510},[1556],{"type":21,"value":513},{"type":15,"tag":304,"props":1558,"children":1559},{"class":306,"line":654},[1560],{"type":15,"tag":304,"props":1561,"children":1562},{"style":311},[1563],{"type":21,"value":704},{"type":15,"tag":304,"props":1565,"children":1566},{"class":306,"line":672},[1567,1571],{"type":15,"tag":304,"props":1568,"children":1569},{"style":365},[1570],{"type":21,"value":368},{"type":15,"tag":304,"props":1572,"children":1573},{"style":321},[1574],{"type":21,"value":1575}," 类型注解必须完整（mypy strict 模式）\n",{"type":15,"tag":304,"props":1577,"children":1578},{"class":306,"line":690},[1579,1583],{"type":15,"tag":304,"props":1580,"children":1581},{"style":365},[1582],{"type":21,"value":368},{"type":15,"tag":304,"props":1584,"children":1585},{"style":321},[1586],{"type":21,"value":1587}," 函数必须有 docstring（Google 风格）\n",{"type":15,"tag":304,"props":1589,"children":1590},{"class":306,"line":698},[1591,1595],{"type":15,"tag":304,"props":1592,"children":1593},{"style":365},[1594],{"type":21,"value":368},{"type":15,"tag":304,"props":1596,"children":1597},{"style":321},[1598],{"type":21,"value":1599}," 数据处理优先使用 Polars，Pandas 仅在必要时使用\n",{"type":15,"tag":304,"props":1601,"children":1602},{"class":306,"line":707},[1603,1607],{"type":15,"tag":304,"props":1604,"children":1605},{"style":365},[1606],{"type":21,"value":368},{"type":15,"tag":304,"props":1608,"children":1609},{"style":321},[1610],{"type":21,"value":1611}," 所有 DataFrame 操作必须指定数据类型\n",{"type":15,"tag":304,"props":1613,"children":1614},{"class":306,"line":720},[1615],{"type":15,"tag":304,"props":1616,"children":1617},{"emptyLinePlaceholder":510},[1618],{"type":21,"value":513},{"type":15,"tag":304,"props":1620,"children":1621},{"class":306,"line":733},[1622],{"type":15,"tag":304,"props":1623,"children":1624},{"style":311},[1625],{"type":21,"value":773},{"type":15,"tag":304,"props":1627,"children":1628},{"class":306,"line":746},[1629,1633,1637,1642],{"type":15,"tag":304,"props":1630,"children":1631},{"style":365},[1632],{"type":21,"value":368},{"type":15,"tag":304,"props":1634,"children":1635},{"style":321},[1636],{"type":21,"value":1220},{"type":15,"tag":304,"props":1638,"children":1639},{"style":625},[1640],{"type":21,"value":1641},"`pd.read_csv`",{"type":15,"tag":304,"props":1643,"children":1644},{"style":321},[1645],{"type":21,"value":1646}," 而不指定 dtype\n",{"type":15,"tag":304,"props":1648,"children":1649},{"class":306,"line":759},[1650,1654],{"type":15,"tag":304,"props":1651,"children":1652},{"style":365},[1653],{"type":21,"value":368},{"type":15,"tag":304,"props":1655,"children":1656},{"style":321},[1657],{"type":21,"value":1658}," 禁止在循环中逐行处理 DataFrame\n",{"type":15,"tag":304,"props":1660,"children":1661},{"class":306,"line":767},[1662,1666],{"type":15,"tag":304,"props":1663,"children":1664},{"style":365},[1665],{"type":21,"value":368},{"type":15,"tag":304,"props":1667,"children":1668},{"style":321},[1669],{"type":21,"value":1670}," 禁止将密码、密钥写入代码\n",{"type":15,"tag":101,"props":1672,"children":1673},{},[],{"type":15,"tag":24,"props":1675,"children":1677},{"id":1676},"agentsmd-vs-claudemd-vs-cursorrules",[1678],{"type":21,"value":1679},"AGENTS.md vs CLAUDE.md vs .cursorrules",{"type":15,"tag":110,"props":1681,"children":1682},{},[1683,1706],{"type":15,"tag":114,"props":1684,"children":1685},{},[1686],{"type":15,"tag":118,"props":1687,"children":1688},{},[1689,1694,1698,1702],{"type":15,"tag":122,"props":1690,"children":1691},{},[1692],{"type":21,"value":1693},"维度",{"type":15,"tag":122,"props":1695,"children":1696},{},[1697],{"type":21,"value":39},{"type":15,"tag":122,"props":1699,"children":1700},{},[1701],{"type":21,"value":47},{"type":15,"tag":122,"props":1703,"children":1704},{},[1705],{"type":21,"value":179},{"type":15,"tag":138,"props":1707,"children":1708},{},[1709,1732,1753,1776],{"type":15,"tag":118,"props":1710,"children":1711},{},[1712,1717,1722,1727],{"type":15,"tag":145,"props":1713,"children":1714},{},[1715],{"type":21,"value":1716},"兼容性",{"type":15,"tag":145,"props":1718,"children":1719},{},[1720],{"type":21,"value":1721},"多工具支持",{"type":15,"tag":145,"props":1723,"children":1724},{},[1725],{"type":21,"value":1726},"Claude Code 专属",{"type":15,"tag":145,"props":1728,"children":1729},{},[1730],{"type":21,"value":1731},"Cursor 专属",{"type":15,"tag":118,"props":1733,"children":1734},{},[1735,1740,1745,1749],{"type":15,"tag":145,"props":1736,"children":1737},{},[1738],{"type":21,"value":1739},"格式",{"type":15,"tag":145,"props":1741,"children":1742},{},[1743],{"type":21,"value":1744},"Markdown",{"type":15,"tag":145,"props":1746,"children":1747},{},[1748],{"type":21,"value":1744},{"type":15,"tag":145,"props":1750,"children":1751},{},[1752],{"type":21,"value":1744},{"type":15,"tag":118,"props":1754,"children":1755},{},[1756,1761,1766,1771],{"type":15,"tag":145,"props":1757,"children":1758},{},[1759],{"type":21,"value":1760},"优先级",{"type":15,"tag":145,"props":1762,"children":1763},{},[1764],{"type":21,"value":1765},"中",{"type":15,"tag":145,"props":1767,"children":1768},{},[1769],{"type":21,"value":1770},"高（Claude 中）",{"type":15,"tag":145,"props":1772,"children":1773},{},[1774],{"type":21,"value":1775},"高（Cursor 中）",{"type":15,"tag":118,"props":1777,"children":1778},{},[1779,1784,1789,1793],{"type":15,"tag":145,"props":1780,"children":1781},{},[1782],{"type":21,"value":1783},"子目录支持",{"type":15,"tag":145,"props":1785,"children":1786},{},[1787],{"type":21,"value":1788},"✅ 可在子目录放置",{"type":15,"tag":145,"props":1790,"children":1791},{},[1792],{"type":21,"value":1788},{"type":15,"tag":145,"props":1794,"children":1795},{},[1796],{"type":21,"value":1797},"❌ 仅根目录",{"type":15,"tag":30,"props":1799,"children":1800},{},[1801,1806],{"type":15,"tag":51,"props":1802,"children":1803},{},[1804],{"type":21,"value":1805},"建议",{"type":21,"value":265},{"type":15,"tag":64,"props":1808,"children":1809},{},[1810,1820,1830],{"type":15,"tag":68,"props":1811,"children":1812},{},[1813,1815],{"type":21,"value":1814},"如果只用 Claude Code → 写 ",{"type":15,"tag":34,"props":1816,"children":1818},{"className":1817},[],[1819],{"type":21,"value":47},{"type":15,"tag":68,"props":1821,"children":1822},{},[1823,1825],{"type":21,"value":1824},"如果只用 Cursor → 写 ",{"type":15,"tag":34,"props":1826,"children":1828},{"className":1827},[],[1829],{"type":21,"value":179},{"type":15,"tag":68,"props":1831,"children":1832},{},[1833,1835,1840],{"type":21,"value":1834},"如果多工具混用 → 写 ",{"type":15,"tag":34,"props":1836,"children":1838},{"className":1837},[],[1839],{"type":21,"value":39},{"type":21,"value":1841},"（通用格式）",{"type":15,"tag":101,"props":1843,"children":1844},{},[],{"type":15,"tag":24,"props":1846,"children":1848},{"id":1847},"优先级与合并策略",[1849],{"type":21,"value":1847},{"type":15,"tag":30,"props":1851,"children":1852},{},[1853],{"type":21,"value":1854},"当项目中同时存在多个指令文件时，AI 工具如何决定听谁的？",{"type":15,"tag":282,"props":1856,"children":1858},{"id":1857},"多文件共存场景",[1859],{"type":21,"value":1857},{"type":15,"tag":294,"props":1861,"children":1863},{"code":1862},"project\u002F\n├── AGENTS.md              ← 通用指令\n├── CLAUDE.md              ← Claude Code 专属指令\n├── .cursorrules           ← Cursor 专属指令\n├── src\u002F\n│   └── CLAUDE.md          ← 子目录专属指令\n└── .github\u002F\n    └── copilot-instructions.md\n",[1864],{"type":15,"tag":34,"props":1865,"children":1866},{"__ignoreMap":7},[1867],{"type":21,"value":1862},{"type":15,"tag":282,"props":1869,"children":1871},{"id":1870},"优先级规则",[1872],{"type":21,"value":1870},{"type":15,"tag":110,"props":1874,"children":1875},{},[1876,1895],{"type":15,"tag":114,"props":1877,"children":1878},{},[1879],{"type":15,"tag":118,"props":1880,"children":1881},{},[1882,1886,1891],{"type":15,"tag":122,"props":1883,"children":1884},{},[1885],{"type":21,"value":1760},{"type":15,"tag":122,"props":1887,"children":1888},{},[1889],{"type":21,"value":1890},"文件",{"type":15,"tag":122,"props":1892,"children":1893},{},[1894],{"type":21,"value":136},{"type":15,"tag":138,"props":1896,"children":1897},{},[1898,1922,1950],{"type":15,"tag":118,"props":1899,"children":1900},{},[1901,1906,1911],{"type":15,"tag":145,"props":1902,"children":1903},{},[1904],{"type":21,"value":1905},"最高",{"type":15,"tag":145,"props":1907,"children":1908},{},[1909],{"type":21,"value":1910},"子目录指令文件",{"type":15,"tag":145,"props":1912,"children":1913},{},[1914,1920],{"type":15,"tag":34,"props":1915,"children":1917},{"className":1916},[],[1918],{"type":21,"value":1919},"src\u002FCLAUDE.md",{"type":21,"value":1921}," 优先于根目录的",{"type":15,"tag":118,"props":1923,"children":1924},{},[1925,1930,1935],{"type":15,"tag":145,"props":1926,"children":1927},{},[1928],{"type":21,"value":1929},"中等",{"type":15,"tag":145,"props":1931,"children":1932},{},[1933],{"type":21,"value":1934},"工具专属文件",{"type":15,"tag":145,"props":1936,"children":1937},{},[1938,1943,1945],{"type":15,"tag":34,"props":1939,"children":1941},{"className":1940},[],[1942],{"type":21,"value":47},{"type":21,"value":1944}," 在 Claude Code 中优先于 ",{"type":15,"tag":34,"props":1946,"children":1948},{"className":1947},[],[1949],{"type":21,"value":39},{"type":15,"tag":118,"props":1951,"children":1952},{},[1953,1958,1963],{"type":15,"tag":145,"props":1954,"children":1955},{},[1956],{"type":21,"value":1957},"最低",{"type":15,"tag":145,"props":1959,"children":1960},{},[1961],{"type":21,"value":1962},"通用文件",{"type":15,"tag":145,"props":1964,"children":1965},{},[1966,1971],{"type":15,"tag":34,"props":1967,"children":1969},{"className":1968},[],[1970],{"type":21,"value":39},{"type":21,"value":1972}," 作为兜底",{"type":15,"tag":282,"props":1974,"children":1976},{"id":1975},"合并策略",[1977],{"type":21,"value":1975},{"type":15,"tag":64,"props":1979,"children":1980},{},[1981,1991,2020],{"type":15,"tag":68,"props":1982,"children":1983},{},[1984,1989],{"type":15,"tag":51,"props":1985,"children":1986},{},[1987],{"type":21,"value":1988},"不是替换，是合并",{"type":21,"value":1990},"：高优先级文件不会完全覆盖低优先级，而是补充和覆盖冲突项",{"type":15,"tag":68,"props":1992,"children":1993},{},[1994,1999,2001,2006,2008,2013,2015],{"type":15,"tag":51,"props":1995,"children":1996},{},[1997],{"type":21,"value":1998},"冲突时高优先级胜出",{"type":21,"value":2000},"：如果 ",{"type":15,"tag":34,"props":2002,"children":2004},{"className":2003},[],[2005],{"type":21,"value":39},{"type":21,"value":2007}," 说\"用 ESLint\"，而 ",{"type":15,"tag":34,"props":2009,"children":2011},{"className":2010},[],[2012],{"type":21,"value":47},{"type":21,"value":2014}," 说\"用 Biome\"，Claude Code 会听 ",{"type":15,"tag":34,"props":2016,"children":2018},{"className":2017},[],[2019],{"type":21,"value":47},{"type":15,"tag":68,"props":2021,"children":2022},{},[2023,2027],{"type":15,"tag":51,"props":2024,"children":2025},{},[2026],{"type":21,"value":1805},{"type":21,"value":2028},"：保持各文件职责清晰，避免重复定义相同规则",{"type":15,"tag":282,"props":2030,"children":2032},{"id":2031},"最佳实践",[2033],{"type":21,"value":2031},{"type":15,"tag":64,"props":2035,"children":2036},{},[2037,2047,2064],{"type":15,"tag":68,"props":2038,"children":2039},{},[2040,2045],{"type":15,"tag":51,"props":2041,"children":2042},{},[2043],{"type":21,"value":2044},"单一工具",{"type":21,"value":2046},"：只用一个工具专属文件就够了",{"type":15,"tag":68,"props":2048,"children":2049},{},[2050,2055,2057,2062],{"type":15,"tag":51,"props":2051,"children":2052},{},[2053],{"type":21,"value":2054},"多工具混用",{"type":21,"value":2056},"：用 ",{"type":15,"tag":34,"props":2058,"children":2060},{"className":2059},[],[2061],{"type":21,"value":39},{"type":21,"value":2063}," 写通用规则，各工具专属文件只写差异部分",{"type":15,"tag":68,"props":2065,"children":2066},{},[2067,2072,2074,2080],{"type":15,"tag":51,"props":2068,"children":2069},{},[2070],{"type":21,"value":2071},"子目录覆盖",{"type":21,"value":2073},"：特殊模块（如 ",{"type":15,"tag":34,"props":2075,"children":2077},{"className":2076},[],[2078],{"type":21,"value":2079},"legacy\u002F",{"type":21,"value":2081},"）用子目录指令文件覆盖全局规则",{"type":15,"tag":101,"props":2083,"children":2084},{},[],{"type":15,"tag":24,"props":2086,"children":2088},{"id":2087},"常见误区",[2089],{"type":21,"value":2087},{"type":15,"tag":282,"props":2091,"children":2093},{"id":2092},"_1-写太多",[2094],{"type":21,"value":2095},"1. 写太多",{"type":15,"tag":30,"props":2097,"children":2098},{},[2099],{"type":21,"value":2100},"把整个项目文档塞进去 → AI 注意力被稀释，效果反而变差。",{"type":15,"tag":282,"props":2102,"children":2104},{"id":2103},"_2-写太泛",[2105],{"type":21,"value":2106},"2. 写太泛",{"type":15,"tag":30,"props":2108,"children":2109},{},[2110],{"type":21,"value":2111},"\"注意性能\"、\"代码要好\" → AI 无法执行，等于没写。",{"type":15,"tag":282,"props":2113,"children":2115},{"id":2114},"_3-不更新",[2116],{"type":21,"value":2117},"3. 不更新",{"type":15,"tag":30,"props":2119,"children":2120},{},[2121],{"type":21,"value":2122},"技术栈升级了但规则文件没更新 → AI 按旧规范生成代码。",{"type":15,"tag":282,"props":2124,"children":2126},{"id":2125},"_4-忽视子目录规则",[2127],{"type":21,"value":2128},"4. 忽视子目录规则",{"type":15,"tag":30,"props":2130,"children":2131},{},[2132],{"type":21,"value":2133},"不同模块有不同规范 → 应该在子目录也放指令文件。",{"type":15,"tag":101,"props":2135,"children":2136},{},[],{"type":15,"tag":24,"props":2138,"children":2140},{"id":2139},"常见问题",[2141],{"type":21,"value":2139},{"type":15,"tag":110,"props":2143,"children":2144},{},[2145,2161],{"type":15,"tag":114,"props":2146,"children":2147},{},[2148],{"type":15,"tag":118,"props":2149,"children":2150},{},[2151,2156],{"type":15,"tag":122,"props":2152,"children":2153},{},[2154],{"type":21,"value":2155},"问题",{"type":15,"tag":122,"props":2157,"children":2158},{},[2159],{"type":21,"value":2160},"解决方案",{"type":15,"tag":138,"props":2162,"children":2163},{},[2164,2177,2190,2203,2216],{"type":15,"tag":118,"props":2165,"children":2166},{},[2167,2172],{"type":15,"tag":145,"props":2168,"children":2169},{},[2170],{"type":21,"value":2171},"AI 不读 AGENTS.md",{"type":15,"tag":145,"props":2173,"children":2174},{},[2175],{"type":21,"value":2176},"检查文件名是否正确、是否在根目录",{"type":15,"tag":118,"props":2178,"children":2179},{},[2180,2185],{"type":15,"tag":145,"props":2181,"children":2182},{},[2183],{"type":21,"value":2184},"多个文件规则冲突",{"type":15,"tag":145,"props":2186,"children":2187},{},[2188],{"type":21,"value":2189},"理解优先级，精简重复规则",{"type":15,"tag":118,"props":2191,"children":2192},{},[2193,2198],{"type":15,"tag":145,"props":2194,"children":2195},{},[2196],{"type":21,"value":2197},"文件太长 AI 忽略部分内容",{"type":15,"tag":145,"props":2199,"children":2200},{},[2201],{"type":21,"value":2202},"拆分到子目录，或精简到 100 行",{"type":15,"tag":118,"props":2204,"children":2205},{},[2206,2211],{"type":15,"tag":145,"props":2207,"children":2208},{},[2209],{"type":21,"value":2210},"不知道该写什么",{"type":15,"tag":145,"props":2212,"children":2213},{},[2214],{"type":21,"value":2215},"从技术栈和禁止事项开始，逐步补充",{"type":15,"tag":118,"props":2217,"children":2218},{},[2219,2224],{"type":15,"tag":145,"props":2220,"children":2221},{},[2222],{"type":21,"value":2223},"子目录文件不生效",{"type":15,"tag":145,"props":2225,"children":2226},{},[2227],{"type":21,"value":2228},"检查文件名是否正确，部分工具只支持根目录",{"type":15,"tag":2230,"props":2231,"children":2232},"style",{},[2233],{"type":21,"value":2234},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":327,"depth":327,"links":2236},[2237,2238,2239,2244,2248,2252,2253,2259,2265],{"id":26,"depth":317,"text":26},{"id":106,"depth":317,"text":106},{"id":278,"depth":317,"text":278,"children":2240},[2241,2242,2243],{"id":284,"depth":327,"text":287},{"id":336,"depth":327,"text":339},{"id":414,"depth":327,"text":417},{"id":482,"depth":317,"text":482,"children":2245},[2246,2247],{"id":487,"depth":327,"text":487},{"id":844,"depth":327,"text":844},{"id":962,"depth":317,"text":962,"children":2249},[2250,2251],{"id":967,"depth":327,"text":970},{"id":1389,"depth":327,"text":1392},{"id":1676,"depth":317,"text":1679},{"id":1847,"depth":317,"text":1847,"children":2254},[2255,2256,2257,2258],{"id":1857,"depth":327,"text":1857},{"id":1870,"depth":327,"text":1870},{"id":1975,"depth":327,"text":1975},{"id":2031,"depth":327,"text":2031},{"id":2087,"depth":317,"text":2087,"children":2260},[2261,2262,2263,2264],{"id":2092,"depth":327,"text":2095},{"id":2103,"depth":327,"text":2106},{"id":2114,"depth":327,"text":2117},{"id":2125,"depth":327,"text":2128},{"id":2139,"depth":317,"text":2139},"content:methodology:agents-claude-md.md","content","methodology\u002Fagents-claude-md.md","methodology\u002Fagents-claude-md","md",1777287374440]