@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.
Files changed (80) hide show
  1. package/dist/templates/claude/agents/trellis-check.md +61 -61
  2. package/dist/templates/claude/agents/trellis-implement.md +58 -58
  3. package/dist/templates/claude/agents/trellis-research.md +67 -67
  4. package/dist/templates/codebuddy/agents/trellis-check.md +61 -61
  5. package/dist/templates/codebuddy/agents/trellis-implement.md +58 -58
  6. package/dist/templates/codebuddy/agents/trellis-research.md +67 -67
  7. package/dist/templates/codex/agents/trellis-check.toml +99 -30
  8. package/dist/templates/codex/agents/trellis-implement.toml +99 -16
  9. package/dist/templates/codex/agents/trellis-research.toml +116 -39
  10. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +41 -41
  11. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +194 -261
  12. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +59 -93
  13. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +72 -110
  14. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +120 -171
  15. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +35 -43
  16. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +78 -78
  17. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +24 -24
  18. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +29 -29
  19. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +46 -46
  20. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +28 -28
  21. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +66 -66
  22. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +32 -32
  23. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +40 -40
  24. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +40 -40
  25. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +44 -44
  26. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +79 -79
  27. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +37 -37
  28. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +43 -43
  29. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +47 -47
  30. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +40 -40
  31. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +33 -33
  32. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +61 -61
  33. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +41 -41
  34. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +31 -31
  35. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +40 -40
  36. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +40 -41
  37. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +36 -36
  38. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +36 -38
  39. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +52 -52
  40. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +45 -45
  41. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +41 -42
  42. package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +28 -28
  43. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +30 -30
  44. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +34 -34
  45. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +30 -30
  46. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +39 -39
  47. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +40 -40
  48. package/dist/templates/common/commands/continue.md +28 -29
  49. package/dist/templates/common/commands/finish-work.md +32 -40
  50. package/dist/templates/cursor/agents/trellis-check.md +61 -61
  51. package/dist/templates/cursor/agents/trellis-implement.md +58 -58
  52. package/dist/templates/cursor/agents/trellis-research.md +67 -67
  53. package/dist/templates/droid/droids/trellis-check.md +64 -56
  54. package/dist/templates/droid/droids/trellis-implement.md +61 -53
  55. package/dist/templates/droid/droids/trellis-research.md +67 -67
  56. package/dist/templates/gemini/agents/trellis-check.md +64 -57
  57. package/dist/templates/gemini/agents/trellis-implement.md +61 -54
  58. package/dist/templates/gemini/agents/trellis-research.md +67 -67
  59. package/dist/templates/kiro/agents/trellis-check.json +15 -3
  60. package/dist/templates/kiro/agents/trellis-implement.json +15 -3
  61. package/dist/templates/kiro/agents/trellis-research.json +10 -2
  62. package/dist/templates/kiro/agents/trellis.json +19 -5
  63. package/dist/templates/opencode/agents/trellis-check.md +61 -61
  64. package/dist/templates/opencode/agents/trellis-implement.md +58 -59
  65. package/dist/templates/opencode/agents/trellis-research.md +67 -67
  66. package/dist/templates/pi/agents/trellis-check.md +99 -21
  67. package/dist/templates/pi/agents/trellis-implement.md +90 -22
  68. package/dist/templates/pi/agents/trellis-research.md +124 -12
  69. package/dist/templates/qoder/agents/trellis-check.md +64 -57
  70. package/dist/templates/qoder/agents/trellis-implement.md +61 -54
  71. package/dist/templates/qoder/agents/trellis-research.md +67 -67
  72. package/dist/templates/trae/agents/trellis-check.md +64 -57
  73. package/dist/templates/trae/agents/trellis-implement.md +61 -54
  74. package/dist/templates/trae/agents/trellis-research.md +67 -67
  75. package/dist/templates/trellis/agents/check.md +29 -29
  76. package/dist/templates/trellis/agents/implement.md +30 -30
  77. package/dist/templates/trellis/workflow.md +349 -356
  78. package/dist/templates/zcode/agents/trellis-check.md +64 -51
  79. package/dist/templates/zcode/agents/trellis-implement.md +61 -53
  80. 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
- This skill is for local Cviauto users who have already run `cviauto init` in a project. After reading it, an AI should understand the Cviauto architecture, operating model, and customization entry points inside that user project, then modify the generated `.cviauto/` and platform directory files according to the user's request.
9
-
10
- Cviauto v0.6 adds three architectural surfaces on top of the pre-v0.6 workflow / persistence / platform model. First, a multi-agent collaboration runtime: `cviauto channel` coordinates multiple AI worker processes through project-scoped JSONL event logs at `~/.cviauto/channels/<project>/<channel>/events.jsonl`, with worker OOM guard, forum/thread channels, durable idempotency keys, and bundled `.cviauto/agents/{check,implement}.md` runtime definitions. Second, cross-session memory: `cviauto mem list | search | context | extract | projects` reads raw Claude Code, Codex, and Pi Agent JSONL already on disk, slices by `--phase brainstorm|implement|all`, and never uploads anything. Third, a dual-package npm release: `@baoanaz/cviauto` (CLI) and `@baoanaz/cviauto-core` (SDK with `/channel`, `/task`, `/mem`, `/testing` subpaths) ship in lockstep on one version. Treat these as first-class customization surfaces alongside the per-platform integration files.
11
-
12
- The default operating scope is local files in the user project:
13
-
14
- - `.cviauto/`: workflow, config, tasks, spec, workspace, scripts, bundled runtime agents, and runtime state.
15
- - Platform directories: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.reasonix/`, `.kilocode/`, `.agent/`, `.devin/`, and similar directories. Pi additionally exposes a native `trellis_subagent` tool with `single` / `parallel` / `chain` dispatch modes, throttled progress cards, and `isTrellisAgent()` validation on top of the file layout. Reasonix stores both workflow skills and subagent skills as `.reasonix/skills/<name>/SKILL.md`; subagent skills carry `runAs: subagent` frontmatter.
16
- - Shared skill layer: `.agents/skills/`.
17
- - User-owned channel store outside the project tree: `~/.cviauto/channels/<project>/<channel>/events.jsonl`.
18
- - Raw platform conversation logs queryable via `cviauto mem`: `~/.claude/projects/`, `~/.codex/sessions/`, and `~/.pi/agent/sessions/` (OpenCode adapter degraded for the v0.6 line).
19
-
20
- Do not assume the user has the Cviauto source repository. Do not default to modifying the global npm install directory or `node_modules` — both `@baoanaz/cviauto` and `@baoanaz/cviauto-core` ship as published packages sharing one version and one git tag per release.
21
-
22
- ## How To Use
23
-
24
- 1. Read `references/local-architecture/overview.md` first to establish the local Cviauto system model.
25
- 2. If the request involves a specific AI tool, read `references/platform-files/platform-map.md` and the relevant platform file notes.
26
- 3. If the request involves multi-agent dispatch or channel workers, read `references/local-architecture/multi-agent-channel.md` and the bundled `.cviauto/agents/` files.
27
- 4. If the user wants to change behavior, read `references/customize-local/overview.md`, then open the specific customization topic.
28
- 5. Before editing, read the actual files in the user project and treat local content as authoritative.
29
-
30
- ## References
31
-
32
- ### Local Architecture
33
-
34
- - `references/local-architecture/overview.md`: The layered local Cviauto architecture (workflow / persistence / platform / channel runtime) and customization principles.
35
- - `references/local-architecture/generated-files.md`: Files generated by `cviauto init` and their customization boundaries, including `.cviauto/agents/`.
36
- - `references/local-architecture/workflow.md`: Phases, routing, workflow-state blocks, and selectable workflow templates (`native`, `tdd`, `channel-driven-subagent-dispatch`, marketplace) in `.cviauto/workflow.md`.
37
- - `references/local-architecture/task-system.md`: Task directories, active task, JSONL context, parent/child task trees, and task runtime.
38
- - `references/local-architecture/spec-system.md`: How `.cviauto/spec/` is organized, injected, and refreshed from a `registry.spec` source.
39
- - `references/local-architecture/workspace-memory.md`: `.cviauto/workspace/` journals plus `cviauto mem` cross-session recall and the `@baoanaz/cviauto-core/mem` SDK.
40
- - `references/local-architecture/context-injection.md`: Hooks, sub-agent preludes, and channel-runtime worker inbox routing.
41
- - `references/local-architecture/multi-agent-channel.md`: `cviauto channel` subcommands, project-scoped event store, forum/thread channels, worker OOM guard, durable idempotency, and bundled `.cviauto/agents/` runtime agents.
42
- - `references/local-architecture/bundled-skills.md`: Auto-dispatched bundled skills (`cviauto-meta`, `cviauto-spec-bootstrap`, `cviauto-session-insight`) and how `getBundledSkillTemplates()` ships them to every platform skill root.
43
-
44
- ### Platform Files
45
-
46
- - `references/platform-files/overview.md`: How shared `.cviauto/` files relate to platform directories and the four platform integration modes (hook-driven, agent prelude, main-session workflow, channel runtime).
47
- - `references/platform-files/platform-map.md`: Platform directories and paths for skills, agents, hooks, and extensions across all 15 supported platforms including Reasonix and Pi's native `trellis_subagent` extension.
48
- - `references/platform-files/hooks-and-settings.md`: How settings/config files, hooks, plugins, and extensions connect to Cviauto; covers `channel.worker_guard.*` and `codex.dispatch_mode`.
49
- - `references/platform-files/agents.md`: Per-platform `cviauto-research` / `cviauto-implement` / `cviauto-check` sub-agent files plus bundled `.cviauto/agents/{check,implement}.md` for the channel runtime.
50
- - `references/platform-files/skills-and-commands.md`: Differences between skills, commands, prompts, and workflows, plus how to change them.
51
-
52
- ### Local Customization
53
-
54
- - `references/customize-local/overview.md`: Choose the right local customization entry point for the user's request.
55
- - `references/customize-local/change-workflow.md`: Change phases, routing, next actions, workflow-state, and the selected workflow template.
56
- - `references/customize-local/change-task-lifecycle.md`: Change task creation, status, archive behavior, parent/child links, archive slug collision handling, and lifecycle hooks.
57
- - `references/customize-local/change-context-loading.md`: Change how tasks, specs, journals, hook context, channel inbox messages, and `cviauto mem` recall are loaded.
58
- - `references/customize-local/change-hooks.md`: Change platform hooks, settings, task lifecycle hooks (`hooks.after_*`), and shell session bridges.
59
- - `references/customize-local/change-agents.md`: Change research, implement, and check agent behavior across platform sub-agents, bundled channel runtime agents, and the Codex `dispatch_mode` toggle.
60
- - `references/customize-local/change-skills-or-commands.md`: Add or modify local skills, commands, prompts, and workflows; covers upstream bundled-skill auto-dispatch.
61
- - `references/customize-local/change-spec-structure.md`: Adjust the project spec structure under `.cviauto/spec/`, including registry-backed sources.
62
- - `references/customize-local/add-project-local-conventions.md`: Put team rules into project-local specs or local skills.
63
-
64
- ## Current Rules
65
-
66
- - `.cviauto/workflow.md` is the local workflow source of truth; its initial content was selected from a workflow template (built-in `native`, `tdd`, `channel-driven-subagent-dispatch`, or a marketplace template) at `cviauto init` time and can be re-selected via `cviauto workflow --template <id>`. Missing `.cviauto/agents/<name>.md` files referenced by the active template trigger a non-blocking stderr warning pointing at `cviauto update`.
67
- - `.cviauto/config.yaml` is the project-level Cviauto configuration entry point. It hosts task lifecycle hooks (`hooks.after_create` / `after_start` / `after_finish` / `after_archive`), journal shape (`session_commit_message` / `max_journal_lines` / `session_auto_commit`), channel worker guard (`channel.worker_guard.idle_timeout` / `max_live_workers`), Codex dispatch mode (`codex.dispatch_mode: inline | sub-agent`), and the spec registry block (`registry.spec.source` + `registry.spec.template`).
68
- - `.cviauto/spec/` stores the user's project-specific coding conventions and design constraints. When `registry.spec` is set, files are refreshed by `cviauto update`; local edits surface as "modified by user" conflicts in `.cviauto/.template-hashes.json`.
69
- - `.cviauto/tasks/` stores task PRDs, design notes, implement plans, research files, and JSONL context. Tasks form parent/child trees: `task.py create --parent <slug>`, `task.py add-subtask <parent> <child>`, `task.py remove-subtask <parent> <child>`, and `task.py list-context <task>`. `task.py create` rejects a slug already present in `.cviauto/tasks/archive/**`.
70
- - `.cviauto/workspace/` stores **deliberately written** developer journals. Raw cross-session dialogue is **not** stored here — it lives on disk under `~/.claude/projects/`, `~/.codex/sessions/`, and `~/.pi/agent/sessions/` and is recovered via `cviauto mem search|extract|context`. The bundled `cviauto-session-insight` skill teaches when to reach for `mem`.
71
- - `.cviauto/agents/{check,implement}.md` are bundled, platform-agnostic channel runtime agent definitions loaded by `cviauto channel spawn --agent <name>`. Editable; `cviauto update` backfills missing ones. Editing the per-platform `cviauto-implement.md` / `cviauto-check.md` does **not** change channel-runtime worker behavior.
72
- - `~/.cviauto/channels/<project>/<channel>/events.jsonl` is the channel runtime event log per project per channel. User-owned, file-locked sequence numbering, durable `idempotencyKey` support; never under `.cviauto/`.
73
- - Bundled multi-file skills (`cviauto-meta`, `cviauto-spec-bootstrap`, `cviauto-session-insight`, `cviauto-channel`) are auto-dispatched to every platform skill root by `getBundledSkillTemplates()` in `packages/cli/src/templates/common/index.ts`. Dropping a new directory under `packages/cli/src/templates/common/bundled-skills/` (upstream) ships it to every platform on the next `cviauto update`.
74
- - Platform settings/config files decide which hooks, agents, skills, commands, prompts, and workflows actually run. Reasonix has no settings file — behavior is encoded inside skill frontmatter.
75
- - `.cviauto/.template-hashes.json` and `.cviauto/.runtime/` are management/runtime state files. Confirm necessity before editing them.
76
-
77
- ## Do Not
78
-
79
- - Do not treat Cviauto upstream source code as the default target for local customization.
80
- - Do not modify the global npm install directory or `node_modules/@baoanaz/cviauto` or `node_modules/@baoanaz/cviauto-core` to implement project needs; both packages ship in lockstep.
81
- - Do not overwrite user-modified local files with default templates; check `.cviauto/.template-hashes.json` first and prefer `.new` sidecar files over destructive overwrites.
82
- - Do not put team-private project rules into any public bundled skill (`cviauto-meta`, `cviauto-spec-bootstrap`, `cviauto-session-insight`, `cviauto-channel`); put project rules in `.cviauto/spec/`, a project-local skill, the current task, or the workspace journal — `cviauto update` will overwrite anything inside a bundled skill directory.
83
- - Do not hand-edit `~/.cviauto/channels/<project>/<channel>/events.jsonl`; sequence numbers are assigned under a file lock and replay-safe writes go through the `cviauto channel` CLI or the `@baoanaz/cviauto-core/channel` SDK.
84
- - Do not edit `.claude/agents/cviauto-implement.md` (or any other per-platform sub-agent file) when the goal is to change channel runtime worker behavior — edit `.cviauto/agents/<name>.md` instead.
85
- - Do not describe removed or never-shipped mechanisms as current Cviauto behavior; cross-check against the local `.cviauto/config.yaml` and the installed CLI's `trellis --help` before claiming a knob exists.
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 CodeCodex 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`:Hookssub-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
- # Add Project-Local Conventions
1
+ # 添加项目本地约定
2
2
 
3
- Often the user does not need to change Cviauto mechanics; they need local AI to understand their team's conventions. In that case, prefer `.cviauto/spec/` or a project-local skill instead of editing `cviauto-meta`.
3
+ 用户通常不需要更改 Cviauto 机制本身;他们需要让本地 AI 理解其团队的约定。在这种情况下,优先使用 `.cviauto/spec/` 或项目本地 skill,而非编辑 `cviauto-meta`。
4
4
 
5
- ## Where To Put Things
5
+ ## 各类内容放置位置
6
6
 
7
- | Content type | Location |
7
+ | 内容类型 | 位置 |
8
8
  | --- | --- |
9
- | Rules code must follow | `.cviauto/spec/<layer>/` |
10
- | Cross-layer thinking methods | `.cviauto/spec/guides/` |
11
- | AI capability for a project-specific flow | Platform-local skill |
12
- | One-off task material | `.cviauto/tasks/<task>/` |
13
- | Session summary | `.cviauto/workspace/<developer>/journal-N.md` |
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
- ## Create A Project-Local Skill
15
+ ## 创建项目本地 Skill
16
16
 
17
- If the user wants AI to know "how this project customizes Cviauto," create a local skill:
17
+ 如果用户希望 AI 了解「本项目如何自定义 Cviauto」,创建一个本地 skill
18
18
 
19
19
  ```text
20
20
  .claude/skills/cviauto-local/
21
21
  └── SKILL.md
22
22
  ```
23
23
 
24
- Example:
24
+ 示例:
25
25
 
26
26
  ```md
27
27
  ---
28
- name: trellis-local
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
- For multi-platform projects, place equivalent versions in other platform skill directories, or use `.agents/skills/` for platforms that support the shared layer.
51
+ 对于多平台项目,在其他平台 skill 目录中放置等效版本,或在支持共享层的平台上使用 `.agents/skills/`。
52
52
 
53
- ## Write To `.cviauto/spec/`
53
+ ## 写入 `.cviauto/spec/`
54
54
 
55
- If the content is a coding convention, write it to spec. Examples:
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
- After writing it, update the corresponding `index.md` so AI can find the new rule from the entry point.
63
+ 写入后,更新对应的 `index.md`,以便 AI 能从入口点找到新规则。
64
64
 
65
- ## Make The Current Task Use New Conventions
65
+ ## 让当前 Task 使用新约定
66
66
 
67
- After writing a spec, add it to the current task context:
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
- ## Do Not Store Project-Private Rules In `cviauto-meta`
74
+ ## 不要将项目私有规则存储在 `cviauto-meta`
75
75
 
76
- `cviauto-meta` is a public skill for understanding Cviauto architecture and local customization entry points. Put project-private content in:
76
+ `cviauto-meta` 是一个用于理解 Cviauto 架构和本地自定义入口点的公共 skill。将项目私有内容放在:
77
77
 
78
78
  - `.cviauto/spec/`
79
- - a project-local skill
80
- - the current task
79
+ - 项目本地 skill
80
+ - 当前 task
81
81
  - workspace journal
82
82
 
83
- This prevents future updates to Cviauto's built-in `cviauto-meta` from overwriting the team's own conventions.
83
+ 这可以防止未来 Cviauto 内置的 `cviauto-meta` 更新覆盖团队自己的约定。
@@ -1,18 +1,18 @@
1
- # Change Local Agents
1
+ # 修改本地 Agents
2
2
 
3
- When the user wants to change `cviauto-research`, `cviauto-implement`, or `cviauto-check` behavior, edit platform agent files in the user project.
3
+ 当用户想更改 `cviauto-research`、`cviauto-implement` `cviauto-check` 的行为时,编辑用户项目中的平台 agent 文件。
4
4
 
5
- ## Read These Files First
5
+ ## 先阅读这些文件
6
6
 
7
- 1. Target platform agent directory
8
- 2. `.cviauto/workflow.md` Phase 2 / research routing
9
- 3. Current task `prd.md`
10
- 4. Current task `implement.jsonl` / `check.jsonl`
11
- 5. Relevant hook or agent prelude
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
- ## Common Paths
13
+ ## 常见路径
14
14
 
15
- | Platform | Path |
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` (subagent frontmatter) |
27
+ | Reasonix | `.reasonix/skills/cviauto-*/SKILL.md`(subagent frontmatter |
28
28
  | ZCode | `.zcode/cli/agents/cviauto-*.md` |
29
29
 
30
- Use the actual paths in the user project as authoritative.
30
+ 以用户项目中的实际路径为准。
31
31
 
32
- ## Common Needs
32
+ ## 常见需求
33
33
 
34
- | Need | Which agent to edit |
34
+ | 需求 | 应编辑哪个 agent |
35
35
  | --- | --- |
36
- | Research must write files, not only reply in chat | `cviauto-research` |
37
- | Certain local specs must be read before implementation | `cviauto-implement` + `implement.jsonl` configuration rules |
38
- | Specific commands must run during checking | `cviauto-check` |
39
- | Agent must not modify certain directories | The corresponding agent's write boundary instructions |
40
- | Agent output format must be fixed | The corresponding agent's final/reporting instructions |
36
+ | Research 必须写入文件,而不能仅在聊天中回复 | `cviauto-research` |
37
+ | 实现前必须读取某些本地 spec | `cviauto-implement` + `implement.jsonl` 配置规则 |
38
+ | 检查阶段必须运行特定命令 | `cviauto-check` |
39
+ | Agent 不得修改某些目录 | 对应 agent 的写入边界指令 |
40
+ | Agent 输出格式必须固定 | 对应 agent 的最终/报告指令 |
41
41
 
42
- ## Modification Principles
42
+ ## 修改原则
43
43
 
44
- 1. **Preserve role boundaries**: research investigates and persists; implement writes implementation; check reviews and fixes.
45
- 2. **Do not hard-code project specs into agents**: long-term specs belong in `.cviauto/spec/`; agents are responsible for reading them.
46
- 3. **Make read order explicit**: active task -> PRD -> info -> JSONL -> spec/research.
47
- 4. **Make write boundaries explicit**: which directories may be written and which may not.
48
- 5. **Synchronize across platforms**: when the user configured multiple platforms, decide whether to change only the current platform or all platform agents.
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 Platforms
50
+ ## Agent Pull(拉取)平台
51
51
 
52
- If an agent file contains a prelude for "read task/context after startup," do not remove those steps when editing. Otherwise the agent will work only from chat context and bypass Cviauto's core mechanism.
52
+ 如果 agent 文件中包含「启动后读取 task/context」的前置步骤,编辑时不要删除这些步骤。否则 agent 将仅依赖聊天上下文工作,绕过 Cviauto 的核心机制。
53
53
 
54
- ## Hook Push Platforms
54
+ ## Hook Push(推送)平台
55
55
 
56
- If context is injected by a hook, the agent file should still retain responsibility boundaries. Do not remove PRD/spec requirements from the agent just because a hook injects context.
56
+ 如果上下文由 hook 注入,agent 文件仍应保留职责边界。不要因为 hook 注入了上下文就从 agent 中移除 PRD/spec 要求。
@@ -1,78 +1,78 @@
1
- # Change Local Context Loading
1
+ # 修改本地上下文加载
2
2
 
3
- Context loading determines when AI reads workflow, task, spec, research, workspace, and git status. Read this page when the user says "AI does not know the current task," "the agent did not read specs," or "there is too much/too little context."
3
+ 上下文加载决定了 AI 何时读取工作流、任务、规范(spec)、调研(research)、工作区(workspace)和 git 状态。当用户说"AI 不知道当前任务""代理没有读取规范""上下文太多/太少"时,请阅读本页。
4
4
 
5
- ## Read These Files First
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. Current platform hooks or agent files
13
- 7. The current task's `implement.jsonl` / `check.jsonl`
12
+ 6. 当前平台钩子或代理文件
13
+ 7. 当前任务的 `implement.jsonl` / `check.jsonl`
14
14
 
15
- ## Context Sources
15
+ ## 上下文来源
16
16
 
17
- | Source | Purpose |
17
+ | 来源 | 用途 |
18
18
  | --- | --- |
19
- | `.cviauto/workflow.md` | Workflow and next-action hints. |
20
- | `.cviauto/tasks/<task>/prd.md` | Current task requirements. |
21
- | `.cviauto/tasks/<task>/design.md` | Complex task technical design. |
22
- | `.cviauto/tasks/<task>/implement.md` | Complex task execution plan. |
23
- | `.cviauto/tasks/<task>/implement.jsonl` | Spec/research to read before implementation. |
24
- | `.cviauto/tasks/<task>/check.jsonl` | Spec/research to read during checking. |
25
- | `.cviauto/spec/` | Project specs. |
26
- | `.cviauto/workspace/` | Session records. |
27
- | git status | Current working tree changes. |
28
-
29
- ## Common Needs And Edit Points
30
-
31
- | Need | Edit point |
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
- | Inject more/less information in new sessions | `session_context.py` or the platform `session-start` hook. |
34
- | Change hints on each user input | `[workflow-state:STATUS]` block in `.cviauto/workflow.md`. The `inject-workflow-state` hook is parser-only and reads the block verbatim. |
35
- | Agent did not read specs | Task JSONL, agent prelude, `inject-subagent-context` hook. |
36
- | Active task is lost | `active_task.py` and platform session identity propagation. |
37
- | Change JSONL validation rules | `task_context.py`. |
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 Rules
39
+ ## JSONL 规则
40
40
 
41
- `implement.jsonl` / `check.jsonl` are the key context loading interface:
41
+ `implement.jsonl` / `check.jsonl` 是关键的上下文加载接口:
42
42
 
43
43
  ```jsonl
