Skip to content

feat: add support for the Trae tool adapter#677

Open
cherrwer wants to merge 2 commits intoFission-AI:mainfrom
cherrwer:feat/add-trae-command-adapters
Open

feat: add support for the Trae tool adapter#677
cherrwer wants to merge 2 commits intoFission-AI:mainfrom
cherrwer:feat/add-trae-command-adapters

Conversation

@cherrwer
Copy link

@cherrwer cherrwer commented Feb 7, 2026

Summary by CodeRabbit

  • New Features

    • Added support for Trae tool integration, enabling export of commands in the new opsx command workflow.
  • Documentation

    • Updated Trae documentation to reflect the new invocation pattern and command file location.
  • Tests

    • Added tests validating Trae integration, path handling, and command file formatting.

@cherrwer cherrwer requested a review from TabishB as a code owner February 7, 2026 08:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

Adds a new Trae command adapter that writes commands to .trae/commands/opsx/<commandId>.md with YAML frontmatter, registers it in the adapter registry, updates docs and .gitignore, and adds tests covering path and formatting behavior.

Changes

Cohort / File(s) Summary
Configuration & Documentation
\.gitignore, docs/supported-tools.md
Added .trae/ to .gitignore and updated Trae entry to use .trae/commands/opsx/ and the /opsx:* invocation pattern.
Adapter Implementation
src/core/command-generation/adapters/trae.ts, src/core/command-generation/adapters/index.ts
New traeAdapter exported; generates .trae/commands/opsx/<commandId>.md and formats files with YAML frontmatter (name, description, category, tags) plus body.
Registry Integration
src/core/command-generation/registry.ts
Imported and registered traeAdapter in CommandAdapterRegistry initializer.
Tests
test/core/command-generation/adapters.test.ts
Added tests for traeAdapter: toolId, path generation (including cross-platform path.join behavior), YAML frontmatter formatting, and empty-tags handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • TabishB

Poem

🐰 I found a new trail in .trae tonight,
I stitched frontmatter by lantern-light,
Opsx commands tucked in neat rows,
Hopping through tags where the YAML glows,
A little rabbit cheers—what a delight! 🎋

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and specifically describes the main change: adding support for the Trae tool adapter. It aligns directly with the changeset, which introduces a new adapter implementation across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
docs/supported-tools.md (1)

36-36: Consider removing the invocation annotation for consistency.

The (via /opsx:*) annotation is not present on other tools with the same commands/opsx/ pattern (Claude Code, CodeBuddy, Crush, Gemini CLI, Qoder). Since line 9 already documents that skills "power the /opsx:* workflow commands" and line 77 confirms the invocation pattern applies generally, the annotation is redundant and creates inconsistency.

📝 Suggested change for consistency
-| Trae | `.trae/skills/` | `.trae/commands/opsx/` (via `/opsx:*`) |
+| Trae | `.trae/skills/` | `.trae/commands/opsx/` |

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Feb 7, 2026

Greptile Overview

Greptile Summary

  • Adds a new trae tool adapter implementation and wires it into the command-generation adapter registry.
  • Updates adapter exports/registration so trae can be selected/auto-detected like other supported tools.
  • Extends adapter tests to validate Trae adapter behavior and registration.
  • Updates supported-tools documentation (and gitignore) to reflect the new adapter support.

Confidence Score: 2/5

  • Unable to verify PR correctness due to missing code/diff inspection in this review run.
  • The required review artifacts were generated, but the actual PR diff and file contents were not inspected/validated here, so I cannot reliably attest that there are no merge-blocking issues.
  • All changed files, especially src/core/command-generation/adapters/trae.ts and registry wiring in src/core/command-generation/registry.ts

Important Files Changed

Filename Overview
.gitignore Adds ignore entries related to Trae adapter support; no functional code changes.
docs/supported-tools.md Documents Trae as a supported tool adapter; no code behavior changes.
src/core/command-generation/adapters/index.ts Exports/registers the new Trae adapter in the adapters index.
src/core/command-generation/adapters/trae.ts Implements Trae tool adapter parsing/normalization for command generation.
src/core/command-generation/registry.ts Registers Trae adapter with the adapter registry for lookup by name.
test/core/command-generation/adapters.test.ts Adds/updates tests to cover Trae adapter registration and behavior.

Sequence Diagram

sequenceDiagram
    participant User
    participant OpenSpec as OpenSpec CLI
    participant Registry as AdapterRegistry
    participant Adapter as ToolAdapter (Trae)

    User->>OpenSpec: Provide tool output / select "trae"
    OpenSpec->>Registry: getAdapter("trae")
    Registry-->>OpenSpec: Trae adapter instance
    OpenSpec->>Adapter: parseToolOutput(raw)
    Adapter-->>OpenSpec: Normalized command generation context
    OpenSpec->>OpenSpec: Generate commands from context
    OpenSpec-->>User: Suggested terminal commands
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant