@mindfoldhq/trellis 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/cli/index.js +1 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/channel/messages.js +1 -1
  4. package/dist/commands/channel/supervisor.d.ts.map +1 -1
  5. package/dist/commands/channel/supervisor.js +34 -2
  6. package/dist/commands/channel/supervisor.js.map +1 -1
  7. package/dist/commands/init.d.ts +1 -0
  8. package/dist/commands/init.d.ts.map +1 -1
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/uninstall.d.ts.map +1 -1
  11. package/dist/commands/uninstall.js +1 -0
  12. package/dist/commands/uninstall.js.map +1 -1
  13. package/dist/commands/update.d.ts.map +1 -1
  14. package/dist/commands/update.js +23 -11
  15. package/dist/commands/update.js.map +1 -1
  16. package/dist/configurators/codex.d.ts.map +1 -1
  17. package/dist/configurators/codex.js +1 -15
  18. package/dist/configurators/codex.js.map +1 -1
  19. package/dist/configurators/index.d.ts.map +1 -1
  20. package/dist/configurators/index.js +25 -9
  21. package/dist/configurators/index.js.map +1 -1
  22. package/dist/configurators/kiro.d.ts +4 -2
  23. package/dist/configurators/kiro.d.ts.map +1 -1
  24. package/dist/configurators/kiro.js +12 -3
  25. package/dist/configurators/kiro.js.map +1 -1
  26. package/dist/configurators/pi.d.ts.map +1 -1
  27. package/dist/configurators/pi.js +14 -4
  28. package/dist/configurators/pi.js.map +1 -1
  29. package/dist/configurators/shared.d.ts +0 -19
  30. package/dist/configurators/shared.d.ts.map +1 -1
  31. package/dist/configurators/shared.js +12 -32
  32. package/dist/configurators/shared.js.map +1 -1
  33. package/dist/configurators/trae.d.ts +17 -0
  34. package/dist/configurators/trae.d.ts.map +1 -0
  35. package/dist/configurators/trae.js +42 -0
  36. package/dist/configurators/trae.js.map +1 -0
  37. package/dist/configurators/zcode.js +3 -3
  38. package/dist/configurators/zcode.js.map +1 -1
  39. package/dist/migrations/manifests/0.6.4.json +9 -0
  40. package/dist/migrations/manifests/0.6.5.json +9 -0
  41. package/dist/templates/codex/skills/brainstorm/SKILL.md +19 -1
  42. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
  43. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +1 -1
  44. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +1 -0
  45. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +2 -2
  46. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +2 -0
  47. package/dist/templates/common/skills/brainstorm.md +19 -1
  48. package/dist/templates/copilot/prompts/brainstorm.prompt.md +19 -1
  49. package/dist/templates/kiro/agents/trellis.json +34 -0
  50. package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +14 -0
  51. package/dist/templates/kiro/index.d.ts +16 -2
  52. package/dist/templates/kiro/index.d.ts.map +1 -1
  53. package/dist/templates/kiro/index.js +13 -3
  54. package/dist/templates/kiro/index.js.map +1 -1
  55. package/dist/templates/pi/agents/trellis-check.md +1 -1
  56. package/dist/templates/pi/agents/trellis-implement.md +1 -1
  57. package/dist/templates/pi/agents/trellis-research.md +1 -1
  58. package/dist/templates/pi/extensions/trellis/index.ts.txt +84 -8
  59. package/dist/templates/shared-hooks/index.d.ts +9 -3
  60. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  61. package/dist/templates/shared-hooks/index.js +14 -3
  62. package/dist/templates/shared-hooks/index.js.map +1 -1
  63. package/dist/templates/shared-hooks/inject-workflow-state.py +52 -7
  64. package/dist/templates/shared-hooks/session-start.py +13 -0
  65. package/dist/templates/trae/agents/trellis-check.md +108 -0
  66. package/dist/templates/trae/agents/trellis-implement.md +103 -0
  67. package/dist/templates/trae/agents/trellis-research.md +137 -0
  68. package/dist/templates/trae/hooks.json +27 -0
  69. package/dist/templates/trae/index.d.ts +15 -0
  70. package/dist/templates/trae/index.d.ts.map +1 -0
  71. package/dist/templates/trae/index.js +15 -0
  72. package/dist/templates/trae/index.js.map +1 -0
  73. package/dist/templates/trellis/scripts/common/active_task.py +2 -0
  74. package/dist/templates/trellis/scripts/common/cli_adapter.py +37 -11
  75. package/dist/templates/trellis/scripts/common/task_store.py +1 -0
  76. package/dist/templates/trellis/workflow.md +22 -20
  77. package/dist/types/ai-tools.d.ts +4 -4
  78. package/dist/types/ai-tools.d.ts.map +1 -1
  79. package/dist/types/ai-tools.js +16 -0
  80. package/dist/types/ai-tools.js.map +1 -1
  81. package/package.json +2 -2
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: trellis-implement
3
+ description: |
4
+ Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
5
+ tools: Read, Write, Edit, Bash, Glob, Grep
6
+ ---
7
+ # Implement Agent
8
+
9
+ You are the Implement Agent in the Trellis workflow.
10
+
11
+ ## Recursion Guard
12
+
13
+ You are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.
14
+
15
+ - Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.
16
+ - If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.
17
+ - Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.
18
+
19
+ ## Context
20
+
21
+ Before implementing, read:
22
+ - `.trellis/workflow.md` - Project workflow
23
+ - `.trellis/spec/` - Development guidelines
24
+ - Task `prd.md` - Requirements document
25
+ - Task `design.md` - Technical design (if exists)
26
+ - Task `implement.md` - Execution plan (if exists)
27
+
28
+ ## Core Responsibilities
29
+
30
+ 1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
31
+ 2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
32
+ 3. **Implement features** - Write code following specs and task artifacts
33
+ 4. **Self-check** - Ensure code quality
34
+ 5. **Report results** - Report completion status
35
+
36
+ ## Forbidden Operations
37
+
38
+ **Do NOT execute these git commands:**
39
+
40
+ - `git commit`
41
+ - `git push`
42
+ - `git merge`
43
+
44
+ ---
45
+
46
+ ## Workflow
47
+
48
+ ### 1. Understand Specs
49
+
50
+ Read relevant specs based on task type:
51
+
52
+ - Spec layers: `.trellis/spec/<package>/<layer>/`
53
+ - Shared guides: `.trellis/spec/guides/`
54
+
55
+ ### 2. Understand Requirements
56
+
57
+ Read the task's prd.md, design.md if present, and implement.md if present:
58
+
59
+ - What are the core requirements
60
+ - Key points of technical design
61
+ - Implementation order, validation commands, and rollback points
62
+
63
+ ### 3. Implement Features
64
+
65
+ - Write code following specs and task artifacts
66
+ - Follow existing code patterns
67
+ - Only do what's required, no over-engineering
68
+
69
+ ### 4. Verify
70
+
71
+ Run project's lint and typecheck commands to verify changes.
72
+
73
+ ---
74
+
75
+ ## Report Format
76
+
77
+ ```markdown
78
+ ## Implementation Complete
79
+
80
+ ### Files Modified
81
+
82
+ - `src/components/Feature.tsx` - New component
83
+ - `src/hooks/useFeature.ts` - New hook
84
+
85
+ ### Implementation Summary
86
+
87
+ 1. Created Feature component...
88
+ 2. Added useFeature hook...
89
+
90
+ ### Verification Results
91
+
92
+ - Lint: Passed
93
+ - TypeCheck: Passed
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Code Standards
99
+
100
+ - Follow existing code patterns
101
+ - Don't add unnecessary abstractions
102
+ - Only do what's required, no over-engineering
103
+ - Keep code readable
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: trellis-research
3
+ description: |
4
+ Code and tech search expert. Finds files, patterns, and tech solutions, and PERSISTS every finding to the current task's research/ directory. No code modifications outside that directory.
5
+ tools: Read, Write, Glob, Grep, Bash, Skill, mcp__*
6
+ ---
7
+ # Research Agent
8
+
9
+ You are the Research Agent in the Trellis workflow.
10
+
11
+ ## Core Principle
12
+
13
+ **You do one thing: find, explain, and PERSIST information.**
14
+
15
+ Conversations get compacted; files don't. Every research output MUST end up as a file under `{TASK_DIR}/research/`. Returning findings only through the chat reply is a failure — the caller cannot read them next session.
16
+
17
+ ---
18
+
19
+ ## Core Responsibilities
20
+
21
+ 1. **Internal Search** — locate files/components, understand code logic, discover patterns (Glob, Grep, Read)
22
+ 2. **External Search** — library docs, API references, best practices (web search)
23
+ 3. **Persist** — write each research topic to `{TASK_DIR}/research/<topic>.md`
24
+ 4. **Report** — return file paths + one-line summaries to the main agent (not full content)
25
+
26
+ ---
27
+
28
+ ## Workflow
29
+
30
+ ### Step 1: Resolve Current Task
31
+
32
+ Run `python3 ./.trellis/scripts/task.py current --source` → active task path. If no active task is set, ask the user where to write output; do NOT guess.
33
+
34
+ Ensure `{TASK_DIR}/research/` exists:
35
+
36
+ ```bash
37
+ mkdir -p <TASK_DIR>/research
38
+ ```
39
+
40
+ ### Step 2: Understand Search Request
41
+
42
+ Classify: internal / external / mixed. Determine scope (global / specific directory) and expected shape (file list / pattern notes / tech comparison).
43
+
44
+ ### Step 3: Execute Search
45
+
46
+ Run independent searches in parallel (Glob + Grep + web) for efficiency.
47
+
48
+ ### Step 4: Persist Each Topic
49
+
50
+ For each distinct research topic, Write a markdown file at `{TASK_DIR}/research/<topic-slug>.md`. Use the File Format below.
51
+
52
+ ### Step 5: Report to Main Agent
53
+
54
+ Reply with ONLY:
55
+
56
+ - List of files written (paths relative to repo root)
57
+ - One-line summary per file
58
+ - Any critical caveats that the main agent needs to know right now
59
+
60
+ Do NOT paste full research content into the reply. The files are the contract.
61
+
62
+ ---
63
+
64
+ ## Scope Limits (Strict)
65
+
66
+ ### Write ALLOWED
67
+
68
+ - `{TASK_DIR}/research/*.md` — your own output
69
+ - Creating `{TASK_DIR}/research/` if it doesn't exist (via `mkdir -p`)
70
+
71
+ ### Write FORBIDDEN
72
+
73
+ - Code files (`src/`, `lib/`, …)
74
+ - Spec files (`.trellis/spec/`) — main agent should use `update-spec` skill instead
75
+ - `.trellis/scripts/`, `.trellis/workflow.md`, platform config (`.claude/`, `.cursor/`, `.trae/`, etc.)
76
+ - Other task directories
77
+ - Any git operation (commit / push / branch / merge)
78
+
79
+ If the user asks you to edit code, decline and suggest spawning `implement` instead.
80
+
81
+ ---
82
+
83
+ ## File Format
84
+
85
+ Each `{TASK_DIR}/research/<topic>.md` should follow:
86
+
87
+ ```markdown
88
+ # Research: <topic>
89
+
90
+ - **Query**: <original query>
91
+ - **Scope**: <internal / external / mixed>
92
+ - **Date**: <YYYY-MM-DD>
93
+
94
+ ## Findings
95
+
96
+ ### Files Found
97
+
98
+ | File Path | Description |
99
+ |---|---|
100
+ | `src/services/xxx.ts` | Main implementation |
101
+ | `src/types/xxx.ts` | Type definitions |
102
+
103
+ ### Code Patterns
104
+
105
+ <describe patterns, cite file:line>
106
+
107
+ ### External References
108
+
109
+ - [Library X docs](url) — <why relevant, version constraints>
110
+
111
+ ### Related Specs
112
+
113
+ - `.trellis/spec/xxx.md` — <description>
114
+
115
+ ## Caveats / Not Found
116
+
117
+ <anything incomplete or uncertain>
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Guidelines
123
+
124
+ ### DO
125
+
126
+ - Provide specific file paths and line numbers
127
+ - Quote actual code snippets
128
+ - Persist every topic to its own file
129
+ - Return file paths in your reply, not the full content
130
+ - Mark "not found" explicitly when searches come up empty
131
+
132
+ ### DON'T
133
+
134
+ - Don't write code or modify files outside `{TASK_DIR}/research/`
135
+ - Don't guess uncertain info
136
+ - Don't paste full research text into the reply (files are the deliverable)
137
+ - Don't propose improvements or critique implementation (that's not your role)
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "{{PYTHON_CMD}} .trae/hooks/session-start.py",
10
+ "timeout": 30
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "UserPromptSubmit": [
16
+ {
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "{{PYTHON_CMD}} .trae/hooks/inject-workflow-state.py",
21
+ "timeout": 15
22
+ }
23
+ ]
24
+ }
25
+ ]
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Trae IDE templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ *
6
+ * Directory structure:
7
+ * trae/
8
+ * ├── agents/ # Multi-agent pipeline agents (Markdown)
9
+ * └── hooks.json # Hook configuration
10
+ */
11
+ import { type AgentTemplate, type HookTemplate } from "../template-utils.js";
12
+ export type { AgentTemplate, HookTemplate };
13
+ export declare const getAllAgents: () => AgentTemplate[];
14
+ export declare const getSettingsTemplate: () => HookTemplate;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trae/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAI5C,eAAO,MAAM,YAAY,QAAO,aAAa,EAAoB,CAAC;AAClE,eAAO,MAAM,mBAAmB,QAAO,YACZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Trae IDE templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ *
6
+ * Directory structure:
7
+ * trae/
8
+ * ├── agents/ # Multi-agent pipeline agents (Markdown)
9
+ * └── hooks.json # Hook configuration
10
+ */
11
+ import { createTemplateReader, } from "../template-utils.js";
12
+ const { listMdAgents, getSettings } = createTemplateReader(import.meta.url);
13
+ export const getAllAgents = () => listMdAgents();
14
+ export const getSettingsTemplate = () => getSettings("hooks.json");
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trae/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAoB,EAAE,CAAC,YAAY,EAAE,CAAC;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAiB,EAAE,CACpD,WAAW,CAAC,YAAY,CAAC,CAAC"}
@@ -43,6 +43,7 @@ _KNOWN_PLATFORMS = {
43
43
  "kiro",
44
44
  "copilot",
45
45
  "pi",
46
+ "trae",
46
47
  }
