乐于分享
好东西不私藏

精通 CursorRules:给你的 AI 助手戴上"紧箍咒",干活更得力!

精通 CursorRules:给你的 AI 助手戴上"紧箍咒",干活更得力!

引言:我的 AI 队友,有时像"猪队友"?

嘿,各位程序员兄弟姐妹们!自从有了 Cursor 这种 AI 神器,写代码是不是感觉像开了挂?嗖嗖的,效率倍儿增!但有时候吧,这位 AI 队友是不是也有点"放飞自我"?比如,你明明想让它改个 Bug,它却热情洋溢地帮你重构了半个项目;或者,你强调了八百遍要用 Tab 缩进,它偏偏跟你杠上了,坚持用空格... 这感觉,就像带了个天赋异禀但有点"野"的新人,潜力巨大,但得好好"调教"。

Hey, fellow code wranglers! Ever since AI marvels like Cursor landed, coding feels like having superpowers, right? Zoom zoom, productivity boost! But let's be real, doesn't this AI teammate sometimes go a bit... freestyle? Like, you ask it to fix a tiny bug, and it enthusiastically refactors half your project? Or you've hammered home the 'use Tabs for indentation' rule 800 times, and it stubbornly insists on spaces... It feels like mentoring a super-talented but slightly wild rookie – huge potential, but needs some serious "guidance."

这时候,CursorRules 闪亮登场!它可不是简单的配置文件,更像是你给 AI 助手量身定做的"行为规范手册",或者说是孙悟空头上的那个"紧箍咒"——当然,咱这是友好的、为了高效合作的"咒"。通过 CursorRules,你可以明确告诉 AI:"在我这儿,得按我的规矩来!" 从最初一个孤零零的 .cursorrules 文件,到现在更灵活、更强大的 .cursor/rules/ 目录结构,CursorRules 也在不断进化,让我们能更精细地"驯服"这头潜力无限的 AI 猛兽。这篇指南,就是要带你深入探索 CursorRules 的十八般武艺,从入门到精通,让你和 AI 的协作丝滑流畅,告别"猪队友"时刻!

That's where CursorRules makes its grand entrance! It's not just some boring config file; think of it as a custom "Code of Conduct" for your AI assistant, or maybe like the golden headband on Sun Wukong – but, you know, the friendly kind, for efficient teamwork. With CursorRules, you can clearly tell your AI, "Around here, we play by my rules!" From its humble beginnings as a single .cursorrules file to the more flexible and powerful .cursor/rules/ directory structure, CursorRules keeps evolving, allowing us to fine-tune this incredibly potential-packed AI beast. This guide is your deep dive into the martial arts of CursorRules, taking you from novice to master, making your AI collaboration silky smooth, and banishing those "pig teammate" moments for good!


第一部分:摸清门道——CursorRules 基础必知

1. 这"规矩"到底是啥玩意儿?

想象一下,你是个大导演,你的 AI 助手就是那个演技炸裂但偶尔即兴发挥过头的明星演员。CursorRules 就是你给这位演员的"剧本补充说明"和"导演阐述"。它告诉演员:"这场戏,你得这么演:语气要稳重,台词不能改,走位往这边……" 具体到代码世界,CursorRules 就是你给 AI 的一系列指令,告诉它:

Okay, picture this: you're a big-shot movie director, and your AI assistant is that super-talented star actor who occasionally goes way off-script with improvisation. CursorRules is like your "Director's Notes" and "Script Addendum" for this actor. It tells them, "For this scene, here's how you play it: tone should be serious, stick to the lines, hit your mark over here..." In the coding world, CursorRules are the set of instructions you give your AI, telling it things like:

  • • 项目背景板 (Project Context): "咱这项目用的是 React + TypeScript,后端是 Node.js,UI 库是 Ant Design,记住了啊!"
    • • "This project uses React + TypeScript, Node.js backend, and Ant Design for the UI library, got it?"
  • • 行为小贴士 (Behavioral Nudges): "生成代码注释要用 JSDoc 格式。" "遇到错误先别急着改,先分析根本原因。"
    • • "Generate code comments using JSDoc format." "When you hit an error, analyze the root cause before jumping to fixes."
  • • 纠错小黑板 (Error Correction Board): "上次让你用 lodash 你搞错了,记住,导入要用 import _ from 'lodash'; 这种方式。"
    • • "Last time you messed up using lodash, remember, import it like import _ from 'lodash;."
  • • 团队风向标 (Team Style Guide): "我们团队统一用 Prettier 格式化,缩进 2 空格,看到不一样的给我改过来!"
    • • "Our team uses Prettier for formatting, 2-space indentation. Fix anything that looks different!"

