Skip to content

feat: add Trae IDE support as a new agent#1817

Open
huangguang1999 wants to merge 11 commits intogithub:mainfrom
huangguang1999:feature/add-trae-support
Open

feat: add Trae IDE support as a new agent#1817
huangguang1999 wants to merge 11 commits intogithub:mainfrom
huangguang1999:feature/add-trae-support

Conversation

@huangguang1999
Copy link

@huangguang1999 huangguang1999 commented Mar 12, 2026

Summary

Add Trae as a supported AI agent in spec-kit. Trae is an IDE-based AI assistant that uses .trae/rules/ directory for project-level rules in Markdown format.

Follows the same integration pattern as kimi support (#1790) and tabnine support.

Changes (9 files, +128 / -12)

Core runtime

  • src/specify_cli/__init__.py — Add trae to AGENT_CONFIG (IDE-based, .trae/ folder, rules subdir, requires_cli: False)
  • src/specify_cli/extensions.py — Add trae to CommandRegistrar.AGENT_CONFIGS (.trae/rules, markdown, .md)

Release packaging

  • create-release-packages.sh — Add trae to ALL_AGENTS and build case
  • create-release-packages.ps1 — Add trae to $AllAgents and switch block
  • create-github-release.sh — Add trae template zips to release assets

Agent context scripts

  • scripts/bash/update-agent-context.sh — Add TRAE_FILE, case branch, and auto-detect
  • scripts/powershell/update-agent-context.ps1 — Add TRAE_FILE, ValidateSet, switch, auto-detect

Documentation & tests

  • README.md — Add Trae to supported agents table, CLI examples, --ai option list
  • tests/test_agent_config_consistency.py — Add 8 consistency tests for trae

Design Decisions

  • Directory: .trae/rules/ — Trae's project rules location per official docs
  • Format: Markdown (.md) — consistent with Trae's rule file format
  • IDE-based: requires_cli: False, install_url: None — similar to Cursor/Windsurf pattern
  • Placement: Before generic in all agent lists, following existing ordering convention

Testing

  • Verified Python syntax validity for both __init__.py and extensions.py
  • Confirmed all 8 new consistency tests cover every integration point
  • Cross-checked with kimi (feat: add Kimi Code CLI agent support #1790) and tabnine integration patterns for consistency

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

This contribution was developed with AI assistance (Mira AI) for:

  • Researching Trae IDE's configuration structure and rule file format from official documentation
  • Generating code changes across all 9 integration points following established patterns
  • Writing 8 consistency tests mirroring the kimi/tabnine test structure

All changes were reviewed and verified by the contributor.

Add Trae (https://www.trae.ai/) as a supported AI agent in spec-kit.
Trae is an IDE-based agent that uses .trae/rules/ directory for
project-level rules in Markdown format.

Changes across 9 files:
- src/specify_cli/__init__.py: Add trae to AGENT_CONFIG (IDE-based,
  .trae/ folder, rules subdir, no CLI required)
- src/specify_cli/extensions.py: Add trae to CommandRegistrar.AGENT_CONFIGS
  (.trae/rules, markdown format, .md extension)
- README.md: Add Trae to supported agents table, CLI examples, and
  --ai option description
- .github/workflows/scripts/create-release-packages.sh: Add trae to
  ALL_AGENTS array and build case statement
- .github/workflows/scripts/create-release-packages.ps1: Add trae to
  AllAgents array and switch statement
- .github/workflows/scripts/create-github-release.sh: Add trae template
  zip files to release assets
- scripts/bash/update-agent-context.sh: Add TRAE_FILE, trae case in
  update function, and auto-detect block
- scripts/powershell/update-agent-context.ps1: Add TRAE_FILE, ValidateSet
  entry, switch case, and auto-detect block
- tests/test_agent_config_consistency.py: Add 8 consistency tests for
  trae following established kimi/tabnine patterns
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Trae IDE as a new supported AI agent, following the established pattern for IDE-based agents (like Cursor/Windsurf). Trae uses .trae/rules/ for project-level rules in Markdown format.

Changes:

  • Registers trae in AGENT_CONFIG and CommandRegistrar.AGENT_CONFIGS with appropriate directory/format settings
  • Adds trae to all release packaging, agent context, and documentation files
  • Adds 8 consistency tests mirroring existing agent test patterns

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/specify_cli/__init__.py Add trae to AGENT_CONFIG as IDE-based agent
src/specify_cli/extensions.py Add trae to CommandRegistrar.AGENT_CONFIGS
create-release-packages.sh Add trae to agent list and build case
create-release-packages.ps1 Add trae to agent list and build case
create-github-release.sh Add trae template zips to release assets
scripts/bash/update-agent-context.sh Add trae agent context support
scripts/powershell/update-agent-context.ps1 Add trae agent context support
README.md Add Trae to docs and CLI examples
tests/test_agent_config_consistency.py Add 8 consistency tests for trae

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable please explain why

… release script

Fix incorrect parameter names in the trae case of Build-Variant:
- -Format -> -Extension
- -ArgsToken -> -ArgFormat
- -OutDir -> -OutputDir

These now match the Generate-Commands function signature and all other
agent entries in the script.

Co-authored-by: Copilot <copilot@github.com>
@huangguang1999 huangguang1999 requested a review from mnriem March 13, 2026 03:24
@huangguang1999
Copy link
Author

Good catch! Fixed in 5e162dd — corrected the parameter names to -Extension, -ArgFormat, -OutputDir to match the Generate-Commands function signature and all other agent entries.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback and make sure to resolve any conflicts. You are really close!

@huangguang1999 huangguang1999 requested a review from mnriem March 13, 2026 14:59
@mnriem
Copy link
Collaborator

mnriem commented Mar 13, 2026

And please resolve conflicts

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please resolve the conflicts. Thanks!

@mnriem mnriem requested a review from Copilot March 13, 2026 16:57
@huangguang1999
Copy link
Author

Can you please resolve the conflicts. Thanks!

I have fixed it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

huangguang1999 and others added 2 commits March 14, 2026 01:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants