@pennixrv/trellis 0.7.2-beta.0 → 0.7.2-beta.11

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 (143) hide show
  1. package/README.md +14 -0
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +94 -96
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/teamwork/adapters/acp.d.ts.map +1 -1
  6. package/dist/commands/teamwork/adapters/acp.js +3 -0
  7. package/dist/commands/teamwork/adapters/acp.js.map +1 -1
  8. package/dist/commands/teamwork/adapters/index.d.ts +1 -1
  9. package/dist/commands/teamwork/adapters/index.d.ts.map +1 -1
  10. package/dist/commands/teamwork/artifact.d.ts +9 -4
  11. package/dist/commands/teamwork/artifact.d.ts.map +1 -1
  12. package/dist/commands/teamwork/artifact.js +8 -37
  13. package/dist/commands/teamwork/artifact.js.map +1 -1
  14. package/dist/commands/teamwork/batch.d.ts +1 -0
  15. package/dist/commands/teamwork/batch.d.ts.map +1 -1
  16. package/dist/commands/teamwork/batch.js +24 -3
  17. package/dist/commands/teamwork/batch.js.map +1 -1
  18. package/dist/commands/teamwork/coordinator.d.ts +16 -3
  19. package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
  20. package/dist/commands/teamwork/coordinator.js +209 -86
  21. package/dist/commands/teamwork/coordinator.js.map +1 -1
  22. package/dist/commands/teamwork/guard.js +2 -2
  23. package/dist/commands/teamwork/guard.js.map +1 -1
  24. package/dist/commands/teamwork/index.d.ts.map +1 -1
  25. package/dist/commands/teamwork/index.js +26 -2
  26. package/dist/commands/teamwork/index.js.map +1 -1
  27. package/dist/commands/teamwork/result.d.ts +2 -1
  28. package/dist/commands/teamwork/result.d.ts.map +1 -1
  29. package/dist/commands/teamwork/result.js.map +1 -1
  30. package/dist/commands/teamwork/runtime.d.ts +2 -2
  31. package/dist/commands/teamwork/runtime.d.ts.map +1 -1
  32. package/dist/commands/teamwork/runtime.js +60 -30
  33. package/dist/commands/teamwork/runtime.js.map +1 -1
  34. package/dist/commands/teamwork/spawn.d.ts.map +1 -1
  35. package/dist/commands/teamwork/spawn.js +2 -0
  36. package/dist/commands/teamwork/spawn.js.map +1 -1
  37. package/dist/commands/teamwork/supervisor.d.ts +1 -1
  38. package/dist/commands/teamwork/supervisor.d.ts.map +1 -1
  39. package/dist/commands/teamwork/teammate-adapters.d.ts +3 -0
  40. package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -1
  41. package/dist/commands/teamwork/teammate-adapters.js +14 -5
  42. package/dist/commands/teamwork/teammate-adapters.js.map +1 -1
  43. package/dist/commands/update.d.ts.map +1 -1
  44. package/dist/commands/update.js +34 -44
  45. package/dist/commands/update.js.map +1 -1
  46. package/dist/configurators/workflow.d.ts.map +1 -1
  47. package/dist/configurators/workflow.js +15 -52
  48. package/dist/configurators/workflow.js.map +1 -1
  49. package/dist/migrations/manifests/0.7.2-beta.1.json +11 -0
  50. package/dist/migrations/manifests/0.7.2-beta.10.json +9 -0
  51. package/dist/migrations/manifests/0.7.2-beta.2.json +11 -0
  52. package/dist/migrations/manifests/0.7.2-beta.3.json +9 -0
  53. package/dist/migrations/manifests/0.7.2-beta.4.json +9 -0
  54. package/dist/migrations/manifests/0.7.2-beta.5.json +9 -0
  55. package/dist/migrations/manifests/0.7.2-beta.6.json +9 -0
  56. package/dist/migrations/manifests/0.7.2-beta.7.json +9 -0
  57. package/dist/migrations/manifests/0.7.2-beta.8.json +9 -0
  58. package/dist/migrations/manifests/0.7.2-beta.9.json +9 -0
  59. package/dist/templates/claude/agents/trellis-implement.md +1 -1
  60. package/dist/templates/codebuddy/agents/trellis-implement.md +1 -1
  61. package/dist/templates/codex/hooks/session-start.py +24 -29
  62. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +2 -0
  63. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +7 -3
  64. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +2 -0
  65. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +2 -0
  66. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +6 -0
  67. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +2 -0
  68. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +14 -5
  69. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +6 -0
  70. package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +2 -0
  71. package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +1 -1
  72. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +7 -0
  73. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +6 -2
  74. package/dist/templates/common/bundled-skills/trellis-worktree-delegation/SKILL.md +14 -0
  75. package/dist/templates/common/bundled-skills/trellis-worktree-delegation/workflow.md +17 -0
  76. package/dist/templates/common/commands/continue.md +8 -0
  77. package/dist/templates/common/commands/start.md +2 -0
  78. package/dist/templates/common/skills/before-dev.md +3 -1
  79. package/dist/templates/common/skills/check.md +3 -1
  80. package/dist/templates/common/skills/request-intake.md +5 -3
  81. package/dist/templates/copilot/hooks/session-start.py +10 -29
  82. package/dist/templates/cursor/agents/trellis-implement.md +1 -1
  83. package/dist/templates/droid/droids/trellis-implement.md +1 -1
  84. package/dist/templates/dsh/agents/trellis-implement.md +1 -1
  85. package/dist/templates/gemini/agents/trellis-implement.md +1 -1
  86. package/dist/templates/grok/agents/trellis-implement.md +1 -1
  87. package/dist/templates/kimi/agents/trellis-implement.md +1 -1
  88. package/dist/templates/kiro/agents/trellis-implement.json +1 -1
  89. package/dist/templates/kiro/agents/trellis.json +1 -1
  90. package/dist/templates/markdown/agents.md +9 -0
  91. package/dist/templates/markdown/index.d.ts +1 -0
  92. package/dist/templates/markdown/index.d.ts.map +1 -1
  93. package/dist/templates/markdown/index.js +1 -0
  94. package/dist/templates/markdown/index.js.map +1 -1
  95. package/dist/templates/markdown/spec/index.md.txt +19 -0
  96. package/dist/templates/opencode/agents/trellis-implement.md +1 -1
  97. package/dist/templates/opencode/lib/session-utils.js +17 -5
  98. package/dist/templates/qoder/agents/trellis-implement.md +1 -1
  99. package/dist/templates/shared-hooks/guard-teamwork-wait.py +5 -0
  100. package/dist/templates/shared-hooks/inject-workflow-state.py +15 -0
  101. package/dist/templates/shared-hooks/session-start.py +7 -5
  102. package/dist/templates/snow/agents/trellis-implement.md +1 -1
  103. package/dist/templates/trae/agents/trellis-implement.md +1 -1
  104. package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +20 -22
  105. package/dist/templates/trellis/agents/teammate.md +4 -2
  106. package/dist/templates/trellis/agents/worktree-delegation-node.md +24 -0
  107. package/dist/templates/trellis/index.d.ts.map +1 -1
  108. package/dist/templates/trellis/index.js +1 -0
  109. package/dist/templates/trellis/index.js.map +1 -1
  110. package/dist/templates/trellis/scripts/common/config.py +5 -0
  111. package/dist/templates/trellis/scripts/common/git_context.py +10 -0
  112. package/dist/templates/trellis/scripts/common/io.py +2 -2
  113. package/dist/templates/trellis/scripts/common/packages_context.py +29 -1
  114. package/dist/templates/trellis/scripts/common/task_continuity.py +73 -0
  115. package/dist/templates/trellis/scripts/common/task_move.py +2 -2
  116. package/dist/templates/trellis/scripts/common/task_store.py +23 -1
  117. package/dist/templates/trellis/scripts/common/task_workflow.py +63 -6
  118. package/dist/templates/trellis/scripts/common/worktree_delegation.py +561 -0
  119. package/dist/templates/trellis/scripts/task.py +39 -1
  120. package/dist/templates/trellis/workflow.md +20 -3
  121. package/dist/templates/zcode/agents/trellis-implement.md +1 -1
  122. package/dist/utils/asset-backup.d.ts.map +1 -1
  123. package/dist/utils/asset-backup.js +40 -26
  124. package/dist/utils/asset-backup.js.map +1 -1
  125. package/dist/utils/file-writer.d.ts +2 -0
  126. package/dist/utils/file-writer.d.ts.map +1 -1
  127. package/dist/utils/file-writer.js +1 -1
  128. package/dist/utils/file-writer.js.map +1 -1
  129. package/dist/utils/managed-markdown.d.ts +5 -0
  130. package/dist/utils/managed-markdown.d.ts.map +1 -0
  131. package/dist/utils/managed-markdown.js +64 -0
  132. package/dist/utils/managed-markdown.js.map +1 -0
  133. package/dist/utils/managed-removal.d.ts +2 -0
  134. package/dist/utils/managed-removal.d.ts.map +1 -1
  135. package/dist/utils/managed-removal.js +26 -2
  136. package/dist/utils/managed-removal.js.map +1 -1
  137. package/dist/utils/manifest-prune.d.ts.map +1 -1
  138. package/dist/utils/manifest-prune.js +5 -12
  139. package/dist/utils/manifest-prune.js.map +1 -1
  140. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  141. package/dist/utils/uninstall-scrubbers.js +5 -11
  142. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  143. package/package.json +2 -2
