-
Notifications
You must be signed in to change notification settings - Fork 990
feat: add Trae IDE support to configuration #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
forztf
wants to merge
9
commits into
Fission-AI:main
Choose a base branch
from
forztf:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4b0c7b9
feat: add Trae IDE support to OpenSpec
forztf b7b78f1
fix: 修复Trae配置检测测试中的变量名和值匹配问题
forztf d7b7e4a
Merge pull request #1 from Fission-AI/main
forztf 22073e8
Merge branch 'main' of https://github.com/forztf/OpenSpec
forztf d791c37
Delete .trae directory
forztf 2017f0b
Merge branch 'Fission-AI:main' into main
forztf 589f601
feat: 添加中文模板支持和测试环境兼容性修复
forztf 9ed2bf2
chore: 更新.gitignore忽略Trae项目规则文件
forztf 8be4148
Merge branch 'main' of https://github.com/forztf/OpenSpec
forztf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # 增加对 Trae IDE 的支持 | ||
|
|
||
| ## Why | ||
|
|
||
| Trae IDE 是一个新兴的 AI 驱动开发环境,需要与 OpenSpec 集成以支持规范驱动的开发工作流。目前 OpenSpec 支持多种 AI 工具(Claude、Cline、CodeBuddy 等),但缺少对 Trae IDE 的支持。 | ||
|
|
||
| ## What Changes | ||
|
|
||
| - 添加 `TraeConfigurator` 类,实现 `ToolConfigurator` 接口 | ||
| - 在 `ToolRegistry` 中注册 Trae 配置器 | ||
| - 支持在项目根目录的 `.trae/rules/project_rules.md` 文件中注入 OpenSpec 指令 | ||
| - 遵循现有的配置器模式,使用 OPENSPEC 标记管理内容 | ||
|
|
||
| ## Impact | ||
|
|
||
| - affected specs: `cli-init` (初始化命令需要支持 Trae 选项) | ||
| - affected code: | ||
| - `src/core/configurators/trae.ts` (新文件) | ||
| - `src/core/configurators/registry.ts` (注册新配置器) | ||
| - 相关测试文件 | ||
| - 向后兼容:不影响现有功能 | ||
| - 用户体验:Trae IDE 用户可以通过 `openspec init` 自动配置项目规则 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # CLI Init 规范增量变更 | ||
|
|
||
| ## ADDED Requirements | ||
|
|
||
| ### Requirement: Trae IDE 配置支持 | ||
| 系统 SHALL 支持为 Trae IDE 生成项目配置文件。 | ||
|
|
||
| #### Scenario: 用户选择 Trae IDE 工具 | ||
| - **WHEN** 用户在初始化过程中选择 Trae IDE 作为 AI 工具 | ||
| - **THEN** 系统应在 `.trae/rules/project_rules.md` 文件中注入 OpenSpec 指令 | ||
| - **AND** 使用 OPENSPEC 标记管理内容块 | ||
| - **AND** 内容应包含项目特定的 OpenSpec 使用说明 | ||
|
|
||
| #### Scenario: Trae 配置文件已存在 | ||
| - **WHEN** 项目中已存在 `.trae/rules/project_rules.md` 文件 | ||
| - **THEN** 系统应使用 OPENSPEC 标记更新现有文件 | ||
| - **AND** 保留文件中的其他内容不变 | ||
| - **AND** 仅更新 OPENSPEC 标记之间的内容 | ||
|
|
||
| #### Scenario: Trae 目录不存在 | ||
| - **WHEN** 项目中不存在 `.trae/rules/` 目录 | ||
| - **THEN** 系统应自动创建必要的目录结构 | ||
| - **AND** 创建 `project_rules.md` 文件 | ||
| - **AND** 注入完整的 OpenSpec 配置内容 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # 实现任务 | ||
|
|
||
| ## 1. 核心实现 | ||
| - [ ] 1.1 创建 `src/core/configurators/trae.ts` 文件 | ||
| - [ ] 1.2 实现 `TraeConfigurator` 类,继承 `ToolConfigurator` 接口 | ||
| - [ ] 1.3 配置目标文件路径为 `.trae/rules/project_rules.md` | ||
| - [ ] 1.4 使用 `TemplateManager.getAgentsStandardTemplate()` 获取模板内容 | ||
|
|
||
| ## 2. 注册集成 | ||
| - [ ] 2.1 在 `src/core/configurators/registry.ts` 中导入 `TraeConfigurator` | ||
| - [ ] 2.2 在 `ToolRegistry` 静态块中注册 Trae 配置器 | ||
| - [ ] 2.3 使用 'trae' 作为工具 ID | ||
|
|
||
| ## 3. 测试验证 | ||
| - [ ] 3.1 创建单元测试文件 `test/core/configurators/trae.test.ts` | ||
| - [ ] 3.2 测试配置器的基本功能 | ||
| - [ ] 3.3 验证文件路径和内容生成 | ||
| - [ ] 3.4 运行现有测试确保无回归 | ||
|
|
||
| ## 4. 文档更新 | ||
| - [ ] 4.1 确认 CLI 初始化命令自动包含新的配置器 | ||
| - [ ] 4.2 验证 `openspec init` 命令中 Trae 选项可用 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark completed tasks as done.
All tasks listed in this file have been implemented:
TraeConfiguratorclass created insrc/core/configurators/trae.ts✓src/core/configurators/registry.tswith 'trae' ID ✓test/core/configurators/trae.test.tsand integration test intest/core/init.test.ts✓src/core/config.tsand spec documented ✓As per coding guidelines, mark each completed item with
- [x]once finished.Apply this diff to mark all tasks as complete:
🤖 Prompt for AI Agents