简单说,CursorRules 就是让 AI 更懂你、更懂项目、更符合团队规范的"说明书"。[1, 4]

In short, CursorRules is the "instruction manual" that makes your AI understand you, your project, and your team's standards better. [1, 4]

2. 全局 VS 项目:"家规"与"游戏规则"

写规矩的地方有两个,就像家里的"家规"和棋牌室里的"特定游戏规则":

You've got two main places to write these rules, kind of like "house rules" versus the "specific game rules" you have at the poker table:

  • • 全局规则 (Global Rules): 这就是你的"家规",写在 Cursor 的设置里 (Settings > General > Rules for AI)。这里的规矩对你所有的项目都生效。比如,"无论干啥,优先考虑代码可读性"这种普适原则,放这儿就挺好。但缺点是,它不够具体,没法针对某个项目的特殊要求。
    • • Global Rules: These are your "house rules," written in Cursor's settings (Settings > General > Rules for AI). Rules here apply to all your projects. Great for universal principles like, "Prioritize code readability above all else." The downside? It's not specific enough for the quirks of individual projects.
  • • 项目特定规则 (Project-Specific Rules): 这就是"游戏规则",只在当前项目里有效,能覆盖全局规则里的某些条款。以前是在项目根目录放一个 .cursorrules 文件,简单粗暴。但现在,Cursor 更推荐用新的方式(老方法未来可能不支持了哦):在项目根目录下创建一个 .cursor 文件夹,然后在里面再建个 rules 文件夹,最后把你的规则分门别类写在不同的 .mdc 文件里,比如 python.mdc 管 Python 的事,react.mdc 管 React 的事。[8] 这就像你把工具箱里的螺丝刀、扳手、锤子分门别类放在不同的小格子里,找起来是不是方便多了?
    • • Project-Specific Rules: These are the "game rules," only active within the current project, and they can override global rules. It used to be a single .cursorrules file in your project root – simple, maybe a bit messy. But now, Cursor recommends the new hotness (the old way might get retired!): create a .cursor folder in your project root, then a rules folder inside that, and finally, put your rules into different .mdc files, neatly categorized. For example, python.mdc handles Python stuff, react.mdc handles React stuff. [8] Think of it like organizing your toolbox: instead of tossing everything into one big box (.cursorrules), you have labeled drawers (.mdc files in .cursor/rules/) for screwdrivers, wrenches, hammers. Much easier to find what you need, right?

优先级 (Priority): 一般来说,项目特定规则的"威力"更大。如果全局规则说"用 4 空格缩进",但当前项目的规则文件里写了"用 2 空格缩进",那 AI 在这个项目里就会听项目规则的。当然,你得在全局设置里勾选"包含 .cursorrules 文件"(或者类似的新选项)来启用项目规则。[5]

Priority: Generally, project-specific rules pack more punch. If your global rules say "use 4 spaces for indentation," but the current project's rules say "use 2 spaces," the AI will listen to the project rules for this project. Of course, you need to make sure you've enabled project rules in your global settings (look for something like "include .cursorrules file" or the equivalent for the new system). [5]

3. 新手起步:写几条简单的试试水

刚开始别把自己搞太复杂。试试用大白话写几条基本规则,就当跟 AI 聊天呢:[4]

Don't overcomplicate things at first. Try writing a few basic rules in plain English, like you're just chatting with the AI: [4]

# .cursor/rules/general.mdc (或者旧的 .cursorrules 文件)## 通用礼节 (General Etiquette)- 优先保证代码简洁易懂。- 别搞过度设计,简单实用就好。- 给我解释代码的时候,说人话,别拽专业术语。## Code Style Basics- 缩进用 2 个空格,拜托了!- 文件末尾必须有一个空行。- 函数名用小驼峰命名法 (camelCase)。---# .cursor/rules/general.mdc (or the old .cursorrules file)## General Etiquette- Prioritize simple and understandable code.- Avoid over-engineering; keep it practical.- When explaining code to me, use plain language, ditch the jargon.## Code Style Basics- Use 2 spaces for indentation, please!- Files must end with a single newline.- Use camelCase for function names.