44
- {"file": ".cviauto/spec/backend/index.md", "reason": "Backend conventions"}
45
- {"file": ".cviauto/tasks/04-28-x/research/api.md", "reason": "API research"}
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
- Include only spec/research files. Do not put code files that will be modified into these manifests; agents read code files themselves during implementation.
48
+ 仅包含规范/调研文件。不要将将要修改的代码文件放入这些清单中;代理在实现期间会自行读取代码文件。
49
49
 
50
- ## Change Session Context
50
+ ## 修改会话上下文
51
51
 
52
- If the user wants every new session to see more project state, edit:
52
+ 如果用户希望每个新会话都能看到更多项目状态,请编辑:
53
53
 
54
54
  - `.cviauto/scripts/common/session_context.py`
55
- - the corresponding platform `session-start` hook
55
+ - 相应的平台 `session-start` 钩子
56
56
 
57
- Context cannot grow without bound. Prefer injecting indexes and paths so the AI can read detailed files on demand.
57
+ 上下文不能无限制增长。优先注入索引和路径,使 AI 可以按需读取详细文件。
58
58
 
59
- ## Change Sub-Agent Context
59
+ ## 修改子代理上下文
60
60
 
61
- First determine which mode the platform uses:
61
+ 首先确定平台使用哪种模式:
62
62
 
