[{"data":1,"prerenderedAt":742},["ShallowReactive",2],{"content-query-hPZo9Wo5FY":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"lastUpdated":10,"body":11,"_type":177,"_id":737,"_source":738,"_file":739,"_stem":740,"_extension":741},"\u002Fmethodology\u002Fpersonal-rules","methodology",false,"","个人规则配置","配置个人化的AI编程规则，提升代码质量和一致性","2026-04-23",{"type":12,"children":13,"toc":724},"root",[14,21,27,41,45,50,157,160,165,172,249,255,318,324,375,381,444,447,453,570,584,587,592,636,639,644,718],{"type":15,"tag":16,"props":17,"children":18},"element","h1",{"id":8},[19],{"type":20,"value":8},"text",{"type":15,"tag":22,"props":23,"children":25},"h2",{"id":24},"什么是个人规则",[26],{"type":20,"value":24},{"type":15,"tag":28,"props":29,"children":30},"p",{},[31,33,39],{"type":20,"value":32},"个人规则是你在使用 AI 编程工具时的偏好设置。它",{"type":15,"tag":34,"props":35,"children":36},"strong",{},[37],{"type":20,"value":38},"跨项目生效",{"type":20,"value":40},"，告诉 AI \"我喜欢什么样的代码\"。配一次，所有项目通用。",{"type":15,"tag":42,"props":43,"children":44},"hr",{},[],{"type":15,"tag":22,"props":46,"children":48},{"id":47},"配置位置",[49],{"type":20,"value":47},{"type":15,"tag":51,"props":52,"children":53},"table",{},[54,77],{"type":15,"tag":55,"props":56,"children":57},"thead",{},[58],{"type":15,"tag":59,"props":60,"children":61},"tr",{},[62,68,72],{"type":15,"tag":63,"props":64,"children":65},"th",{},[66],{"type":20,"value":67},"工具",{"type":15,"tag":63,"props":69,"children":70},{},[71],{"type":20,"value":47},{"type":15,"tag":63,"props":73,"children":74},{},[75],{"type":20,"value":76},"格式",{"type":15,"tag":78,"props":79,"children":80},"tbody",{},[81,105,123,140],{"type":15,"tag":59,"props":82,"children":83},{},[84,90,100],{"type":15,"tag":85,"props":86,"children":87},"td",{},[88],{"type":20,"value":89},"Claude Code",{"type":15,"tag":85,"props":91,"children":92},{},[93],{"type":15,"tag":94,"props":95,"children":97},"code",{"className":96},[],[98],{"type":20,"value":99},"~\u002F.claude\u002FCLAUDE.md",{"type":15,"tag":85,"props":101,"children":102},{},[103],{"type":20,"value":104},"Markdown",{"type":15,"tag":59,"props":106,"children":107},{},[108,113,118],{"type":15,"tag":85,"props":109,"children":110},{},[111],{"type":20,"value":112},"Cursor",{"type":15,"tag":85,"props":114,"children":115},{},[116],{"type":20,"value":117},"Settings → Rules → User Rules",{"type":15,"tag":85,"props":119,"children":120},{},[121],{"type":20,"value":122},"文本框",{"type":15,"tag":59,"props":124,"children":125},{},[126,131,136],{"type":15,"tag":85,"props":127,"children":128},{},[129],{"type":20,"value":130},"Trae",{"type":15,"tag":85,"props":132,"children":133},{},[134],{"type":20,"value":135},"设置 → 个人规则",{"type":15,"tag":85,"props":137,"children":138},{},[139],{"type":20,"value":122},{"type":15,"tag":59,"props":141,"children":142},{},[143,148,153],{"type":15,"tag":85,"props":144,"children":145},{},[146],{"type":20,"value":147},"GitHub Copilot",{"type":15,"tag":85,"props":149,"children":150},{},[151],{"type":20,"value":152},"Settings → Personal Instructions",{"type":15,"tag":85,"props":154,"children":155},{},[156],{"type":20,"value":122},{"type":15,"tag":42,"props":158,"children":159},{},[],{"type":15,"tag":22,"props":161,"children":163},{"id":162},"常见规则类型",[164],{"type":20,"value":162},{"type":15,"tag":166,"props":167,"children":169},"h3",{"id":168},"_1-代码风格规则",[170],{"type":20,"value":171},"1. 代码风格规则",{"type":15,"tag":173,"props":174,"children":178},"pre",{"className":175,"code":176,"language":177,"meta":7,"style":7},"language-markdown shiki shiki-themes github-dark","# 代码风格\n- 使用 TypeScript，严格类型检查\n- 使用 ESLint + Prettier\n- 组件使用 Composition API\n- 优先使用 const，需要重新赋值时用 let\n","markdown",[179],{"type":15,"tag":94,"props":180,"children":181},{"__ignoreMap":7},[182,194,210,223,236],{"type":15,"tag":183,"props":184,"children":187},"span",{"class":185,"line":186},"line",1,[188],{"type":15,"tag":183,"props":189,"children":191},{"style":190},"--shiki-default:#79B8FF;--shiki-default-font-weight:bold",[192],{"type":20,"value":193},"# 代码风格\n",{"type":15,"tag":183,"props":195,"children":197},{"class":185,"line":196},2,[198,204],{"type":15,"tag":183,"props":199,"children":201},{"style":200},"--shiki-default:#FFAB70",[202],{"type":20,"value":203},"-",{"type":15,"tag":183,"props":205,"children":207},{"style":206},"--shiki-default:#E1E4E8",[208],{"type":20,"value":209}," 使用 TypeScript，严格类型检查\n",{"type":15,"tag":183,"props":211,"children":213},{"class":185,"line":212},3,[214,218],{"type":15,"tag":183,"props":215,"children":216},{"style":200},[217],{"type":20,"value":203},{"type":15,"tag":183,"props":219,"children":220},{"style":206},[221],{"type":20,"value":222}," 使用 ESLint + Prettier\n",{"type":15,"tag":183,"props":224,"children":226},{"class":185,"line":225},4,[227,231],{"type":15,"tag":183,"props":228,"children":229},{"style":200},[230],{"type":20,"value":203},{"type":15,"tag":183,"props":232,"children":233},{"style":206},[234],{"type":20,"value":235}," 组件使用 Composition API\n",{"type":15,"tag":183,"props":237,"children":239},{"class":185,"line":238},5,[240,244],{"type":15,"tag":183,"props":241,"children":242},{"style":200},[243],{"type":20,"value":203},{"type":15,"tag":183,"props":245,"children":246},{"style":206},[247],{"type":20,"value":248}," 优先使用 const，需要重新赋值时用 let\n",{"type":15,"tag":166,"props":250,"children":252},{"id":251},"_2-命名规范",[253],{"type":20,"value":254},"2. 命名规范",{"type":15,"tag":173,"props":256,"children":258},{"className":175,"code":257,"language":177,"meta":7,"style":7},"# 命名规范\n- 组件使用 PascalCase（如 UserProfile）\n- 函数使用 camelCase（如 getUserInfo）\n- 常量使用 UPPER_SNAKE_CASE\n- 文件使用 kebab-case\n",[259],{"type":15,"tag":94,"props":260,"children":261},{"__ignoreMap":7},[262,270,282,294,306],{"type":15,"tag":183,"props":263,"children":264},{"class":185,"line":186},[265],{"type":15,"tag":183,"props":266,"children":267},{"style":190},[268],{"type":20,"value":269},"# 命名规范\n",{"type":15,"tag":183,"props":271,"children":272},{"class":185,"line":196},[273,277],{"type":15,"tag":183,"props":274,"children":275},{"style":200},[276],{"type":20,"value":203},{"type":15,"tag":183,"props":278,"children":279},{"style":206},[280],{"type":20,"value":281}," 组件使用 PascalCase（如 UserProfile）\n",{"type":15,"tag":183,"props":283,"children":284},{"class":185,"line":212},[285,289],{"type":15,"tag":183,"props":286,"children":287},{"style":200},[288],{"type":20,"value":203},{"type":15,"tag":183,"props":290,"children":291},{"style":206},[292],{"type":20,"value":293}," 函数使用 camelCase（如 getUserInfo）\n",{"type":15,"tag":183,"props":295,"children":296},{"class":185,"line":225},[297,301],{"type":15,"tag":183,"props":298,"children":299},{"style":200},[300],{"type":20,"value":203},{"type":15,"tag":183,"props":302,"children":303},{"style":206},[304],{"type":20,"value":305}," 常量使用 UPPER_SNAKE_CASE\n",{"type":15,"tag":183,"props":307,"children":308},{"class":185,"line":238},[309,313],{"type":15,"tag":183,"props":310,"children":311},{"style":200},[312],{"type":20,"value":203},{"type":15,"tag":183,"props":314,"children":315},{"style":206},[316],{"type":20,"value":317}," 文件使用 kebab-case\n",{"type":15,"tag":166,"props":319,"children":321},{"id":320},"_3-注释规范",[322],{"type":20,"value":323},"3. 注释规范",{"type":15,"tag":173,"props":325,"children":327},{"className":175,"code":326,"language":177,"meta":7,"style":7},"# 注释规范\n- 函数必须添加 JSDoc 注释\n- 复杂逻辑需要行内注释\n- 使用中文注释\n",[328],{"type":15,"tag":94,"props":329,"children":330},{"__ignoreMap":7},[331,339,351,363],{"type":15,"tag":183,"props":332,"children":333},{"class":185,"line":186},[334],{"type":15,"tag":183,"props":335,"children":336},{"style":190},[337],{"type":20,"value":338},"# 注释规范\n",{"type":15,"tag":183,"props":340,"children":341},{"class":185,"line":196},[342,346],{"type":15,"tag":183,"props":343,"children":344},{"style":200},[345],{"type":20,"value":203},{"type":15,"tag":183,"props":347,"children":348},{"style":206},[349],{"type":20,"value":350}," 函数必须添加 JSDoc 注释\n",{"type":15,"tag":183,"props":352,"children":353},{"class":185,"line":212},[354,358],{"type":15,"tag":183,"props":355,"children":356},{"style":200},[357],{"type":20,"value":203},{"type":15,"tag":183,"props":359,"children":360},{"style":206},[361],{"type":20,"value":362}," 复杂逻辑需要行内注释\n",{"type":15,"tag":183,"props":364,"children":365},{"class":185,"line":225},[366,370],{"type":15,"tag":183,"props":367,"children":368},{"style":200},[369],{"type":20,"value":203},{"type":15,"tag":183,"props":371,"children":372},{"style":206},[373],{"type":20,"value":374}," 使用中文注释\n",{"type":15,"tag":166,"props":376,"children":378},{"id":377},"_4-框架偏好",[379],{"type":20,"value":380},"4. 框架偏好",{"type":15,"tag":173,"props":382,"children":384},{"className":175,"code":383,"language":177,"meta":7,"style":7},"# 框架偏好\n- 前端优先使用 Vue 3 + TypeScript\n- 后端优先使用 Node.js + Express\n- 样式优先使用 Tailwind CSS\n- 测试优先使用 Vitest\n",[385],{"type":15,"tag":94,"props":386,"children":387},{"__ignoreMap":7},[388,396,408,420,432],{"type":15,"tag":183,"props":389,"children":390},{"class":185,"line":186},[391],{"type":15,"tag":183,"props":392,"children":393},{"style":190},[394],{"type":20,"value":395},"# 框架偏好\n",{"type":15,"tag":183,"props":397,"children":398},{"class":185,"line":196},[399,403],{"type":15,"tag":183,"props":400,"children":401},{"style":200},[402],{"type":20,"value":203},{"type":15,"tag":183,"props":404,"children":405},{"style":206},[406],{"type":20,"value":407}," 前端优先使用 Vue 3 + TypeScript\n",{"type":15,"tag":183,"props":409,"children":410},{"class":185,"line":212},[411,415],{"type":15,"tag":183,"props":412,"children":413},{"style":200},[414],{"type":20,"value":203},{"type":15,"tag":183,"props":416,"children":417},{"style":206},[418],{"type":20,"value":419}," 后端优先使用 Node.js + Express\n",{"type":15,"tag":183,"props":421,"children":422},{"class":185,"line":225},[423,427],{"type":15,"tag":183,"props":424,"children":425},{"style":200},[426],{"type":20,"value":203},{"type":15,"tag":183,"props":428,"children":429},{"style":206},[430],{"type":20,"value":431}," 样式优先使用 Tailwind CSS\n",{"type":15,"tag":183,"props":433,"children":434},{"class":185,"line":238},[435,439],{"type":15,"tag":183,"props":436,"children":437},{"style":200},[438],{"type":20,"value":203},{"type":15,"tag":183,"props":440,"children":441},{"style":206},[442],{"type":20,"value":443}," 测试优先使用 Vitest\n",{"type":15,"tag":42,"props":445,"children":446},{},[],{"type":15,"tag":22,"props":448,"children":450},{"id":449},"个人规则-vs-项目规则",[451],{"type":20,"value":452},"个人规则 vs 项目规则",{"type":15,"tag":51,"props":454,"children":455},{},[456,477],{"type":15,"tag":55,"props":457,"children":458},{},[459],{"type":15,"tag":59,"props":460,"children":461},{},[462,467,472],{"type":15,"tag":63,"props":463,"children":464},{},[465],{"type":20,"value":466},"维度",{"type":15,"tag":63,"props":468,"children":469},{},[470],{"type":20,"value":471},"个人规则",{"type":15,"tag":63,"props":473,"children":474},{},[475],{"type":20,"value":476},"项目规则",{"type":15,"tag":78,"props":478,"children":479},{},[480,498,516,534,552],{"type":15,"tag":59,"props":481,"children":482},{},[483,488,493],{"type":15,"tag":85,"props":484,"children":485},{},[486],{"type":20,"value":487},"作用范围",{"type":15,"tag":85,"props":489,"children":490},{},[491],{"type":20,"value":492},"跨项目",{"type":15,"tag":85,"props":494,"children":495},{},[496],{"type":20,"value":497},"单个项目",{"type":15,"tag":59,"props":499,"children":500},{},[501,506,511],{"type":15,"tag":85,"props":502,"children":503},{},[504],{"type":20,"value":505},"存储位置",{"type":15,"tag":85,"props":507,"children":508},{},[509],{"type":20,"value":510},"工具设置中",{"type":15,"tag":85,"props":512,"children":513},{},[514],{"type":20,"value":515},"项目仓库中",{"type":15,"tag":59,"props":517,"children":518},{},[519,524,529],{"type":15,"tag":85,"props":520,"children":521},{},[522],{"type":20,"value":523},"是否版本管理",{"type":15,"tag":85,"props":525,"children":526},{},[527],{"type":20,"value":528},"否",{"type":15,"tag":85,"props":530,"children":531},{},[532],{"type":20,"value":533},"是",{"type":15,"tag":59,"props":535,"children":536},{},[537,542,547],{"type":15,"tag":85,"props":538,"children":539},{},[540],{"type":20,"value":541},"优先级",{"type":15,"tag":85,"props":543,"children":544},{},[545],{"type":20,"value":546},"低",{"type":15,"tag":85,"props":548,"children":549},{},[550],{"type":20,"value":551},"高",{"type":15,"tag":59,"props":553,"children":554},{},[555,560,565],{"type":15,"tag":85,"props":556,"children":557},{},[558],{"type":20,"value":559},"适合内容",{"type":15,"tag":85,"props":561,"children":562},{},[563],{"type":20,"value":564},"编码偏好",{"type":15,"tag":85,"props":566,"children":567},{},[568],{"type":20,"value":569},"技术栈、规范、禁止事项",{"type":15,"tag":571,"props":572,"children":573},"blockquote",{},[574],{"type":15,"tag":28,"props":575,"children":576},{},[577,582],{"type":15,"tag":34,"props":578,"children":579},{},[580],{"type":20,"value":581},"冲突时",{"type":20,"value":583},"：项目规则优先于个人规则。如果你的个人规则说\"用 ESLint\"，但项目规则说\"用 Biome\"，AI 会听项目规则。",{"type":15,"tag":42,"props":585,"children":586},{},[],{"type":15,"tag":22,"props":588,"children":590},{"id":589},"最佳实践",[591],{"type":20,"value":589},{"type":15,"tag":593,"props":594,"children":595},"ol",{},[596,609,621,631],{"type":15,"tag":597,"props":598,"children":599},"li",{},[600,602,607],{"type":20,"value":601},"规则要",{"type":15,"tag":34,"props":603,"children":604},{},[605],{"type":20,"value":606},"具体、可执行",{"type":20,"value":608},"（❌ \"注意代码质量\" ✅ \"所有函数必须有 JSDoc 注释\"）",{"type":15,"tag":597,"props":610,"children":611},{},[612,614,619],{"type":20,"value":613},"不超过 ",{"type":15,"tag":34,"props":615,"children":616},{},[617],{"type":20,"value":618},"30 行",{"type":20,"value":620},"（个人规则不需要太多）",{"type":15,"tag":597,"props":622,"children":623},{},[624,629],{"type":15,"tag":34,"props":625,"children":626},{},[627],{"type":20,"value":628},"定期更新",{"type":20,"value":630},"以适应新技术栈",{"type":15,"tag":597,"props":632,"children":633},{},[634],{"type":20,"value":635},"不要写和项目规则冲突的内容——项目规则优先",{"type":15,"tag":42,"props":637,"children":638},{},[],{"type":15,"tag":22,"props":640,"children":642},{"id":641},"常见问题",[643],{"type":20,"value":641},{"type":15,"tag":51,"props":645,"children":646},{},[647,663],{"type":15,"tag":55,"props":648,"children":649},{},[650],{"type":15,"tag":59,"props":651,"children":652},{},[653,658],{"type":15,"tag":63,"props":654,"children":655},{},[656],{"type":20,"value":657},"问题",{"type":15,"tag":63,"props":659,"children":660},{},[661],{"type":20,"value":662},"解决方案",{"type":15,"tag":78,"props":664,"children":665},{},[666,679,692,705],{"type":15,"tag":59,"props":667,"children":668},{},[669,674],{"type":15,"tag":85,"props":670,"children":671},{},[672],{"type":20,"value":673},"AI 忽略了我的规则",{"type":15,"tag":85,"props":675,"children":676},{},[677],{"type":20,"value":678},"检查规则是否太模糊，改用具体指令",{"type":15,"tag":59,"props":680,"children":681},{},[682,687],{"type":15,"tag":85,"props":683,"children":684},{},[685],{"type":20,"value":686},"个人规则和项目规则冲突",{"type":15,"tag":85,"props":688,"children":689},{},[690],{"type":20,"value":691},"项目规则优先级更高，调整个人规则",{"type":15,"tag":59,"props":693,"children":694},{},[695,700],{"type":15,"tag":85,"props":696,"children":697},{},[698],{"type":20,"value":699},"规则太多 AI 不遵守",{"type":15,"tag":85,"props":701,"children":702},{},[703],{"type":20,"value":704},"精简到 20 行以内，保留最关键的",{"type":15,"tag":59,"props":706,"children":707},{},[708,713],{"type":15,"tag":85,"props":709,"children":710},{},[711],{"type":20,"value":712},"不知道该写什么",{"type":15,"tag":85,"props":714,"children":715},{},[716],{"type":20,"value":717},"从命名规范和代码风格开始，逐步补充",{"type":15,"tag":719,"props":720,"children":721},"style",{},[722],{"type":20,"value":723},"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":212,"depth":212,"links":725},[726,727,728,734,735,736],{"id":24,"depth":196,"text":24},{"id":47,"depth":196,"text":47},{"id":162,"depth":196,"text":162,"children":729},[730,731,732,733],{"id":168,"depth":212,"text":171},{"id":251,"depth":212,"text":254},{"id":320,"depth":212,"text":323},{"id":377,"depth":212,"text":380},{"id":449,"depth":196,"text":452},{"id":589,"depth":196,"text":589},{"id":641,"depth":196,"text":641},"content:methodology:personal-rules.md","content","methodology\u002Fpersonal-rules.md","methodology\u002Fpersonal-rules","md",1777287374692]