中文 | English
这是一个关于 Trae IDE 智能体规则配置的学习项目,旨在通过标准化、结构化的规则定义,提升 AI 辅助编程的效率与准确性。
本项目是我 (@Cooper-X-Oak) 的学习之作。内容深受开源社区 Agent Rules 相关项目的启发,在此基础上进行了重构、汉化和定制,以适应 Trae IDE 的工作流。
本项目对 Agent Rules 进行了深度的标准化和结构化改造,主要特点如下:
-
自我指向的递归进化 (Self-Referential Evolution)
- 核心哲学:本项目构建了一个“自我指向”的文档系统,即利用规则系统本身来规范和完善规则的制定。
- 极致精简:采用
Key:Value键值对格式,摒弃冗长描述,实现 Token 的最大化利用。 - 强指令约束:使用
MUST,NEVER,REQUIRED等关键词,降低理解歧义。
-
智能生效模式 (Smart Triggering)
alwaysApply: true: 全局生效(如中文交互规范)。globs: "*.md": 基于文件路径自动匹配生效。description: "...": 基于语义场景智能触发。
-
标准化分类命名 (Standardized Categories)
- 所有规则文件采用
Category-功能名称.md格式,分类清晰(Global/Core/Docs/Tech/Tools)。
- 所有规则文件采用
所有规则文件均位于 TRAERULES/ 目录下,采用扁平化管理。新版架构引入了元规则(Meta-Rules)来增强系统的自我管理能力:
_Meta-规则架构标准.md: [核心元规则] 定义了所有规则必须遵循的宪法级标准(替代了旧版的RULEOFRULES.md)。_Meta-规则索引专家.md: [索引与引导] 全局规则索引,负责根据用户意图引导加载特定的领域规则。- Core (核心类)
Core-中文交互规范.md: 全局语言约束,确保中文回复。Core-Bug修复专家.md: 标准化 Bug 修复流程。Core-技术实现架构师.md: 代码实现与架构设计。- ... (全视角审查、根因分析等)
- Docs (文档类)
Docs-技术文档工程师.md: 编写技术文档。Docs-版本日志管理员.md: 维护 CHANGELOG.md。- ... (文档维护、上下文引导等)
- Tech (技术栈类)
Tech-现代Swift专家.md: Swift 开发规范。Tech-浏览器自动化工程师.md: 浏览器自动化开发。
- Tools (工具类)
Tools-Github项目管家.md: Github 项目管理。Tools-GitCommit专家.md: 规范化 Git 提交。Tools-脚本工具规范.md: [NEW] 规范临时脚本的创建与管理。- ... (MCP配置、系统可视化等)
本仓库只包含整理好的规则文件,不包含 Trae 的项目配置或原始素材。
git clone https://github.com/Cooper-X-Oak/trae-agent-rules.git- 在你的 Trae 项目根目录下,创建
.trae/rules/文件夹。 - 将
TRAERULES文件夹中的所有.md文件复制到.trae/rules/目录下。 - 重要:确保
_Meta-规则架构标准.md、_Meta-规则索引专家.md和Core-中文交互规范.md被包含在内,以保证基础体验。
在 Trae 中打开任意文件或进行对话,AI 将根据当前的上下文(文件类型或你的问题)自动加载相应的规则。例如,询问“项目结构”时应触发 Docs-项目上下文引导员。
欢迎提交 Issue 或 Pull Request 来改进规则库!
- Fork 本仓库。
- 创建特性分支 (
git checkout -b feature/AmazingRule). - 按照
_Meta-规则架构标准.md的标准编写新规则。 - 提交更改 (
git commit -m 'feat: Add AmazingRule'). - 推送到分支 (
git push origin feature/AmazingRule). - 提交 Pull Request。
Created with ❤️ by Cooper-X-Oak using Trae IDE
中文 | English
This is a learning project about Trae IDE agent rule configuration, aiming to improve the efficiency and accuracy of AI-assisted programming through standardized and structured rule definitions.
This project is a learning work by me (@Cooper-X-Oak). The content is deeply inspired by Agent Rules related projects in the open-source community, and has been refactored, localized, and customized to fit the Trae IDE workflow.
This project has undergone deep standardization and structural transformation of Agent Rules. Key features include:
-
Self-Referential Evolution
- Core Philosophy: This project builds a "self-referential" documentation system, meaning it uses the rule system itself to regulate and improve rule creation.
- Extreme Minimalism: Adopts
Key:Valueformat, discarding verbose descriptions to maximize Token utilization. - Strong Constraint Directives: Uses keywords like
MUST,NEVER,REQUIREDto reduce ambiguity.
-
Smart Triggering
alwaysApply: true: Globally effective (e.g., Language Constraint).globs: "*.md": Automatically triggered based on file paths.description: "...": Intelligently triggered based on semantic context.
-
Standardized Categories
- All rule files follow the
Category-FeatureName.mdformat with clear classification (Global/Core/Docs/Tech/Tools).
- All rule files follow the
All rule files are located in the TRAERULES_EN/ directory (for English version), managed in a flat structure. The new architecture introduces Meta-Rules to enhance the system's self-management capabilities:
_Meta-RulesArchStandard.md: [Core Meta-Rule] Defines the constitutional standards that all rules must follow (Replaces the oldRULEOFRULES.md)._Meta-RulesIndexExpert.md: [Index & Guide] Global rule index, responsible for guiding the loading of specific domain rules based on user intent.- Core
Core-LanguageConstraint.md: Global language constraint (Enforces English).Core-BugFixExpert.md: Standardized Bug fix process.Core-TechImplementationArchitect.md: Code implementation and architecture design.- ... (Comprehensive Review, Root Cause Analysis, etc.)
- Docs
Docs-TechWriter.md: Writes technical documentation.Docs-ChangelogManager.md: Maintains CHANGELOG.md.- ... (Doc Maintainer, Context Guide, etc.)
- Tech
Tech-ModernSwiftExpert.md: Swift development standards.Tech-BrowserAutomationEng.md: Browser automation development.
- Tools
Tools-GithubProjectManager.md: Github project management.Tools-GitCommitExpert.md: Standardized Git commits.Tools-ScriptToolSpec.md: [NEW] Standardize temporary script management.- ... (MCP Config, System Visualization, etc.)
This repository only contains the organized rule files and does not include Trae's project configuration or raw materials.
git clone https://github.com/Cooper-X-Oak/trae-agent-rules.git- In your Trae project root directory, create a
.trae/rules/folder. - Copy all
.mdfiles from theTRAERULES_ENfolder to the.trae/rules/directory. - Important: Ensure
_Meta-RulesArchStandard.md,_Meta-RulesIndexExpert.mdandCore-LanguageConstraint.mdare included to guarantee the basic experience.
Open any file or start a conversation in Trae. The AI will automatically load the corresponding rules based on the current context (file type or your question). For example, asking about "project structure" should trigger Docs-ProjectContextGuide.
Issues and Pull Requests are welcome to improve the rule library!
- Fork this repository.
- Create a feature branch (
git checkout -b feature/AmazingRule). - Write a new rule following the standard in
RULEOFRULES.md. - Commit changes (
git commit -m 'feat: Add AmazingRule'). - Push to branch (
git push origin feature/AmazingRule). - Submit a Pull Request.
Created with ❤️ by Cooper-X-Oak using Trae IDE