47
48
 
48
49
  _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
@@ -57,6 +58,7 @@ _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
57
58
  ("kiro", ("KIRO_SESSION_ID",)),
58
59
  ("copilot", ("COPILOT_SESSION_ID", "COPILOT_SESSIONID")),
59
60
  ("pi", ("PI_SESSION_ID", "PI_SESSIONID")),
61
+ ("trae", ("TRAE_SESSION_ID",)),
60
62
  )
61
63
  _ENV_CONVERSATION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
62
64
  ("cursor", ("CURSOR_CONVERSATION_ID", "CURSOR_CONVERSATIONID")),
@@ -19,6 +19,7 @@ Supported platforms:
19
19
  - copilot: GitHub Copilot (VS Code)
20
20
  - droid: Factory Droid (commands-based)
21
21
  - pi: Pi Agent (extension-backed)
22
+ - trae: Trae IDE (IDE-only, hooks-based)
22
23
 
23
24
  Usage:
24
25
  from common.cli_adapter import CLIAdapter
@@ -53,6 +54,7 @@ Platform = Literal[
53
54
  "copilot",
54
55
  "droid",
55
56
  "pi",
57
+ "trae",
56
58
  ]
57
59
 
58
60
 
@@ -97,7 +99,7 @@ class CLIAdapter:
97
99
  """Get platform-specific config directory name.
98
100
 
99
101
  Returns:
100
- Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.devin', '.qoder', '.codebuddy', '.github/copilot', '.factory', or '.pi')
102
+ Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.devin', '.qoder', '.codebuddy', '.github/copilot', '.factory', '.pi', or '.trae')
101
103
  """
