Skip to content

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

Open
huangguang1999 wants to merge 1 commit intogithub:mainfrom
huangguang1999:feature/add-trae-support
Open

feat: add Trae IDE support as a new agent#1817
huangguang1999 wants to merge 1 commit 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.

'trae' {
$rulesDir = Join-Path $baseDir ".trae/rules"
New-Item -ItemType Directory -Force -Path $rulesDir | Out-Null
Generate-Commands -Agent 'trae' -Format 'md' -ArgsToken '$ARGUMENTS' -OutDir $rulesDir -ScriptVariant $script
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The Generate-Commands call for trae uses incorrect parameter names (-Format, -ArgsToken, -OutDir) compared to all other agents which use -Extension, -ArgFormat, -OutputDir. This will cause a runtime error when building trae release packages.

Suggested change
Generate-Commands -Agent 'trae' -Format 'md' -ArgsToken '$ARGUMENTS' -OutDir $rulesDir -ScriptVariant $script
Generate-Commands -Agent 'trae' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $rulesDir -ScriptVariant $script

Copilot uses AI. Check for mistakes.
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

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