小贴士 (Tips):

  • • 具体点儿: "用合适的缩进"就不如"用 2 个空格缩进"来得明确。[4]
    • • Be Specific: "Use proper indentation" is less clear than "Use 2 spaces for indentation." [4]
  • • 说人话: 就用自然语言写,AI 能看懂。[4]
    • • Use Natural Language: Just write like you talk; the AI gets it. [4]
  • • 抓重点: 把最重要的规矩写在前面。[4]
    • • Prioritize: Put the most critical rules at the top. [4]
  • • 多试试: 用着用着你就会发现哪里还需要加规矩,随时更新就好。[4]
    • • Iterate: As you use it, you'll spot where more rules are needed. Just update them! [4]

第二部分:高手进阶——结构化你的"规矩",精准打击!

1. 告别大杂烩:拥抱 .cursor/rules/ 新结构

前面提到了,现在推荐用 .cursor/rules/ 目录来管理你的规则文件。这可不只是换个地方放文件那么简单,好处多多:[8]

As mentioned, the recommended way now is to use the .cursor/rules/ directory to manage your rule files. This isn't just about changing where files live; the benefits are real: [8]

  • • 模块化 (Modularity): 每个 .mdc 文件可以专注于一个特定领域(比如 Python 规范、React 组件写法、Git 提交信息格式等)。
    • • Each .mdc file can focus on a specific area (e.g., Python standards, React component patterns, Git commit message format).
  • • 清晰明了 (Clarity): 查找和修改特定规则变得更容易,不用在一大堆文字里大海捞针。
    • • Finding and modifying specific rules becomes much easier; no more digging through one massive file.
  • • 按需加载 (On-Demand Loading): 结合后面要讲的 RuleType,可以实现只在需要时加载相关规则,更高效。
    • • Combined with RuleType (discussed next), you can load rules only when they're relevant, making things more efficient.

想象一下,你的项目像个大厨房,.cursorrules 文件就像一个乱糟糟的抽屉,里面塞满了各种厨具。而 .cursor/rules/ 目录就像一个分类清晰的橱柜系统,刀具、锅碗、调料各有归属,井井有条。

Imagine your project is a big kitchen. The old .cursorrules file is like one messy drawer crammed with all sorts of utensils. The .cursor/rules/ directory is like a well-organized cabinet system: knives in one drawer (knife_rules.mdc), pots and pans in another (cookware_rules.mdc), spices on a rack (spice_rules.mdc). Everything is neat and tidy!

例子 (Example Structure):

.├── .cursor/│   └── rules/│       ├── general.mdc       # 通用规则 (Always on)│       ├── python.mdc        # Python 相关 (Loads for .py files)│       ├── react.mdc         # React 相关 (Loads for .jsx, .tsx files)│       ├── database.mdc      # 数据库操作相关 (Maybe always on or specific types)│       └── git.mdc           # Git 提交规范 (Always on?)├── src/│   └── ...└── requirements.txt

2. 指哪打哪:玩转规则类型 (RuleType)

光把规则分文件还不够,我们还得告诉 Cursor 什么时候用哪些规则。这时候 RuleType 就派上用场了(这个配置通常写在 .mdc 文件的开头,用类似 YAML front matter 的格式)。[8]

Just splitting rules into files isn't enough; we need to tell Cursor when to use which rules. That's where RuleType comes in (this configuration is usually placed at the beginning of your .mdc file, often using YAML front matter). [8]

  • • Always: 这类规则是"万金油",无论你打开什么文件,它都默默生效。适合放项目总体介绍、通用编码哲学、Git 规范这种"普世价值"。
    • • Always: These rules are the "universal constants." No matter what file you open, they're active. Perfect for general project introductions, core coding philosophies, Git standards – things that always apply.
  • • Auto Attached: 这类规则是"专科医生",只有当你打开特定类型的文件时,它才会被激活。比如,你可以设置 python.mdc 只在编辑 .py 文件时加载,react.mdc 只在编辑 .jsx 或 .tsx 文件时加载。这能确保 AI 在处理特定语言或框架时,能得到最相关的指导,同时也避免了不相关规则的干扰。
    • • Auto Attached: These are the "specialists." They only activate when you open a specific type of file. For instance, you can set python.mdc to load only when editing .py files, and react.mdc only for .jsx or .tsx files. This ensures the AI gets the most relevant guidance for the specific language or framework you're working with, without being distracted by irrelevant rules.

