This Skill is used to quickly generate the standardized configuration files required for a Trae project, helping the project achieve a standardized development workflow.
Overview of the Trae Configuration System
Trae manages project configuration through the .trae directory, supporting the following core files:
| File Path | Purpose | Priority |
|---|---|---|
.trae/USER_PREFERENCES.md |
User preferences (language, tech stack, interaction style) | Highest |
.trae/rules/project_rules.md |
Project-specific rules (lint, typecheck, build commands) | High |
.trae/Skills/ |
Custom Skill directory | Medium |
Quick Start
Initialize Project Configuration
Run the initialization script to automatically create the complete .trae directory structure:
python scripts/init_trae_project.py --path /path/to/project
The script will automatically create:
.trae/USER_PREFERENCES.md- User preferences template.trae/rules/project_rules.md- Project rules template.trae/Skills/- Skill storage directory
Validate Project Configuration
Validate whether the existing configuration complies with the specification:
python scripts/validate_trae_project.py --path /path/to/project
Detailed Explanation of Core Configuration Files
USER_PREFERENCES.md
User preferences file, defining global behavior patterns. Trae will prioritize the settings in this file in all operations.
Key configuration items:
# User Preferences
## 1. 技术栈偏好 (Tech Stack)
* **CSS Framework**: Tailwind CSS
* **State Management**: Zustand (React), Riverpod (Flutter)
* **Testing**: Vitest
* **Language**: TypeScript (Strict Mode)
## 2. 交互风格 (Communication Style)
* **Language**: 中文回复,技术术语保留英文
* **Detail Level**: 资深开发者模式,直接给代码
* **Emoji**: 禁用
## 3. 角色覆盖 (Role Overrides)
* **@Backend Developer**: 优先使用 FastAPI
## 4. 禁令 (Constraints)
* 严禁使用 `any` 类型
* 严禁创建 `.env` 文件
project_rules.md
Project rules file, defining project-specific development standards.
Key configuration items:
# Project Rules
## 构建与验证命令
* **Lint**: npm run lint
* **TypeCheck**: npm run typecheck
* **Test**: npm run test
* **Build**: npm run build
## 代码规范
* **函数注释**: 必须添加函数级注释
* **语言**: 中文注释,外链库需在中国可用
## Git 规范
* **Commit**: 遵循 Conventional Commits
* **Branch**: feature/*, fix/*, docs/*
Create a New Skill
Use the Initialization Script
python scripts/init_trae_skill.py <skill-name> --path .trae/Skills
Skill Directory Structure
skill-name/
├── SKILL.md # 必需:Skill 主文件
├── scripts/ # 可选:可执行脚本
├── references/ # 可选:参考文档
├── assets/ # 可选:资源文件
└── AGENTS.md # 可选:Agent 定义
SKILL.md Format
---
name: skill-name
description: Skill 描述,包含触发条件和使用场景
---
# Skill Title
## Overview
简要说明 Skill 功能
## Workflow
1. 步骤一
2. 步骤二
AGENTS.md Format
---
name: agent-name
description: Agent 描述
---
# Agent Title
## 角色定义
* **专长**: 描述专业领域
* **风格**: 描述工作风格
## 工作流程
1. 步骤一
2. 步骤二
Template Files
The complete template files are stored in the templates/ directory:
USER_PREFERENCES.md.template- User preferences templateproject_rules.md.template- Project rules templateSKILL.md.template- Skill templateAGENTS.md.template- Agent template
Reference Documentation
For detailed specifications, please refer to: