Skip to content

feat: add support for the Trae tool adapter#677

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

feat: add support for the Trae tool adapter#677
cherrwer wants to merge 1 commit 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 with new command workflow.
  • Documentation

    • Updated Trae tool documentation with new invocation path and command location.

@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

This pull request introduces a new Trae command adapter for the command generation system. The adapter handles command storage at .trae/commands/opsx/<commandId>.md with YAML frontmatter formatting. Changes include adapter implementation, registry integration, gitignore entry, documentation updates, and comprehensive test coverage.

Changes

Cohort / File(s) Summary
Configuration & Documentation
.gitignore, docs/supported-tools.md
Added .trae/ directory to gitignore and updated supported tools documentation to reflect new OPSX workflow path (.trae/commands/opsx/ with /opsx:* invocation).
Adapter Implementation
src/core/command-generation/adapters/trae.ts, src/core/command-generation/adapters/index.ts
Introduced new traeAdapter with toolId 'trae' that generates paths as .trae/commands/opsx/<commandId>.md and formats files with YAML frontmatter (name, description, category, escaped tags) followed by content body. Added public export in adapter index.
Integration
src/core/command-generation/registry.ts
Registered traeAdapter in CommandAdapterRegistry static initializer to include it in available adapters at startup.
Test Coverage
test/core/command-generation/adapters.test.ts
Added comprehensive test suite for traeAdapter covering toolId validation, path generation, YAML frontmatter formatting with escaped values, empty tags handling, and cross-platform path semantics consistency.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested Reviewers

  • TabishB

Poem

🐰 A Trae adapter springs to life, so spry,
With YAML frontmatter reaching for the sky,
Through .trae/commands/opsx/ it hops with glee,
Tags formatted, paths precise—a joy to see! 🌿✨

🚥 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 title accurately describes the main change: adding support for the Trae tool adapter, which is clearly evident across all modified 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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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