配置示例 (Configuration Example in .mdc):

---RuleType:Always---# general.mdc# 这个规则文件将始终被加载# This rule file will always be loaded你是一个乐于助人且有点幽默感的AI编程助手。YouareahelpfulandslightlyhumorousAIcodingassistant.项目技术栈:Python(Flask),PostgreSQL,React,TailwindCSSProject Tech Stack:Python(Flask),PostgreSQL,React,TailwindCSS
---RuleType:AutoAttachedFileTypes: ["*.py"]---# python.mdc# 只有在打开 .py 文件时加载# Only loaded when opening .py filesPython版本是3.10。请使用f-string进行字符串格式化。Pythonversionis3.10.Pleaseusef-stringsforstringformatting.遵循PEP8规范,特别是每行不超过79个字符的建议(虽然我知道这很难)。FollowPEP8guidelines,especiallythe79-characterlinelimit(thoughIknowit'stough).

工作流程图 (Workflow Diagram - Mermaid):

这个图大概意思就是:打开一个 .py 文件?好的,把通用规则 (general.mdc) 和 Python 专属规则 (python.mdc) 都给 AI 看。打开 .jsx 文件?那就通用规则加 React 规则。其他文件?就只看通用规则。这样是不是很智能?

This diagram roughly means: Opening a .py file? Okay, feed the AI both the general rules (general.mdc) and the Python-specific rules (python.mdc). Opening a .jsx file? Then it's general plus React rules. Any other file? Just the general rules apply. Pretty smart, huh?

3. 不止代码风格:喂给 AI 更深度的"料" 

CursorRules 的强大之处在于,它不光能管代码风格这种"表面功夫",更能给 AI 提供深层次的项目理解力。就像你要让演员演好一个角色,光告诉他"要帅"是不够的,你得给他看剧本、讲人物小传、分析角色内心世界。[1, 5]

The real power of CursorRules lies in its ability to go beyond superficial "style points" and provide the AI with a deeper understanding of the project. Just like telling an actor "look cool" isn't enough to get a great performance, you need to give them the script, character background, and analyze their inner world. [1, 5]

  • • 技术栈与架构"全家桶" (The Full Tech Stack & Architecture Meal): 别只说用了啥语言框架,可以提一提关键的设计模式(比如"我们这里重度使用策略模式")、重要的架构决策("数据库读写分离,注意区分")、核心库的特定用法("处理日期必须用 dayjs,别用 moment")。
    • • Don't just list the language/framework. Mention key design patterns ("We heavily use the Strategy pattern here"), important architectural decisions ("Read/write split for the database, pay attention"), specific ways to use core libraries ("Must use dayjs for dates, not moment").
  • • 领域知识"扫盲" (Domain Knowledge "Crash Course"): 如果你的项目涉及特定行业(比如金融、医疗),用几句话给 AI 科普一下核心业务概念、常用术语缩写。这样 AI 生成的代码和注释才能更"行内"。比如:"在这个电商项目里,SKU 指的是最小存货单位,和 SPU(标准化产品单元)不同,别搞混了。"
    • • If your project is in a specific industry (like finance or healthcare), give the AI a quick primer on core business concepts and common acronyms. This helps it generate code and comments that sound more "insider." Example: "In this e-commerce project, SKU means Stock Keeping Unit, distinct from SPU (Standard Product Unit), don't mix them up."
  • • "踩坑实录"与"经验分享" (Pitfall Diary & Experience Sharing): 这就是 .cursorrules 文件里提到的 Lessons 部分的精髓!把你或团队踩过的坑、总结出的经验教训、特定库的 workarounds 都写进去。比如:"注意!这个第三方 API 有个 bug,查询时 page 参数从 0 开始而不是 1。" "处理用户上传的图片,一定要先压缩再存储,用这个 compress_image 函数。" 这能有效避免 AI 重蹈覆辙。[1]
    • • This is the essence of the Lessons section mentioned in .cursorrules files! Write down the pitfalls you or your team have encountered, lessons learned, and workarounds for specific libraries. Example: "Warning! This third-party API has a bug; the page parameter starts from 0, not 1." "When handling user-uploaded images, always compress before storing, use this compress_image function." This effectively prevents the AI from repeating past mistakes. [1]
  • • 工具链与环境"备忘录" (Toolchain & Environment "Memo"): 提一下项目用的构建工具 (Webpack/Vite)、包管理器 (npm/yarn/pnpm)、测试框架 (Jest/Pytest)、代码检查工具 (ESLint/Flake8) 等,以及它们的重要配置。比如:"ESLint 配置了不允许 console.log,调试时请用 debugger。"
    • • Mention the build tools (Webpack/Vite), package managers (npm/yarn/pnpm), testing frameworks (Jest/Pytest), linters (ESLint/Flake8), and any important configurations. Example: "ESLint is configured to disallow console.log; use debugger for debugging."