63
- - hook push: edit the `inject-subagent-context` hook.
64
- - agent pull: edit the read steps in the corresponding `cviauto-implement` / `cviauto-check` agent file.
63
+ - 钩子推送(hook push):编辑 `inject-subagent-context` 钩子。
64
+ - 代理拉取(agent pull):编辑对应 `cviauto-implement` / `cviauto-check` 代理文件中的读取步骤。
65
65
 
66
- In both modes, make sure the agent ultimately reads:
66
+ 两种模式下,确保代理最终读取:
67
67
 
68
- 1. active task
69
- 2. the corresponding JSONL
70
- 3. spec/research referenced by the JSONL
68
+ 1. 活动任务
69
+ 2. 对应的 JSONL
70
+ 3. JSONL 引用的规范/调研
71
71
  4. `prd.md`
72
- 5. `design.md` if present
73
- 6. `implement.md` if present
72
+ 5. `design.md`(如果存在)
73
+ 6. `implement.md`(如果存在)
74
74
 
75
- ## Troubleshooting Order
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
- Confirm the task and JSONL are correct before editing hooks/agents.
84
+ 在编辑钩子/代理之前,先确认任务和 JSONL 是正确的。
@@ -1,57 +1,57 @@
1
- # Change Local Hooks
1
+ # 修改本地 Hooks
2
2
 
