@mindfoldhq/trellis 0.6.2 → 0.6.4

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 (109) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.js +11 -2
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +5 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +49 -2
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/mem.d.ts.map +1 -1
  9. package/dist/commands/mem.js +4 -3
  10. package/dist/commands/mem.js.map +1 -1
  11. package/dist/commands/update.d.ts.map +1 -1
  12. package/dist/commands/update.js +1 -2
  13. package/dist/commands/update.js.map +1 -1
  14. package/dist/configurators/antigravity.d.ts +1 -1
  15. package/dist/configurators/antigravity.js +1 -1
  16. package/dist/configurators/claude.d.ts +5 -2
  17. package/dist/configurators/claude.d.ts.map +1 -1
  18. package/dist/configurators/claude.js +37 -4
  19. package/dist/configurators/claude.js.map +1 -1
  20. package/dist/configurators/codebuddy.d.ts +1 -1
  21. package/dist/configurators/codebuddy.js +1 -1
  22. package/dist/configurators/codex.d.ts.map +1 -1
  23. package/dist/configurators/codex.js +3 -17
  24. package/dist/configurators/codex.js.map +1 -1
  25. package/dist/configurators/copilot.d.ts +1 -1
  26. package/dist/configurators/copilot.js +1 -1
  27. package/dist/configurators/cursor.d.ts +1 -1
  28. package/dist/configurators/cursor.js +1 -1
  29. package/dist/configurators/devin.d.ts +7 -0
  30. package/dist/configurators/devin.d.ts.map +1 -0
  31. package/dist/configurators/{windsurf.js → devin.js} +7 -7
  32. package/dist/configurators/devin.js.map +1 -0
  33. package/dist/configurators/droid.d.ts +1 -1
  34. package/dist/configurators/droid.js +1 -1
  35. package/dist/configurators/gemini.d.ts +1 -1
  36. package/dist/configurators/gemini.js +1 -1
  37. package/dist/configurators/index.d.ts +2 -1
  38. package/dist/configurators/index.d.ts.map +1 -1
  39. package/dist/configurators/index.js +22 -15
  40. package/dist/configurators/index.js.map +1 -1
  41. package/dist/configurators/kilo.d.ts +1 -1
  42. package/dist/configurators/kilo.js +1 -1
  43. package/dist/configurators/kiro.d.ts +4 -2
  44. package/dist/configurators/kiro.d.ts.map +1 -1
  45. package/dist/configurators/kiro.js +12 -3
  46. package/dist/configurators/kiro.js.map +1 -1
  47. package/dist/configurators/shared.d.ts +18 -24
  48. package/dist/configurators/shared.d.ts.map +1 -1
  49. package/dist/configurators/shared.js +19 -39
  50. package/dist/configurators/shared.js.map +1 -1
  51. package/dist/configurators/zcode.d.ts +19 -0
  52. package/dist/configurators/zcode.d.ts.map +1 -0
  53. package/dist/configurators/zcode.js +54 -0
  54. package/dist/configurators/zcode.js.map +1 -0
  55. package/dist/migrations/manifests/0.6.3.json +24 -0
  56. package/dist/migrations/manifests/0.6.4.json +9 -0
  57. package/dist/templates/claude/hooks/statusline.py +324 -0
  58. package/dist/templates/claude/index.d.ts +10 -1
  59. package/dist/templates/claude/index.d.ts.map +1 -1
  60. package/dist/templates/claude/index.js +12 -1
  61. package/dist/templates/claude/index.js.map +1 -1
  62. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +4 -4
  63. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +2 -0
  64. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +2 -1
  65. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
  66. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +3 -3
  67. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +2 -2
  68. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
  69. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +3 -1
  70. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +2 -0
  71. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +2 -2
  72. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +4 -2
  73. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +3 -1
  74. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +2 -2
  75. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +23 -24
  76. package/dist/templates/common/skills/brainstorm.md +43 -0
  77. package/dist/templates/common/skills/break-loop.md +59 -0
  78. package/dist/templates/kiro/agents/trellis.json +34 -0
  79. package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +14 -0
  80. package/dist/templates/kiro/index.d.ts +16 -2
  81. package/dist/templates/kiro/index.d.ts.map +1 -1
  82. package/dist/templates/kiro/index.js +13 -3
  83. package/dist/templates/kiro/index.js.map +1 -1
  84. package/dist/templates/shared-hooks/index.d.ts +12 -4
  85. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  86. package/dist/templates/shared-hooks/index.js +17 -5
  87. package/dist/templates/shared-hooks/index.js.map +1 -1
  88. package/dist/templates/shared-hooks/inject-workflow-state.py +13 -3
  89. package/dist/templates/shared-hooks/session-start.py +8 -0
  90. package/dist/templates/trellis/scripts/add_session.py +26 -6
  91. package/dist/templates/trellis/scripts/common/cli_adapter.py +46 -32
  92. package/dist/templates/trellis/scripts/common/safe_commit.py +46 -16
  93. package/dist/templates/trellis/scripts/common/task_store.py +2 -2
  94. package/dist/templates/trellis/scripts/common/workflow_phase.py +1 -1
  95. package/dist/templates/trellis/workflow.md +23 -23
  96. package/dist/templates/zcode/agents/trellis-check.md +102 -0
  97. package/dist/templates/zcode/agents/trellis-implement.md +102 -0
  98. package/dist/templates/zcode/index.d.ts +15 -0
  99. package/dist/templates/zcode/index.d.ts.map +1 -0
  100. package/dist/templates/zcode/index.js +18 -0
  101. package/dist/templates/zcode/index.js.map +1 -0
  102. package/dist/types/ai-tools.d.ts +4 -4
  103. package/dist/types/ai-tools.d.ts.map +1 -1
  104. package/dist/types/ai-tools.js +25 -7
  105. package/dist/types/ai-tools.js.map +1 -1
  106. package/package.json +2 -2
  107. package/dist/configurators/windsurf.d.ts +0 -7
  108. package/dist/configurators/windsurf.d.ts.map +0 -1
  109. package/dist/configurators/windsurf.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  """
2
2
  CLI Adapter for Multi-Platform Support.
3
3
 
4
- Abstracts differences between Claude Code, OpenCode, Cursor, iFlow, Codex, Kilo, Kiro Code, Gemini CLI, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Factory Droid, and Pi Agent interfaces.
4
+ Abstracts differences between Claude Code, OpenCode, Cursor, iFlow, Codex, Kilo, Kiro Code, Gemini CLI, Antigravity, Devin, Qoder, CodeBuddy, GitHub Copilot, Factory Droid, and Pi Agent interfaces.
5
5
 
6
6
  Supported platforms:
7
7
  - claude: Claude Code (default)
@@ -13,7 +13,7 @@ Supported platforms:
13
13
  - kiro: Kiro Code (skills-based)
14
14
  - gemini: Gemini CLI
15
15
  - antigravity: Antigravity (workflow-based)
16
- - windsurf: Windsurf (workflow-based)
16
+ - devin: Devin (formerly Windsurf; workflow-based)
17
17
  - qoder: Qoder
18
18
  - codebuddy: CodeBuddy
19
19
  - copilot: GitHub Copilot (VS Code)
@@ -47,7 +47,7 @@ Platform = Literal[
47
47
  "kiro",
48
48
  "gemini",
49
49
  "antigravity",
50
- "windsurf",
50
+ "devin",
51
51
  "qoder",
52
52
  "codebuddy",
53
53
  "copilot",
@@ -97,7 +97,7 @@ class CLIAdapter:
97
97
  """Get platform-specific config directory name.
