Add documentation for the three-stage development workflow and CLI management strategy; create a new notes file for additional insights.

This commit is contained in:
yuxuanhui
2026-08-03 16:17:16 +08:00
parent 91861565bb
commit 6e0c5c35fc
14 changed files with 3122 additions and 61 deletions
@@ -28,7 +28,7 @@ Trellis 是控制面,不替代工程方法;Matt 是方法层,不拥有 tas
- 全局 `AGENTS.md` 与本文共同拥有任务分流权;Trellis bundled skill 不得覆盖二者。
- `trellis-start` 只用于加载 context、phase 和 spec indexes;忽略其中旧的 task-consent 与固定 skill route。
- 不调用 `trellis-brainstorm` 和原生 `trellis-implement`。Planning 使用 `grill-with-docs`;Trellis Phase 2 使用 `trellis-matt-implement` 执行本工作流适配后的 Matt implementation contract。
- 不调用 `trellis-brainstorm` 和原生 `trellis-implement`。普通 Planning 使用 `grill-with-docs`;Feishu-bound task 先做 approved-source snapshot 检查,只对 decision-bearing delta 使用 `grill-with-docs`。Trellis Phase 2 使用 `trellis-matt-implement` 执行本工作流适配后的 Matt implementation contract。
- 不依赖 `trellis-continue` 的旧 route table;恢复逻辑以本文 `Active Task Routing` 为准。
- 不调用 `trellis-finish-work` 的旧 commit-first 流程;直接运行本文 3.5 的 `--no-commit` 命令。
- 即使 Codex hook 的 `<codex-mode>` banner 显示 Trellis sub-agent 默认值,本文对 planning/implementation 方法的明确选择优先:不得派发原生 `trellis-implement`。
@@ -95,7 +95,7 @@ Trellis 是控制面,不替代工程方法;Matt 是方法层,不拥有 tas
Trellis 生命周期内有两个固定替换:
- Phase 1 不使用 `trellis-brainstorm`;先由主会话基于证据形成 planning artifacts,再用 `grill-with-docs` review 和压实 spec。
- Phase 1 不使用 `trellis-brainstorm`;先由主会话基于证据形成 planning artifacts。普通 task 再用 `grill-with-docs` review 和压实 spec;已审批的 Feishu-bound task 先验证 source snapshot,只 review 新增 delta。
- Phase 2 不使用原生 `trellis-implement`;派发 `trellis-matt-implement` 按已经 review 的 artifacts 执行适配后的 Matt implementation contract。
其他意图不要在本文件复制一份会过期的 Matt skill 清单。按以下顺序路由:
@@ -152,6 +152,8 @@ python3 ./.trellis/scripts/task.py list-archive
`prd.md` 不放详细技术设计和执行 checklist。`design.md` 解释技术形状与取舍。`implement.md` 记录有序步骤、验证命令、风险、rollback point 和当前 checkpoint。
Feishu-bound task 的 Wiki Spec/Base Tickets 继续拥有产品需求、验收、身份和关系事实。Trellis `prd.md`/`implement.md`保存可恢复的执行 snapshot 与 task-local planning:必须记录稳定 record IDs、来源更新时间/Wiki revision(可用时)、Ticket 集合和关系。它们不得静默覆盖飞书来源,也不得要求用户仅因内容被复制到 Trellis 就再次全文审批。
每个 Trellis implementation task 在 `prd.md` 中维护:
```markdown
@@ -214,7 +216,7 @@ Phase 3: Finish → verify, evaluate knowledge, optionally use VCS, archive and
| 简单、局部、根因明确 | Inline;不创建 task |
| 非简单但单会话可完成 | 按当前 skill `description` 选择 Matt 方法 |
| 明确 `/tdd`、test-first、red-green-refactor 或 integration tests | `/tdd`;Trellis task 先记录 mode 并确认公开 seam |
| Trellis planning artifact review | `grill-with-docs`;不用 `trellis-brainstorm` |
| Trellis planning artifact review | 普通 task 用 `grill-with-docs`;Feishu-bound task 做 snapshot check,只对 delta 用 `grill-with-docs`;不用 `trellis-brainstorm` |
| Trellis reviewed spec implementation | `trellis-matt-implement`;不用原生 `trellis-implement`;不可用时主会话执行 Matt fallback |
| 诊断、review、架构、research | 按当前 skill `description` 选择最窄匹配 |
| Trellis 状态、恢复、归档 | 本文 Phase、Active Task Routing 与 `.trellis/scripts/` |
@@ -224,7 +226,7 @@ Phase 3: Finish → verify, evaluate knowledge, optionally use VCS, archive and
- 1.0 Create or resume task `[required · once]`
- 1.1 Draft planning artifacts from evidence `[required · repeatable]`
- 1.2 Research / prototype / design inquiry `[optional · repeatable]`
- 1.3 Review spec with `grill-with-docs` `[required · once]`
- 1.3 Review spec or source delta `[required · once]`
- 1.4 Activate or stop at planning boundary `[required · once]`
- 1.5 Planning completion criteria
@@ -237,11 +239,11 @@ Route by `AGENTS.md`; keep simple work inline. Main session is default. Create a
[/workflow-state:no_task-inline]
[workflow-state:planning]
Do not use `trellis-brainstorm`. Draft task artifacts, record `standard|tdd`, confirm public TDD seams when required, review with `grill-with-docs`, then route by the user's original intent.
Do not use `trellis-brainstorm`. Draft task artifacts, record `standard|tdd`, confirm public TDD seams when required, then review the full spec or only the approved-source delta as applicable before routing by the user's original intent.
[/workflow-state:planning]
[workflow-state:planning-inline]
Draft task artifacts, record `standard|tdd`, confirm public TDD seams when required, review with `grill-with-docs`, and sync decisions. Trellis artifacts remain task-level truth.
Draft task artifacts, record `standard|tdd`, confirm public TDD seams when required, and review the full spec or only the approved-source delta as applicable. Feishu-bound artifacts remain execution snapshots; unbound Trellis artifacts remain task-level truth.
[/workflow-state:planning-inline]
### Phase 2 summary
@@ -312,6 +314,7 @@ python3 ./.trellis/scripts/task.py create "<short title>" --slug <name>
6. 若实现 agent 需要固定读取某些 spec/research,把真实条目加入 `implement.jsonl`;不登记产品代码。没有额外 context 时允许保留 seed,由 agent 自行发现相关规范。
7. 每次重要结论形成后立即更新 owning artifact,避免只留在聊天里。
8. 暂不使用 `trellis-brainstorm`;开放决策和 TDD seam 留给 1.3 的 `grill-with-docs` 逐项 review。
9. Feishu-bound task 读取并记录最新 Spec/Ticket record IDs、更新时间、Wiki revision(可用时)、验收和 blocker 集,作为后续 snapshot/delta 比较基线;不把 copied source 当成新 Spec。
`prd.md` 至少包含:Goal、Background/Evidence、In Scope、Out of Scope、Requirements、Acceptance Criteria、Constraints、Open Decisions、Testing Strategy。
@@ -331,21 +334,24 @@ Research 规则:
Prototype 规则:代码从一开始就视为 throwaway;保留答案,不把原型未经重新设计直接并入产品实现。
#### 1.3 Review spec with `grill-with-docs` `[required · once]`
#### 1.3 Review spec or source delta `[required · once]`
显式加载 `grill-with-docs`,用它 review `prd.md`、条件性的 `design.md` 和 `implement.md`:
先判断 task 是否绑定已经过审批的 Feishu Spec/Tickets:
- **普通 task**:显式加载 `grill-with-docs`,review `prd.md`、条件性的 `design.md` 和 `implement.md`。
- **Feishu-bound,snapshot-only**:比较稳定 IDs、Base 更新时间、Wiki revision(可用时)、完整 Ticket 集、parent/blocker、验收和 task-local 文本。完全一致且没有新增决策时,只记录 `snapshot-only / No decision-bearing delta`,不重复全文 grilling。
- **Feishu-bound,delta-reviewed**:只把 task-local planning 新增或改变的兼容、迁移、rollout/rollback、安全、seam 或执行顺序等 decision-bearing delta 交给 `grill-with-docs`,确认后记录 delta 和来源版本。
- **source-revision-required**:若 task-local planning 改变产品行为、范围、验收、Ticket 身份、parent 或 blocker 语义,停止激活;先修订并批准 owning Wiki Spec/Base Tickets,再刷新 snapshot。
Review 时遵守:
1. 先由环境证据回答事实问题,不把仓库可查事实反问用户。
2. 对产品、范围、UX、兼容、风险、验收和关键设计决策逐项 grilling。
3. 一次只问一个问题,每个问题提供推荐答案和不同选择的取舍。
4. 每个答案确认后立即同步到 owning Trellis artifact。
5. `Implementation Mode: tdd` 时,按 `/tdd` 契约确认要观察的公开 interface/seam;未确认前不写测试、不进入 Phase 2。`standard` 不询问 TDD seam。
6. `CONTEXT.md` 只记录稳定领域术语;ADR 只记录难以逆转、反直觉且经过真实取舍的决策。
7. Trellis artifacts 始终是当前 task 的 spec source of truth;不要让 glossary/ADR 复制任务细节。
2. 一次只问一个决定性问题,每题提供推荐答案和选择取舍。
3. 每个答案确认后立即同步到 owning artifact;产品/验收写回飞书来源,执行决策写入 Trellis。
4. `Implementation Mode: tdd` 时,按 `/tdd` 契约确认公开 interface/seam;未确认前不写测试、不进入 Phase 2。`standard` 不询问 TDD seam。
5. `CONTEXT.md` 只记录稳定领域术语;ADR 只记录难以逆转、反直觉且经过真实取舍的决策。
`grill-with-docs` 在平台上不可直接加载时,使用其等价组合:`grilling` + `domain-modeling`。
当用户确认已经达到 shared understanding 时,本步骤完成。这个确认是 spec review 的完成条件,不再额外增加一层 Trellis implementation approval。
`grill-with-docs` 在平台上不可直接加载时,使用其等价组合:`grilling` + `domain-modeling`。普通 task 在 shared understanding 后完成本步骤;Feishu-bound task 在 snapshot/delta disposition 已记录且无 unresolved delta 后完成。两者都不再增加额外的 Trellis implementation approval。
#### 1.4 Activate or stop at planning boundary `[required · once]`
@@ -365,7 +371,7 @@ Prototype 规则:代码从一开始就视为 throwaway;保留答案,不把
python3 ./.trellis/scripts/task.py start <task-dir>
```
原始实现请求加上 1.3 的 shared-understanding 确认已经构成实现授权;不再额外增加 Trellis planning approval。
原始实现请求加上 1.3 的 review completion(普通 task 的 shared understanding,或 Feishu-bound task 的有效 snapshot/delta disposition)已经构成实现授权;不再额外增加 Trellis planning approval。
Planning-only task 的 planning 产物本身就是交付物;完成并验证后可直接进入 3.5 归档,不必为了走形式而把它切到 `in_progress`。
@@ -381,7 +387,7 @@ Planning-only task 的 planning 产物本身就是交付物;完成并验证后
| research 结论已持久化(如有) | ✅ |
| `Testing Strategy` 已记录 `standard` 或 `tdd` | ✅ |
| `tdd` 模式的公开测试 seam 已由用户确认 | 条件性 ✅ |
| `grill-with-docs` review 已达到 shared understanding | ✅ |
| 普通 task 已达到 shared understanding;Feishu-bound task 已记录有效 snapshot/delta disposition | ✅ |
| 当前动作仍处于用户授权范围 | ✅ |
## Phase 2: Execute
@@ -540,8 +546,8 @@ Active task 存在时,先读取 `task.json`、artifacts 和 Current Checkpoint
| --- | --- |
| `planning`,`prd.md` 未收敛 | 1.1 |
| `planning`,存在技术未知项 | 1.2 |
| `planning`,artifacts 尚未通过 `grill-with-docs` review | 1.3 |
| `planning`,shared understanding 已确认 | 1.4;按用户原始意图 start 或停在 planning boundary |
| `planning`,普通 artifacts 尚未 review,或 Feishu snapshot/delta disposition 缺失/已失效 | 1.3 |
| `planning`,1.3 review completion 已满足 | 1.4;按用户原始意图 start 或停在 planning boundary |
| `in_progress`,checkpoint 指向未完成实现/诊断/review | 2.1 |
| `in_progress`,执行完成但缺 full-scope evidence | 2.2 |
| `in_progress`,acceptance 已验证 | 3.3 → 条件性 3.4 → 3.5 |