给 AI 的"料"越足,它就越能像个真正的资深队友一样思考和行动。

The more "intel" you feed the AI, the more it can think and act like a genuinely senior teammate.


第三部分:融会贯通——最佳实践与独门绝技

1. 写好"规矩"的武林秘籍

想让你的 CursorRules 发挥最大威力?光知道怎么写还不够,得讲究策略和技巧:[4, 8]

  1. 1. 持续进化,拒绝僵化 : 你的项目在变,团队规范在变,你对 AI 的期望也在变。所以,别把规则写死,要定期回顾、测试、优化。发现 AI 哪里做得不好,或者有了新想法,就去更新你的 .mdc 文件。把它当成一个活的文档。
  2. 2. 松紧适度,方为大师 : 规矩太松,AI 可能还是乱跑;规矩太死,又可能扼杀它的创造力,或者在遇到规则没覆盖到的新情况时束手无策。要找到那个平衡点:给出明确的核心原则和底线,但在具体实现上留有一定的灵活性。
  3. 3. "少说多做",上示例! : 空泛的描述不如一个具体的例子来得直接。想让 AI 遵循某种代码模式?贴一小段你期望的代码片段。想让它按特定格式写注释?给个 JSDoc 的例子。
  4. 4. 保持队形,别内讧 : 检查你的规则,确保它们内部以及不同规则文件之间没有自相矛盾的地方。比如,一个文件里说用单引号,另一个文件里说用双引号,AI 就懵了。
  5. 5. 纳入版本控制,利于协作 : 把 .cursor/rules/ 目录加到你的 Git 仓库里!这样不仅能追踪规则的修改历史,还能方便团队成员共享、讨论和维护同一套标准。这对于团队协作至关重要。
  6. 6. 团队布道,达成共识 : 如果是团队项目,光你自己用一套规则还不够。要和团队成员沟通,共同制定或采纳一套 CursorRules 标准,并确保大家都理解并愿意遵守。可以指定专人维护,或者定期开会讨论更新。

Want your CursorRules to reach their full potential? Knowing how to write them isn't enough; you need strategy and finesse: [4, 8]

  1. 1. Iterate, Don't Stagnate: Your project changes, team standards evolve, and your expectations for the AI shift. So, don't treat rules as set in stone. Regularly review, test, and refine them. If you notice the AI falling short or you have new ideas, update your .mdc files. Treat them like living documents.
  2. 2. Balance Guidance and Freedom: Rules too loose? The AI might still run wild. Rules too strict? You might stifle its creativity or leave it helpless when facing situations your rules don't cover. Find the balance: provide clear core principles and boundaries but allow some flexibility in implementation.
  3. 3. "Show, Don't Just Tell" – Use Examples!: Vague descriptions are less effective than concrete examples. Want the AI to follow a certain code pattern? Paste a small snippet of the desired code. Want comments in a specific format? Provide a JSDoc example.
  4. 4. Consistency is Key: Check your rules to ensure there are no contradictions within them or between different rule files. For example, one file saying use single quotes and another saying use double quotes will just confuse the AI.
  5. 5. Version Control for the Win: Add your .cursor/rules/ directory to your Git repository! This not only tracks the history of rule changes but also makes it easy for team members to share, discuss, and maintain the same standards. Crucial for team collaboration.
  6. 6. Team Buy-in and Standardization: If it's a team project, having your own set of rules isn't enough. Communicate with your team to jointly develop or adopt a standard set of CursorRules, ensuring everyone understands and agrees to follow them. You could assign maintainers or have regular meetings to discuss updates.

2. 给 AI 开"外挂":@Docs 的神秘力量

有时候,光靠规则里的文字还不够,AI 可能需要参考更详尽的外部资料,比如项目的 README、某个库的官方文档、甚至是一篇解释复杂算法的 PDF 论文。这时候,Cursor 的 @Docs 功能就派上用场了![1, 3]