@@ -56,7 +56,7 @@ Before implementing, read:
56
56
 
57
57
  Read relevant specs based on task type:
58
58
 
59
- - Spec layers: `.trellis/spec/<package>/<layer>/`
59
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
60
60
  - Shared guides: `.trellis/spec/guides/`
61
61
 
62
62
  ### 2. Understand Requirements
@@ -56,7 +56,7 @@ Before implementing, read:
56
56
 
57
57
  Read relevant specs based on task type:
58
58
 
59
- - Spec layers: `.trellis/spec/<package>/<layer>/`
59
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
60
60
  - Shared guides: `.trellis/spec/guides/`
61
61
 
62
62
  ### 2. Understand Requirements
@@ -268,9 +268,9 @@ def _get_task_status(trellis_dir: Path, hook_input: dict) -> str:
268
268
  if task_status == "planning":
269
269
  next_action = (
270
270
  "Follow the current per-turn workflow-state. Task lifecycle status and artifact presence "
271
- "do not identify the business phase. If no phase route is initialized, load "
272
- "`trellis-goal-exploration-and-requirements` and confirm the requirements baseline "
273
- "before initializing the route."
271
+ "do not identify the business phase. If no phase route is initialized, inspect recorded "
272
+ "requirements and authorization, choose applicable ordered phases with evidence for omissions, "
273
+ "then initialize through Trellis CLI and load the current phase Skill. Reuse valid confirmations."
274
274
  )