3
- Hooks are the automation layer that connects a platform to Cviauto. When the user wants to change "when context is injected," "how shell commands inherit a session," or "which files are read before an agent starts," hooks are usually the edit point.
3
+ Hooks(钩子)是将平台与 Cviauto 连接起来的自动化层。当用户想更改「何时注入上下文」「shell 命令如何继承会话」「agent 启动前应读取哪些文件」时,通常需要编辑 hooks
4
4
 
5
- ## Read These Files First
5
+ ## 先阅读这些文件
6
6
 
7
- 1. Target platform settings/config, such as `.claude/settings.json`, `.codex/hooks.json`, `.cursor/hooks.json`, `.trae/hooks.json`
8
- 2. Target platform hooks directory
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
- ## Common Hook Types
13
+ ## 常见 Hook 类型
14
14
 
15
- | Hook | Purpose |
15
+ | Hook | 用途 |
16
16
  | --- | --- |
17
- | session-start | Injects a Cviauto overview when a session starts, clears, or compacts. |
18
- | workflow-state | Injects a state hint on each user input. |
19
- | sub-agent context | Injects PRD/spec/research before an agent starts. |
20
- | shell session bridge | Lets `task.py` commands in shell see the same session identity. |
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
- ## Modification Steps
22
+ ## 修改步骤
23
23
 