Sometimes, the text within your rules isn't enough. The AI might need to consult more detailed external materials, like the project's README, the official docs for a library, or even a PDF paper explaining a complex algorithm. That's where Cursor's @Docs feature comes to the rescue! [1, 3]

它的工作流程大概是这样:

  1. 1. 准备"教材" : 如果是 PDF,先用工具(比如 Marker [3])把它转换成 Markdown 格式。如果是网页文档,复制关键内容。如果是代码仓库,可以提取 README 或其他关键的 Markdown 文件。
  2. 2. 上传到"云书架" : 把准备好的 Markdown 内容粘贴到一个公开的 GitHub Gist 里。[3] Gist 就像一个简单的代码片段分享服务。
  3. 3. 在 Cursor 里"登记入学" : 在 Cursor 里找到添加文档的功能(通常在聊天框输入 @Docs 会有提示),选择"添加新文档",给它起个名字,把 Gist 的链接(通常是 HTTPS 克隆链接)粘贴进去,然后让 Cursor 索引它。[3]
  4. 4. 在规则或提问中"召唤" : 现在,你可以在 CursorRules 文件里,或者直接在聊天提问时,使用 @Doc <你起的名字> 来引用这份文档了![3] 比如,你可以在规则里写:"生成用户认证相关代码时,请务必参考 @Doc AuthGuide 文档里的流程。" 或者直接问:"@Doc MyAPISpec,根据这份文档,给我写一个调用 /users/{id} 端点的函数。"

The workflow generally looks like this:

  1. 1. Prepare the "Textbook": If it's a PDF, first convert it to Markdown using a tool (like Marker [3]). If it's web documentation, copy the key content. If it's a code repository, you might extract the README or other crucial Markdown files.
  2. 2. Upload to the "Cloud Bookshelf": Paste the prepared Markdown content into a public GitHub Gist. [3] Gist is like a simple code snippet sharing service.
  3. 3. Register it in Cursor: Find the "Add Documentation" feature in Cursor (typing @Docs in the chat usually prompts it), choose "Add new doc," give it a name, paste the Gist link (usually the HTTPS clone URL), and let Cursor index it. [3]
  4. 4. Summon it in Rules or Prompts: Now, you can reference this document within your CursorRules file or directly in your chat prompts using @Doc ! [3] For instance, in your rules: "When generating user authentication code, you must refer to the process in the @Doc AuthGuide document." Or ask directly: "@Doc MyAPISpec, based on this document, write me a function to call the /users/{id} endpoint."

这样一来,AI 就能利用这些外部知识库,提供更精准、更符合项目实际的帮助了。是不是很酷?

This way, the AI can leverage these external knowledge bases to provide much more accurate and project-relevant assistance. Cool, right?

3. 让 AI 学会"思考":探索"计划-执行"模式

这部分稍微有点超前,更像是对未来可能性的一种探索。社区里有些大神(比如 devin.cursorrules [10])在尝试通过 CursorRules 引导 AI 进行更复杂的任务规划和执行,有点像让 AI 具备初步的"计划-执行"能力。

This part is a bit more advanced, more like exploring future possibilities. Some wizards in the community (like those behind devin.cursorrules [10]) are experimenting with using CursorRules to guide the AI through more complex task planning and execution, kind of giving it rudimentary "plan-and-execute" capabilities.

想象一下,你不是直接告诉 AI "修复这个 Bug",而是在规则里定义一个大致的"Debug 工作流":Imagine, instead of directly telling the AI "Fix this bug," you define a rough "Debugging Workflow" in your rules:

# 实验性规则 (Experimental Rule)当你被要求修复一个 Bug 时,请遵循以下步骤:When asked to fix a bug, follow these steps:1.理解问题 (Understand): 仔细阅读 Bug 描述和相关代码,复述你对问题的理解。2.分析原因 (Analyze): 提出至少两种可能的根本原因。3.制定计划 (Plan): 描述你打算如何验证这些原因,并给出修复方案。4.请求确认 (Confirm): 在动手修改前,向我确认你的计划。5.执行修复 (Execute): 实施修复。6.解释说明 (Explain): 解释你做了哪些修改以及为什么。

这种方式尝试引导 AI 像人类开发者一样,更有条理地解决复杂问题。当然,目前这更多的是一种提示工程(Prompt Engineering)的延伸,效果依赖于 AI 模型的理解能力和规则的巧妙设计,还不算是 Cursor 的标准功能,但它展示了 CursorRules 的巨大潜力——不仅仅是约束,更是赋能![1]