275
275
  if any(
276
276
  path.is_file() and not _has_curated_jsonl_entry(path)
@@ -325,31 +325,12 @@ def _repo_relative(repo_root: Path, path: Path) -> str:
325
325
  return str(path)
326
326
 
327
327
 
328
- def _collect_spec_index_paths(trellis_dir: Path) -> list[str]:
329
- paths: list[str] = []
330
- guides_index = trellis_dir / "spec" / "guides" / "index.md"
331
- if guides_index.is_file():
332
- paths.append(".trellis/spec/guides/index.md")
333
-
334
- spec_dir = trellis_dir / "spec"
335
- if not spec_dir.is_dir():
336
- return paths
337
-
338
- for sub in sorted(spec_dir.iterdir()):
339
- if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
340
- continue
341
- index_file = sub / "index.md"
342
- if index_file.is_file():
343
- paths.append(f".trellis/spec/{sub.name}/index.md")
344
- continue
345
- for nested in sorted(sub.iterdir()):
346
- if not nested.is_dir():
347
- continue
348
- nested_index = nested / "index.md"
349
- if nested_index.is_file():
350
- paths.append(f".trellis/spec/{sub.name}/{nested.name}/index.md")
351
-
352
- return paths
328
+ def _collect_spec_index_paths(trellis_dir: Path, input_data: dict | None = None) -> list[str]:
329
+ scripts = str(trellis_dir / "scripts")
330
+ if scripts not in sys.path:
331
+ sys.path.insert(0, scripts)
332
+ from common.packages_context import collect_spec_index_paths # type: ignore[import-not-found]
333
+ return collect_spec_index_paths(trellis_dir.parent, input_data, platform="codex")
353
334
 
354
335
 
355
336
  def _build_compact_current_state(
@@ -495,6 +476,20 @@ def _build_workflow_toc(workflow_path: Path) -> str:
495
476
 
496
477
 
497
478
  def main() -> None:
479
+ if os.environ.get("TRELLIS_DELEGATION_CONTEXT"):
480
+ try:
481
+ locator = Path(os.environ["TRELLIS_DELEGATION_CONTEXT"])
482
+ if locator.is_symlink() or locator.stat().st_size > 256 * 1024:
483
+ raise ValueError("invalid delegation context")
484
+ context = json.loads(locator.read_text(encoding="utf8"))
485
+ result = subprocess.run([sys.executable, str(Path(context["control_root"]) / ".trellis/scripts/get_context.py")], capture_output=True, text=True, timeout=15)
486
+ message = result.stdout.strip() if result.returncode == 0 else "Delegated node blocked: invalid/stale context; preserve resources and report to controller."
487
+ if len(message.encode()) > 256 * 1024:
488
+ raise ValueError("oversized delegation context")
489
+ except (OSError, ValueError, KeyError, subprocess.TimeoutExpired):
490
+ message = "Delegated node blocked: missing/invalid execution context; do not enter controller workflow."
491
+ print(json.dumps({"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": message}}))
492
+ return
498
493
  if should_skip_injection():
499
494
  sys.exit(0)
500
495
 
@@ -515,7 +510,7 @@ def main() -> None:
515
510
  configure_project_encoding(project_dir)
516
511
 
517
512
  trellis_dir = project_dir / ".trellis"
518
- spec_index_paths = _collect_spec_index_paths(trellis_dir)
513
+ spec_index_paths = _collect_spec_index_paths(trellis_dir, hook_input)
519
514
 
520
515
  output = StringIO()
521
516
 
@@ -5,6 +5,8 @@ description: 当前任务进入决策空间构造与归并阶段时,整理实
5
5
 
6
6
  # 决策空间构造与归并阶段
7
7
 
8
+ 有证据的架构摩擦、具体接口权衡或重复过程设计,可采用宿主已声明的相应方法;跨方法组合不清时按需使用可用总路由。候选足够即返回本阶段,不扩成无关审计,不以方法替代用户决定或阶段接受。
9
+
8
10
  当 `current_phase_id` 为 `decision_space_construction_and_merging` 时使用。阅读本 Skill 同目录的 `workflow.md`,并基于已确认且仍有效的需求基线工作。
9
11
 
10
12
  决策空间构造与归并阶段负责展示和归并决策空间,不代替用户锁定保留决定。简单问题使用清单或比较表;只有前置选择或条件会改变后续选项时才建立决策树。阶段结果由 Trellis CLI 接受;无实质候选差异时可按证据跳过本阶段。
@@ -4,10 +4,12 @@
4
4
 
5
5
  需要构造时,梳理决策项及其权限、候选、重要排除项与理由;按需补齐证据、适用约束、标准、阈值、依赖、影响和优先级。证据足够时给出推荐;证据不足则保留未知或待决项,不伪造结论。仅当选择之间存在条件依赖时使用决策树,并标明分支条件、来源、未知路径及其下游影响。互斥、共享依赖或汇合关系可用依赖图;独立候选用比较表或清单即可。
6
6
 
7
- 候选尚未覆盖实质选择时,从不同机制、责任边界或运作方式拓宽,而非只列同一做法的参数变体;适用时纳入维持现状或不做。再以已确认约束、当前实现、外部先例及必要的有界探针筛选,区分不可行、代价较高与证据不足,保留排除理由及依赖后果。重要选择已可比较、未知已定位到受影响的决定时停止;不凑候选数量,不在没有新证据时追加轮次。目标变化回第一阶段,用户保留决定整理给第三阶段,不由辅助 Skill 提前锁定。
7
+ 候选尚未覆盖实质选择时,从不同机制、责任边界或运作方式拓宽,而非只列同一做法的参数变体;适用时纳入维持现状或不做。再以已确认约束、当前实现、外部先例及必要的有界探针筛选,区分不可行、代价较高与证据不足,保留排除理由及依赖后果。移交前还应完成下述重要默认与遗漏分支核对;不凑候选数量,不在没有新证据时追加轮次。目标变化回第一阶段,用户保留决定整理给第三阶段,不由辅助 Skill 提前锁定。
8
8
 
9
9
  新颖机制、重大重构、跨组件边界变化或关键取舍缺少可信本地先例时,进行有界的 `prior-art review`,记录适用性与采纳或排除理由。只读 Teamwork 可按需补充证据;主代理核验报告后归并。将 `DecisionSpace` 或有据跳过记录交由 Trellis CLI 接受,待用户决定交由解决方案设计与收敛阶段处理。
10
10
 
11
+ 移交前,从当前目标的实际使用、失败或交付场景挑战重要默认假设,检查候选之外是否仍有会改变行为、责任或验收的分支。可查事实由代理补证,真实用户取舍交第三阶段处理;尚未满足前置或暂不能精确表述的未知,说明影响哪个决定及后续处理,不能因当前无就绪问题就当作已解决。在现有产物简短保留关键发现、排除依据和未决项的移交方式;重要选择可比较且未知已有处置路径时停止,不穷举理论分支,也不把每个默认都变成用户问题。
12
+
11
13
  ```mermaid
12
14
  flowchart TD
13
15
  input["核对已确认且仍有效的需求基线"] --> material{"差异或条件分支会改变交付、验收、风险或下游选择?"}
@@ -26,8 +28,9 @@ flowchart TD
26
28
  merge --> representation{"候选关系需要条件分支吗?"}
27
29
  representation -->|"是"| tree["建立可追溯决策树并标明相关未知路径"]
28
30
  representation -->|"否"| simple["使用清单、比较表或适用的依赖图"]
29
- tree --> assess["核对证据、覆盖范围、关系与当前 revision"]
30
- simple --> assess
31
+ tree --> challenge["用当前任务场景挑战重要默认,检查遗漏分支与未知处置"]
32
+ simple --> challenge
33
+ challenge --> assess["核对证据、覆盖范围、关系与当前 revision"]
31
34
  assess -->|"目标或范围变化"| goal_exploration_and_requirements["回到目标探索与需求核对阶段,更新基线"]
32
35
  assess -->|"证据或候选仍有缺口"| items
33
36
  assess -->|"可供方案收敛"| output["Trellis CLI 接受 DecisionSpace"]
@@ -40,3 +43,4 @@ flowchart TD
40
43
  - 有实质决策空间时,候选、关键证据、关系、未知项和推荐均能支持下一阶段比较;不要求固定字段数量或同时使用多种图表。
41
44
  - 无实质差异时,跳过记录须能说明当前基线、判断依据和重新进入条件。
42
45
  - 保留用户决定不在本阶段锁定;外部参考不替代项目事实或用户选择。
46
+ - 已检查影响当前目标的重要默认和遗漏分支,关键未知有受影响决定及移交路径;没有就绪问题不单独构成退出依据。
@@ -5,6 +5,8 @@ description: 当前任务进入交付审查与现场收尾阶段时,核对当
5
5
 
6
6
  # 交付审查与现场收尾阶段
7
7
 
8
+ 按交付风险采用宿主已声明的质量与语言检查方法;只有实际执行摩擦或优化目标才复盘。清理、知识保存及正式交接分别核对真实意图、授权与 owner,不因收尾自动执行。方法产物返回本阶段,不替代交付接受或任务完成。
9
+
8
10
  当 `current_phase_id` 为 `delivery_review_and_closeout` 时使用。阅读本 Skill 同目录的 `workflow.md`,只审查当前路线和 revision 下的交付,不在本阶段重新设计或实施。
9
11
 
10
12
  本阶段核验交付与合同、接受条件、工作包、集成、验证、未结发现和资源事实。当前合同内缺口按最早受影响阶段回流或暂停;合同外遗留应记录责任方、触发条件、影响和后续引用。满足交付条件后由 Trellis CLI 接受;只有明确撤回才进入取消处置。会话交接包是独立附加操作,不是阶段或任务收尾的前置条件。
@@ -5,6 +5,8 @@ description: 当前任务处于目标探索与需求核对阶段时,核对目
5
5
 
6
6
  # 目标探索与需求核对阶段
7
7
 
8
+ 根据当前问题选择宿主可用方法:重要用户取舍、零散素材、学习目标或理解障碍分别采用适用方法,不要求用户点名。只加载相关入口,产物返回本阶段;可选方法缺席不阻断原生流程,也不替代需求确认。
9
+
8
10
  当 Trellis 任务的 `current_phase_id` 为 `goal_exploration_and_requirements` 时使用。先阅读本 Skill 同目录的 `workflow.md`,再按当前项目事实选择必要的探索深度和证据来源。
9
11
 
10
12
  阶段产物和用户确认通过 Trellis CLI 记录。离开本阶段前,必须由用户明确确认绑定当前 `artifact_revision` 的目标与需求基线;只要求修订或尚未确认时,继续停留在本阶段。确认不等于最终方案批准或实施授权。
@@ -1,5 +1,11 @@
1
1
  # Teamwork Runtime
2
2
 
3
+ The mechanism is Trellis Teamwork (Trellis 团队协作); an executor is a Trellis
4
+ teammate, plural Trellis teammates (Trellis 团队成员). Paseo-based-parallelism
5
+ (Paseo 并行协作) and its Paseo delegated-agent (Paseo 委派 Agent) are separate.
6
+ Sessions, worktrees, nodes, attempts and work packages keep their own meanings.
7
+ Native commands, paths and protocol fields retain their exact identifiers.
8
+
3
9
  `trellis teamwork` provides durable coordination sessions and teammate processes. Its session lifecycle is independent of the Trellis task lifecycle and phase route. A session may be associated with a task, but it never owns task status, phase state, or phase acceptance.
4
10
 
5
11
  ## Local surfaces
@@ -5,6 +5,8 @@ description: 当前任务处于解决方案设计与收敛阶段时,处理用
5
5
 
6
6
  # 解决方案设计与收敛阶段
7
7
 
8
+ 实际接口权衡、可由原型验证的具体未知、已有材料成文及批准前输出复核,可采用宿主已声明的相关方法。方法明确就直接使用,组合不清时按需使用可用总路由;只完成当前所需产物后返回,方法不替代整体方案接受和实施授权。
9
+
8
10
  当 `current_phase_id` 为 `solution_design_and_convergence` 时使用。阅读本 Skill 同目录的 `workflow.md`,核对当前有效的需求基线和决策空间构造与归并阶段结果或跳过记录。
9
11
 
10
12
  本阶段锁定当前路线所依据的决定和方案,不代表实施已获授权。需用户决定时,使用 `pennix-decision-grill` 同步询问并留在解决方案设计与收敛阶段;实施路线须形成 `implementation_contract`,再单独取得实施批准后才能进入任务实施与测试验证阶段。触发 prior-art review 的方案须在阶段结果接受前完成该审查。
@@ -4,6 +4,8 @@
4
4
 
5
5
  比较适用方案,说明选择依据、重要后果、行为边界、责任、必要依赖、验证方式、停止与恢复条件及实质风险。对新颖核心机制、重大重构、跨组件边界变化或关键不确定性缺少可信本地先例的方案,在结果接受前完成有界 `prior-art review`,记录适用性、采纳或排除理由,或说明没有适用先例。外部材料改变候选、标准或依赖时回到决策空间构造与归并阶段。
6
6
 
7
+ 用户答复、新证据、方案修订或复核发现后,重新筛选受影响的重要选择:是否出现新分支、前置是否满足、原决定是否仍有效。先保存真实答案及其影响,只重开受影响项;可查事实继续补证,用户取舍按依赖提问,不把问完原有列表或当前无就绪问题等同于方案完整。关键未知须有补证、用户决定、明确接受的剩余风险、延期或不继续等处置,不能静默排除。
8
+
7
9
  判断当前结果:分析交付形成 `analysis_conclusion`;不继续形成 `no_go`;延期形成带责任方、触发条件和恢复位置的 `deferred`,留在解决方案设计与收敛阶段;实施路线形成 `implementation_contract`,明确目标、范围和接受条件,并按路线需要补足实施与核验信息。只有交付物具有独立实施或集成边界时才拆分工作包,并说明推进和协作所需的依赖、顺序、责任或集成信息;单一交付不人为拆分工作包。解决方案设计与收敛阶段的结果接受与实施授权分开记录;只有合同及明确批准均有效时,Trellis CLI 才允许进入任务实施与测试验证阶段。
8
10
 
9
11
  合同结果已接受、实施尚未授权时,发现需要返修,应通过 `task.py phase return` 回到本阶段或更早受影响阶段,记录理由和证据。受影响的接受与授权随之失效;修订后重新接受当前产物,再核验实施授权。
@@ -14,22 +16,29 @@
14
16
 
15
17
  研究、原型和协作证据写回现有阶段产物、research 或 execution 自然落点,注明来源与版本、事实和假设、适用性、限制及决定影响。证据足够即停止扩搜;工具、报告或模板不能替代用户决定和 Trellis 原生接受事实。
16
18
 
19
+ 请求整体批准前,落实已有独立复核,在现有产物简短说明关键反例、发现及处置。以当前任务的具体行为或交付物检验端到端可执行性与验收依据;涉及发布安装时,核对本地验证、发布产物和实际运行身份的关系,不能只凭版本字符串认定同一产物。发现未决重要选择就回到筛选,不为没有新发现的情况追加轮次;充分的整体接受和实施授权不重复索取。
20
+
17
21
  ```mermaid
18
22
  flowchart TD
19
- input["核对需求基线与已接受的 DecisionSpace"] --> decisions{"存在尚待用户决定的实质取舍?"}
23
+ input["核对需求基线与已接受的 DecisionSpace"] --> rescreen["复用已定事项,重新筛选重要分支、前置与未知处置"]
24
+ rescreen --> decisions{"存在尚待用户决定的实质取舍?"}
20
25
  decisions -->|"是"| grill["pennix-decision-grill 同步询问;留在解决方案设计与收敛阶段"]
21
26
  grill --> impact{"答复影响哪个范围?"}
22
27
  impact -->|"目标或范围"| goal_exploration_and_requirements["回到目标探索与需求核对阶段"]
23
28
  impact -->|"候选、标准或依赖"| decision_space_construction_and_merging["回到决策空间构造与归并阶段"]
24
- impact -->|"当前候选中的选择"| compare["比较方案和重要后果"]
25
- decisions -->|"否"| compare
29
+ impact -->|"当前候选中的选择;保存答复后重算"| rescreen
30
+ decisions -->|"否;必要证据和未知已有处置"| compare["比较方案和重要后果"]
31
+ decisions -->|"前置或证据尚缺"| repair["补证或修订受影响方案"]
32
+ repair --> rescreen
26
33
  compare --> prior{"触发 prior-art review?"}
27
34
  prior -->|"是"| review["核验相关开源实现或公开提案并记录适用性"]
28
35
  review --> changed{"外部证据改变候选、标准或依赖?"}
29
36
  changed -->|"是"| decision_space_construction_and_merging
30
- changed -->|"否"| assess["核对完整性、风险、验证和恢复条件"]
37
+ changed -->|"否"| newDecisions{"新证据出现未决重要分支?"}
38
+ newDecisions -->|"是"| rescreen
39
+ newDecisions -->|"否"| assess["独立复核完整性、风险、验证、恢复与关键发现处置"]
31
40
  prior -->|"否"| assess
32
- assess -->|"有实质缺口"| compare
41
+ assess -->|"有实质缺口;补证或修订后重算"| repair
33
42
  assess -->|"analysis_conclusion 或 no_go"| reviewResult["Trellis CLI 接受解决方案设计与收敛阶段结果"]
34
43
  assess -->|"deferred"| defer["记录恢复条件并留在解决方案设计与收敛阶段"]
35
44
  assess -->|"implementation_contract"| contract["冻结必要实施合同"]
@@ -18,6 +18,8 @@ Use short snippets only when they make the rule clearer. Prefer linking to the f
18
18
  Keep the spec tree aligned with the project:
19
19
 
20
20
  - Keep `index.md` as the navigation file for the spec directory.
21
+ - Keep the root index and configured package indexes connected to the real
22
+ topic files. Do not assume frontend/backend layers or recreate deleted layers.
21
23
  - Split topics when developers would look for them independently.
22
24
  - Merge topics when separate files would repeat the same rule.
23
25
  - Delete template files that do not apply.
@@ -25,6 +27,10 @@ Keep the spec tree aligned with the project:
25
27
 
26
28
  ## Content Standards
27
29
 
30
+ Use a minimal topic structure: scope, project conventions with source evidence,
31
+ and verification. For an empty project, record confirmed boundaries and pending
32
+ evidence; do not invent conventions or generate empty domain documents.
33
+
28
34
  Good spec sections include:
29
35
 
30
36
  - When the rule applies.
@@ -5,6 +5,8 @@ description: 当前任务处于任务实施与测试验证阶段时,按已授
5
5
 
6
6
  # 任务实施与测试验证阶段
7
7
 
8
+ 按实际问题选用宿主已声明的诊断、检索或设计辅助方法;执行摩擦确需解释时可有界复盘,不能因此自动改环境。方法明确时直接使用,组合不清时按需读取可用总路由;完成证据后继续已授权工作,不增加可选集合依赖或重问已定选择。
9
+
8
10
  当 `current_phase_id` 为 `task_implementation` 时使用。先阅读本 Skill 同目录的 `workflow.md`,再加载目标仓库适用的 `AGENTS.md`、Trellis spec 和实现合同。
9
11
 
10
12
  按合同依赖和优先级逐项实施;主工作树主代理负责阶段接受和集成。只在执行路线获准时使用 Paseo 委派写入;Trellis Teamwork teammate 只提供只读证据。默认在当前阶段修复和验证,只有合同、授权、依赖、基线或接受条件实质失效且无法安全恢复时,才回到最早受影响的阶段。
@@ -4,7 +4,7 @@
4
4
 
5
5
  实施阶段为 `blocked` 或 `waiting_user` 时,先解决阻塞并经原生 `phase resume` 恢复,再重新核验准入。`delegate-start` 核验父任务已有的 ownership 围栏和子任务状态;存在未消费交接、当前会话不符合已有 ownership 记录,或子任务已完成、取消时,不启动或复用委派执行。没有 ownership 记录的任务不具备默认会话独占保护。
6
6
 
7
- 父授权有效后,用 `task.py delegate-bind <child>` 绑定子 PRD、角色、Git base、分支和结果路径,再用 `delegate-start` 启动。输入漂移须先核对是否仍在父授权范围内,再重新绑定。失联现场先用 `delegate-reconcile` 预览,证据充分时才显式 `--execute --reason ... --approval-ref ...` 核销,不能直接覆盖旧映射。
7
+ 父授权有效且本轮允许委派写入时,先加载 `trellis-worktree-delegation`,通过其原生新协议入口冻结明确目标、设置与能力要求,再准备、核验 ready、执行和观察。委派节点沿 `TRELLIS_DELEGATION_CONTEXT` 与共享节点方法执行本包,不进入主控阶段或新建任务。输入漂移先保全并核对授权;未知创建或发送只做原生 inspect 和显式 recover,不覆盖映射或重放。结果由 owner 审查并在目标分支 merge/FF,验证 ancestry 后再显式核销;idle/cancel 不替代 writer 停止证据。
8
8
 
9
9
  按合同的依赖和优先级选取当前工作包,实施满足目标的最小变更,并运行与风险和影响相称的局部验证。主工作树主代理核对来源、revision、Git 基线、差异和结果后接受工作包。多包任务按合同集成;单一交付不人为拆分。Trellis Teamwork 仅用于冻结计划下的只读比较或评议,不能改写任务状态或接受实施结果。实际写入委派依父任务规定使用 Trellis 受控入口与 Paseo;各组件源码仍在 owner 仓库内修改。
10
10
 
@@ -5,6 +5,12 @@ description: Use Trellis Teamwork for live multi-agent collaboration, Teamwork S
5
5
 
6
6
  # trellis-teamwork
7
7
 
8
+ Mechanism: **Trellis Teamwork** (Trellis 团队协作). One executor is a
9
+ **Trellis teammate**; plural **Trellis teammates** (Trellis 团队成员).
10
+ **Paseo-based-parallelism** (Paseo 并行协作) and its **Paseo delegated-agent**
11
+ (Paseo 委派 Agent) are a separate implementation mechanism and executor role.
12
+ Sessions, worktrees, nodes and attempts retain their own object names.
13
+
8
14
  `trellis teamwork` is the local multi-agent collaboration runtime. A
9
15
  Teamwork Session is the persistent chat or forum object used by the runtime;
10
16
  it is independent from the Trellis task lifecycle and does not own business-phase progress.
@@ -52,6 +58,7 @@ trellis teamwork context list <session> --scope global --thread <thread>
52
58
  ## Core Rules
53
59
 
54
60
  - Teammates provide research, review, verification, evidence, and advice under a role contract; they do not implement product code. Coding tools or provider permission modes do not grant that role authority. Return results in the assigned format and let the coordinator review them.
61
+ - Trellis teammates do not ask the user directly or require a user-question tool. Return missing input, limitations, unresolved choices or contract-valid blocked reports to the main agent; the main agent first resolves evidence and allocation before deciding whether a user choice is needed.
55
62
  - `general`, `advisor`, and `committee` are coordination modes, independent from profiles, providers, `run`, batch execution, and forum sessions. Read project defaults with `teamwork config`; construct a frozen plan with `teamwork plan` and execute it with `teamwork batch --task <task-dir>`.
56
63
  - For a managed batch, invoke one foreground `teamwork batch --json` command and wait for its receipt. The CLI owns FIFO admission, capacity, provider waits, retries, cancellation, report validation, and settlement; the main agent must not schedule per-assignment waits or retries.
57
64
  - If the host yields that call, silently continue its original handle. Do not emit repetitive progress, query status, start unrelated work, or create another batch. Host continuation is not CLI scheduling. Codex ships a native wait projection and PreToolUse guard for supported tool events; neither prevents model wake-ups or ordinary model messages. After a lost coordinator, use native `teamwork reconcile` and retain reservations until process exit is proven.
@@ -197,8 +197,12 @@ answer. Retention may remove failed-attempt artifacts. Main-agent semantic
197
197
  review checks the answer and evidence against the acceptance criteria; shape
198
198
  validation does not perform that review or change native task acceptance.
199
199
 
200
- The coordinator returns `ALL_ACCEPTED`, `SETTLED_WITH_FAILURE`, or
201
- `RECONCILIATION_REQUIRED`. For `ALL_ACCEPTED`, review every accepted report
200
+ The coordinator returns `AWAITING_REVIEW`, `ALL_ACCEPTED`, `SETTLED_WITH_FAILURE`, or
201
+ `RECONCILIATION_REQUIRED`. For `AWAITING_REVIEW`, read every report and its
202
+ evidence, limitations and unresolved items, then use `trellis teamwork review`
203
+ with the exact task, batch and assignment identity (see `review --help`).
204
+ Accept or request rework through that native interface; do not edit receipts.
205
+ For `ALL_ACCEPTED`, review every accepted report
202
206
  against the phase contract, record the evidence in the task-owned artifact, and
203
207
  use the native task acceptance gate before advancing. For
204
208
  `SETTLED_WITH_FAILURE`, review the failure reports and blockers, do not accept
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: trellis-worktree-delegation
3
+ description: 在 Trellis 已授权实施阶段,把完整结果包交由同机 Paseo 独立工作树执行,管理绑定、准备、返工、恢复及 owner 集成;不用于 Teamwork 只读审查或普通研究。
4
+ ---
5
+
6
+ # Paseo 并行协作(Paseo-based-parallelism)
7
+
8
+ 执行者称为 Paseo 委派 Agent(Paseo delegated-agent;复数 Paseo delegated-agents)。Trellis 团队协作(Trellis Teamwork)的执行者称为 Trellis 团队成员(Trellis teammate;复数 Trellis teammates)。两类机制、执行者和运行对象分别命名;本 Skill 的原生命名与 `task.py delegate-*` 命令保持不变。
9
+
10
+ 先读取 [操作合同](workflow.md)。此入口只编排已批准的完整工作包;任务阶段、授权和接受由主控 Trellis 维护,workspace、agent 和 provider thread 由 Paseo 维护。Teamwork 用于有界只读研究或审查,不获得源码实施权。
11
+
12
+ 主控按依赖与包大小选择可同时推进的结果包;不为每个普通实现步骤另建委派。目标可为独立仓库、submodule 或 linked worktree,可没有 Trellis。不要复制全局 AGENTS、安装目录或主控整个上下文。必要方法通过明确只读引用提供;没有目标项目资产不构成自动初始化许可。
13
+
14
+ 原生 `task.py delegate-*` 负责校验绑定与当前父授权;可选 `trellis-paseo-adapter` 只通过公开 SDK 操作同机 daemon。缺包、版本、身份或必需能力不符时停止相应动作,沿 Lifecycle 修复;不调用旧 start、不换 host/provider、不把弱角色提示词当兼容模式。创建/发送结果不明时 inspect 并核验原生资源,使用显式 recover 接回,不能重放未知操作。
@@ -0,0 +1,17 @@
1
+ # 主控操作合同
2
+
3
+ 使用项目原生 `python3 .trellis/scripts/task.py <command> --help` 核对参数。先核对父任务有效实施合同、父子链接、owner、当前路线的 Lifecycle/Paseo/Git 准入及证据。一个 controller task 是控制权威;节点不创建第二套阶段状态。
4
+
5
+ 1. 读取 adapter 的 capability(有界 stdin JSON `version=1, operation=capability, daemon_selector={}, payload={cwd:目标绝对路径}`),从实际可用 Codex 模型解析默认值并固定显式 model/effort。使用 mode `full-access`,sandbox/approval/reviewer/context 保留 `native_default`。固定角色为 `.trellis/agents/delegated-worktree-primary-agent.md`,节点方法为 `.trellis/agents/worktree-delegation-node.md`;两包共用同版正文。
6
+ 2. 在子任务记录 PRD、`settings.json`、`requirements.json`,通过原生 `task.py set-branch` 设置不存在的执行分支。settings 含 version=1、provider=codex、model、effort、mode=full-access;可指定同机 daemon_home。requirements 含 version=1、非空 allowed_paths、forbidden_paths、required_rules/required_skills/required_tools/checks/resources 字符串数组、可选 setup_ref、teamwork_permission(none/read_only)。声明准确来源、工具真实探测、测试端口/数据库等资源;setup_ref 指向已授权的原生准备动作。禁止副作用隐藏在 setup 中。
7
+ 3. `delegate-bind <child> --target-repo <确切 checkout> --integration-branch <owner 分支> --settings-ref settings.json --requirements-ref requirements.json` 使用 binding format 2 冻结 PRD、角色、节点方法、可选 setup 正文、设置与能力哈希、base、目标 Git 身份及父授权。派发与节点读取同时检查当前批准输入和 attempt 冻结快照;投影的正文引用不再指向主控实时文件。旧不完整绑定只能核验、取消及保全,核销后重新绑定,不静默升级。target 与 controller 可不同;integration 是该目标 owner 分支。主控在启动前检查项目原生 workspace setup/teardown,不允许未经批准的脚本;原生 autoArchiveAfterMerge 必须为 false。CLI 不修改 daemon 配置。
8
+ 4. `delegate-start <child>` 先持久化创建 intent,再创建 workspace 和 prepare agent。只授予准备许可;观察 native resources 与 bounded ready,核对当前源码 HEAD、完整必需能力、实际模型/effort/mode;不能只凭节点自报或 idle 就接受。主控检查 `delegate-inspect` 后,`delegate-execute` 发送实施指令。有并行包时分别准备、执行,按真实依赖集成后再派下游。
9
+ 5. `delegate-wait <child> --timeout-ms 3600000` 使用原生等待;主控还有独立工作就先推进。没有其他工作时持续原生等待,timeout 不是完成或批准。observe/inspect 不改结果接受;`delegate-followup --instructions-ref <子任务内文件>` 返工前重核当前绑定与实际设置。interrupt 仅请求取消,不证明 writer 已停止。
10
+ 6. 压缩/新主控恢复先 inspect,沿当前 task/binding/attempt/native ID 续接。未知创建使用 `delegate-reconcile --recover --workspace-id <完整ID> [--agent-id <完整ID>]` 预览,核验准确原生 workspace、cwd、Git common/branch/base、agent 标签后,显式 `--execute --reason ... --approval-ref ...` 接回。未知发送/取消还需要 `--delivery-evidence-ref`,引用主控实际检查的原生 timeline/turn 证据;不得把 idle 当交付证明。workspace 已映射而尚未发起 agent 时,恢复后 `delegate-start` 仅创建尚未发起的 agent。未知 agent 创建必须先找到准确 ID,不能再创建一个。
11
+ 若原生验证明确在创建前拒绝 agent,且包含后台/归档的全量检查确认没有当前 attempt agent,可使用 `--delivery-evidence-ref` 提交主控核验的原生拒绝与未创建证据,显式恢复到 workspace_created。仅“当前列表没看到”不充分;发现匹配 agent 时必须映射准确 ID,未知结果保留现场。
12
+ 7. owner 审查 result 的真实 commits/diff/checks、范围和控制面未被改动,依赖结果只能在集成后作为当前树事实。通过目标 owner 原生 merge/FF 集成,验证 accepted HEAD 是目标 integration branch 的祖先;禁止默认 cherry-pick。根侧 gitlink 集成单独记录。
13
+ 8. `delegate-reconcile --disposition integrated` 预览;确认原生 agent 无 active turn、结果和接受证据、源码保全、后台 writer 与测试服务已停后,使用 `--execute --reason ... --approval-ref ... --writer-evidence-ref <子任务内证据>` 核销。取消可用 retained,保留实际 checkout/HEAD/status 和候选;没有结果时也必须保留源码,不销毁未知 writer。核销仅结束控制记录,不自动 archive/delete。资源删除由原生 owner 另按已批准处置执行。
14
+
15
+ 退休尝试不能 execute/followup。父授权失效或输入漂移后,禁止准备、执行、返工、重新接管和 integrated 接受;已绑定身份下的 inspect/observe/interrupt 与 `reconcile --disposition retained` 仍可核验和保全旧资源,不刷新写许可。未知创建或发送保持现场,原生紧急取消不替代停止证据。正常先核销再离开第四阶段;第五阶段需要实施返工时由主控返回有效授权的第四阶段。
16
+
17
+ 新协议记录在 ignored `.trellis/.runtime/delegation/<child>/`;任务 PRD 和实施/接受证据仍在原生任务中。不要手写 record、映射或许可。旧 meta 记录只供旧 reconciliation/闭合,不能作为新协议启动成功证据。完成、取消、转移、解绑、移动及重命名前应核销活动委派;遇未知状态保留资源并报告。
@@ -12,8 +12,16 @@ Resume from the active Trellis task and its current phase. The task record and p
12
12
 
13
13
  Follow the active phase breadcrumb to the matching bundled phase Skill and its workflow.md. Use the task CLI to inspect or change phase state. A resume does not itself accept an artifact, grant authorization, or move the task.
14
14
 
15
+ Without hook context, use `{{PYTHON_CMD}} ./.trellis/scripts/task.py phase show <task>`
16
+ and explicitly read the applicable spec indexes and guidelines. If the route is
17
+ missing, inspect recorded requirements and authorization, choose the ordered
18
+ phases with evidence for omissions, then initialize through the native CLI.
19
+ Reuse existing confirmations; resume only the known unfinished action.
20
+
15
21
  Task lifecycle status and business phase are separate. A planning task may remain in Goal Exploration and Requirements Confirmation Phase, Decision Space Construction and Consolidation Phase, or Solution Design and Convergence Phase. `in_progress` marks authorized Task Implementation and Test Verification Phase; `completed` and `cancelled` are terminal lifecycle states. Delivery Review and On-Site Closeout Phase remains explicit.
16
22
 
17
23
  ## Phase operations
18
24
 
25
+ Resume the known unfinished action first. Reassess auxiliary methods only when the problem, phase, or available capabilities have changed; reuse still-valid Skill bodies and decisions. Select relevant host-declared methods directly, or use an available workflow router for unclear combinations. Do not restart discovery, preload a collection, infer paths from old summaries, or repeat settled questions. Auxiliary methods do not change task state or action permissions.
26
+
19
27
  Use the native task CLI for phase artifact revisions, acceptance, evidence-backed skips, waiting, blocking, resuming, returning to an earlier phase, route changes, implementation authorization, completion, and cancellation. Read task.py help for current arguments. Do not create a second status record or use formal session handoff to resume task work.
@@ -12,6 +12,8 @@ Read the applicable spec indexes before editing code. The active phase breadcrum
12
12
 
13
13
  ## Route the current request
14
14
 
15
+ After identifying the request and native phase, select only host-declared auxiliary Skills that fit the current problem. Direct matches need no router; unclear combinations or responsibilities may use an available workflow router. Do not preload all methods or require a particular optional collection. Reuse valid decisions and authorization, and return method results to the current request or phase.
16
+
15
17
  - New request: use `trellis-request-intake` to determine whether it changes the current goal, is independent work, or qualifies for the taskless route. Reuse existing authorization and evidence.
16
18
  - Task with no initialized route: inspect its current requirements, choose the applicable ordered phases with evidence for omissions, then initialize the route through task.py phase init.
17
19
  - Goal Exploration and Requirements Confirmation Phase: load `trellis-goal-exploration-and-requirements`. Do not leave until the user confirms the current requirements artifact revision.
@@ -14,7 +14,9 @@ Execute these steps:
14
14
  - What type of work (backend, frontend, unit-test, docs, etc.)
15
15
  - Any spec/research paths referenced by the task artifacts
16
16
 
17
- 4. **Read the spec index** for each relevant module:
17
+ 4. **Read the available spec indexes**: `.trellis/spec/index.md`, then
18
+ `.trellis/spec/<package>/index.md` for the affected configured packages,
19
+ and existing layer indexes where applicable. Older projects need no migration:
18
20
  ```bash
19
21
  cat .trellis/spec/<package>/<layer>/index.md
20
22
  ```
@@ -19,7 +19,9 @@ Read the current native phase, accepted contract and its actual artifact referen
19
19
  python3 ./.trellis/scripts/get_context.py --mode packages
20
20
  ```
21
21
 
22
- For each changed package/layer, read the spec index and follow its **Quality Check** section:
22
+ Read the available `.trellis/spec/index.md`, affected configured package
23
+ indexes (`.trellis/spec/<package>/index.md`), and existing layer indexes.
24
+ Follow their **Quality Check** sections; older projects need no migration:
23
25
 
24
26
  ```bash
25
27
  cat .trellis/spec/<package>/<layer>/index.md
@@ -2,16 +2,18 @@
2
2
 
3
3
  Use this entry skill to route a new request. First check its relationship to the active task: a change to the same goal returns to the earliest affected phase; independent work needs its own intake. Do not put unrelated work into the active task or bypass its ownership and acceptance gates. To resume existing work, use trellis-continue and the current native task facts.
4
4
 
5
- Reuse verified evidence and existing authorization. For a clear, low-risk, reversible, authorized, immediately verifiable request, follow the taskless route in workflow.md. Intake ends when the request reaches its appropriate phase; do not repeat session initialization or conduct a second requirements or planning workflow here.
5
+ Reuse verified evidence and existing authorization. Follow the taskless route in workflow.md only when all of these are true: the goal is clear; the scope and owner are bounded; risk is controlled; the user has authorized the actual action; success can be verified in the current session; and the work needs no persistent route, coordination, design, review, release, installation, migration, external delivery, or dedicated rollback plan. A bounded irreversible action additionally needs exact target verification, an acceptable recovery or loss boundary, and a stop condition. User authorization alone is not sufficient. Read-only inspection, bounded diagnosis, low-impact native-owner maintenance or cleanup, small single-surface edits, and rerunning existing checks are examples, not an allowlist. Intake ends when the request reaches its appropriate phase; do not repeat session initialization or conduct a second requirements or planning workflow here.
6
6
 
7
7
  ## Start the task
8
8
 
9
+ Choose auxiliary methods from the host's available Skills according to the actual business problem, including taskless requests. A clear match goes directly to that Skill; combinations or unclear ownership may use an available workflow router. Do not require the user to name a method, preload a collection, or create a task merely to use one. Method output returns to this intake or the current phase; it does not grant action permissions or replace Trellis acceptance and authorization.
10
+
9
11
  1. Inspect only evidence that can change the goal, scope, acceptance criteria, constraints, or route. Ask the user only for missing intent or a material user choice; use the project's decision method when needed.
10
- 2. Create a Trellis task when the work needs a persistent route, coordination, or review:
12
+ 2. When the work needs a persistent route, coordination, design, review, release, installation, migration, external delivery, or a durable record, treat it as task-based. If the user did not explicitly ask to create a task, stop before the create command and ask for creation approval. State which taskless condition is not met, the proposed owner/scope/route, and the risk of proceeding without a task. An explicit user request to create or resume a task is already authorization for that lifecycle action only; it does not authorize implementation or delivery:
11
13
 
12
14
  {{PYTHON_CMD}} ./.trellis/scripts/task.py create "<title>" --description "<summary>"
13
15
 
14
- 3. Initialize an ordered phase route that includes Goal Exploration and Requirements Confirmation Phase, then only the later phases the task needs:
16
+ 3. After creation approval, initialize an ordered phase route that includes Goal Exploration and Requirements Confirmation Phase, then only the later phases the task needs:
15
17
 
16
18
  {{PYTHON_CMD}} ./.trellis/scripts/task.py phase init <task> --task-kind <analysis|implementation|combined> --complexity <simple|standard|complex> --project-context <new|existing> --phase-ids <ordered-phase-ids>
17
19
 
@@ -267,9 +267,9 @@ def _get_task_status(trellis_dir: Path, hook_input: dict) -> str:
267
267
  if task_status == "planning":
268
268
  next_action = (
269
269
  "Follow the current per-turn workflow-state. Task lifecycle status and artifact presence "
270
- "do not identify the business phase. If no phase route is initialized, load "
271
- "`trellis-goal-exploration-and-requirements` and confirm the requirements baseline "
272
- "before initializing the route."
270
+ "do not identify the business phase. If no phase route is initialized, inspect recorded "
271
+ "requirements and authorization, choose applicable ordered phases with evidence for omissions, "
272
+ "then initialize through Trellis CLI and load the current phase Skill. Reuse valid confirmations."
273
273
  )
274
274
  if any(
275
275
  path.is_file() and not _has_curated_jsonl_entry(path)
@@ -324,31 +324,12 @@ def _repo_relative(repo_root: Path, path: Path) -> str:
324
324
  return str(path)
325
325
 
326
326
 
327
- def _collect_spec_index_paths(trellis_dir: Path) -> list[str]:
328
- paths: list[str] = []
329
- guides_index = trellis_dir / "spec" / "guides" / "index.md"
330
- if guides_index.is_file():
331
- paths.append(".trellis/spec/guides/index.md")
332
-
333
- spec_dir = trellis_dir / "spec"
334
- if not spec_dir.is_dir():
335
- return paths
336
-
337
- for sub in sorted(spec_dir.iterdir()):
338
- if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
339
- continue
340
- index_file = sub / "index.md"
341
- if index_file.is_file():
342
- paths.append(f".trellis/spec/{sub.name}/index.md")
343
- continue
344
- for nested in sorted(sub.iterdir()):
345
- if not nested.is_dir():
346
- continue
347
- nested_index = nested / "index.md"
348
- if nested_index.is_file():
349
- paths.append(f".trellis/spec/{sub.name}/{nested.name}/index.md")
350
-
351
- return paths
327
+ def _collect_spec_index_paths(trellis_dir: Path, input_data: dict | None = None) -> list[str]:
328
+ scripts = str(trellis_dir / "scripts")
329
+ if scripts not in sys.path:
330
+ sys.path.insert(0, scripts)
331
+ from common.packages_context import collect_spec_index_paths # type: ignore[import-not-found]
332
+ return collect_spec_index_paths(trellis_dir.parent, input_data, platform="copilot")
352
333
 
353
334
 
354
335
  def _build_compact_current_state(
@@ -514,7 +495,7 @@ def main() -> None:
514
495
  configure_project_encoding(project_dir)
515
496
 
516
497
  trellis_dir = project_dir / ".trellis"
517
- spec_index_paths = _collect_spec_index_paths(trellis_dir)
498
+ spec_index_paths = _collect_spec_index_paths(trellis_dir, hook_input)
518
499
 
519
500
  output = StringIO()
520
501
 
@@ -55,7 +55,7 @@ Before implementing, read:
55
55
 
56
56
  Read relevant specs based on task type:
57
57
 
58
- - Spec layers: `.trellis/spec/<package>/<layer>/`
58
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
59
59
  - Shared guides: `.trellis/spec/guides/`
60
60
 
61
61
  ### 2. Understand Requirements
@@ -48,7 +48,7 @@ Before implementing, read:
48
48
 
49
49
  Read relevant specs based on task type:
50
50
 
51
- - Spec layers: `.trellis/spec/<package>/<layer>/`
51
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
52
52
  - Shared guides: `.trellis/spec/guides/`
53
53
 
54
54
  ### 2. Understand Requirements
@@ -52,7 +52,7 @@ Before implementing, read:
52
52
 
53
53
  Read relevant specs based on task type:
54
54
 
55
- - Spec layers: `.trellis/spec/<package>/<layer>/`
55
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
56
56
  - Shared guides: `.trellis/spec/guides/`
57
57
 
58
58
  ### 2. Understand Requirements
@@ -48,7 +48,7 @@ Before implementing, read:
48
48
 
49
49
  Read relevant specs based on task type:
50
50
 
51
- - Spec layers: `.trellis/spec/<package>/<layer>/`
51
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
52
52
  - Shared guides: `.trellis/spec/guides/`
53
53
 
54
54
  ### 2. Understand Requirements
@@ -62,7 +62,7 @@ Before implementing, read:
62
62
 
63
63
  Read relevant specs based on task type:
64
64
 
65
- - Spec layers: `.trellis/spec/<package>/<layer>/`
65
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
66
66
  - Shared guides: `.trellis/spec/guides/`
67
67
 
68
68
  ### 2. Understand Requirements
@@ -61,7 +61,7 @@ Before implementing, read:
61
61
 
62
62
  Read relevant specs based on task type:
63
63
 
64
- - Spec layers: `.trellis/spec/<package>/<layer>/`
64
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
65
65
  - Shared guides: `.trellis/spec/guides/`
66
66
 
67
67
  ### 2. Understand Requirements
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trellis-implement",
3
3
  "description": "Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.",
4
- "prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- 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.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore implementing, read:\n- `.trellis/workflow.md` - Project workflow\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n\n## Core Responsibilities\n\n1. **Understand specs** - Read relevant spec files in `.trellis/spec/`\n2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present\n3. **Implement features** - Write code following specs and task artifacts\n4. **Self-check** - Ensure code quality\n5. **Report results** - Report completion status\n\n## Forbidden Operations\n\n**Do NOT execute these git commands:**\n\n- `git commit`\n- `git push`\n- `git merge`\n\n---\n\n## Workflow\n\n### 1. Understand Specs\n\nRead relevant specs based on task type:\n\n- Spec layers: `.trellis/spec/<package>/<layer>/`\n- Shared guides: `.trellis/spec/guides/`\n\n### 2. Understand Requirements\n\nRead the task's prd.md, design.md if present, and implement.md if present:\n\n- What are the core requirements\n- Key points of technical design\n- Implementation order, validation commands, and rollback points\n\n### 3. Implement Features\n\n- Write code following specs and task artifacts\n- Follow existing code patterns\n- Only do what's required, no over-engineering\n\n### 4. Verify\n\nRun project's lint and typecheck commands to verify changes.\n\n---\n\n## Report Format\n\n```markdown\n## Implementation Complete\n\n### Files Modified\n\n- `src/components/Feature.tsx` - New component\n- `src/hooks/useFeature.ts` - New hook\n\n### Implementation Summary\n\n1. Created Feature component...\n2. Added useFeature hook...\n\n### Verification Results\n\n- Lint: Passed\n- TypeCheck: Passed\n```\n\n---\n\n## Code Standards\n\n- Follow existing code patterns\n- Don't add unnecessary abstractions\n- Only do what's required, no over-engineering\n- Keep code readable",
4
+ "prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- 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.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore implementing, read:\n- `.trellis/workflow.md` - Project workflow\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n\n## Core Responsibilities\n\n1. **Understand specs** - Read relevant spec files in `.trellis/spec/`\n2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present\n3. **Implement features** - Write code following specs and task artifacts\n4. **Self-check** - Ensure code quality\n5. **Report results** - Report completion status\n\n## Forbidden Operations\n\n**Do NOT execute these git commands:**\n\n- `git commit`\n- `git push`\n- `git merge`\n\n---\n\n## Workflow\n\n### 1. Understand Specs\n\nRead relevant specs based on task type:\n\n- Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).\n- Shared guides: `.trellis/spec/guides/`\n\n### 2. Understand Requirements\n\nRead the task's prd.md, design.md if present, and implement.md if present:\n\n- What are the core requirements\n- Key points of technical design\n- Implementation order, validation commands, and rollback points\n\n### 3. Implement Features\n\n- Write code following specs and task artifacts\n- Follow existing code patterns\n- Only do what's required, no over-engineering\n\n### 4. Verify\n\nRun project's lint and typecheck commands to verify changes.\n\n---\n\n## Report Format\n\n```markdown\n## Implementation Complete\n\n### Files Modified\n\n- `src/components/Feature.tsx` - New component\n- `src/hooks/useFeature.ts` - New hook\n\n### Implementation Summary\n\n1. Created Feature component...\n2. Added useFeature hook...\n\n### Verification Results\n\n- Lint: Passed\n- TypeCheck: Passed\n```\n\n---\n\n## Code Standards\n\n- Follow existing code patterns\n- Don't add unnecessary abstractions\n- Only do what's required, no over-engineering\n- Keep code readable",
5
5
  "tools": [
6
6
  "read",
7
7
  "write",