24
- 1. Find the hook registration in settings/config.
25
- 2. Confirm the registered script path exists.
26
- 3. Read the hook script and identify inputs, outputs, and called `.cviauto/scripts/`.
27
- 4. Modify hook behavior.
28
- 5. If the hook depends on workflow content, synchronize `.cviauto/workflow.md`.
24
+ 1. settings/config 中找到 hook 注册项。
25
+ 2. 确认注册的脚本路径存在。
26
+ 3. 阅读 hook 脚本,识别输入、输出以及调用的 `.cviauto/scripts/`。
27
+ 4. 修改 hook 行为。
28
+ 5. 如果 hook 依赖工作流内容,同步更新 `.cviauto/workflow.md`。
29
29
 
30
- ## Example: Change New-Session Injection Content
30
+ ## 示例:更改新会话注入内容
31
31
 
32
- First find the session-start hook:
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
- If the hook ultimately calls `.cviauto/scripts/get_context.py` or `session_context.py`, editing the local script is usually more robust than hard-coding content in the hook.
39
+ 如果该 hook 最终调用了 `.cviauto/scripts/get_context.py` `session_context.py`,那么编辑本地脚本通常比在 hook 中硬编码内容更稳健。
40
40
 
41
- ## Example: Agent Did Not Read JSONL
41
+ ## 示例:Agent 未读取 JSONL
42
42
 
43
- First confirm:
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
- If the task and JSONL are correct, determine whether the platform uses hook push or agent pull. For hook push, edit `inject-subagent-context`; for agent pull, edit the agent file.
50
+ 如果 task JSONL 正确,判断平台使用的是 hook push(推送)方式还是 agent pull(拉取)方式。对于 hook push,编辑 `inject-subagent-context`;对于 agent pull,编辑 agent 文件。
51
51
 
52
- ## Notes
52
+ ## 注意事项
53
53
 
54
- - Settings handle registration, hook scripts handle behavior; inspect both together.
55
- - Different platforms support different hook events. Do not directly copy another platform's settings.
56
- - Hooks should read project-local `.cviauto/`; they should not depend on Cviauto upstream source paths.
57
- - Hook failures should produce visible errors so AI does not silently lose context.
54
+ - Settings 负责注册,hook 脚本负责行为;两者需一起检查。
55
+ - 不同平台支持不同的 hook 事件。不要直接复制其他平台的 settings
56
+ - Hooks 应读取项目本地的 `.cviauto/`;不应依赖 Cviauto 上游源码路径。
57
+ - Hook 失败时应产生可见的错误,使 AI 不会静默丢失上下文。