98
98
 
99
99
  Returns:
100
- Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.windsurf', '.qoder', '.codebuddy', '.github/copilot', '.factory', or '.pi')
100
+ Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.devin', '.qoder', '.codebuddy', '.github/copilot', '.factory', or '.pi')
101
101
  """
102
102
  if self.platform == "opencode":
103
103
  return ".opencode"
@@ -115,8 +115,8 @@ class CLIAdapter:
115
115
  return ".gemini"
116
116
  elif self.platform == "antigravity":
117
117
  return ".agent"
118
- elif self.platform == "windsurf":
119
- return ".windsurf"
118
+ elif self.platform == "devin":
119
+ return ".devin"
120
120
  elif self.platform == "qoder":
121
121
  return ".qoder"
122
122
  elif self.platform == "codebuddy":
@@ -137,7 +137,7 @@ class CLIAdapter:
137
137
  project_root: Project root directory
138
138
 
139
139
  Returns:
140
- Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .windsurf, .qoder, .codebuddy, .github/copilot, .factory, or .pi)
140
+ Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .devin, .qoder, .codebuddy, .github/copilot, .factory, or .pi)
141
141
  """
142
142
  return project_root / self.config_dir_name
143
143
 
@@ -169,7 +169,7 @@ class CLIAdapter:
169
169
  Note:
170
170
  Cursor uses prefix naming: .cursor/commands/trellis-<name>.md
171
171
  Antigravity uses workflow directory: .agent/workflows/<name>.md
172
- Windsurf uses workflow directory: .windsurf/workflows/trellis-<name>.md
172
+ Devin uses workflow directory: .devin/workflows/trellis-<name>.md
173
173
  Copilot uses prompt files: .github/prompts/<name>.prompt.md
174
174
  Pi uses prompt templates: .pi/prompts/trellis-<name>.md
175
175
  Claude/OpenCode use subdirectory: .claude/commands/trellis/<name>.md
@@ -185,7 +185,7 @@ class CLIAdapter:
185
185
  return prompts_dir / f"trellis-{filename}.md"
186
186
  return prompts_dir / Path(*parts)
187
187
 
188
- if self.platform == "windsurf":
188
+ if self.platform == "devin":
189
189
  workflow_dir = self.get_config_dir(project_root) / "workflows"
190
190
  if not parts:
191
191
  return workflow_dir
@@ -242,7 +242,7 @@ class CLIAdapter:
242
242
  Kiro: .kiro/skills/trellis-<name>/SKILL.md
243
243
  Gemini: .gemini/commands/trellis/<name>.toml
244
244
  Antigravity: .agent/workflows/<name>.md
245
- Windsurf: .windsurf/workflows/trellis-<name>.md
245
+ Devin: .devin/workflows/trellis-<name>.md
246
246
  Pi: .pi/prompts/trellis-<name>.md
247
247
  Others: .{platform}/commands/trellis/<name>.md
248
248
  """
@@ -258,8 +258,8 @@ class CLIAdapter:
258
258
  return f".gemini/commands/trellis/{name}.toml"
259
259
  elif self.platform == "antigravity":
260
260
  return f".agent/workflows/{name}.md"
261
- elif self.platform == "windsurf":
262
- return f".windsurf/workflows/trellis-{name}.md"
261
+ elif self.platform == "devin":
262
+ return f".devin/workflows/trellis-{name}.md"
263
263
  elif self.platform == "kilo":
264
264
  return f".kilocode/workflows/{name}.md"
265
265
  elif self.platform == "copilot":
@@ -293,7 +293,7 @@ class CLIAdapter:
293
293
  return {} # Gemini CLI doesn't have a non-interactive env var
294
294
  elif self.platform == "antigravity":
295
295
  return {}
296
- elif self.platform == "windsurf":
296
+ elif self.platform == "devin":
297
297
  return {}
298
298
  elif self.platform == "qoder":
299
299
  return {}
@@ -370,9 +370,9 @@ class CLIAdapter:
370
370
  raise ValueError(
371
371
  "Antigravity workflows are UI slash commands; CLI agent run is not supported."
372
372
  )
373
- elif self.platform == "windsurf":
373
+ elif self.platform == "devin":
374
374
  raise ValueError(
375
- "Windsurf workflows are UI slash commands; CLI agent run is not supported."
375
+ "Devin workflows are UI slash commands; CLI agent run is not supported."
376
376
  )
377
377
  elif self.platform == "qoder":
378
378
  cmd = ["qodercli", "-p", prompt]
@@ -436,9 +436,9 @@ class CLIAdapter:
436
436
  raise ValueError(
437
437
  "Antigravity workflows are UI slash commands; CLI resume is not supported."
438
438
  )
439
- elif self.platform == "windsurf":
439
+ elif self.platform == "devin":
440
440
  raise ValueError(
441
- "Windsurf workflows are UI slash commands; CLI resume is not supported."
441
+ "Devin workflows are UI slash commands; CLI resume is not supported."
442
442
  )
443
443
  elif self.platform == "qoder":
444
444
  return ["qodercli", "--resume", session_id]
@@ -518,8 +518,8 @@ class CLIAdapter:
518
518
  return "gemini"
519
519
  elif self.platform == "antigravity":
520
520
  return "agy"
521
- elif self.platform == "windsurf":
522
- return "windsurf"
521
+ elif self.platform == "devin":
522
+ return "devin"
523
523
  elif self.platform == "qoder":
524
524
  return "qodercli"
525
525
  elif self.platform == "codebuddy":
@@ -594,14 +594,21 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
594
594
  """Get CLI adapter for the specified platform.