102
104
  if self.platform == "opencode":
103
105
  return ".opencode"
@@ -127,6 +129,8 @@ class CLIAdapter:
127
129
  return ".factory"
128
130
  elif self.platform == "pi":
129
131
  return ".pi"
132
+ elif self.platform == "trae":
133
+ return ".trae"
130
134
  else:
131
135
  return ".claude"
132
136
 
@@ -137,7 +141,7 @@ class CLIAdapter:
137
141
  project_root: Project root directory
138
142
 
139
143
  Returns:
140
- Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .devin, .qoder, .codebuddy, .github/copilot, .factory, or .pi)
144
+ Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .devin, .qoder, .codebuddy, .github/copilot, .factory, .pi, or .trae)
141
145
  """
142
146
  return project_root / self.config_dir_name
143
147
 
@@ -305,6 +309,8 @@ class CLIAdapter:
305
309
  return {}
306
310
  elif self.platform == "pi":
307
311
  return {}
312
+ elif self.platform == "trae":
313
+ return {}
308
314
  else:
309
315
  return {"CLAUDE_NON_INTERACTIVE": "1"}
310
316
 
@@ -390,6 +396,10 @@ class CLIAdapter:
390
396
  )
391
397
  elif self.platform == "pi":
392
398
  cmd = ["pi", "-p", prompt]
399
+ elif self.platform == "trae":
400
+ raise ValueError(
401
+ "Trae is IDE-only; CLI agent run is not supported."
402
+ )
393
403
 
394
404
  else: # claude
395
405
  cmd = ["claude", "-p"]
@@ -456,6 +466,10 @@ class CLIAdapter:
456
466
  )
457
467
  elif self.platform == "pi":
458
468
  return ["pi", "-c", session_id]
469
+ elif self.platform == "trae":
470
+ raise ValueError(
471
+ "Trae is IDE-only; CLI resume is not supported."
472
+ )
459
473
  else:
460
474
  return ["claude", "--resume", session_id]
461
475
 
@@ -530,6 +544,8 @@ class CLIAdapter:
530
544
  return "droid"
531
545
  elif self.platform == "pi":
532
546
  return "pi"
547
+ elif self.platform == "trae":
548
+ return "trae"
533
549
  else:
534
550
  return "claude"
535
551
 
@@ -594,7 +610,7 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
594
610
  """Get CLI adapter for the specified platform.
