trae-project-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTrae Project Setup
Trae Project Setup
本 Skill 用于快速生成 Trae 项目所需的规范化配置文件,帮助项目实现标准化开发流程。
This Skill is used to quickly generate standardized configuration files required for Trae projects, helping projects implement standardized development processes.
Trae 配置体系概述
Overview of Trae Configuration System
Trae 通过 目录管理项目配置,支持以下核心文件:
.trae| 文件路径 | 用途 | 优先级 |
|---|---|---|
| 用户偏好设置(语言、技术栈、交互风格) | 最高 |
| 项目特定规则(lint、typecheck、构建命令) | 高 |
| 自定义 Skill 目录 | 中 |
Trae manages project configurations through the directory and supports the following core files:
.trae| File Path | Purpose | Priority |
|---|---|---|
| User preference settings (language, tech stack, interaction style) | Highest |
| Project-specific rules (lint, typecheck, build commands) | High |
| Custom Skill directory | Medium |
快速开始
Quick Start
初始化项目配置
Initialize Project Configuration
运行初始化脚本,自动创建完整的 目录结构:
.traebash
python scripts/init_trae_project.py --path /path/to/project脚本会自动创建:
- - 用户偏好模板
.trae/USER_PREFERENCES.md - - 项目规则模板
.trae/rules/project_rules.md - - Skill 存放目录
.trae/Skills/
Run the initialization script to automatically create the complete directory structure:
.traebash
python scripts/init_trae_project.py --path /path/to/projectThe script will automatically create:
- - User preference template
.trae/USER_PREFERENCES.md - - Project rule template
.trae/rules/project_rules.md - - Skill storage directory
.trae/Skills/
验证项目配置
Verify Project Configuration
验证现有配置是否符合规范:
bash
python scripts/validate_trae_project.py --path /path/to/projectVerify whether the existing configuration conforms to the specifications:
bash
python scripts/validate_trae_project.py --path /path/to/project核心配置文件详解
Detailed Explanation of Core Configuration Files
USER_PREFERENCES.md
USER_PREFERENCES.md
用户偏好文件,定义全局行为模式。Trae 会在所有操作中优先遵循此文件的设置。
关键配置项:
markdown
undefinedUser preference file that defines global behavior patterns. Trae will prioritize the settings in this file in all operations.
Key configuration items:
markdown
undefinedUser Preferences
User Preferences
1. 技术栈偏好 (Tech Stack)
1. 技术栈偏好 (Tech Stack)
- CSS Framework: Tailwind CSS
- State Management: Zustand (React), Riverpod (Flutter)
- Testing: Vitest
- Language: TypeScript (Strict Mode)
- CSS Framework: Tailwind CSS
- State Management: Zustand (React), Riverpod (Flutter)
- Testing: Vitest
- Language: TypeScript (Strict Mode)
2. 交互风格 (Communication Style)
2. 交互风格 (Communication Style)
- Language: 中文回复,技术术语保留英文
- Detail Level: 资深开发者模式,直接给代码
- Emoji: 禁用
- Language: 中文回复,技术术语保留英文
- Detail Level: 资深开发者模式,直接给代码
- Emoji: 禁用
3. 角色覆盖 (Role Overrides)
3. 角色覆盖 (Role Overrides)
- @Backend Developer: 优先使用 FastAPI
- @Backend Developer: 优先使用 FastAPI
4. 禁令 (Constraints)
4. 禁令 (Constraints)
- 严禁使用 类型
any - 严禁创建 文件
.env
undefined- 严禁使用 类型
any - 严禁创建 文件
.env
undefinedproject_rules.md
project_rules.md
项目规则文件,定义项目特定的开发规范。
关键配置项:
markdown
undefinedProject rule file that defines project-specific development specifications.
Key configuration items:
markdown
undefinedProject Rules
Project Rules
构建与验证命令
构建与验证命令
- Lint: npm run lint
- TypeCheck: npm run typecheck
- Test: npm run test
- Build: npm run build
- Lint: npm run lint
- TypeCheck: npm run typecheck
- Test: npm run test
- Build: npm run build
代码规范
代码规范
- 函数注释: 必须添加函数级注释
- 语言: 中文注释,外链库需在中国可用
- 函数注释: 必须添加函数级注释
- 语言: 中文注释,外链库需在中国可用
Git 规范
Git 规范
- Commit: 遵循 Conventional Commits
- Branch: feature/, fix/, docs/*
undefined- Commit: 遵循 Conventional Commits
- Branch: feature/, fix/, docs/*
undefined创建新 Skill
Create New Skill
使用初始化脚本
Use Initialization Script
bash
python scripts/init_trae_skill.py <skill-name> --path .trae/Skillsbash
python scripts/init_trae_skill.py <skill-name> --path .trae/SkillsSkill 目录结构
Skill Directory Structure
skill-name/
├── SKILL.md # 必需:Skill 主文件
├── scripts/ # 可选:可执行脚本
├── references/ # 可选:参考文档
├── assets/ # 可选:资源文件
└── AGENTS.md # 可选:Agent 定义skill-name/
├── SKILL.md # 必需:Skill 主文件
├── scripts/ # 可选:可执行脚本
├── references/ # 可选:参考文档
├── assets/ # 可选:资源文件
└── AGENTS.md # 可选:Agent 定义SKILL.md 格式
SKILL.md Format
markdown
---
name: skill-name
description: Skill 描述,包含触发条件和使用场景
---markdown
---
name: skill-name
description: Skill 描述,包含触发条件和使用场景
---Skill Title
Skill Title
Overview
Overview
简要说明 Skill 功能
简要说明 Skill 功能
Workflow
Workflow
- 步骤一
- 步骤二
undefined- 步骤一
- 步骤二
undefinedAGENTS.md 格式
AGENTS.md Format
markdown
---
name: agent-name
description: Agent 描述
---markdown
---
name: agent-name
description: Agent 描述
---Agent Title
Agent Title
角色定义
角色定义
- 专长: 描述专业领域
- 风格: 描述工作风格
- 专长: 描述专业领域
- 风格: 描述工作风格
工作流程
工作流程
- 步骤一
- 步骤二
undefined- 步骤一
- 步骤二
undefined模板文件
Template Files
完整的模板文件存放在 目录:
templates/- - 用户偏好模板
USER_PREFERENCES.md.template - - 项目规则模板
project_rules.md.template - - Skill 模板
SKILL.md.template - - Agent 模板
AGENTS.md.template
The complete template files are stored in the directory:
templates/- - User preference template
USER_PREFERENCES.md.template - - Project rule template
project_rules.md.template - - Skill template
SKILL.md.template - - Agent template
AGENTS.md.template
参考文档
Reference Documents
详细规范请参阅:
- Trae 配置规范
- Skill 开发指南
For detailed specifications, please refer to:
- Trae Configuration Specification
- Skill Development Guide