595
595
 
596
596
  Args:
597
- platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'windsurf', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')
597
+ platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')
598
598
 
599
599
  Returns:
600
600
  CLIAdapter instance
601
601
 
602
602
  Raises:
603
603
  ValueError: If platform is not supported
604
+
605
+ Note:
606
+ 'windsurf' is accepted as a deprecated alias for 'devin' (Windsurf was
607
+ renamed to Devin) and normalized before validation.
604
608
  """
609
+ # Deprecated alias: Windsurf was renamed to Devin.
610
+ if platform == "windsurf":
611
+ platform = "devin"
605
612
  if platform not in (
606
613
  "claude",
607
614
  "opencode",
@@ -612,7 +619,7 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
612
619
  "kiro",
613
620
  "gemini",
614
621
  "antigravity",
615
- "windsurf",
622
+ "devin",
616
623
  "qoder",
617
624
  "codebuddy",
618
625
  "copilot",
@@ -620,7 +627,7 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
620
627
  "pi",
621
628
  ):
622
629
  raise ValueError(
623
- f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'windsurf', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')"
630
+ f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or 'pi')"
624
631
  )
625
632
 
626
633
  return CLIAdapter(platform=platform) # type: ignore
@@ -636,7 +643,8 @@ _ALL_PLATFORM_CONFIG_DIRS = (
636
643
  ".kiro",
637
644
  ".gemini",
638
645
  ".agent",
639
- ".windsurf",
646
+ ".devin",
647
+ ".windsurf", # deprecated: pre-rename Devin config dir (still a platform signal)
640
648
  ".qoder",
641
649
  ".codebuddy",
642
650
  ".github/copilot",
@@ -647,7 +655,7 @@ _ALL_PLATFORM_CONFIG_DIRS = (
647
655
  checks. `.agents/skills/` is NOT listed here: it is a shared cross-platform
648
656
  layer (written by Codex, also consumed by Amp/Cline/Warp/etc. via the
649
657
  agentskills.io standard), not a single-platform signal. Its presence must not
650
- block detection of Kiro, Antigravity, Windsurf, or other platforms."""
658
+ block detection of Kiro, Antigravity, Devin, or other platforms."""
651
659
 
652
660
 
653
661
  def _has_other_platform_dir(project_root: Path, exclude: set[str]) -> bool:
@@ -672,7 +680,7 @@ def detect_platform(project_root: Path) -> Platform:
672
680
  7. .kiro/skills exists and no other platform dirs → kiro
673
681
  8. .gemini directory exists → gemini
674
682
  9. .agent/workflows exists and no other platform dirs → antigravity
675
- 10. .windsurf/workflows exists and no other platform dirs → windsurf
683
+ 10. .devin/workflows (or legacy .windsurf/workflows) exists and no other platform dirs → devin
676
684
  11. .codebuddy directory exists → codebuddy
677
685
  12. .qoder directory exists → qoder
678
686
  13. .pi directory exists → pi
@@ -682,12 +690,15 @@ def detect_platform(project_root: Path) -> Platform:
682
690
  project_root: Project root directory
683
691
 
684
692
  Returns:
685
- Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'windsurf', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or default 'claude')
693
+ Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or default 'claude')
686
694
  """
687
695
  import os
688
696
 
689
697
  # Check environment variable first
690
698
  env_platform = os.environ.get("TRELLIS_PLATFORM", "").lower()
699
+ # Deprecated alias: Windsurf was renamed to Devin.
700
+ if env_platform == "windsurf":
701
+ env_platform = "devin"
691
702
  if env_platform in (
692
703
  "claude",
693
704
  "opencode",
@@ -698,7 +709,7 @@ def detect_platform(project_root: Path) -> Platform:
698
709
  "kiro",
699
710
  "gemini",
700
711
  "antigravity",
701
- "windsurf",
712
+ "devin",
702
713
  "qoder",
703
714
  "codebuddy",
704
715
  "copilot",
@@ -749,13 +760,16 @@ def detect_platform(project_root: Path) -> Platform:
749
760
  ):
750
761
  return "antigravity"
751
762
 
752
- # Check for Windsurf workflow directory only when no other platform config exists
763
+ # Check for Devin workflow directory only when no other platform config
764
+ # exists. `.windsurf/workflows` is the legacy pre-rename path (still detected
765
+ # as devin for back-compat until users migrate via `trellis update --migrate`).
753
766
  if (
754
- project_root / ".windsurf" / "workflows"
755
- ).is_dir() and not _has_other_platform_dir(
756
- project_root, {".windsurf"}
767
+ (project_root / ".devin" / "workflows").is_dir()
768
+ or (project_root / ".windsurf" / "workflows").is_dir()
769
+ ) and not _has_other_platform_dir(
770
+ project_root, {".devin", ".windsurf"}
757
771
  ):
758
- return "windsurf"
772
+ return "devin"
759
773
 
760
774
  # Check for .codebuddy directory (CodeBuddy-specific)
761
775
  if (project_root / ".codebuddy").is_dir():
@@ -58,7 +58,10 @@ TRELLIS_IGNORED_SUBPATHS = (
58
58
  )
59
59
 
60
60
 
61
- def safe_trellis_paths_to_add(repo_root: Path) -> list[str]:
61
+ def safe_trellis_paths_to_add(
62
+ repo_root: Path,
63
+ task_name: str | None = None,
64
+ ) -> list[str]:
62
65
  """Return the list of repo-relative paths the auto-commit should stage.
63
66
 
64
67
  Only includes paths that exist on disk so callers don't pass non-existent
@@ -68,12 +71,23 @@ def safe_trellis_paths_to_add(repo_root: Path) -> list[str]:
68
71
  Included:
69
72
  - .trellis/workspace/<developer>/journal-*.md
70
73
  - .trellis/workspace/<developer>/index.md
71
- - .trellis/tasks/<task-dir>/ (every active task directory)
72
- - .trellis/tasks/archive/ (whole archive subtree, if present)
74
+ - .trellis/tasks/<task_name>/ (ONLY the current task dir when
75
+ ``task_name`` is passed; plus its archive location if the task
76
+ already lives under archive/)
73
77
 
74
78
  Excluded (intentionally — these must not be staged):
75
79
  - .trellis/.backup-*, .trellis/worktrees/,
76
80
  .trellis/.template-hashes.json, .trellis/.runtime/, .trellis/.cache/
81
+
82
+ Scope contract (see #303 / break-loop analysis): when ``task_name`` is
83
+ passed, the task segment stages ONLY that task directory — it never walks
84
+ ``tasks_dir.iterdir()`` over all active tasks. This mirrors
85
+ :func:`safe_archive_paths_to_add` and prevents dirty changes in OTHER
86
+ parallel-window task dirs from being bundled into the session auto-commit.
87
+
88
+ Backwards-compat: with no ``task_name``, the function walks every active
89
+ task directory (+ the archive subtree) the old wide way. New callers
90
+ should always pass ``task_name``.
77
91
  """
78
92
  paths: list[str] = []
79
93
 
@@ -93,20 +107,36 @@ def safe_trellis_paths_to_add(repo_root: Path) -> list[str]:
93
107
  f"{DIR_WORKFLOW}/{DIR_WORKSPACE}/{developer}/index.md"
94
108
  )
95
109
 
96
- # Active tasks: each direct child of tasks/ that is a directory and not
97
- # the archive root. The archive subtree is added as a single path below.
98
110
  tasks_dir = repo_root / DIR_WORKFLOW / DIR_TASKS
99
- if tasks_dir.is_dir():
100
- for child in sorted(tasks_dir.iterdir()):
101
- if not child.is_dir():
102
- continue
103
- if child.name == DIR_ARCHIVE:
104
- continue
105
- paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{child.name}")
106
-
107
- archive_dir = tasks_dir / DIR_ARCHIVE
108
- if archive_dir.is_dir():
109
- paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}")
111
+ if not tasks_dir.is_dir():
112
+ return paths
113
+
114
+ if task_name is not None:
115
+ # Narrow scope — ONLY the current task directory (active or archived).
116
+ # Never iterdir() all tasks: parallel-window dirty task dirs must not
117
+ # leak into the session auto-commit.
118
+ active_task = tasks_dir / task_name
119
+ if active_task.is_dir():
120
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{task_name}")
121
+ archived_task = tasks_dir / DIR_ARCHIVE / task_name
122
+ if archived_task.is_dir():
123
+ paths.append(
124
+ f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}/{task_name}"
125
+ )
126
+ return paths
127
+
128
+ # Legacy wide scope (no task_name): each direct child of tasks/ that is a
129
+ # directory and not the archive root, plus the whole archive subtree.
130
+ for child in sorted(tasks_dir.iterdir()):
131
+ if not child.is_dir():
132
+ continue
133
+ if child.name == DIR_ARCHIVE:
134
+ continue
135
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{child.name}")
136
+
137
+ archive_dir = tasks_dir / DIR_ARCHIVE
138
+ if archive_dir.is_dir():
139
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}")
110
140
 
111
141
  return paths
112
142
 
@@ -115,7 +115,7 @@ def _repo_relative_path(path: Path, repo_root: Path) -> str:
115
115
  # Keep in sync with src/types/ai-tools.ts AI_TOOLS entries — these are the
116
116
  # platforms listed in workflow.md's "agent-capable" Skill Routing block
117
117
  # (Class-1 hook-inject + Class-2 pull-based preludes). Kilo / Antigravity /
118
- # Windsurf are NOT in this list: they do not consume JSONL.
118
+ # Devin are NOT in this list: they do not consume JSONL.
119
119
  _SUBAGENT_CONFIG_DIRS: tuple[str, ...] = (
120
120
  ".claude",
121
121
  ".cursor",
@@ -299,7 +299,7 @@ def cmd_create(args: argparse.Namespace) -> int:
299
299
 
300
300
  # Seed implement.jsonl / check.jsonl for sub-agent-capable platforms.
301
301
  # Agent curates real entries during planning when the task needs them.
302
- # Agent-less platforms (Kilo / Antigravity / Windsurf) skip this — they
302
+ # Agent-less platforms (Kilo / Antigravity / Devin) skip this — they
303
303
  # load specs via the trellis-before-dev skill instead of JSONL.
304
304
  seeded_jsonl = False
305
305
  if _has_subagent_platform(repo_root):
@@ -148,7 +148,7 @@ def resolve_effective_platform(platform: str, config: dict) -> str:
148
148
  or ``"codex-sub-agent"`` based on ``.trellis/config.yaml`` ``codex.dispatch_mode``.
149
149
  ``filter_platform`` then surfaces blocks whose marker lists include the
150
150
  namespaced name (e.g. ``[codex-sub-agent, ...]`` or ``[codex-inline, Kilo,
151
- Antigravity, Windsurf]``).
151
+ Antigravity, Devin]``).
152
152
 
153
153
  Default is ``inline`` because Codex sub-agents run with ``fork_turns="none"``
154
154
  isolation and can't inherit the parent session's task context — inline
@@ -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
 
@@ -272,21 +272,21 @@ 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]
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]
282
282
 
283
- [codex-inline, Kilo, Antigravity, Windsurf]
283
+ [codex-inline, Kilo, Antigravity, Devin]
284
284
 
285
285
  - Planning or unclear requirements -> `trellis-brainstorm`.