595
611
 
596
612
  Args:
597
- platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')
613
+ platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or 'trae')
598
614
 
599
615
  Returns:
600
616
  CLIAdapter instance
@@ -625,9 +641,10 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
625
641
  "copilot",
626
642
  "droid",
627
643
  "pi",
644
+ "trae",
628
645
  ):
629
646
  raise ValueError(
630
- f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')"
647
+ f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or 'trae')"
631
648
  )
632
649
 
633
650
  return CLIAdapter(platform=platform) # type: ignore
@@ -650,6 +667,7 @@ _ALL_PLATFORM_CONFIG_DIRS = (
650
667
  ".github/copilot",
651
668
  ".factory",
652
669
  ".pi",
670
+ ".trae",
653
671
  )
654
672
  """Platform-specific config directory names used by detect_platform exclusion
655
673
  checks. `.agents/skills/` is NOT listed here: it is a shared cross-platform
@@ -675,22 +693,25 @@ def detect_platform(project_root: Path) -> Platform:
675
693
  2. .opencode directory exists → opencode
676
694
  3. .iflow directory exists → iflow
677
695
  4. .cursor directory exists (without .claude) → cursor
678
- 5. .codex exists and no other platform dirs codex
679
- 6. .kilocode directory exists → kilo
680
- 7. .kiro/skills exists and no other platform dirs kiro
681
- 8. .gemini directory exists → gemini
696
+ 5. .gemini directory exists → gemini
697
+ 6. .codex exists and no other platform dirs codex
698
+ 7. .kilocode directory exists → kilo
699
+ 8. .kiro/skills exists and no other platform dirs kiro
682
700
  9. .agent/workflows exists and no other platform dirs → antigravity
683
701
  10. .devin/workflows (or legacy .windsurf/workflows) exists and no other platform dirs → devin
684
702
  11. .codebuddy directory exists → codebuddy
685
703
  12. .qoder directory exists → qoder
686
- 13. .pi directory exists → pi
687
- 14. Defaultclaude
704
+ 13. .github/copilot directory exists → copilot
705
+ 14. .factory directory exists droid
706
+ 15. .pi directory exists → pi
707
+ 16. .trae directory exists → trae
708
+ 17. Default → claude
688
709
 
689
710
  Args:
690
711
  project_root: Project root directory
691
712
 
692
713
  Returns:
693
- Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or default 'claude')
714
+ Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', 'trae', or default 'claude')
694
715
  """
