@baoanaz/cviauto 0.6.5 → 0.6.8
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.
- package/dist/templates/claude/agents/trellis-check.md +61 -61
- package/dist/templates/claude/agents/trellis-implement.md +58 -58
- package/dist/templates/claude/agents/trellis-research.md +67 -67
- package/dist/templates/codebuddy/agents/trellis-check.md +61 -61
- package/dist/templates/codebuddy/agents/trellis-implement.md +58 -58
- package/dist/templates/codebuddy/agents/trellis-research.md +67 -67
- package/dist/templates/codex/agents/trellis-check.toml +99 -30
- package/dist/templates/codex/agents/trellis-implement.toml +99 -16
- package/dist/templates/codex/agents/trellis-research.toml +116 -39
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +41 -41
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +194 -261
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +59 -93
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +72 -110
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +120 -171
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +35 -43
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +78 -78
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +24 -24
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +29 -29
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +46 -46
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +28 -28
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +66 -66
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +32 -32
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +44 -44
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +79 -79
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +37 -37
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +43 -43
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +47 -47
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +33 -33
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +61 -61
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +41 -41
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +31 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +40 -41
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +36 -36
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +36 -38
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +52 -52
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +45 -45
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +41 -42
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +28 -28
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +30 -30
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +34 -34
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +30 -30
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +39 -39
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +40 -40
- package/dist/templates/common/commands/continue.md +28 -29
- package/dist/templates/common/commands/finish-work.md +32 -40
- package/dist/templates/cursor/agents/trellis-check.md +61 -61
- package/dist/templates/cursor/agents/trellis-implement.md +58 -58
- package/dist/templates/cursor/agents/trellis-research.md +67 -67
- package/dist/templates/droid/droids/trellis-check.md +64 -56
- package/dist/templates/droid/droids/trellis-implement.md +61 -53
- package/dist/templates/droid/droids/trellis-research.md +67 -67
- package/dist/templates/gemini/agents/trellis-check.md +64 -57
- package/dist/templates/gemini/agents/trellis-implement.md +61 -54
- package/dist/templates/gemini/agents/trellis-research.md +67 -67
- package/dist/templates/kiro/agents/trellis-check.json +15 -3
- package/dist/templates/kiro/agents/trellis-implement.json +15 -3
- package/dist/templates/kiro/agents/trellis-research.json +10 -2
- package/dist/templates/kiro/agents/trellis.json +19 -5
- package/dist/templates/opencode/agents/trellis-check.md +61 -61
- package/dist/templates/opencode/agents/trellis-implement.md +58 -59
- package/dist/templates/opencode/agents/trellis-research.md +67 -67
- package/dist/templates/pi/agents/trellis-check.md +99 -21
- package/dist/templates/pi/agents/trellis-implement.md +90 -22
- package/dist/templates/pi/agents/trellis-research.md +124 -12
- package/dist/templates/qoder/agents/trellis-check.md +64 -57
- package/dist/templates/qoder/agents/trellis-implement.md +61 -54
- package/dist/templates/qoder/agents/trellis-research.md +67 -67
- package/dist/templates/trae/agents/trellis-check.md +64 -57
- package/dist/templates/trae/agents/trellis-implement.md +61 -54
- package/dist/templates/trae/agents/trellis-research.md +67 -67
- package/dist/templates/trellis/agents/check.md +29 -29
- package/dist/templates/trellis/agents/implement.md +30 -30
- package/dist/templates/trellis/workflow.md +349 -356
- package/dist/templates/zcode/agents/trellis-check.md +64 -51
- package/dist/templates/zcode/agents/trellis-implement.md +61 -53
- package/package.json +2 -2
package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 本地工作流系统
|
|
2
2
|
|
|
3
|
-
`.cviauto/workflow.md`
|
|
3
|
+
`.cviauto/workflow.md` 是用户项目内的 Cviauto 工作流权威来源。AI 不需要 Cviauto 源码就能理解当前项目应如何推进任务;有此文件足矣。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 文件职责
|
|
6
6
|
|
|
7
|
-
`.cviauto/workflow.md`
|
|
7
|
+
`.cviauto/workflow.md` 有三个职责:
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
9
|
+
1. **解释工作流阶段**:Plan、Execute、Finish。
|
|
10
|
+
2. **定义 skill 路由**:当用户表达某种意图时,AI 应使用哪个 skill 或 Agent。
|
|
11
|
+
3. **提供工作流状态 prompt 块**:hooks 可以将当前状态的 prompt 块注入对话。
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 当前阶段模型
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
阶段 1:Plan -> 明确构建内容,产出 prd.md 和所需研究
|
|
17
|
+
阶段 2:Execute -> 根据 PRD 和 spec 实现,然后检查
|
|
18
|
+
阶段 3:Finish -> 最终验证,保存经验,收尾
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
每个阶段包含编号步骤,如 `1.3 Configure context`。这些编号不是 `task.json` 中的运行时字段;它们是供 AI 和人类阅读的工作流结构。
|
|
22
22
|
|
|
23
|
-
## Skill
|
|
23
|
+
## Skill 路由
|
|
24
24
|
|
|
25
|
-
`workflow.md`
|
|
25
|
+
`workflow.md` 按平台能力分离路由:
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
27
|
+
- 支持 sub-agent 的平台:默认分派 `cviauto-implement` 进行实现,`cviauto-check` 进行检查。
|
|
28
|
+
- 不支持 sub-agent 的平台:主会话阅读 `cviauto-before-dev` 等 skill,然后直接执行。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
当改变本地 AI 行为时,首先更新 `workflow.md` 中的路由描述,然后检查相应的平台 skill、command 或 Agent 文件是否需要保持同步。
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## 工作流状态 Prompt 块
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
`workflow.md` 底部可以包含如下状态块:
|
|
35
35
|
|
|
36
36
|
```text
|
|
37
37
|
[workflow-state:no_task]
|
|
@@ -39,37 +39,37 @@ The bottom of `workflow.md` can contain state blocks like this:
|
|
|
39
39
|
[/workflow-state:no_task]
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Hooks
|
|
42
|
+
Hooks 根据当前任务状态选择正确的块并注入到对话中。常见状态包括:
|
|
43
43
|
|
|
44
|
-
|
|
|
44
|
+
| 状态 | 含义 |
|
|
45
45
|
| --- | --- |
|
|
46
|
-
| `no_task` |
|
|
47
|
-
| `planning` |
|
|
48
|
-
| `in_progress` |
|
|
49
|
-
| `completed` |
|
|
46
|
+
| `no_task` | 当前会话没有活动任务。 |
|
|
47
|
+
| `planning` | 任务仍在需求、研究或上下文配置阶段。 |
|
|
48
|
+
| `in_progress` | 任务已进入实现和检查阶段。 |
|
|
49
|
+
| `completed` | 任务已完成,等待收尾或归档。 |
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
如果用户想更改诸如"没有任务时是否创建任务"、"何时可以跳过任务创建"或"是否需要 sub-agent"等策略,编辑这些状态块及其上方的路由表。
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## 本地修改模式
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
常见变更:
|
|
56
56
|
|
|
57
|
-
|
|
|
57
|
+
| 目标 | 编辑点 |
|
|
58
58
|
| --- | --- |
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
59
|
+
| 添加阶段 | 更新阶段索引、阶段正文、路由和状态块。 |
|
|
60
|
+
| 更改任务创建策略 | 更新 `no_task` 状态块和阶段 1 描述。 |
|
|
61
|
+
| 更改默认实现/检查路径 | 更新阶段 2 和 skill 路由。 |
|
|
62
|
+
| 更改收尾流程 | 更新阶段 3 和 `finish-work` 相关描述。注意当前拆分:阶段 3.3 = 可选的人工门禁 spec 推广,阶段 3.4 = AI 驱动的工作提交(批量,用户确认),阶段 3.5 = `/finish-work`(本地归档 + 会话日志)。如果有未提交的任务代码,`/finish-work` 拒绝运行。 |
|
|
63
|
+
| 更改平台差异 | 更新按平台分组的路由描述。 |
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
编辑后,让 AI 重新读取 `.cviauto/workflow.md`;不要假设旧对话中的流程仍然有效。
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## 与平台文件的关系
|
|
68
68
|
|
|
69
|
-
`workflow.md`
|
|
69
|
+
`workflow.md` 是本地工作流的语义中心,但每个平台也可以有自己的入口文件:
|
|
70
70
|
|
|
71
|
-
- skills
|
|
72
|
-
- commands/prompts/workflows
|
|
73
|
-
- hooks
|
|
71
|
+
- skills,如 `cviauto-brainstorm` 和 `cviauto-check`。
|
|
72
|
+
- commands/prompts/workflows,如 continue 和 finish-work。
|
|
73
|
+
- hooks,如 session-start 或 workflow-state 注入。
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
如果只改了 `workflow.md`,平台入口文件可能仍然包含旧的语言。当用户想要改变"AI 实际做什么"时,也要检查相关平台目录。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Local Workspace Memory System
|
|
1
|
+
# 本地工作区记忆系统(Local Workspace Memory System)
|
|
2
2
|
|
|
3
|
-
`.cviauto/workspace/`
|
|
3
|
+
`.cviauto/workspace/` 存储跨会话记忆。其目的是让 AI 和人类能够在不同窗口、不同日期之间了解之前发生过什么。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 目录结构
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
8
|
.cviauto/workspace/
|
|
@@ -13,28 +13,28 @@
|
|
|
13
13
|
└── journal-2.md
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
|
16
|
+
| 文件 | 用途 |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| `.cviauto/.developer` |
|
|
19
|
-
| `.cviauto/workspace/index.md` |
|
|
20
|
-
| `.cviauto/workspace/<developer>/index.md` |
|
|
21
|
-
| `.cviauto/workspace/<developer>/journal-N.md` |
|
|
18
|
+
| `.cviauto/.developer` | 当前开发者身份。 |
|
|
19
|
+
| `.cviauto/workspace/index.md` | 全局工作区概览。 |
|
|
20
|
+
| `.cviauto/workspace/<developer>/index.md` | 某位开发者的会话索引。 |
|
|
21
|
+
| `.cviauto/workspace/<developer>/journal-N.md` | 会话日志。 |
|
|
22
22
|
|
|
23
|
-
## Developer Identity
|
|
23
|
+
## 开发者身份(Developer Identity)
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
首次使用时运行:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
python3 ./.cviauto/scripts/init_developer.py <name>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
此命令会创建 `.cviauto/.developer` 和对应的工作区目录。AI 不应随意更改开发者身份;如果身份有误,请先确认当前项目的使用者是谁。
|
|
32
32
|
|
|
33
|
-
## Journal
|
|
33
|
+
## 日志(Journal)
|
|
34
34
|
|
|
35
|
-
`journal-N.md`
|
|
35
|
+
`journal-N.md` 记录每个会话中已完成或部分完成的工作。默认情况下,每个日志文件容纳约 2000 行;超出后自动轮转到下一个文件。
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
记录会话的常用命令:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
python3 ./.cviauto/scripts/add_session.py \
|
|
@@ -43,29 +43,29 @@ python3 ./.cviauto/scripts/add_session.py \
|
|
|
43
43
|
--commit "abc1234"
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
没有 commit 的计划或审查工作也可以通过 `--no-commit` 或空 commit 值来记录。
|
|
47
47
|
|
|
48
|
-
## Relationship Between Workspace Memory And Tasks
|
|
48
|
+
## 工作区记忆与任务的关系(Relationship Between Workspace Memory And Tasks)
|
|
49
49
|
|
|
50
|
-
|
|
|
50
|
+
| 系统 | 存储内容 |
|
|
51
51
|
| --- | --- |
|
|
52
|
-
| `.cviauto/tasks/` |
|
|
53
|
-
| `.cviauto/workspace/` |
|
|
54
|
-
| `.cviauto/spec/` |
|
|
52
|
+
| `.cviauto/tasks/` | 特定任务的需求、设计、研究和状态。 |
|
|
53
|
+
| `.cviauto/workspace/` | 跨任务、跨会话的工作记录。 |
|
|
54
|
+
| `.cviauto/spec/` | 作为长期约定保存的工程知识。 |
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
如果信息仅对当前任务有用,请放入任务目录。
|
|
57
|
+
如果信息描述了当前会话中发生的事,请放入工作区日志。
|
|
58
|
+
如果信息应在未来每次编写代码时都遵循,请放入 spec。
|
|
59
59
|
|
|
60
|
-
## Local Customization Points
|
|
60
|
+
## 本地自定义点(Local Customization Points)
|
|
61
61
|
|
|
62
|
-
|
|
|
62
|
+
| 需求 | 编辑位置 |
|
|
63
63
|
| --- | --- |
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
64
|
+
| 更改日志最大行数 | `.cviauto/config.yaml` 中的 `max_journal_lines`。 |
|
|
65
|
+
| 更改会话自动 commit 消息 | `.cviauto/config.yaml` 中的 `session_commit_message`。 |
|
|
66
|
+
| 更改会话内容格式 | `.cviauto/scripts/add_session.py`。 |
|
|
67
|
+
| 更改工作区在上下文中的展示方式 | `.cviauto/scripts/common/session_context.py`。 |
|
|
68
68
|
|
|
69
|
-
## AI Usage Rules
|
|
69
|
+
## AI 使用规则(AI Usage Rules)
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
AI 不应将工作区视为唯一的事实来源。恢复任务时,请先阅读当前任务,然后将工作区用作背景信息。任务完成后,在工作区中记录重要的过程笔记;如果产生了长期规则,请更新 spec。
|
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# Agents
|
|
1
|
+
# Agents(代理)
|
|
2
2
|
|
|
3
|
-
Cviauto
|
|
3
|
+
Cviauto Agent 文件定义专门的角色。用户项目中常见的 Cviauto Agent 有:
|
|
4
4
|
|
|
5
5
|
- `cviauto-research`
|
|
6
6
|
- `cviauto-implement`
|
|
7
7
|
- `cviauto-check`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
文件位置和格式因平台而异,但职责边界应保持一致。
|
|
10
10
|
|
|
11
|
-
## Agent Responsibilities
|
|
11
|
+
## Agent Responsibilities(Agent 职责)
|
|
12
12
|
|
|
13
|
-
| Agent | Responsibility |
|
|
13
|
+
| Agent(代理) | Responsibility(职责) |
|
|
14
14
|
| --- | --- |
|
|
15
|
-
| `cviauto-research` |
|
|
16
|
-
| `cviauto-implement` |
|
|
17
|
-
| `cviauto-check` |
|
|
15
|
+
| `cviauto-research` | 调查问题并将发现写入当前任务的 `research/`。 |
|
|
16
|
+
| `cviauto-implement` | 根据 `prd.md`、可选的 `design.md` / `implement.md`、`implement.jsonl` 及相关 spec/research 进行实现。 |
|
|
17
|
+
| `cviauto-check` | 审查变更、修复发现的问题,并运行必要的检查。 |
|
|
18
18
|
|
|
19
|
-
Agent
|
|
19
|
+
Agent 文件不应变成通用的聊天提示。它们应定义输入来源、写入边界、是否可以修改代码,以及如何报告结果。
|
|
20
20
|
|
|
21
|
-
## Common Paths
|
|
21
|
+
## Common Paths(常见路径)
|
|
22
22
|
|
|
23
|
-
| Platform | Agent path |
|
|
23
|
+
| Platform(平台) | Agent path(代理路径) |
|
|
24
24
|
| --- | --- |
|
|
25
25
|
| Claude Code | `.claude/agents/cviauto-*.md` |
|
|
26
26
|
| Cursor | `.cursor/agents/cviauto-*.md` |
|
|
@@ -32,51 +32,51 @@ Agent files should not become generic chat prompts. They should define input sou
|
|
|
32
32
|
| CodeBuddy | `.codebuddy/agents/cviauto-*.md` |
|
|
33
33
|
| Factory Droid | `.factory/droids/cviauto-*.md` |
|
|
34
34
|
| Pi Agent | `.pi/agents/cviauto-*.md` |
|
|
35
|
-
| Reasonix | `.reasonix/skills/cviauto-*/SKILL.md
|
|
35
|
+
| Reasonix | `.reasonix/skills/cviauto-*/SKILL.md`(subagent frontmatter) |
|
|
36
36
|
| ZCode | `.zcode/cli/agents/cviauto-*.md` |
|
|
37
37
|
|
|
38
|
-
GitHub Copilot agent/prompt
|
|
38
|
+
GitHub Copilot 的 agent/prompt 支持由 `.github/agents/`、`.github/prompts/` 和 `.github/skills/` 等目录组合提供;请检查用户项目中实际生成的文件。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
主会话工作流平台如 Kilo、Antigravity 和 Devin 可能没有 Cviauto sub-agent 文件。它们通常依赖 workflows/skills 来引导主会话。
|
|
41
41
|
|
|
42
|
-
## Two Context Loading Modes
|
|
42
|
+
## Two Context Loading Modes(两种上下文加载模式)
|
|
43
43
|
|
|
44
|
-
### hook push
|
|
44
|
+
### hook push(钩子推送)
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
平台 hook 在 agent 启动前注入任务上下文。agent 文件本身可以更专注于职责和边界。
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
常见于支持 agent hooks 的平台。
|
|
49
49
|
|
|
50
|
-
### agent pull
|
|
50
|
+
### agent pull(agent 拉取)
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
agent 文件指示 agent 在启动后读取:
|
|
53
53
|
|
|
54
54
|
- `python3 ./.cviauto/scripts/task.py current --source`
|
|
55
|
-
- `implement.jsonl`
|
|
56
|
-
- spec/research
|
|
57
|
-
-
|
|
58
|
-
- `design.md
|
|
59
|
-
- `implement.md
|
|
55
|
+
- `implement.jsonl` 或 `check.jsonl`
|
|
56
|
+
- JSONL 引用的 spec/research 文件
|
|
57
|
+
- 当前任务的 `prd.md`
|
|
58
|
+
- `design.md`(如有)
|
|
59
|
+
- `implement.md`(如有)
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
此模式适用于 hooks 无法可靠地重写 sub-agent prompt 的平台。
|
|
62
62
|
|
|
63
|
-
## Local Change Scenarios
|
|
63
|
+
## Local Change Scenarios(本地修改场景)
|
|
64
64
|
|
|
65
|
-
| User need | Edit location |
|
|
65
|
+
| User need(用户需求) | Edit location(编辑位置) |
|
|
66
66
|
| --- | --- |
|
|
67
|
-
| Implement agent
|
|
68
|
-
| Check agent
|
|
69
|
-
| Research agent
|
|
70
|
-
| Agent
|
|
71
|
-
|
|
|
67
|
+
| Implement agent 必须遵循额外限制 | 平台的 `cviauto-implement` agent 文件。 |
|
|
68
|
+
| Check agent 必须运行项目特定命令 | `cviauto-check` agent 文件,以及 `.cviauto/spec/`(如需要)。 |
|
|
69
|
+
| Research agent 必须输出固定格式 | `cviauto-research` agent 文件。 |
|
|
70
|
+
| Agent 无法读取任务上下文 | Agent 序言或 `inject-subagent-context` hook。 |
|
|
71
|
+
| 添加项目特定 agent | 平台 agent 目录 + 相关 workflow/command/skill 入口点。 |
|
|
72
72
|
|
|
73
|
-
## Modification Principles
|
|
73
|
+
## Modification Principles(修改原则)
|
|
74
74
|
|
|
75
|
-
1. **Keep responsibilities single-purpose
|
|
76
|
-
2. **Specify the read order
|
|
77
|
-
3. **Specify write boundaries
|
|
78
|
-
4. **Keep semantics synchronized in multi-platform projects
|
|
75
|
+
1. **Keep responsibilities single-purpose(保持职责单一)**。不要将 research、implement 和 check 职责混入一个 agent。
|
|
76
|
+
2. **Specify the read order(指定读取顺序)**。Agent 必须知道从当前任务开始,读取 jsonl/spec 上下文,然后读取 `prd.md`、`design.md`(如有)和 `implement.md`(如有)。
|
|
77
|
+
3. **Specify write boundaries(指定写入边界)**。Research 通常只写入 `research/`;implement 可以写代码;check 可以修复问题。
|
|
78
|
+
4. **Keep semantics synchronized in multi-platform projects(多平台项目中保持语义同步)**。如果用户同时配置了 Claude、Codex 和 Cursor,请决定对某个平台 agent 的更改是否也需要应用到其他平台。
|
|
79
79
|
|
|
80
|
-
## Do Not Default To Editing Upstream Templates
|
|
80
|
+
## Do Not Default To Editing Upstream Templates(不要默认编辑上游模板)
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
本地 AI 应默认修改用户项目内的平台 agent 文件。仅当用户明确希望将更改回馈给 Cviauto 时,才讨论上游模板源。
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Hooks And Settings
|
|
1
|
+
# Hooks And Settings(钩子与设置)
|
|
2
2
|
|
|
3
|
-
Hooks/settings
|
|
3
|
+
Hooks/settings 是将平台连接到 Cviauto 的入口层。它们决定平台在哪些事件上运行哪些脚本、插件或扩展。
|
|
4
4
|
|
|
5
|
-
## Settings Responsibilities
|
|
5
|
+
## Settings Responsibilities(Settings 的职责)
|
|
6
6
|
|
|
7
|
-
settings/config
|
|
7
|
+
settings/config 文件通常注册:
|
|
8
8
|
|
|
9
|
-
- session-start hook
|
|
10
|
-
- workflow-state hook
|
|
11
|
-
- sub-agent context hook
|
|
12
|
-
- shell/session bridge
|
|
13
|
-
- platform plugin or extension entry points
|
|
9
|
+
- session-start hook(会话启动钩子):在新会话启动或上下文重置时注入 Cviauto 概览。
|
|
10
|
+
- workflow-state hook(工作流状态钩子):解析 `.cviauto/workflow.md` 中的 `[workflow-state:STATUS]` 块,在每次用户输入时输出与当前任务 `status` 匹配的正文。仅做解析;脚本不嵌入回退内容。
|
|
11
|
+
- sub-agent context hook(子代理上下文钩子):在 implementation/check/research agent 启动时注入任务上下文。
|
|
12
|
+
- shell/session bridge(shell/会话桥接):让 shell 命令看到相同的 Cviauto 会话身份。
|
|
13
|
+
- platform plugin or extension entry points(平台插件或扩展入口点)。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
常见文件:
|
|
16
16
|
|
|
17
|
-
| Platform | settings/config |
|
|
17
|
+
| Platform(平台) | settings/config(设置/配置) |
|
|
18
18
|
| --- | --- |
|
|
19
19
|
| Claude Code | `.claude/settings.json` |
|
|
20
20
|
| Cursor | `.cursor/hooks.json` |
|
|
@@ -26,47 +26,46 @@ Common files:
|
|
|
26
26
|
| CodeBuddy | `.codebuddy/settings.json` |
|
|
27
27
|
| GitHub Copilot | `.github/copilot/hooks.json` |
|
|
28
28
|
| Factory Droid | `.factory/settings.json` |
|
|
29
|
-
| Pi Agent | `.pi/settings.json`, `.pi/extensions/
|
|
30
|
-
| Trae IDE | `.trae/hooks.json` |
|
|
29
|
+
| Pi Agent | `.pi/settings.json`, `.pi/extensions/cviauto/` |
|
|
31
30
|
|
|
32
|
-
Reasonix
|
|
31
|
+
Reasonix 和 ZCode 是拉取模式平台,不使用 hooks 或 settings 文件;它们的 agent 文件包含启动后读取上下文的序言指令。
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
这些文件是否存在于项目中,取决于用户运行了哪些 `cviauto init --<platform>` 标志。
|
|
35
34
|
|
|
36
|
-
## Hook Script Types
|
|
35
|
+
## Hook Script Types(Hook 脚本类型)
|
|
37
36
|
|
|
38
|
-
| Script | Purpose |
|
|
37
|
+
| Script(脚本) | Purpose(用途) |
|
|
39
38
|
| --- | --- |
|
|
40
|
-
| `session-start.py` |
|
|
41
|
-
| `inject-workflow-state.py` |
|
|
42
|
-
| `inject-subagent-context.py` |
|
|
43
|
-
| `inject-shell-session-context.py` |
|
|
39
|
+
| `session-start.py` | 生成会话启动上下文。 |
|
|
40
|
+
| `inject-workflow-state.py` | 解析 `.cviauto/workflow.md` 中的 `[workflow-state:STATUS]` 块,输出与当前任务状态匹配的正文。当没有匹配块时,回退到 `Refer to workflow.md for current step.`。 |
|
|
41
|
+
| `inject-subagent-context.py` | 将 PRD、JSONL 上下文及相关 spec/research 注入 sub-agent。 |
|
|
42
|
+
| `inject-shell-session-context.py` | 让 shell 命令继承 Cviauto 会话身份。 |
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
并非每个平台都有所有 hook。不要因为某个平台缺少 hook 就从其他平台复制文件;先确认该平台是否支持相应的事件。
|
|
46
45
|
|
|
47
|
-
## Local Change Scenarios
|
|
46
|
+
## Local Change Scenarios(本地修改场景)
|
|
48
47
|
|
|
49
|
-
| User need | Edit location |
|
|
48
|
+
| User need(用户需求) | Edit location(编辑位置) |
|
|
50
49
|
| --- | --- |
|
|
51
|
-
| AI
|
|
52
|
-
|
|
|
53
|
-
| Sub-agent
|
|
54
|
-
| `task.py current`
|
|
55
|
-
|
|
|
50
|
+
| AI 在新会话中应看到更多/更少上下文 | 平台 `session-start` hook。 |
|
|
51
|
+
| 每轮提示策略应更改 | `.cviauto/workflow.md` 中的 `[workflow-state:STATUS]` 块。hook 逐字解析 workflow.md — 无需编辑脚本。 |
|
|
52
|
+
| Sub-agent 无法读取 PRD/spec | `inject-subagent-context` hook 或 agent 序言。 |
|
|
53
|
+
| shell 中 `task.py current` 无当前任务 | Shell/session bridge hook 或平台环境变量配置。 |
|
|
54
|
+
| 禁用自动注入 | settings/config 中对应的 hook 注册。 |
|
|
56
55
|
|
|
57
|
-
## Modification Principles
|
|
56
|
+
## Modification Principles(修改原则)
|
|
58
57
|
|
|
59
|
-
1. **Settings wire things up; hooks define behavior
|
|
60
|
-
2. **Confirm platform event names first
|
|
61
|
-
3. **Hooks read local `.cviauto/`, not upstream source
|
|
62
|
-
4. **Errors must be visible
|
|
58
|
+
1. **Settings wire things up; hooks define behavior(Settings 负责接线;hooks 定义行为)**。如果只改了 hook,平台可能根本不会调用它。如果只改了 settings,行为可能不会改变。
|
|
59
|
+
2. **Confirm platform event names first(先确认平台事件名称)**。不同平台对 SessionStart、UserPromptSubmit、AgentSpawn、shell 执行及类似事件使用不同的名称。
|
|
60
|
+
3. **Hooks read local `.cviauto/`, not upstream source(Hooks 读取本地 `.cviauto/`,而非上游源)**。用户项目中的 `.cviauto/scripts/` 和 `.cviauto/workflow.md` 是默认目标。
|
|
61
|
+
4. **Errors must be visible(错误必须可见)**。Hook 失败时应告知用户什么没有被注入,而不是静默地让 AI 缺少上下文。
|
|
63
62
|
|
|
64
|
-
## Troubleshooting Path
|
|
63
|
+
## Troubleshooting Path(排查路径)
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
如果用户说"AI 没有读取 Cviauto 状态":
|
|
67
66
|
|
|
68
|
-
1.
|
|
69
|
-
2.
|
|
70
|
-
3.
|
|
71
|
-
4.
|
|
72
|
-
5.
|
|
67
|
+
1. 检查平台 settings 是否注册了该 hook。
|
|
68
|
+
2. 检查 hook 文件是否存在。
|
|
69
|
+
3. 手动运行该 hook 依赖的 `.cviauto/scripts/get_context.py` 或 `task.py current --source` 命令。
|
|
70
|
+
4. 检查 `.cviauto/.runtime/sessions/` 中是否存在当前任务状态。
|
|
71
|
+
5. 检查平台 shell 是否传递了会话身份。
|
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# Platform Files Overview
|
|
1
|
+
# Platform Files Overview(平台文件概览)
|
|
2
2
|
|
|
3
|
-
Cviauto
|
|
3
|
+
Cviauto 将同一套本地架构连接到不同的 AI 工具。`.cviauto/` 存放共享运行时;platform 目录存放适配器文件,定义每个 AI 工具如何进入 Cviauto。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
当本地 AI 修改 Cviauto 时,应首先区分两类文件:
|
|
6
6
|
|
|
7
|
-
- **Shared files
|
|
8
|
-
- **Platform files
|
|
7
|
+
- **Shared files(共享文件)**:`.cviauto/workflow.md`、`.cviauto/tasks/`、`.cviauto/spec/`、`.cviauto/scripts/`。
|
|
8
|
+
- **Platform files(平台文件)**:`.claude/`、`.codex/`、`.cursor/`、`.opencode/`、`.kiro/`、`.gemini/`、`.qoder/`、`.codebuddy/`、`.github/`、`.factory/`、`.pi/`、`.kilocode/`、`.agent/`、`.devin/`、`.reasonix/`、`.zcode/` 以及类似目录。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
平台文件不存储业务状态。它们让对应的 AI 工具能够读取 Cviauto 状态、调用 Cviauto 脚本,并加载 Cviauto skills/agents/hooks。
|
|
11
11
|
|
|
12
|
-
## Platform File Categories
|
|
12
|
+
## Platform File Categories(平台文件分类)
|
|
13
13
|
|
|
14
|
-
| Category | Common paths | Purpose |
|
|
14
|
+
| Category(类别) | Common paths(常见路径) | Purpose(用途) |
|
|
15
15
|
| --- | --- | --- |
|
|
16
|
-
| settings/config | `.claude/settings.json
|
|
17
|
-
| hooks/plugins/extensions | `.claude/hooks
|
|
18
|
-
| agents | `.claude/agents
|
|
19
|
-
| skills | `.claude/skills
|
|
20
|
-
| commands/prompts/workflows | `.cursor/commands
|
|
16
|
+
| settings/config(设置/配置) | `.claude/settings.json`、`.codex/hooks.json`、`.qoder/settings.json` | 注册 hooks、plugins、extensions 或平台行为。 |
|
|
17
|
+
| hooks/plugins/extensions(钩子/插件/扩展) | `.claude/hooks/`、`.opencode/plugins/`、`.pi/extensions/` | 在会话启动、用户输入、agent 启动、shell 执行等事件时注入上下文。 |
|
|
18
|
+
| agents(代理) | `.claude/agents/`、`.codex/agents/`、`.kiro/agents/` | 定义 `cviauto-research`、`cviauto-implement` 和 `cviauto-check`。 |
|
|
19
|
+
| skills(技能) | `.claude/skills/`、`.agents/skills/`、`.qoder/skills/` | 能力描述,可自动触发或按需读取。 |
|
|
20
|
+
| commands/prompts/workflows(命令/提示/工作流) | `.cursor/commands/`、`.github/prompts/`、`.devin/workflows/` | 用户显式调用的入口点。 |
|
|
21
21
|
|
|
22
|
-
## Three Platform Integration Modes
|
|
22
|
+
## Three Platform Integration Modes(三种平台集成模式)
|
|
23
23
|
|
|
24
|
-
### 1. Hook / Extension Driven
|
|
24
|
+
### 1. Hook / Extension Driven(钩子/扩展驱动)
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
这些平台可以在特定事件上触发脚本或插件,并主动将 Cviauto 上下文注入 AI。
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
常见能力:
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- PRD/spec/research
|
|
33
|
-
- Shell
|
|
30
|
+
- 会话启动时注入 `.cviauto/` 概览。
|
|
31
|
+
- 每次用户对话轮次的工作流状态提示。
|
|
32
|
+
- sub-agent 启动时注入 PRD/spec/research。
|
|
33
|
+
- Shell 命令继承会话身份。
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
要改变"AI 何时知道什么",请先检查 hooks/plugins/extensions 和 settings。
|
|
36
36
|
|
|
37
|
-
### 2. Agent Prelude / Pull-Based
|
|
37
|
+
### 2. Agent Prelude / Pull-Based(Agent 序言 / 拉取模式)
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
某些平台无法可靠地让 hooks 重写 sub-agent 的 prompt,因此 agent 文件本身会指示 agent 在启动后读取当前任务、PRD 和 JSONL 上下文。
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
要改变 sub-agent 加载上下文的方式,请检查 agent 文件本身。
|
|
42
42
|
|
|
43
|
-
### 3. Main-Session Workflow
|
|
43
|
+
### 3. Main-Session Workflow(主会话工作流)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
某些平台没有 Cviauto sub-agent 或 hook 能力。它们依赖 workflows/skills/commands 来引导主会话 AI 读取文件、运行脚本和推进任务。
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
要改变行为,请检查平台 workflows/skills/commands 和 `.cviauto/workflow.md`。
|
|
48
48
|
|
|
49
|
-
## Local Modification Order
|
|
49
|
+
## Local Modification Order(本地修改顺序)
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
当用户要求为某个平台自定义行为时,AI 应按以下顺序检查文件:
|
|
52
52
|
|
|
53
|
-
1.
|
|
54
|
-
2.
|
|
55
|
-
3.
|
|
56
|
-
4.
|
|
57
|
-
5.
|
|
53
|
+
1. 读取 `.cviauto/workflow.md` 确认共享流程。
|
|
54
|
+
2. 读取目标平台的 settings/config 查看注册了哪些 hooks/agents/skills/commands。
|
|
55
|
+
3. 读取目标平台的 agents/skills/commands/hooks。
|
|
56
|
+
4. 修改最贴近用户需求的本地文件。
|
|
57
|
+
5. 如果改动影响共享流程,同步更新 `.cviauto/workflow.md` 或 `.cviauto/spec/`。
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
不要只修改平台文件而忘记共享工作流。不要只修改 `.cviauto/workflow.md` 而忘记平台入口点可能仍包含旧描述。
|