286
286
  - Before editing -> `trellis-before-dev`; after editing -> `trellis-check`.
287
287
  - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
288
288
 
289
- [/codex-inline, Kilo, Antigravity, Windsurf]
289
+ [/codex-inline, Kilo, Antigravity, Devin]
290
290
 
291
291
  ### Guardrails
292
292
 
@@ -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]
357
357
 
358
358
  Spawn the research sub-agent:
359
359
 
@@ -361,13 +361,13 @@ 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]
365
365
 
366
- [codex-inline, Kilo, Antigravity, Windsurf]
366
+ [codex-inline, Kilo, Antigravity, Devin]
367
367
 
368
368
  Do the research in the main session directly and write findings into `{TASK_DIR}/research/`. (For `codex-inline` this avoids the `fork_turns="none"` isolation that prevents `trellis-research` sub-agents from resolving the active task path.)
369
369
 
370
- [/codex-inline, Kilo, Antigravity, Windsurf]
370
+ [/codex-inline, Kilo, Antigravity, Devin]
371
371
 
372
372
  **Research artifact conventions**:
373
373
  - One file per research topic (e.g. `research/auth-library-comparison.md`)
@@ -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]
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
 
@@ -423,13 +423,13 @@ Delete the seed `_example` line once real entries exist (optional — it's skipp
423
423
 
424
424
  Skip when: `implement.jsonl` and `check.jsonl` have agent-curated entries (the seed row alone doesn't count).
425
425
 
426
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
426
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix]
427
427
 
428
- [codex-inline, Kilo, Antigravity, Windsurf]
428
+ [codex-inline, Kilo, Antigravity, Devin]
429
429
 
430
430
  Skip this step. Context is loaded directly by the `trellis-before-dev` skill in Phase 2.
431
431
 
432
- [/codex-inline, Kilo, Antigravity, Windsurf]
432
+ [/codex-inline, Kilo, Antigravity, Devin]
433
433
 
434
434
  #### 1.4 Activate task `[required · once]`
435
435
 
@@ -456,11 +456,11 @@ If `task.py start` errors with a session-identity message (no context key from h
456
456
  | `design.md` exists (complex tasks) | ✅ |
457
457
  | `implement.md` exists (complex tasks) | ✅ |
458
458
 
459
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
459
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix]
460
460
 
461
461
  | `implement.jsonl` / `check.jsonl` curated when extra spec or research context is needed | recommended |
462
462
 
463
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
463
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix]
464
464
 
465
465
  ---
466
466
 
@@ -484,7 +484,7 @@ The platform hook/plugin auto-handles:
484
484
 
485
485
  [/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
486
486
 
487
- [codex-sub-agent]
487
+ [codex-sub-agent, ZCode, Reasonix]
488
488
 
489
489
  Spawn the implement sub-agent:
490
490
 
@@ -496,7 +496,7 @@ The Codex sub-agent definition auto-handles the context load requirement:
496
496
  - Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
497
497
  - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
498
498
 
499
- [/codex-sub-agent]
499
+ [/codex-sub-agent, ZCode, Reasonix]
500
500
 
501
501
  [Kiro]
502
502
 
@@ -512,7 +512,7 @@ The platform prelude auto-handles the context load requirement:
512
512
 
513
513
  [/Kiro]
514
514
 
515
- [codex-inline, Kilo, Antigravity, Windsurf]
515
+ [codex-inline, Kilo, Antigravity, Devin]
516
516
 
517
517
  1. Load the `trellis-before-dev` skill to read project guidelines
518
518
  2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
@@ -520,11 +520,11 @@ The platform prelude auto-handles the context load requirement:
520
520
  4. Implement the code per reviewed artifacts
521
521
  5. Run project lint and type-check
522
522
 
523
- [/codex-inline, Kilo, Antigravity, Windsurf]
523
+ [/codex-inline, Kilo, Antigravity, Devin]
524
524
 
525
525
  #### 2.2 Quality check `[required · repeatable]`
526
526
 
527
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
527
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix]
528
528
 
529
529
  Spawn the check sub-agent:
530
530
 
@@ -538,9 +538,9 @@ The check agent's job:
538
538
  - Auto-fix issues it finds