This approach tries to guide the AI to solve complex problems more systematically, like a human developer. Of course, currently, this is more an extension of Prompt Engineering; its effectiveness depends heavily on the AI model's understanding and the cleverness of your rule design. It's not exactly a standard Cursor feature yet, but it showcases the immense potential of CursorRules – not just for constraint, but for empowerment! [1]


第四部分:江湖路远——社区资源与未来展望

1. 独乐乐不如众乐乐:拥抱社区力量

写 CursorRules 遇到瓶颈?想看看别人是怎么玩的?别担心,你不是一个人在战斗!Cursor 社区非常活跃,有很多地方可以找到灵感和帮助:[4, 7]

Hitting a wall writing CursorRules? Curious how others are doing it? Don't worry, you're not alone! The Cursor community is vibrant, and there are plenty of places to find inspiration and help: [4, 7]

  • • Cursor 官方论坛 (Cursor Community Forum): 这是宝藏库!有专门的板块讨论和分享 .cursorrules 文件和新的 .cursor/rules/ 用法。你能找到各种项目的规则示例,从 Web 开发到数据科学,应有尽有。[2, 9, 11]
    • • This is a treasure trove! There are dedicated sections for discussing and sharing .cursorrules files and the new .cursor/rules/ usage. You can find rule examples for all sorts of projects, from web dev to data science. [2, 9, 11]
  • • GitHub: 直接在 GitHub 搜索 cursorrules 或者包含 .cursor/rules/ 的项目,你会发现很多开发者公开了他们的规则配置,是非常好的学习材料。[6]
    • • Simply search GitHub for cursorrules or projects containing .cursor/rules/. Many developers share their rule configurations publicly – great learning material! [6]
  • • 博客和教程网站 (Blogs and Tutorial Sites): 像 Cursor 101 [4] 或者一些技术博客(比如 Learn Blockchain 上的文章 [1])也会分享 CursorRules 的使用技巧和最佳实践。
    • • Sites like Cursor 101 [4] or tech blogs (like the article on Learn Blockchain [1]) often share tips and best practices for using CursorRules.

多看看别人的实践,借鉴好的点子,然后结合自己的项目需求进行改造。也别忘了把你觉得写得不错的规则分享出来,互相学习,共同进步嘛!

Check out how others do it, borrow good ideas, and adapt them to your own project needs. And don't forget to share the rules you're proud of – learning from each other helps everyone level up!

2. 未来可期:CursorRules 的星辰大海

CursorRules 作为连接人与 AI 的桥梁,其潜力远未完全发掘。我们可以畅想一下未来的可能性:

As the bridge connecting humans and AI in code generation, CursorRules' potential is far from fully tapped. Let's dream a little about future possibilities:

  • • 更智能的规则逻辑 (Smarter Rule Logic): 也许未来规则能支持条件判断(if/else),或者能根据项目上下文动态调整优先级?
    • • Maybe future rules could support conditional logic (if/else) or dynamically adjust priority based on project context?
  • • 更丰富的规则类型 (Richer Rule Types): 除了 Always 和 Auto Attached,会不会有更细粒度的触发方式?比如基于函数签名、代码复杂度等?
    • • Beyond Always and Auto Attached, could there be more granular triggers? Based on function signatures, code complexity, etc.?
  • • 与工具链更深度集成 (Deeper Toolchain Integration): 规则能否直接调用 Linter 进行检查,或者根据测试框架的输出来调整行为?
    • • Could rules directly invoke linters for checks or adjust behavior based on test framework output?

不管未来如何,CursorRules 已经在改变我们与 AI 协作的方式。它让我们从被动接受 AI 的建议,转向主动引导和塑造 AI 的行为,使 AI 真正成为我们可控、可靠、高效的编程伙伴。

Whatever the future holds, CursorRules is already changing how we collaborate with AI. It shifts us from passively accepting AI suggestions to actively guiding and shaping AI behavior, making AI truly a controllable, reliable, and efficient coding partner.


结语:给你的 AI 装上"导航",出发!

好了,关于 CursorRules 的深度游就到这里了。希望这趟旅程让你对如何"调教"你的 AI 助手有了更深的理解和更多的骚操作思路。

Alright, that's our deep dive into CursorRules wrapped up. Hopefully, this journey has given you a deeper understanding and more nifty ideas on how to "train" your AI assistant.

