diff --git a/.github/workflows/scripts/create-release-packages.ps1 b/.github/workflows/scripts/create-release-packages.ps1 index 29d48c340..a36ca7620 100644 --- a/.github/workflows/scripts/create-release-packages.ps1 +++ b/.github/workflows/scripts/create-release-packages.ps1 @@ -466,6 +466,10 @@ function Build-Variant { 'generic' { $cmdDir = Join-Path $baseDir ".speckit/commands" Generate-Commands -Agent 'generic' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script + } + 'trae' { + $cmdDir = Join-Path $baseDir ".trae/commands" + Generate-Commands -Agent 'trae' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script } default { throw "Unsupported agent '$Agent'." diff --git a/.github/workflows/scripts/create-release-packages.sh b/.github/workflows/scripts/create-release-packages.sh index 021789d5b..331811243 100755 --- a/.github/workflows/scripts/create-release-packages.sh +++ b/.github/workflows/scripts/create-release-packages.sh @@ -292,8 +292,8 @@ build_variant() { mkdir -p "$base_dir/.kimi/skills" create_kimi_skills "$base_dir/.kimi/skills" "$script" ;; trae) - mkdir -p "$base_dir/.trae/rules" - generate_commands trae md "\$ARGUMENTS" "$base_dir/.trae/rules" "$script" ;; + mkdir -p "$base_dir/.trae/commands" + generate_commands trae md "\$ARGUMENTS" "$base_dir/.trae/commands" "$script" ;; pi) mkdir -p "$base_dir/.pi/prompts" generate_commands pi md "\$ARGUMENTS" "$base_dir/.pi/prompts" "$script" ;; diff --git a/AGENTS.md b/AGENTS.md index 7f647fe1b..c1e5a1985 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,7 +47,7 @@ Specify supports multiple AI agents by generating agent-specific command files a | **Kimi Code** | `.kimi/skills/` | Markdown | `kimi` | Kimi Code CLI (Moonshot AI) | | **Pi Coding Agent** | `.pi/prompts/` | Markdown | `pi` | Pi terminal coding agent | | **IBM Bob** | `.bob/commands/` | Markdown | N/A (IDE-based) | IBM Bob IDE | -| **Trae** | `.trae/rules/` | Markdown | N/A (IDE-based) | Trae IDE | +| **Trae** | `.trae/commands/` | Markdown | N/A (IDE-based) | Trae IDE | | **Generic** | User-specified via `--ai-commands-dir` | Markdown | N/A | Bring your own agent | ### Step-by-Step Integration Guide @@ -333,12 +333,13 @@ Work within integrated development environments: - **GitHub Copilot**: Built into VS Code/compatible editors - **Windsurf**: Built into Windsurf IDE - **IBM Bob**: Built into IBM Bob IDE +- **Trae**: Built into Trae IDE ## Command File Formats ### Markdown Format -Used by: Claude, Cursor, opencode, Windsurf, Kiro CLI, Amp, SHAI, IBM Bob, Kimi Code, Qwen, Pi +Used by: Claude, Cursor, opencode, Windsurf, Kiro CLI, Amp, SHAI, IBM Bob, Trae, Kimi Code, Qwen, Pi **Standard format:** @@ -384,6 +385,7 @@ Command content with {SCRIPT} and {{args}} placeholders. - Copilot: `.github/agents/` - Cursor: `.cursor/commands/` - Windsurf: `.windsurf/workflows/` + - Trae: `.trae/commands/` ## Argument Patterns diff --git a/README.md b/README.md index c70de1bae..4ffae1a6a 100644 --- a/README.md +++ b/README.md @@ -206,20 +206,20 @@ The `specify` command supports the following options: ### `specify init` Arguments & Options -| Argument/Option | Type | Description | -| ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `` | Argument | Name for your new project directory (optional if using `--here`, or use `.` for current directory) | -| `--ai` | Option | AI assistant to use: `claude`, `gemini`, `copilot`, `cursor-agent`, `qwen`, `opencode`, `codex`, `windsurf`, `kilocode`, `auggie`, `roo`, `codebuddy`, `amp`, `shai`, `kiro-cli` (`kiro` alias), `agy`, `bob`, `qodercli`, `vibe`, `kimi`, `pi`, or `generic` (requires `--ai-commands-dir`) | -| `--ai-commands-dir` | Option | Directory for agent command files (required with `--ai generic`, e.g. `.myagent/commands/`) | -| `--script` | Option | Script variant to use: `sh` (bash/zsh) or `ps` (PowerShell) | -| `--ignore-agent-tools` | Flag | Skip checks for AI agent tools like Claude Code | -| `--no-git` | Flag | Skip git repository initialization | -| `--here` | Flag | Initialize project in the current directory instead of creating a new one | -| `--force` | Flag | Force merge/overwrite when initializing in current directory (skip confirmation) | -| `--skip-tls` | Flag | Skip SSL/TLS verification (not recommended) | -| `--debug` | Flag | Enable detailed debug output for troubleshooting | -| `--github-token` | Option | GitHub token for API requests (or set GH_TOKEN/GITHUB_TOKEN env variable) | -| `--ai-skills` | Flag | Install Prompt.MD templates as agent skills in agent-specific `skills/` directory (requires `--ai`) | +| Argument/Option | Type | Description | +| ---------------------- | -------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `` | Argument | Name for your new project directory (optional if using `--here`, or use `.` for current directory) | +| `--ai` | Option | AI assistant to use: `claude`, `gemini`, `copilot`, `cursor-agent`, `qwen`, `opencode`, `codex`, `windsurf`, `kilocode`, `auggie`, `roo`, `codebuddy`, `amp`, `shai`, `kiro-cli` (`kiro` alias), `agy`, `bob`, `qodercli`, `trae`, `vibe`, `kimi`, `pi`, or `generic` (requires `--ai-commands-dir`) | +| `--ai-commands-dir` | Option | Directory for agent command files (required with `--ai generic`, e.g. `.myagent/commands/`) | +| `--script` | Option | Script variant to use: `sh` (bash/zsh) or `ps` (PowerShell) | +| `--ignore-agent-tools` | Flag | Skip checks for AI agent tools like Claude Code | +| `--no-git` | Flag | Skip git repository initialization | +| `--here` | Flag | Initialize project in the current directory instead of creating a new one | +| `--force` | Flag | Force merge/overwrite when initializing in current directory (skip confirmation) | +| `--skip-tls` | Flag | Skip SSL/TLS verification (not recommended) | +| `--debug` | Flag | Enable detailed debug output for troubleshooting | +| `--github-token` | Option | GitHub token for API requests (or set GH_TOKEN/GITHUB_TOKEN env variable) | +| `--ai-skills` | Flag | Install Prompt.MD templates as agent skills in agent-specific `skills/` directory (requires `--ai`) | ### Examples @@ -263,6 +263,9 @@ specify init my-project --ai agy --ai-skills # Initialize with an unsupported agent (generic / bring your own agent) specify init my-project --ai generic --ai-commands-dir .myagent/commands/ +# Initialize with Trae support +specify init my-project --ai trae + # Initialize with PowerShell scripts (Windows/cross-platform) specify init my-project --ai copilot --script ps diff --git a/scripts/bash/update-agent-context.sh b/scripts/bash/update-agent-context.sh index 3d9d3e955..911a2ddfb 100644 --- a/scripts/bash/update-agent-context.sh +++ b/scripts/bash/update-agent-context.sh @@ -30,7 +30,7 @@ # # 5. Multi-Agent Support # - Handles agent-specific file paths and naming conventions -# - Supports: Claude, Gemini, Copilot, Cursor, Qwen, opencode, Codex, Windsurf, Kilo Code, Auggie CLI, Roo Code, CodeBuddy CLI, Qoder CLI, Amp, SHAI, Tabnine CLI, Kiro CLI, Mistral Vibe, Kimi Code, Pi Coding Agent, Antigravity or Generic +# - Supports: Claude, Gemini, Copilot, Cursor, Qwen, opencode, Codex, Windsurf, Kilo Code, Auggie CLI, Roo Code, CodeBuddy CLI, Qoder CLI, Amp, SHAI, Trae, Tabnine CLI, Kiro CLI, Mistral Vibe, Kimi Code, Pi Coding Agent, Antigravity or Generic # - Can update single agents or all existing agent files # - Creates default Claude file if no agent files exist # @@ -83,7 +83,7 @@ AGY_FILE="$REPO_ROOT/.agent/rules/specify-rules.md" BOB_FILE="$AGENTS_FILE" VIBE_FILE="$REPO_ROOT/.vibe/agents/specify-agents.md" KIMI_FILE="$REPO_ROOT/KIMI.md" -TRAE_FILE="$REPO_ROOT/.trae/rules/AGENTS.md" +TRAE_FILE="$REPO_ROOT/.trae/rules/specify-rules.md" # Template file TEMPLATE_FILE="$REPO_ROOT/.specify/templates/agent-file-template.md" @@ -685,6 +685,9 @@ update_specific_agent() { generic) log_info "Generic agent: no predefined context file. Use the agent-specific update script for your agent." ;; + trae) + update_agent_file "$TRAE_FILE" "Trae" + ;; *) log_error "Unknown agent type '$agent_type'" log_error "Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|codebuddy|amp|shai|tabnine|kiro-cli|agy|bob|vibe|qodercli|kimi|trae|pi|generic" diff --git a/scripts/powershell/update-agent-context.ps1 b/scripts/powershell/update-agent-context.ps1 index 5eb034743..f735ddc8d 100644 --- a/scripts/powershell/update-agent-context.ps1 +++ b/scripts/powershell/update-agent-context.ps1 @@ -64,7 +64,7 @@ $AGY_FILE = Join-Path $REPO_ROOT '.agent/rules/specify-rules.md' $BOB_FILE = Join-Path $REPO_ROOT 'AGENTS.md' $VIBE_FILE = Join-Path $REPO_ROOT '.vibe/agents/specify-agents.md' $KIMI_FILE = Join-Path $REPO_ROOT 'KIMI.md' -$TRAE_FILE = Join-Path $REPO_ROOT '.trae/rules/AGENTS.md' +$TRAE_FILE = Join-Path $REPO_ROOT '.trae/rules/specify-rules.md' $TEMPLATE_FILE = Join-Path $REPO_ROOT '.specify/templates/agent-file-template.md' diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index 38117b54f..46577c0fa 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -296,6 +296,13 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str) "install_url": None, "requires_cli": False, }, + "trae": { + "name": "Trae", + "folder": ".trae/", + "commands_subdir": "commands", + "install_url": None, # IDE-based + "requires_cli": False, + }, } AI_ASSISTANT_ALIASES = { @@ -1480,7 +1487,7 @@ def init( console.print("[yellow]Example:[/yellow] specify init --ai claude --here") console.print(f"[yellow]Available agents:[/yellow] {', '.join(AGENT_CONFIG.keys())}") raise typer.Exit(1) - + if ai_commands_dir and ai_commands_dir.startswith("--"): console.print(f"[red]Error:[/red] Invalid value for --ai-commands-dir: '{ai_commands_dir}'") console.print("[yellow]Hint:[/yellow] Did you forget to provide a value for --ai-commands-dir?")