539
539
  - Run lint and typecheck to verify
540
540
 
541
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
541
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix]
542
542
 
543
- [codex-inline, Kilo, Antigravity, Windsurf]
543
+ [codex-inline, Kilo, Antigravity, Devin]
544
544
 
545
545
  Load the `trellis-check` skill and verify the code per its guidance:
546
546
  - Spec compliance
@@ -549,7 +549,7 @@ Load the `trellis-check` skill and verify the code per its guidance:
549
549
 
550
550
  If issues are found → fix → re-check, until green.
551
551
 
552
- [/codex-inline, Kilo, Antigravity, Windsurf]
552
+ [/codex-inline, Kilo, Antigravity, Devin]
553
553
 
554
554
  **Final pass (before Phase 3.4 commit)**: the last 2.2 of a task must run full-scope, not just on the latest implement chunk. List all affected packages with `python3 ./.trellis/scripts/get_context.py --mode packages`, then load each package's spec index Quality Check section. This catches cross-layer / multi-package issues a mid-iteration local 2.2 cannot.
555
555
 
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: trellis-check
3
+ description: |
4
+ Code quality check expert. Reviews code changes against specs and self-fixes issues.
5
+ color: "#4f46e5"
6
+ ---
7
+ # Check Agent
8
+
9
+ You are the Check Agent in the Trellis workflow.
10
+
11
+ ## Recursion Guard
12
+
13
+ You are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.
14
+
15
+ - Do NOT spawn another `trellis-check` or `trellis-implement` 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 implementation work is needed, report that recommendation instead of spawning.
18
+
19
+ ## Context
20
+
21
+ Before checking, read:
22
+ - `.trellis/spec/` - Development guidelines
23
+ - Pre-commit checklist for quality standards
24
+
25
+ ## Core Responsibilities
26
+
27
+ 1. **Get code changes** - Use git diff to get uncommitted code
28
+ 2. **Check against specs** - Verify code follows guidelines
29
+ 3. **Self-fix** - Fix issues yourself, not just report them
30
+ 4. **Run verification** - typecheck and lint
31
+
32
+ ## Important
33
+
34
+ **Fix issues yourself**, don't just report them.
35
+
36
+ You have write and edit tools, you can modify code directly.
37
+
38
+ ---
39
+
40
+ ## Workflow
41
+
42
+ ### Step 1: Get Changes
43
+
44
+ ```bash
45
+ git diff --name-only # List changed files
46
+ git diff # View specific changes
47
+ ```
48
+
49
+ ### Step 2: Check Against Specs
50
+
51
+ Read relevant specs in `.trellis/spec/` to check code:
52
+
53
+ - Does it follow directory structure conventions
54
+ - Does it follow naming conventions
55
+ - Does it follow code patterns
56
+ - Are there missing types
57
+ - Are there potential bugs
58
+
59
+ ### Step 3: Self-Fix
60
+
61
+ After finding issues:
62
+
63
+ 1. Fix the issue directly (use edit tool)
64
+ 2. Record what was fixed
65
+ 3. Continue checking other issues
66
+
67
+ ### Step 4: Run Verification
68
+
69
+ Run project's lint and typecheck commands to verify changes.
70
+
71
+ If failed, fix issues and re-run.
72
+
73
+ ---
74
+
75
+ ## Report Format
76
+
77
+ ```markdown
78
+ ## Self-Check Complete
79
+
80
+ ### Files Checked
81
+
82
+ - src/components/Feature.tsx
83
+ - src/hooks/useFeature.ts
84
+
85
+ ### Issues Found and Fixed
86
+
87
+ 1. `<file>:<line>` - <what was fixed>
88
+ 2. `<file>:<line>` - <what was fixed>
89
+
90
+ ### Issues Not Fixed
91
+
92
+ (If there are issues that cannot be self-fixed, list them here with reasons)
93
+
94
+ ### Verification Results
95
+
96
+ - TypeCheck: Passed
97
+ - Lint: Passed
98
+
99
+ ### Summary
100
+
101
+ Checked X files, found Y issues, all fixed.
102
+ ```