精通 CursorRules 的核心价值是什么?What's the core value of mastering CursorRules?

  • • 效率起飞 (Efficiency Takes Off): 减少 AI 的"废话"和"跑偏",让它更快、更准地给到你想要的东西。
    • • Less "nonsense" and "detours" from the AI, getting you what you need faster and more accurately.
  • • 质量保障 (Quality Assurance): 确保 AI 生成的代码符合项目规范和团队标准,减少后续修改成本。
    • • Ensuring AI-generated code meets project specifications and team standards, reducing rework later.
  • • 体验定制 (Customized Experience): 把 AI 调教成最懂你的那个"它",让编程体验更顺心。
    • • Tuning the AI to be the "one" that understands you best, making the coding experience smoother.

别犹豫了,现在就动手,打开你的项目,开始捣鼓你的 .cursor/rules/ 目录吧!从简单的规则开始,不断迭代,你会发现,那个曾经有点"野"的 AI 队友,也能变成配合默契的"神队友"。记住,持续学习,关注社区,你的 AI 调教之旅,才刚刚开始!祝编码愉快!

Don't hesitate! Open your project right now and start tinkering with your .cursor/rules/ directory. Begin with simple rules, iterate constantly, and you'll find that the once slightly "wild" AI teammate can become a remarkably synergistic "god-tier teammate." Remember, keep learning, stay connected with the community – your AI training journey has just begun! Happy coding!


参考资料

  1. 1. 最大化Cursor 使用:高级提示、Cursor 规则与工具集成 - 登链社区 (learnblockchain.cn) - https://learnblockchain.cn/article/11065
  2. 2. Good examples of .cursorrules file? - Discussion - Cursor - Community Forum - https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346
  3. 3. 最大化Cursor 使用:高级提示、Cursor 规则与工具集成 (PDF/Gist 部分) - 登链社区 (learnblockchain.cn) - https://learnblockchain.cn/article/11065
  4. 4. Cursor Rules: Customizing AI Behavior for Personalized Coding - Cursor 101 - https://cursor101.com/article/cursor-rules-customizing-ai-behavior
  5. 5. Cursor Rules: Customizing AI Behavior (全局/项目规则部分) - Cursor 101 - https://cursor101.com/article/cursor-rules-customizing-ai-behavior
  6. 6. GitHub 搜索结果 (例如 kinopeee/cursorrules) - https://github.com/kinopeee/cursorrules (作为社区示例来源的代表)
  7. 7. Cursor Rules: Customizing AI Behavior (社区资源部分) - Cursor 101 - https://cursor101.com/article/cursor-rules-customizing-ai-behavior
  8. 8. Cursor Rules 最佳实践总结 - 53AI知识库 - https://www.53ai.com/news/finetuning/2025032489061.html (重点参考了 .cursor/rules/ 结构和 RuleType 的实践)
  9. 9. How to create a good cursor rule for our project? - Discussion - Cursor - Community Forum - https://forum.cursor.com/t/how-to-create-a-good-cursor-rule-for-our-project/18247
  10. 10. devin.cursorrules GitHub 仓库 (作为 Plan-and-Execute 模式示例的参考) - https://github.com/grapeot/devin.cursorrules/blob/master/.cursorrules
  11. 11. Definitive Rules - Discussion - Cursor - Community Forum - https://forum.cursor.com/t/definitive-rules/45282
基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-06 11:49:06 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/713584.html
  2. 运行时间 : 0.126555s [ 吞吐率:7.90req/s ] 内存消耗:4,962.15kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d9f003567a16899564c1a758a2053697
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000701s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000804s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000346s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000306s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000469s ]
  6. SELECT * FROM `set` [ RunTime:0.000207s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000551s ]
  8. SELECT * FROM `article` WHERE `id` = 713584 LIMIT 1 [ RunTime:0.001963s ]
  9. UPDATE `article` SET `lasttime` = 1780717746 WHERE `id` = 713584 [ RunTime:0.000841s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000211s ]
  11. SELECT * FROM `article` WHERE `id` < 713584 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000394s ]
  12. SELECT * FROM `article` WHERE `id` > 713584 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000339s ]
  13. SELECT * FROM `article` WHERE `id` < 713584 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002751s ]
  14. SELECT * FROM `article` WHERE `id` < 713584 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005888s ]
  15. SELECT * FROM `article` WHERE `id` < 713584 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.006651s ]
0.130973s