Skip to content

Commit cfd5b16

Browse files
authored
Merge pull request affaan-m#985 from likzn/feature/trae-integration
Add Trae IDE support (.trae/)
2 parents 343284d + e970324 commit cfd5b16

File tree

4 files changed

+791
-0
lines changed

4 files changed

+791
-0
lines changed

.trae/README.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Everything Claude Code for Trae
2+
3+
Bring Everything Claude Code (ECC) workflows to Trae IDE. This repository provides custom commands, agents, skills, and rules that can be installed into any Trae project with a single command.
4+
5+
## Quick Start
6+
7+
### Option 1: Local Installation (Current Project Only)
8+
9+
```bash
10+
# Install to current project
11+
cd /path/to/your/project
12+
TRAE_ENV=cn .trae/install.sh
13+
```
14+
15+
This creates `.trae-cn/` in your project directory.
16+
17+
### Option 2: Global Installation (All Projects)
18+
19+
```bash
20+
# Install globally to ~/.trae-cn/
21+
cd /path/to/your/project
22+
TRAE_ENV=cn .trae/install.sh ~
23+
24+
# Or from the .trae folder directly
25+
cd /path/to/your/project/.trae
26+
TRAE_ENV=cn ./install.sh ~
27+
```
28+
29+
This creates `~/.trae-cn/` which applies to all Trae projects.
30+
31+
### Option 3: Quick Install to Current Directory
32+
33+
```bash
34+
# If already in project directory with .trae folder
35+
cd .trae
36+
./install.sh
37+
```
38+
39+
The installer uses non-destructive copy - it will not overwrite your existing files.
40+
41+
## Installation Modes
42+
43+
### Local Installation
44+
45+
Install to the current project's `.trae-cn` directory:
46+
47+
```bash
48+
cd /path/to/your/project
49+
TRAE_ENV=cn .trae/install.sh
50+
```
51+
52+
This creates `/path/to/your/project/.trae-cn/` with all ECC components.
53+
54+
### Global Installation
55+
56+
Install to your home directory's `.trae-cn` directory (applies to all Trae projects):
57+
58+
```bash
59+
# From project directory
60+
TRAE_ENV=cn .trae/install.sh ~
61+
62+
# Or directly from .trae folder
63+
cd .trae
64+
TRAE_ENV=cn ./install.sh ~
65+
```
66+
67+
This creates `~/.trae-cn/` with all ECC components. All Trae projects will use these global installations.
68+
69+
**Note**: Global installation is useful when you want to maintain a single copy of ECC across all your projects.
70+
71+
## Environment Support
72+
73+
- **Default**: Uses `.trae` directory
74+
- **CN Environment**: Uses `.trae-cn` directory (set via `TRAE_ENV=cn`)
75+
76+
### Force Environment
77+
78+
```bash
79+
# From project root, force the CN environment
80+
TRAE_ENV=cn .trae/install.sh
81+
82+
# From inside the .trae folder
83+
cd .trae
84+
TRAE_ENV=cn ./install.sh
85+
```
86+
87+
**Note**: `TRAE_ENV` is a global environment variable that applies to the entire installation session.
88+
89+
## Uninstall
90+
91+
The uninstaller uses a manifest file (`.ecc-manifest`) to track installed files, ensuring safe removal:
92+
93+
```bash
94+
# Uninstall from current directory (if already inside .trae or .trae-cn)
95+
cd .trae-cn
96+
./uninstall.sh
97+
98+
# Or uninstall from project root
99+
cd /path/to/your/project
100+
TRAE_ENV=cn .trae/uninstall.sh
101+
102+
# Uninstall globally from home directory
103+
TRAE_ENV=cn .trae/uninstall.sh ~
104+
105+
# Will ask for confirmation before uninstalling
106+
```
107+
108+
### Uninstall Behavior
109+
110+
- **Safe removal**: Only removes files tracked in the manifest (installed by ECC)
111+
- **User files preserved**: Any files you added manually are kept
112+
- **Non-empty directories**: Directories containing user-added files are skipped
113+
- **Manifest-based**: Requires `.ecc-manifest` file (created during install)
114+
115+
### Environment Support
116+
117+
Uninstall respects the same `TRAE_ENV` environment variable as install:
118+
119+
```bash
120+
# Uninstall from .trae-cn (CN environment)
121+
TRAE_ENV=cn ./uninstall.sh
122+
123+
# Uninstall from .trae (default environment)
124+
./uninstall.sh
125+
```
126+
127+
**Note**: If no manifest file is found (old installation), the uninstaller will ask whether to remove the entire directory.
128+
129+
## What's Included
130+
131+
### Commands
132+
133+
Commands are on-demand workflows invocable via the `/` menu in Trae chat. All commands are reused directly from the project root's `commands/` folder.
134+
135+
### Agents
136+
137+
Agents are specialized AI assistants with specific tool configurations. All agents are reused directly from the project root's `agents/` folder.
138+
139+
### Skills
140+
141+
Skills are on-demand workflows invocable via the `/` menu in chat. All skills are reused directly from the project's `skills/` folder.
142+
143+
### Rules
144+
145+
Rules provide always-on rules and context that shape how the agent works with your code. All rules are reused directly from the project root's `rules/` folder.
146+
147+
## Usage
148+
149+
1. Type `/` in chat to open the commands menu
150+
2. Select a command or skill
151+
3. The agent will guide you through the workflow with specific instructions and checklists
152+
153+
## Project Structure
154+
155+
```
156+
.trae/ (or .trae-cn/)
157+
├── commands/ # Command files (reused from project root)
158+
├── agents/ # Agent files (reused from project root)
159+
├── skills/ # Skill files (reused from skills/)
160+
├── rules/ # Rule files (reused from project root)
161+
├── install.sh # Install script
162+
├── uninstall.sh # Uninstall script
163+
└── README.md # This file
164+
```
165+
166+
## Customization
167+
168+
All files are yours to modify after installation. The installer never overwrites existing files, so your customizations are safe across re-installs.
169+
170+
**Note**: The `install.sh` and `uninstall.sh` scripts are automatically copied to the target directory during installation, so you can run these commands directly from your project.
171+
172+
## Recommended Workflow
173+
174+
1. **Start with planning**: Use `/plan` command to break down complex features
175+
2. **Write tests first**: Invoke `/tdd` command before implementing
176+
3. **Review your code**: Use `/code-review` after writing code
177+
4. **Check security**: Use `/code-review` again for auth, API endpoints, or sensitive data handling
178+
5. **Fix build errors**: Use `/build-fix` if there are build errors
179+
180+
## Next Steps
181+
182+
- Open your project in Trae
183+
- Type `/` to see available commands
184+
- Enjoy the ECC workflows!