695
716
  import os
696
717
 
@@ -715,6 +736,7 @@ def detect_platform(project_root: Path) -> Platform:
715
736
  "copilot",
716
737
  "droid",
717
738
  "pi",
739
+ "trae",
718
740
  ):
719
741
  return env_platform # type: ignore
720
742
 
@@ -791,6 +813,10 @@ def detect_platform(project_root: Path) -> Platform:
791
813
  if (project_root / ".pi").is_dir():
792
814
  return "pi"
793
815
 
816
+ # Check for .trae directory (Trae IDE-specific)
817
+ if (project_root / ".trae").is_dir():
818
+ return "trae"
819
+
794
820
  # Fallback: checkout only has the Codex shared-skills layer
795
821
  # (.agents/skills/trellis-* dirs) and no explicit platform config dir.
796
822
  # Happens on fresh clones where .codex/ is gitignored/absent but the
@@ -128,6 +128,7 @@ _SUBAGENT_CONFIG_DIRS: tuple[str, ...] = (
128
128
  ".factory", # Factory Droid
129
129
  ".github/copilot",
130
130
  ".pi", # Pi Agent
131
+ ".trae", # Trae IDE
131
132
  )
132
133
 
133
134
  _SEED_EXAMPLE = (
@@ -183,7 +183,7 @@ Complex task: ask the user if you can create a Trellis task and enter the planni
183
183
  - 1.0 Create task `[required · once]` (only after task-creation consent)
184
184
  - 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
185
185
  - 1.2 Research `[optional · repeatable]`
186
- - 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi (sub-agent-dispatch platforms only; inline platforms skip)
186
+ - 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix (sub-agent-dispatch platforms only; inline platforms skip)
187
187
  - 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
188
188
  - 1.5 Completion criteria
189
189
 
@@ -220,7 +220,7 @@ Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-bef
220
220
  therefore must cover every required step from implementation through
221
221
  commit, including Phase 3.3 spec update and Phase 3.4 commit. -->
222
222
 
223
- Sub-agent dispatch protocol applies to all platforms and all sub-agents, including class-2 Codex/Copilot/Gemini/Qoder and `trellis-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions.
223
+ Sub-agent dispatch protocol applies to all platforms and all sub-agents, including class-2 Codex/Gemini/Qoder/Copilot/ZCode/Reasonix/Trae and `trellis-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions.
224
224
 
225
225
  [workflow-state:in_progress]
226
226
  Tools: `trellis-implement` / `trellis-research` are sub-agent types only (Task/Agent tool, NOT Skill; there is no skill by these names). `trellis-update-spec` is a skill. `trellis-check` exists as both; prefer the Agent form when verifying after code changes.
@@ -272,13 +272,13 @@ Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
272
272
 
273
273
  When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
274
274
 
275
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
275
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
276
276
 
277
277
  - Planning or unclear requirements -> `trellis-brainstorm`.
278
278
  - `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
279
279
  - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
280
280
 
281
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
281
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
282
282
 
283
283
  [codex-inline, Kilo, Antigravity, Devin]
284
284
 
@@ -353,7 +353,7 @@ Return to this step whenever requirements change and revise the relevant artifac
353
353
 
354
354
  Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
355
355
 
356
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
356
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
357
357
 
358
358
  Spawn the research sub-agent:
359
359
 
@@ -361,7 +361,7 @@ Spawn the research sub-agent:
361
361
  - **Task description**: Research <specific question>
362
362
  - **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
363
363
 
364
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
364
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
365
365
 
366
366
  [codex-inline, Kilo, Antigravity, Devin]
367
367
 
@@ -380,7 +380,7 @@ Brainstorm and research can interleave freely — pause to research a technical
380
380
 
381
381
  #### 1.3 Configure context `[required · once]`
382
382
 
383
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
383
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
384
384
 
385
385
  Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
386
386
 
@@ -421,9 +421,11 @@ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reas
421
421
 
422
422
  Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
423
423
 
424
- Skip when: `implement.jsonl` and `check.jsonl` have agent-curated entries (the seed row alone doesn't count).
424
+ Ready gate: both `implement.jsonl` and `check.jsonl` must contain at least one real `{"file": "...", "reason": "..."}` entry before `task.py start`. The seed `_example` row alone is not ready.
425
425
 
426
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
426
+ Skip this step only when both files already have real curated entries.
427
+
428
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
427
429
 
428
430
  [codex-inline, Kilo, Antigravity, Devin]
429
431
 
@@ -439,7 +441,7 @@ After artifact review, flip the task status to `in_progress`:
439
441
  python3 ./.trellis/scripts/task.py start <task-dir>
440
442
  ```
441
443
 
442
- For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-capable platforms, curate jsonl manifests when extra spec or research context is needed; seed-only manifests are tolerated by consumers.
444
+ For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-dispatch platforms, `implement.jsonl` and `check.jsonl` must both have real curated entries before start. Runtime consumers tolerate missing or seed-only manifests for compatibility, but that tolerance is not a planning-ready state.
443
445
 
444
446
  After this command succeeds, the breadcrumb auto-switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
445
447
 
@@ -456,11 +458,11 @@ If `task.py start` errors with a session-identity message (no context key from h
456
458
  | `design.md` exists (complex tasks) | ✅ |
457
459
  | `implement.md` exists (complex tasks) | ✅ |
458
460
 
459
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
461
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
460
462
 
461
- | `implement.jsonl` / `check.jsonl` curated when extra spec or research context is needed | recommended |
463
+ | `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | |
462
464
 
463
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
465
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
464
466
 
465
467
  ---
466
468
 
@@ -470,7 +472,7 @@ Goal: turn reviewed planning artifacts into code that passes quality checks.
470
472
 
471
473
  #### 2.1 Implement `[required · repeatable]`
472
474
 
473
- [Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
475
+ [Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
474
476
 
475
477
  Spawn the implement sub-agent:
476
478
 
@@ -482,9 +484,9 @@ The platform hook/plugin auto-handles:
482
484
  - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
483
485
  - Injects `prd.md`, `design.md` if present, and `implement.md` if present
484
486
 
485
- [/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
487
+ [/Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
486
488
 
487
- [codex-sub-agent]
489
+ [codex-sub-agent, Gemini, Qoder, Copilot, ZCode, Reasonix, Trae]
488
490
 
489
491
  Spawn the implement sub-agent:
490
492
 
@@ -492,11 +494,11 @@ Spawn the implement sub-agent:
492
494
  - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
493
495
  - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then explicitly say the spawned agent is already `trellis-implement` and must implement directly without spawning another `trellis-implement` / `trellis-check`.
494
496
 
495
- The Codex sub-agent definition auto-handles the context load requirement:
497
+ The pull-based sub-agent definition auto-handles the context load requirement:
496
498
  - Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
497
499
  - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
498
500
 
499
- [/codex-sub-agent]
501
+ [/codex-sub-agent, Gemini, Qoder, Copilot, ZCode, Reasonix, Trae]
500
502
 
501
503
  [Kiro]
502
504
 
@@ -524,7 +526,7 @@ The platform prelude auto-handles the context load requirement:
524
526
 
525
527
  #### 2.2 Quality check `[required · repeatable]`
526
528
 
527
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
529
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
528
530
 
529
531
  Spawn the check sub-agent:
530
532
 
@@ -538,7 +540,7 @@ The check agent's job:
538
540
  - Auto-fix issues it finds
539
541
  - Run lint and typecheck to verify
540
542
 
541
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
543
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
542
544
 
543
545
  [codex-inline, Kilo, Antigravity, Devin]
544
546