@baoanaz/cviauto 0.6.6 → 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
|
@@ -5,81 +5,81 @@ description: "Understand and customize the local Cviauto architecture inside a u
|
|
|
5
5
|
|
|
6
6
|
# Cviauto Meta
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Cviauto v0.6
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `.cviauto
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
28
|
-
5.
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
###
|
|
33
|
-
|
|
34
|
-
- `references/local-architecture/overview.md
|
|
35
|
-
- `references/local-architecture/generated-files.md
|
|
36
|
-
- `references/local-architecture/workflow.md
|
|
37
|
-
- `references/local-architecture/task-system.md
|
|
38
|
-
- `references/local-architecture/spec-system.md
|
|
39
|
-
- `references/local-architecture/workspace-memory.md
|
|
40
|
-
- `references/local-architecture/context-injection.md
|
|
41
|
-
- `references/local-architecture/multi-agent-channel.md
|
|
42
|
-
- `references/local-architecture/bundled-skills.md
|
|
43
|
-
|
|
44
|
-
###
|
|
45
|
-
|
|
46
|
-
- `references/platform-files/overview.md
|
|
47
|
-
- `references/platform-files/platform-map.md
|
|
48
|
-
- `references/platform-files/hooks-and-settings.md
|
|
49
|
-
- `references/platform-files/agents.md
|
|
50
|
-
- `references/platform-files/skills-and-commands.md
|
|
51
|
-
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
- `references/customize-local/overview.md
|
|
55
|
-
- `references/customize-local/change-workflow.md
|
|
56
|
-
- `references/customize-local/change-task-lifecycle.md
|
|
57
|
-
- `references/customize-local/change-context-loading.md
|
|
58
|
-
- `references/customize-local/change-hooks.md
|
|
59
|
-
- `references/customize-local/change-agents.md
|
|
60
|
-
- `references/customize-local/change-skills-or-commands.md
|
|
61
|
-
- `references/customize-local/change-spec-structure.md
|
|
62
|
-
- `references/customize-local/add-project-local-conventions.md
|
|
63
|
-
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
- `.cviauto/workflow.md`
|
|
67
|
-
- `.cviauto/config.yaml`
|
|
68
|
-
- `.cviauto/spec/`
|
|
69
|
-
- `.cviauto/tasks/`
|
|
70
|
-
- `.cviauto/workspace/`
|
|
71
|
-
- `.cviauto/agents/{check,implement}.md`
|
|
72
|
-
- `~/.cviauto/channels/<project>/<channel>/events.jsonl`
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- `.cviauto/.template-hashes.json`
|
|
76
|
-
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
8
|
+
此技能面向已运行过 `cviauto init` 的本地 Cviauto 用户。阅读后,AI 应理解用户项目内的 Cviauto 架构、运行模型和自定义入口点,然后根据用户请求修改生成的 `.cviauto/` 和平台目录文件。
|
|
9
|
+
|
|
10
|
+
Cviauto v0.6 在 v0.6 之前的工作流/持久化/平台模型之上增加了三个架构层面。第一,多 Agent 协作运行时:`cviauto channel` 通过项目范围的 JSONL 事件日志(位于 `~/.cviauto/channels/<project>/<channel>/events.jsonl`)协调多个 AI worker 进程,具有 worker OOM 守护、forum/thread 频道、持久幂等 key 和打包的 `.cviauto/agents/{check,implement}.md` 运行时定义。第二,跨会话记忆:`cviauto mem list | search | context | extract | projects` 读取已存在于磁盘上的 Claude Code、Codex 和 Pi Agent JSONL,按 `--phase brainstorm|implement|all` 切片,且绝不上传任何内容。第三,双包 npm 发布:`@mindfoldhq/cviauto`(CLI)和 `@mindfoldhq/cviauto-core`(SDK,提供 `/channel`、`/task`、`/mem`、`/testing` 子路径)在同一版本上同步发布。将这些视为与各平台集成文件并列的一等自定义层面。
|
|
11
|
+
|
|
12
|
+
默认操作范围是用户项目中的本地文件:
|
|
13
|
+
|
|
14
|
+
- `.cviauto/`:工作流、配置、任务、spec、工作区、脚本、打包的运行时 Agent 和运行时状态。
|
|
15
|
+
- 平台目录:`.claude/`、`.codex/`、`.cursor/`、`.opencode/`、`.kiro/`、`.gemini/`、`.qoder/`、`.codebuddy/`、`.github/`、`.factory/`、`.pi/`、`.reasonix/`、`.kilocode/`、`.agent/`、`.devin/` 和类似目录。Pi 还暴露了原生 `trellis_subagent` 工具,支持 `single` / `parallel` / `chain` 分发模式、节流进度卡和基于文件布局的 `isTrellisAgent()` 验证。Reasonix 将工作流技能和 sub-agent 技能存储为 `.reasonix/skills/<name>/SKILL.md`;sub-agent 技能具有 `runAs: subagent` frontmatter。
|
|
16
|
+
- 共享技能层:`.agents/skills/`。
|
|
17
|
+
- 项目树之外的用户自有频道存储:`~/.cviauto/channels/<project>/<channel>/events.jsonl`。
|
|
18
|
+
- 可通过 `cviauto mem` 查询的原始平台对话日志:`~/.claude/projects/`、`~/.codex/sessions/` 和 `~/.pi/agent/sessions/`(OpenCode 适配器在 v0.6 系列中降级)。
|
|
19
|
+
|
|
20
|
+
不要假设用户有 Cviauto 源码仓库。不要默认修改全局 npm 安装目录或 `node_modules`——`@mindfoldhq/cviauto` 和 `@mindfoldhq/cviauto-core` 作为已发布包交付,共享一个版本和每个发布的一个 git tag。
|
|
21
|
+
|
|
22
|
+
## 如何使用
|
|
23
|
+
|
|
24
|
+
1. 首先阅读 `references/local-architecture/overview.md` 建立本地 Cviauto 系统模型。
|
|
25
|
+
2. 如果请求涉及特定 AI 工具,阅读 `references/platform-files/platform-map.md` 和相关平台文件说明。
|
|
26
|
+
3. 如果请求涉及多 Agent 分发或 channel worker,阅读 `references/local-architecture/multi-agent-channel.md` 和打包的 `.cviauto/agents/` 文件。
|
|
27
|
+
4. 如果用户想改变行为,阅读 `references/customize-local/overview.md`,然后打开具体的自定义主题。
|
|
28
|
+
5. 编辑前,阅读用户项目中的实际文件,将本地内容视为权威来源。
|
|
29
|
+
|
|
30
|
+
## 参考文件
|
|
31
|
+
|
|
32
|
+
### 本地架构
|
|
33
|
+
|
|
34
|
+
- `references/local-architecture/overview.md`:分层本地 Cviauto 架构(工作流 / 持久化 / 平台 / channel 运行时)和自定义原则。
|
|
35
|
+
- `references/local-architecture/generated-files.md`:由 `cviauto init` 生成的文件及其自定义边界,包括 `.cviauto/agents/`。
|
|
36
|
+
- `references/local-architecture/workflow.md`:阶段、路由、工作流状态块和可选工作流模板(`native`、`tdd`、`channel-driven-subagent-dispatch`、marketplace),位于 `.cviauto/workflow.md`。
|
|
37
|
+
- `references/local-architecture/task-system.md`:任务目录、活动任务、JSONL 上下文、父子任务树和任务运行时。
|
|
38
|
+
- `references/local-architecture/spec-system.md`:`.cviauto/spec/` 的组织、注入和从 `registry.spec` 源刷新。
|
|
39
|
+
- `references/local-architecture/workspace-memory.md`:`.cviauto/workspace/` 日志加上 `cviauto mem` 跨会话回忆和 `@mindfoldhq/cviauto-core/mem` SDK。
|
|
40
|
+
- `references/local-architecture/context-injection.md`:Hooks、sub-agent 前置和 channel 运行时 worker 收件箱路由。
|
|
41
|
+
- `references/local-architecture/multi-agent-channel.md`:`cviauto channel` 子命令、项目范围事件存储、forum/thread 频道、worker OOM 守护、持久幂等和打包的 `.cviauto/agents/` 运行时 Agent。
|
|
42
|
+
- `references/local-architecture/bundled-skills.md`:自动分发的打包技能(`cviauto-meta`、`cviauto-spec-bootstrap`、`cviauto-session-insight`)以及 `getBundledSkillTemplates()` 如何将它们部署到每个平台技能根目录。
|
|
43
|
+
|
|
44
|
+
### 平台文件
|
|
45
|
+
|
|
46
|
+
- `references/platform-files/overview.md`:共享 `.cviauto/` 文件如何与平台目录关联,以及四种平台集成模式(hook 驱动、Agent 前置、主会话工作流、channel 运行时)。
|
|
47
|
+
- `references/platform-files/platform-map.md`:所有 15 个支持平台(包括 Reasonix 和 Pi 的原生 `trellis_subagent` 扩展)中技能、Agent、hooks 和扩展的平台目录和路径。
|
|
48
|
+
- `references/platform-files/hooks-and-settings.md`:设置/配置文件、hooks、插件和扩展如何连接到 Cviauto;涵盖 `channel.worker_guard.*` 和 `codex.dispatch_mode`。
|
|
49
|
+
- `references/platform-files/agents.md`:每个平台的 `cviauto-research` / `cviauto-implement` / `cviauto-check` sub-agent 文件,加上 channel 运行时打包的 `.cviauto/agents/{check,implement}.md`。
|
|
50
|
+
- `references/platform-files/skills-and-commands.md`:技能、命令、prompt 和工作流之间的区别,以及如何修改它们。
|
|
51
|
+
|
|
52
|
+
### 本地自定义
|
|
53
|
+
|
|
54
|
+
- `references/customize-local/overview.md`:为用户请求选择合适的本地自定义入口点。
|
|
55
|
+
- `references/customize-local/change-workflow.md`:更改阶段、路由、下一步操作、工作流状态和选定的工作流模板。
|
|
56
|
+
- `references/customize-local/change-task-lifecycle.md`:更改任务创建、状态、归档行为、父子链接、归档 slug 冲突处理和生命周期 hooks。
|
|
57
|
+
- `references/customize-local/change-context-loading.md`:更改任务、spec、日志、hook 上下文、channel 收件箱消息和 `cviauto mem` 回忆的加载方式。
|
|
58
|
+
- `references/customize-local/change-hooks.md`:更改平台 hooks、设置、任务生命周期 hooks(`hooks.after_*`)和 shell 会话桥接。
|
|
59
|
+
- `references/customize-local/change-agents.md`:更改跨平台 sub-agent、打包 channel 运行时 Agent 的 research、implement 和 check Agent 行为,以及 Codex `dispatch_mode` 开关。
|
|
60
|
+
- `references/customize-local/change-skills-or-commands.md`:添加或修改本地技能、命令、prompt 和工作流;涵盖上游打包技能自动分发。
|
|
61
|
+
- `references/customize-local/change-spec-structure.md`:调整 `.cviauto/spec/` 下的项目 spec 结构,包括注册表支持的源。
|
|
62
|
+
- `references/customize-local/add-project-local-conventions.md`:将团队规则放入项目本地 spec 或本地技能。
|
|
63
|
+
|
|
64
|
+
## 当前规则
|
|
65
|
+
|
|
66
|
+
- `.cviauto/workflow.md` 是本地工作流唯一权威来源;其初始内容在 `cviauto init` 时从工作流模板(内置 `native`、`tdd`、`channel-driven-subagent-dispatch` 或 marketplace 模板)中选择,并可通过 `cviauto workflow --template <id>` 重新选择。活动模板引用但缺失的 `.cviauto/agents/<name>.md` 文件会触发非阻塞 stderr 警告,指向 `cviauto update`。
|
|
67
|
+
- `.cviauto/config.yaml` 是项目级 Cviauto 配置入口点。它托管任务生命周期 hooks(`hooks.after_create` / `after_start` / `after_finish` / `after_archive`)、日志形状(`session_commit_message` / `max_journal_lines` / `session_auto_commit`)、channel worker 守护(`channel.worker_guard.idle_timeout` / `max_live_workers`)、Codex 分发模式(`codex.dispatch_mode: inline | sub-agent`)和 spec 注册表块(`registry.spec.source` + `registry.spec.template`)。
|
|
68
|
+
- `.cviauto/spec/` 存储用户的项目特定编码规范和设计约束。当设置了 `registry.spec` 时,文件由 `cviauto update` 刷新;本地编辑在 `.cviauto/.template-hashes.json` 中显示为"用户已修改"冲突。
|
|
69
|
+
- `.cviauto/tasks/` 存储任务 PRD、设计笔记、实现计划、研究文件和 JSONL 上下文。任务形成父子树:`task.py create --parent <slug>`、`task.py add-subtask <parent> <child>`、`task.py remove-subtask <parent> <child>` 和 `task.py list-context <task>`。`task.py create` 拒绝 `.cviauto/tasks/archive/**` 中已存在的 slug。
|
|
70
|
+
- `.cviauto/workspace/` 存储**刻意编写的**开发者日志。原始跨会话对话**不**存储在此——它们存在于 `~/.claude/projects/`、`~/.codex/sessions/` 和 `~/.pi/agent/sessions/` 磁盘中,通过 `cviauto mem search|extract|context` 恢复。打包的 `cviauto-session-insight` 技能教 AI 何时使用 `mem`。
|
|
71
|
+
- `.cviauto/agents/{check,implement}.md` 是打包的、平台无关的 channel 运行时 Agent 定义,由 `cviauto channel spawn --agent <name>` 加载。可编辑;`cviauto update` 回填缺失的文件。编辑每个平台的 `cviauto-implement.md` / `cviauto-check.md` **不会**改变 channel 运行时 worker 的行为。
|
|
72
|
+
- `~/.cviauto/channels/<project>/<channel>/events.jsonl` 是每个项目每个频道的 channel 运行时事件日志。用户拥有,文件锁定的序列号分配,持久的 `idempotencyKey` 支持;绝不在 `.cviauto/` 下。
|
|
73
|
+
- 打包的多文件技能(`cviauto-meta`、`cviauto-spec-bootstrap`、`cviauto-session-insight`、`cviauto-channel`)由 `packages/cli/src/templates/common/index.ts` 中的 `getBundledSkillTemplates()` 自动分发到每个平台的技能根目录。在 `packages/cli/src/templates/common/bundled-skills/`(上游)下放置新目录,将在下次 `cviauto update` 时将其部署到每个平台。
|
|
74
|
+
- 平台设置/配置文件决定哪些 hooks、Agent、技能、命令、prompt 和工作流实际运行。Reasonix 没有设置文件——行为编码在技能 frontmatter 中。
|
|
75
|
+
- `.cviauto/.template-hashes.json` 和 `.cviauto/.runtime/` 是管理/运行时状态文件。编辑前请确认必要性。
|
|
76
|
+
|
|
77
|
+
## 不要
|
|
78
|
+
|
|
79
|
+
- 不要将 Cviauto 上游源码视为本地自定义的默认目标。
|
|
80
|
+
- 不要修改全局 npm 安装目录或 `node_modules/@mindfoldhq/cviauto` 或 `node_modules/@mindfoldhq/cviauto-core` 来实现项目需求;两个包同步发布。
|
|
81
|
+
- 不要用默认模板覆盖用户已修改的本地文件;先检查 `.cviauto/.template-hashes.json`,优先使用 `.new` 侧车文件而非破坏性覆盖。
|
|
82
|
+
- 不要把团队私有项目规则放入任何公共打包技能(`cviauto-meta`、`cviauto-spec-bootstrap`、`cviauto-session-insight`、`cviauto-channel`);将项目规则放入 `.cviauto/spec/`、项目本地技能、当前任务或工作区日志——`cviauto update` 会覆盖打包技能目录中的所有内容。
|
|
83
|
+
- 不要手动编辑 `~/.cviauto/channels/<project>/<channel>/events.jsonl`;序列号在文件锁下分配,可安全重放的写入通过 `cviauto channel` CLI 或 `@mindfoldhq/cviauto-core/channel` SDK 进行。
|
|
84
|
+
- 当目标是改变 channel 运行时 worker 行为时,不要编辑 `.claude/agents/cviauto-implement.md`(或任何其他每个平台的 sub-agent 文件)——改为编辑 `.cviauto/agents/<name>.md`。
|
|
85
|
+
- 不要将被移除或从未发布的机制描述为当前 Cviauto 行为;在声称某个配置项存在之前,交叉核对本地 `.cviauto/config.yaml` 和已安装 CLI 的 `cviauto --help`。
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 添加项目本地约定
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用户通常不需要更改 Cviauto 机制本身;他们需要让本地 AI 理解其团队的约定。在这种情况下,优先使用 `.cviauto/spec/` 或项目本地 skill,而非编辑 `cviauto-meta`。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 各类内容放置位置
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| 内容类型 | 位置 |
|
|
8
8
|
| --- | --- |
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
| AI
|
|
12
|
-
|
|
|
13
|
-
|
|
|
9
|
+
| 代码必须遵循的规则 | `.cviauto/spec/<layer>/` |
|
|
10
|
+
| 跨层思维方法 | `.cviauto/spec/guides/` |
|
|
11
|
+
| 项目特定流程的 AI 能力 | 平台本地 skill |
|
|
12
|
+
| 一次性任务材料 | `.cviauto/tasks/<task>/` |
|
|
13
|
+
| 会话摘要 | `.cviauto/workspace/<developer>/journal-N.md` |
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 创建项目本地 Skill
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
如果用户希望 AI 了解「本项目如何自定义 Cviauto」,创建一个本地 skill:
|
|
18
18
|
|
|
19
19
|
```text
|
|
20
20
|
.claude/skills/cviauto-local/
|
|
21
21
|
└── SKILL.md
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
示例:
|
|
25
25
|
|
|
26
26
|
```md
|
|
27
27
|
---
|
|
28
|
-
name:
|
|
28
|
+
name: cviauto-local
|
|
29
29
|
description: "Project-local Cviauto customizations for this repository. Use when changing this project's Cviauto workflow, hooks, local agents, or team-specific conventions."
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -48,11 +48,11 @@ This skill documents this repository's Cviauto customizations only.
|
|
|
48
48
|
- ...
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
对于多平台项目,在其他平台 skill 目录中放置等效版本,或在支持共享层的平台上使用 `.agents/skills/`。
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## 写入 `.cviauto/spec/`
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
如果内容是编码约定,将其写入 spec。示例:
|
|
56
56
|
|
|
57
57
|
```text
|
|
58
58
|
.cviauto/spec/backend/error-handling.md
|
|
@@ -60,24 +60,24 @@ If the content is a coding convention, write it to spec. Examples:
|
|
|
60
60
|
.cviauto/spec/guides/cross-platform-thinking-guide.md
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
写入后,更新对应的 `index.md`,以便 AI 能从入口点找到新规则。
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## 让当前 Task 使用新约定
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
写入 spec 后,将其添加到当前 task 上下文中:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
python3 ./.cviauto/scripts/task.py add-context <task> implement ".cviauto/spec/backend/error-handling.md" "Error handling conventions"
|
|
71
71
|
python3 ./.cviauto/scripts/task.py add-context <task> check ".cviauto/spec/backend/error-handling.md" "Review error handling"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
##
|
|
74
|
+
## 不要将项目私有规则存储在 `cviauto-meta` 中
|
|
75
75
|
|
|
76
|
-
`cviauto-meta`
|
|
76
|
+
`cviauto-meta` 是一个用于理解 Cviauto 架构和本地自定义入口点的公共 skill。将项目私有内容放在:
|
|
77
77
|
|
|
78
78
|
- `.cviauto/spec/`
|
|
79
|
-
-
|
|
80
|
-
-
|
|
79
|
+
- 项目本地 skill
|
|
80
|
+
- 当前 task
|
|
81
81
|
- workspace journal
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
这可以防止未来 Cviauto 内置的 `cviauto-meta` 更新覆盖团队自己的约定。
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 修改本地 Agents
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
当用户想更改 `cviauto-research`、`cviauto-implement` 或 `cviauto-check` 的行为时,编辑用户项目中的平台 agent 文件。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 先阅读这些文件
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2. `.cviauto/workflow.md` Phase 2 / research
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
5.
|
|
7
|
+
1. 目标平台的 agent 目录
|
|
8
|
+
2. `.cviauto/workflow.md` Phase 2 / research 路由
|
|
9
|
+
3. 当前 task 的 `prd.md`
|
|
10
|
+
4. 当前 task 的 `implement.jsonl` / `check.jsonl`
|
|
11
|
+
5. 相关的 hook 或 agent 前置部分
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 常见路径
|
|
14
14
|
|
|
15
|
-
|
|
|
15
|
+
| 平台 | 路径 |
|
|
16
16
|
| --- | --- |
|
|
17
17
|
| Claude Code | `.claude/agents/cviauto-*.md` |
|
|
18
18
|
| Cursor | `.cursor/agents/cviauto-*.md` |
|
|
@@ -24,33 +24,33 @@ When the user wants to change `cviauto-research`, `cviauto-implement`, or `cviau
|
|
|
24
24
|
| CodeBuddy | `.codebuddy/agents/cviauto-*.md` |
|
|
25
25
|
| Factory Droid | `.factory/droids/cviauto-*.md` |
|
|
26
26
|
| Pi Agent | `.pi/agents/cviauto-*.md` |
|
|
27
|
-
| Reasonix | `.reasonix/skills/cviauto-*/SKILL.md
|
|
27
|
+
| Reasonix | `.reasonix/skills/cviauto-*/SKILL.md`(subagent frontmatter) |
|
|
28
28
|
| ZCode | `.zcode/cli/agents/cviauto-*.md` |
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
以用户项目中的实际路径为准。
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## 常见需求
|
|
33
33
|
|
|
34
|
-
|
|
|
34
|
+
| 需求 | 应编辑哪个 agent |
|
|
35
35
|
| --- | --- |
|
|
36
|
-
| Research
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
| Agent
|
|
40
|
-
| Agent
|
|
36
|
+
| Research 必须写入文件,而不能仅在聊天中回复 | `cviauto-research` |
|
|
37
|
+
| 实现前必须读取某些本地 spec | `cviauto-implement` + `implement.jsonl` 配置规则 |
|
|
38
|
+
| 检查阶段必须运行特定命令 | `cviauto-check` |
|
|
39
|
+
| Agent 不得修改某些目录 | 对应 agent 的写入边界指令 |
|
|
40
|
+
| Agent 输出格式必须固定 | 对应 agent 的最终/报告指令 |
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## 修改原则
|
|
43
43
|
|
|
44
|
-
1.
|
|
45
|
-
2.
|
|
46
|
-
3.
|
|
47
|
-
4.
|
|
48
|
-
5.
|
|
44
|
+
1. **保持角色边界**:research 负责调研并持久化;implement 负责编写实现;check 负责审查和修复。
|
|
45
|
+
2. **不要在 agent 中硬编码项目 spec**:长期 spec 应放在 `.cviauto/spec/` 中;agent 负责读取它们。
|
|
46
|
+
3. **明确读取顺序**:active task -> PRD -> info -> JSONL -> spec/research。
|
|
47
|
+
4. **明确写入边界**:哪些目录可写、哪些不可写。
|
|
48
|
+
5. **跨平台同步**:当用户配置了多个平台时,决定是仅修改当前平台还是修改所有平台的 agent。
|
|
49
49
|
|
|
50
|
-
## Agent Pull
|
|
50
|
+
## Agent Pull(拉取)平台
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
如果 agent 文件中包含「启动后读取 task/context」的前置步骤,编辑时不要删除这些步骤。否则 agent 将仅依赖聊天上下文工作,绕过 Cviauto 的核心机制。
|
|
53
53
|
|
|
54
|
-
## Hook Push
|
|
54
|
+
## Hook Push(推送)平台
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
如果上下文由 hook 注入,agent 文件仍应保留职责边界。不要因为 hook 注入了上下文就从 agent 中移除 PRD/spec 要求。
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 修改本地上下文加载
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
上下文加载决定了 AI 何时读取工作流、任务、规范(spec)、调研(research)、工作区(workspace)和 git 状态。当用户说"AI 不知道当前任务"、"代理没有读取规范"或"上下文太多/太少"时,请阅读本页。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 先阅读这些文件
|
|
6
6
|
|
|
7
7
|
1. `.cviauto/workflow.md`
|
|
8
8
|
2. `.cviauto/scripts/get_context.py`
|
|
9
9
|
3. `.cviauto/scripts/common/session_context.py`
|
|
10
10
|
4. `.cviauto/scripts/common/task_context.py`
|
|
11
11
|
5. `.cviauto/scripts/common/active_task.py`
|
|
12
|
-
6.
|
|
13
|
-
7.
|
|
12
|
+
6. 当前平台钩子或代理文件
|
|
13
|
+
7. 当前任务的 `implement.jsonl` / `check.jsonl`
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 上下文来源
|
|
16
16
|
|
|
17
|
-
|
|
|
17
|
+
| 来源 | 用途 |
|
|
18
18
|
| --- | --- |
|
|
19
|
-
| `.cviauto/workflow.md` |
|
|
20
|
-
| `.cviauto/tasks/<task>/prd.md` |
|
|
21
|
-
| `.cviauto/tasks/<task>/design.md` |
|
|
22
|
-
| `.cviauto/tasks/<task>/implement.md` |
|
|
23
|
-
| `.cviauto/tasks/<task>/implement.jsonl` |
|
|
24
|
-
| `.cviauto/tasks/<task>/check.jsonl` |
|
|
25
|
-
| `.cviauto/spec/` |
|
|
26
|
-
| `.cviauto/workspace/` |
|
|
27
|
-
| git status |
|
|
28
|
-
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
|
|
|
19
|
+
| `.cviauto/workflow.md` | 工作流和下一步提示。 |
|
|
20
|
+
| `.cviauto/tasks/<task>/prd.md` | 当前任务需求。 |
|
|
21
|
+
| `.cviauto/tasks/<task>/design.md` | 复杂任务的技术设计。 |
|
|
22
|
+
| `.cviauto/tasks/<task>/implement.md` | 复杂任务的执行计划。 |
|
|
23
|
+
| `.cviauto/tasks/<task>/implement.jsonl` | 实现前要读取的规范/调研。 |
|
|
24
|
+
| `.cviauto/tasks/<task>/check.jsonl` | 检查期间要读取的规范/调研。 |
|
|
25
|
+
| `.cviauto/spec/` | 项目规范。 |
|
|
26
|
+
| `.cviauto/workspace/` | 会话记录。 |
|
|
27
|
+
| git status | 当前工作树变更。 |
|
|
28
|
+
|
|
29
|
+
## 常见需求与编辑点
|
|
30
|
+
|
|
31
|
+
| 需求 | 编辑点 |
|
|
32
32
|
| --- | --- |
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
33
|
+
| 在新会话中注入更多/更少信息 | `session_context.py` 或平台 `session-start` 钩子。 |
|
|
34
|
+
| 修改每次用户输入时的提示 | `.cviauto/workflow.md` 中的 `[workflow-state:STATUS]` 块。`inject-workflow-state` 钩子是纯解析器,会逐字读取该块内容。 |
|
|
35
|
+
| 代理没有读取规范 | 任务 JSONL、代理 prelude、`inject-subagent-context` 钩子。 |
|
|
36
|
+
| 活动任务丢失 | `active_task.py` 和平台会话身份传播。 |
|
|
37
|
+
| 修改 JSONL 验证规则 | `task_context.py`。 |
|
|
38
38
|
|
|
39
|
-
## JSONL
|
|
39
|
+
## JSONL 规则
|
|
40
40
|
|
|
41
|
-
`implement.jsonl` / `check.jsonl`
|
|
41
|
+
`implement.jsonl` / `check.jsonl` 是关键的上下文加载接口:
|
|
42
42
|
|
|
43
43
|
```jsonl
|
|
44
|
-
{"file": ".cviauto/spec/backend/index.md", "reason": "
|
|
45
|
-
{"file": ".cviauto/tasks/04-28-x/research/api.md", "reason": "API
|
|
44
|
+
{"file": ".cviauto/spec/backend/index.md", "reason": "后端约定"}
|
|
45
|
+
{"file": ".cviauto/tasks/04-28-x/research/api.md", "reason": "API 调研"}
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
仅包含规范/调研文件。不要将将要修改的代码文件放入这些清单中;代理在实现期间会自行读取代码文件。
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## 修改会话上下文
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
如果用户希望每个新会话都能看到更多项目状态,请编辑:
|
|
53
53
|
|
|
54
54
|
- `.cviauto/scripts/common/session_context.py`
|
|
55
|
-
-
|
|
55
|
+
- 相应的平台 `session-start` 钩子
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
上下文不能无限制增长。优先注入索引和路径,使 AI 可以按需读取详细文件。
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## 修改子代理上下文
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
首先确定平台使用哪种模式:
|
|
62
62
|
|
|
63
|
-
- hook push
|
|
64
|
-
- agent pull
|
|
63
|
+
- 钩子推送(hook push):编辑 `inject-subagent-context` 钩子。
|
|
64
|
+
- 代理拉取(agent pull):编辑对应 `cviauto-implement` / `cviauto-check` 代理文件中的读取步骤。
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
两种模式下,确保代理最终读取:
|
|
67
67
|
|
|
68
|
-
1.
|
|
69
|
-
2.
|
|
70
|
-
3.
|
|
68
|
+
1. 活动任务
|
|
69
|
+
2. 对应的 JSONL
|
|
70
|
+
3. JSONL 引用的规范/调研
|
|
71
71
|
4. `prd.md`
|
|
72
|
-
5. `design.md
|
|
73
|
-
6. `implement.md
|
|
72
|
+
5. `design.md`(如果存在)
|
|
73
|
+
6. `implement.md`(如果存在)
|
|
74
74
|
|
|
75
|
-
##
|
|
75
|
+
## 排查顺序
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
python3 ./.cviauto/scripts/task.py current --source
|
|
@@ -81,4 +81,4 @@ python3 ./.cviauto/scripts/task.py validate <task>
|
|
|
81
81
|
python3 ./.cviauto/scripts/get_context.py --mode packages
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
在编辑钩子/代理之前,先确认任务和 JSONL 是正确的。
|
package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 修改本地 Hooks
|
|
2
2
|
|
|
3
|
-
Hooks
|
|
3
|
+
Hooks(钩子)是将平台与 Cviauto 连接起来的自动化层。当用户想更改「何时注入上下文」「shell 命令如何继承会话」「agent 启动前应读取哪些文件」时,通常需要编辑 hooks。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 先阅读这些文件
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
7
|
+
1. 目标平台的 settings/config,如 `.claude/settings.json`、`.codex/hooks.json`、`.cursor/hooks.json`
|
|
8
|
+
2. 目标平台的 hooks 目录
|
|
9
9
|
3. `.cviauto/scripts/common/active_task.py`
|
|
10
10
|
4. `.cviauto/scripts/common/session_context.py`
|
|
11
11
|
5. `.cviauto/workflow.md`
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 常见 Hook 类型
|
|
14
14
|
|
|
15
|
-
| Hook |
|
|
15
|
+
| Hook | 用途 |
|
|
16
16
|
| --- | --- |
|
|
17
|
-
| session-start |
|
|
18
|
-
| workflow-state |
|
|
19
|
-
| sub-agent context |
|
|
20
|
-
| shell session bridge |
|
|
17
|
+
| session-start | 在会话启动、清除或压缩时注入 Cviauto 概览。 |
|
|
18
|
+
| workflow-state | 在每次用户输入时注入状态提示。 |
|
|
19
|
+
| sub-agent context | 在 agent 启动前注入 PRD/spec/research。 |
|
|
20
|
+
| shell session bridge | 让 shell 中的 `task.py` 命令能够看到相同的会话标识。 |
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## 修改步骤
|
|
23
23
|
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
28
|
-
5.
|
|
24
|
+
1. 在 settings/config 中找到 hook 注册项。
|
|
25
|
+
2. 确认注册的脚本路径存在。
|
|
26
|
+
3. 阅读 hook 脚本,识别输入、输出以及调用的 `.cviauto/scripts/`。
|
|
27
|
+
4. 修改 hook 行为。
|
|
28
|
+
5. 如果 hook 依赖工作流内容,同步更新 `.cviauto/workflow.md`。
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## 示例:更改新会话注入内容
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
首先找到 session-start hook:
|
|
33
33
|
|
|
34
34
|
```text
|
|
35
35
|
.claude/settings.json
|
|
36
36
|
.claude/hooks/session-start.py
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
如果该 hook 最终调用了 `.cviauto/scripts/get_context.py` 或 `session_context.py`,那么编辑本地脚本通常比在 hook 中硬编码内容更稳健。
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## 示例:Agent 未读取 JSONL
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
首先确认:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
python3 ./.cviauto/scripts/task.py current --source
|
|
47
47
|
python3 ./.cviauto/scripts/task.py validate <task>
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
如果 task 和 JSONL 正确,判断平台使用的是 hook push(推送)方式还是 agent pull(拉取)方式。对于 hook push,编辑 `inject-subagent-context`;对于 agent pull,编辑 agent 文件。
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## 注意事项
|
|
53
53
|
|
|
54
|
-
- Settings
|
|
55
|
-
-
|
|
56
|
-
- Hooks
|
|
57
|
-
- Hook
|
|
54
|
+
- Settings 负责注册,hook 脚本负责行为;两者需一起检查。
|
|
55
|
+
- 不同平台支持不同的 hook 事件。不要直接复制其他平台的 settings。
|
|
56
|
+
- Hooks 应读取项目本地的 `.cviauto/`;不应依赖 Cviauto 上游源码路径。
|
|
57
|
+
- Hook 失败时应产生可见的错误,使 AI 不会静默丢失上下文。
|