.trae/README.zh-CN.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Everything Claude Code for Trae
2+
3+
为 Trae IDE 带来 Everything Claude Code (ECC) 工作流。此仓库提供自定义命令、智能体、技能和规则,可以通过单个命令安装到任何 Trae 项目中。
4+
5+
## 快速开始
6+
7+
### 方式一:本地安装到 `.trae` 目录(默认环境)
8+
9+
```bash
10+
# 安装到当前项目的 .trae 目录
11+
cd /path/to/your/project
12+
.trae/install.sh
13+
```
14+
15+
这将在您的项目目录中创建 `.trae/`
16+
17+
### 方式二:本地安装到 `.trae-cn` 目录(CN 环境)
18+
19+
```bash
20+
# 安装到当前项目的 .trae-cn 目录
21+
cd /path/to/your/project
22+
TRAE_ENV=cn .trae/install.sh
23+
```
24+
25+
这将在您的项目目录中创建 `.trae-cn/`
26+
27+
### 方式三:全局安装到 `~/.trae` 目录(默认环境)
28+
29+
```bash
30+
# 全局安装到 ~/.trae/
31+
cd /path/to/your/project
32+
.trae/install.sh ~
33+
```
34+
35+
这将创建 `~/.trae/`,适用于所有 Trae 项目。
36+
37+
### 方式四:全局安装到 `~/.trae-cn` 目录(CN 环境)
38+
39+
```bash
40+
# 全局安装到 ~/.trae-cn/
41+
cd /path/to/your/project
42+
TRAE_ENV=cn .trae/install.sh ~
43+
```
44+
45+
这将创建 `~/.trae-cn/`,适用于所有 Trae 项目。
46+
47+
安装程序使用非破坏性复制 - 它不会覆盖您现有的文件。
48+
49+
## 安装模式
50+
51+
### 本地安装
52+
53+
安装到当前项目的 `.trae``.trae-cn` 目录:
54+
55+
```bash
56+
# 安装到当前项目的 .trae 目录(默认)
57+
cd /path/to/your/project
58+
.trae/install.sh
59+
60+
# 安装到当前项目的 .trae-cn 目录(CN 环境)
61+
cd /path/to/your/project
62+
TRAE_ENV=cn .trae/install.sh
63+
```
64+
65+
### 全局安装
66+
67+
安装到您主目录的 `.trae``.trae-cn` 目录(适用于所有 Trae 项目):
68+
69+
```bash
70+
# 全局安装到 ~/.trae/(默认)
71+
.trae/install.sh ~
72+
73+
# 全局安装到 ~/.trae-cn/(CN 环境)
74+
TRAE_ENV=cn .trae/install.sh ~
75+
```
76+
77+
**注意**:全局安装适用于希望在所有项目之间维护单个 ECC 副本的场景。
78+
79+
## 环境支持
80+
81+
- **默认**:使用 `.trae` 目录
82+
- **CN 环境**:使用 `.trae-cn` 目录(通过 `TRAE_ENV=cn` 设置)
83+
84+
### 强制指定环境
85+
86+
```bash
87+
# 从项目根目录强制使用 CN 环境
88+
TRAE_ENV=cn .trae/install.sh
89+
90+
# 进入 .trae 目录后使用默认环境
91+
cd .trae
92+
./install.sh
93+
```
94+
95+
**注意**`TRAE_ENV` 是一个全局环境变量,适用于整个安装会话。
96+
97+
## 卸载
98+
99+
卸载程序使用清单文件(`.ecc-manifest`)跟踪已安装的文件,确保安全删除:
100+
101+
```bash
102+
# 从当前目录卸载(如果已经在 .trae 或 .trae-cn 目录中)
103+
cd .trae-cn
104+
./uninstall.sh
105+
106+
# 或者从项目根目录卸载
107+
cd /path/to/your/project
108+
TRAE_ENV=cn .trae/uninstall.sh
109+
110+
# 从主目录全局卸载
111+
TRAE_ENV=cn .trae/uninstall.sh ~
112+
113+
# 卸载前会询问确认
114+
```
115+
116+
### 卸载行为
117+
118+
- **安全删除**:仅删除清单中跟踪的文件(由 ECC 安装的文件)
119+
- **保留用户文件**:您手动添加的任何文件都会被保留
120+
- **非空目录**:包含用户添加文件的目录会被跳过
121+
- **基于清单**:需要 `.ecc-manifest` 文件(在安装时创建)
122+
123+
### 环境支持
124+
125+
卸载程序遵循与安装程序相同的 `TRAE_ENV` 环境变量:
126+
127+
```bash
128+
# 从 .trae-cn 卸载(CN 环境)
129+
TRAE_ENV=cn ./uninstall.sh
130+
131+
# 从 .trae 卸载(默认环境)
132+
./uninstall.sh
133+
```
134+
135+
**注意**:如果找不到清单文件(旧版本安装),卸载程序将询问是否删除整个目录。
136+
137+
## 包含的内容
138+
139+
### 命令
140+
141+
命令是通过 Trae 聊天中的 `/` 菜单调用的按需工作流。所有命令都直接复用自项目根目录的 `commands/` 文件夹。
142+
143+
### 智能体
144+
145+
智能体是具有特定工具配置的专门 AI 助手。所有智能体都直接复用自项目根目录的 `agents/` 文件夹。
146+
147+
### 技能
148+
149+
技能是通过聊天中的 `/` 菜单调用的按需工作流。所有技能都直接复用自项目的 `skills/` 文件夹。
150+
151+
### 规则
152+
153+
规则提供始终适用的规则和上下文,塑造智能体处理代码的方式。所有规则都直接复用自项目根目录的 `rules/` 文件夹。
154+
155+
## 使用方法
156+
157+
1. 在聊天中输入 `/` 以打开命令菜单
158+
2. 选择一个命令或技能
159+
3. 智能体将通过具体说明和检查清单指导您完成工作流
160+
161+
## 项目结构
162+
163+
```
164+
.trae/ (或 .trae-cn/)
165+
├── commands/ # 命令文件(复用自项目根目录)
166+
├── agents/ # 智能体文件(复用自项目根目录)
167+
├── skills/ # 技能文件(复用自 skills/)
168+
├── rules/ # 规则文件(复用自项目根目录)
169+
├── install.sh # 安装脚本
170+
├── uninstall.sh # 卸载脚本
171+
└── README.md # 此文件
172+
```
173+
174+
## 自定义
175+
176+
安装后,所有文件都归您修改。安装程序永远不会覆盖现有文件,因此您的自定义在重新安装时是安全的。
177+
178+
**注意**:安装时会自动将 `install.sh``uninstall.sh` 脚本复制到目标目录,这样您可以在项目本地直接运行这些命令。
179+
180+
## 推荐的工作流
181+
182+
1. **从计划开始**:使用 `/plan` 命令分解复杂功能
183+
2. **先写测试**:在实现之前调用 `/tdd` 命令
184+
3. **审查您的代码**:编写代码后使用 `/code-review`
185+
4. **检查安全性**:对于身份验证、API 端点或敏感数据处理,再次使用 `/code-review`
186+
5. **修复构建错误**:如果有构建错误,使用 `/build-fix`
187+
188+
## 下一步
189+
190+
- 在 Trae 中打开您的项目
191+
- 输入 `/` 以查看可用命令
192+
- 享受 ECC 工作流!

0 commit comments

Comments
 (0)