@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.
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
@@ -1,467 +1,460 @@
1
- # Development Workflow
1
+ # 开发工作流(Development Workflow
2
2
 
3
3
  ---
4
4
 
5
- ## Core Principles
5
+ ## 核心原则(Core Principles
6
6
 
7
- 1. **Plan before code** — figure out what to do before you start
8
- 2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory
9
- 3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
10
- 4. **Incremental development** — one task at a time
11
- 5. **Human-gated learnings** — write new knowledge back to spec only when the user explicitly asks to promote it
7
+ 1. **先计划后编码**——在开始之前弄清楚要做什么
8
+ 2. **Spec 被注入,而非记忆**——指南通过 hook/skill 注入,而非从记忆中回忆
9
+ 3. **持久化一切**——研究、决策和教训全部写入文件;对话可以被压缩,文件不会
10
+ 4. **增量开发**——一次一个任务
11
+ 5. **人为门控的学习沉淀**——只有当用户明确要求将新知识回写到 spec 时才执行
12
12
 
13
13
  ---
14
14
 
15
- ## Cviauto System
15
+ ## Cviauto 系统(Cviauto System
16
16
 
17
- ### Developer Identity
17
+ ### 开发者身份(Developer Identity
18
18
 
19
- On first use, initialize your identity:
19
+ 首次使用时,初始化你的身份:
20
20
 
21
21
  ```bash
22
22
  python3 ./.cviauto/scripts/init_developer.py <your-name>
23
23
  ```
24
24
 
25
- Creates `.cviauto/.developer` (gitignored) + `.cviauto/workspace/<your-name>/`.
25
+ 创建 `.cviauto/.developer`(已 gitignore)+ `.cviauto/workspace/<your-name>/`。
26
26
 
27
- ### Spec System
27
+ ### Spec 系统(Spec System
28
28
 
29
- `.cviauto/spec/` holds coding guidelines organized by package and layer.
29
+ `.cviauto/spec/` 按包和层组织存放编码指南。
30
30
 
31
- - `.cviauto/spec/<package>/<layer>/index.md` — entry point with **Pre-Development Checklist** + **Quality Check**. Actual guidelines live in the `.md` files it points to.
32
- - `.cviauto/spec/guides/index.md` — cross-package thinking guides.
31
+ - `.cviauto/spec/<package>/<layer>/index.md`——入口点,包含**开发前检查清单(Pre-Development Checklist)**+**质量检查(Quality Check)**。实际指南位于其指向的 `.md` 文件中。
32
+ - `.cviauto/spec/guides/index.md`——跨包思维指南。
33
33
 
34
34
  ```bash
35
- python3 ./.cviauto/scripts/get_context.py --mode packages # list packages / layers
35
+ python3 ./.cviauto/scripts/get_context.py --mode packages # 列出包 /
36
36
  ```
37
37
 
38
- **When to update spec**: only when the user explicitly asks to promote a reusable rule, pattern, bug-fix prevention lesson, or technical decision into `.cviauto/spec/`.
38
+ **何时更新 spec**:仅当用户明确要求将一个可复用的规则、模式、bug 修复预防经验或技术决策回写到 `.cviauto/spec/` 时才执行。
39
39
 
40
- ### Task System
40
+ ### 任务系统(Task System
41
41
 
42
- Every task has its own directory under `.cviauto/tasks/{MM-DD-name}/` holding `task.json`, `prd.md`, optional `design.md`, optional `implement.md`, optional `research/`, and context manifests (`implement.jsonl`, `check.jsonl`) for sub-agent-capable platforms.
42
+ 每个任务在 `.cviauto/tasks/{MM-DD-name}/` 下拥有自己的目录,包含 `task.json`、`prd.md`、可选的 `design.md`、可选的 `implement.md`、可选的 `research/`,以及面向支持子 agent 的平台的上下文清单(`implement.jsonl`、`check.jsonl`)。
43
43
 
44
44
  ```bash
45
- # Task lifecycle
45
+ # 任务生命周期
46
46
  python3 ./.cviauto/scripts/task.py create "<title>" [--slug <name>] [--parent <dir>]
47
- python3 ./.cviauto/scripts/task.py start <name> # set active task (session-scoped when available)
48
- python3 ./.cviauto/scripts/task.py current --source # show active task and source
49
- python3 ./.cviauto/scripts/task.py finish # clear active task (triggers after_finish hooks)
50
- python3 ./.cviauto/scripts/task.py archive <name> # move to archive/{year-month}/
47
+ python3 ./.cviauto/scripts/task.py start <name> # 设置活跃任务(可用时作用于会话范围)
48
+ python3 ./.cviauto/scripts/task.py current --source # 显示活跃任务及其来源
49
+ python3 ./.cviauto/scripts/task.py finish # 清除活跃任务(触发 after_finish hooks
50
+ python3 ./.cviauto/scripts/task.py archive <name> # 移至 archive/{year-month}/
51
51
  python3 ./.cviauto/scripts/task.py list [--mine] [--status <s>]
52
52
  python3 ./.cviauto/scripts/task.py list-archive
53
53
 
54
- # Code-spec context (injected into implement/check agents via JSONL).
55
- # `implement.jsonl` / `check.jsonl` are seeded on `task create` for sub-agent-capable
56
- # platforms; the AI curates real spec + research entries during planning when needed.
54
+ # 代码-spec 上下文(通过 JSONL 注入到 implement/check agent 中)。
55
+ # `implement.jsonl` / `check.jsonl` `task create` 时为支持子 agent 的平台
56
+ # 进行种子化;AI 在规划期间按需整理真实的 spec + research 条目。
57
57
  python3 ./.cviauto/scripts/task.py add-context <name> <action> <file> <reason>
58
58
  python3 ./.cviauto/scripts/task.py list-context <name> [action]
59
59
  python3 ./.cviauto/scripts/task.py validate <name>
60
60
 
61
- # Task metadata
61
+ # 任务元数据
62
62
  python3 ./.cviauto/scripts/task.py set-branch <name> <branch>
63
- python3 ./.cviauto/scripts/task.py set-base-branch <name> <branch> # PR target
63
+ python3 ./.cviauto/scripts/task.py set-base-branch <name> <branch> # PR 目标
64
64
  python3 ./.cviauto/scripts/task.py set-scope <name> <scope>
65
65
 
66
- # Hierarchy (parent/child)
66
+ # 层级(父/子)
67
67
  python3 ./.cviauto/scripts/task.py add-subtask <parent> <child>
68
68
  python3 ./.cviauto/scripts/task.py remove-subtask <parent> <child>
69
69
 
70
- # PR creation
70
+ # PR 创建
71
71
  python3 ./.cviauto/scripts/task.py create-pr [name] [--dry-run]
72
72
  ```
73
73
 
74
- > Run `python3 ./.cviauto/scripts/task.py --help` to see the authoritative, up-to-date list.
74
+ > 运行 `python3 ./.cviauto/scripts/task.py --help` 查看权威的、最新的列表。
75
75
 
76
- **Current-task mechanism**: `task.py create` creates the task directory and (when session identity is available) auto-sets the per-session active-task pointer so the planning breadcrumb fires immediately. `task.py start` writes the same pointer (idempotent if already set) and flips `task.json.status` from `planning` to `in_progress`. State is stored under `.cviauto/.runtime/sessions/`. If no context key is available from hook input, `TRELLIS_CONTEXT_ID`, or a platform-native session environment variable, there is no active task and `task.py start` fails with a session identity hint. `task.py finish` deletes the current session file (status unchanged). `task.py archive <task>` writes `status=completed`, moves the directory to `archive/`, and deletes any runtime session files that still point at the archived task.
76
+ **当前任务机制**:`task.py create` 创建任务目录,并在会话身份可用时自动设置每会话的活跃任务指针,使规划面包屑(breadcrumb)立即生效。`task.py start` 写入相同的指针(如果已设置则幂等),并将 `task.json.status` `planning` 翻转为 `in_progress`。状态存储在 `.cviauto/.runtime/sessions/` 下。如果没有来自 hook 输入、`TRELLIS_CONTEXT_ID` 或平台原生会话环境变量的 context key,则没有活跃任务,此时 `task.py start` 会失败并给出会话身份提示。`task.py finish` 删除当前会话文件(状态不变)。`task.py archive <task>` 写入 `status=completed`,将目录移至 `archive/`,并删除仍指向该归档任务的运行时会话文件。
77
77
 
78
- ### Workspace System
78
+ ### 工作区系统(Workspace System
79
79
 
80
- Records every AI session for cross-session tracking under `.cviauto/workspace/<developer>/`.
80
+ `.cviauto/workspace/<developer>/` 下记录每个 AI 会话,用于跨会话跟踪。
81
81
 
82
- - `journal-N.md` — session log. **Max 2000 lines per file**; a new `journal-(N+1).md` is auto-created when exceeded.
83
- - `index.md` — personal index (total sessions, last active).
82
+ - `journal-N.md`——会话日志。**每个文件最多 2000 行**;超出后自动创建 `journal-(N+1).md`。
83
+ - `index.md`——个人索引(总会话数、最后活跃时间)。
84
84
 
85
85
  ```bash
86
86
  python3 ./.cviauto/scripts/add_session.py --title "Title" --commit "hash" --summary "Summary"
87
87
  ```
88
88
 
89
- ### Context Script
89
+ ### 上下文脚本(Context Script
90
90
 
91
91
  ```bash
92
- python3 ./.cviauto/scripts/get_context.py # full session runtime
93
- python3 ./.cviauto/scripts/get_context.py --mode packages # available packages + spec layers
94
- python3 ./.cviauto/scripts/get_context.py --mode phase --step <X.Y> # detailed guide for a workflow step
92
+ python3 ./.cviauto/scripts/get_context.py # 完整会话运行时上下文
93
+ python3 ./.cviauto/scripts/get_context.py --mode packages # 可用包 + spec
94
+ python3 ./.cviauto/scripts/get_context.py --mode phase --step <X.Y> # 工作流步骤的详细指南
95
95
  ```
96
96
 
97
97
  ---
98
98
 
99
99
  <!--
100
- WORKFLOW-STATE BREADCRUMB CONTRACT (read this before editing the tag blocks below)
101
-
102
- The [workflow-state:STATUS] blocks embedded in the ## Phase Index section
103
- below are the SINGLE source of truth for the per-turn `<workflow-state>`
104
- breadcrumb that every supported AI platform's UserPromptSubmit hook
105
- reads. inject-workflow-state.py (Python platforms) and
106
- inject-workflow-state.js (OpenCode plugin) only parse them — there is no
107
- fallback dict baked into the scripts after v0.5.0-rc.0.
108
-
109
- STATUS charset: [A-Za-z0-9_-]+. When the hook can't find a tag, it
110
- degrades to a generic "Refer to workflow.md for current step." line —
111
- intentionally visible so users notice and fix a broken workflow.md.
112
-
113
- INVARIANT (test/regression.test.ts):
114
- Every workflow-walkthrough step marked `[required · once]` must have a
115
- matching enforcement line in its phase's [workflow-state:*] block. The
116
- breadcrumb is the only per-turn channel; if a mandatory step isn't
117
- mentioned there, the AI silently skips it (Phase 1 planning gate
118
- skip and Phase 3.4 commit skip both manifested via this gap).
119
-
120
- TAG PHASE scoping:
121
- [workflow-state:no_task] no active task; before Phase 1
122
- [workflow-state:planning] all of Phase 1 (status='planning')
123
- [workflow-state:planning-inline] Codex inline variant of Phase 1
124
- [workflow-state:in_progress] → Phase 2 + Phase 3.2-3.4
125
- (status stays 'in_progress' from
126
- task.py start until task.py archive)
127
- [workflow-state:in_progress-inline] Codex inline variant of Phase 2/3
128
- [workflow-state:completed] → currently DEAD: cmd_archive flips
129
- status and moves the dir in the same
130
- call, so the resolver loses the
131
- pointer (block kept for a future
132
- explicit in_progress→completed
133
- transition)
134
-
135
- Editing checklist:
136
- - When you change a [workflow-state:STATUS] block, also check the
137
- matching phase's `[required · once]` walkthrough steps for sync
138
- - Run `cviauto update` after editing to push the new bodies to
139
- downstream user projects (block-level managed replacement)
140
- - Full runtime contract:
100
+ WORKFLOW-STATE BREADCRUMB CONTRACT(在编辑下面的标记块之前阅读此注释)
101
+
102
+ 嵌入在下方 ## Phase Index 章节中的 workflow-state:STATUS 块是每个
103
+ 支持 AI 平台的 UserPromptSubmit hook 读取的每轮 `<workflow-state>`
104
+ 面包屑的**唯一**真实来源。inject-workflow-state.py(Python 平台)和
105
+ inject-workflow-state.js(OpenCode 插件)仅解析它们——在 v0.5.0-rc.0
106
+ 之后,脚本中没有硬编码的回退字典。
107
+
108
+ STATUS 字符集:[A-Za-z0-9_-]+。当 hook 找不到标记时,会降级为通用的
109
+ "Refer to workflow.md for current step."行——刻意使其可见,以便用户注意
110
+ 并修复损坏的 workflow.md
111
+
112
+ 约束条件(test/regression.test.ts):
113
+ 每个标记为 `[required · once]` 的工作流演练步骤必须在其阶段的
114
+ workflow-state:* 块中有匹配的执行提示行。面包屑是唯一的每轮通道;
115
+ 如果一个强制性步骤在那里没有被提及,AI 将静默地跳过它(Phase 1 规划门禁跳过
116
+ Phase 3.4 提交跳过均由此类缺口导致)。
117
+
118
+ 标记 阶段范围:
119
+ ~workflow-state:no_task~ → 没有活跃任务;Phase 1 之前
120
+ ~workflow-state:planning~ → 整个 Phase 1(status='planning')
121
+ ~workflow-state:planning-inline~ Codex inline 变体,Phase 1
122
+ ~workflow-state:in_progress~ Phase 2 + Phase 3.2-3.4
123
+ (status 保持 'in_progress',从
124
+ task.py start 直到 task.py archive)
125
+ ~workflow-state:in_progress-inline~ Codex inline 变体,Phase 2/3
126
+ ~workflow-state:completed~ → 当前为 DEAD:cmd_archive 在同一个
127
+ 调用中翻转 status 并移动目录,因此
128
+ 解析器丢失了指针(保留此块用于未来的
129
+ 显式 in_progress→completed 转换)
130
+
131
+ 编辑检查清单:
132
+ - 当你更改 [workflow-state:STATUS] 块时,还要检查匹配阶段中
133
+ `[required · once]` 演练步骤的同步情况
134
+ - 编辑后运行 `cviauto update` 将新的正文推送到下游用户项目
135
+ (块级托管替换)
136
+ - 完整运行时契约请参见:
141
137
  .cviauto/spec/cli/backend/workflow-state-contract.md
142
138
  -->
143
139
 
144
140
  ## Phase Index
145
141
 
146
142
  ```
147
- Phase 1: Plan → classify, get task-creation consent, then write planning artifacts
148
- Phase 2: Execute → implement only after task status is in_progress
149
- Phase 3: Finish → verify, optionally update spec, commit, and wrap up
143
+ Phase 1: Plan → 分类、获取任务创建同意、然后编写规划产物
144
+ Phase 2: Execute → 仅在任务状态为 in_progress 后才实施
145
+ Phase 3: Finish → 验证、可选地更新 spec、提交并收尾
150
146
  ```
151
147
 
152
- ### Request Triage
148
+ ### 请求分类(Request Triage
153
149
 
154
- - Simple conversation or small task: ask only whether this turn should create a Cviauto task. If the user says no, skip Cviauto for this session.
155
- - Complex task: ask whether you may create a Cviauto task and enter planning. If the user says no, do not do broad inline implementation; explain, clarify scope, or suggest a smaller split.
156
- - User approval to create a task is not approval to start implementation. Planning still happens first.
150
+ - 简单对话或小任务:仅询问本轮是否应创建 Cviauto 任务。如果用户说不需要,则在本会话中跳过 Cviauto
151
+ - 复杂任务:询问用户是否可以创建 Cviauto 任务并进入规划阶段。如果用户说不需要,不要进行大范围的行内实现;解释、明确范围或建议拆分为更小的任务。
152
+ - 用户同意创建任务不等于同意开始实现。规划仍然先进行。
157
153
 
158
- ### Planning Artifacts
154
+ ### 规划产物(Planning Artifacts
159
155
 
160
- - `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
161
- - `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
162
- - `implement.md` — execution plan for complex tasks: ordered checklist, validation commands, review gates, and rollback points.
163
- - `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
164
- - Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
156
+ - `prd.md`——需求、约束条件和验收标准。不要将技术设计或执行检查清单放在这里。
157
+ - `design.md`——复杂任务的技术设计:边界、契约、数据流、权衡、兼容性、上线/回滚形态。
158
+ - `implement.md`——复杂任务的执行计划:有序检查清单、验证命令、审查门禁和回滚点。
159
+ - `implement.jsonl` / `check.jsonl`——子 agent 上下文的 spec 和研究清单。它们不替代 `implement.md`。
160
+ - 轻量任务可以仅 PRD。复杂任务在 `task.py start` 之前必须有 `prd.md`、`design.md` `implement.md`。
165
161
 
166
- ### Parent / Child Task Trees
162
+ ### 父/子任务树(Parent / Child Task Trees
167
163
 
168
- Use a parent task when one user request contains several independently verifiable deliverables. The parent task owns the source requirement set, the task map, cross-child acceptance criteria, and final integration review; it normally should not be the implementation target unless it also has direct work.
164
+ 当一个用户请求包含多个可独立验证的交付物时使用父任务。父任务拥有源需求集、任务映射、跨子任务的验收标准和最终集成审查;除非它本身也有直接工作,否则通常不应是实现的目标。
169
165
 
170
- Use child tasks for deliverables that can be planned, implemented, checked, and archived independently. Parent/child structure is not a dependency system: if one child must wait for another, write that ordering in the child `prd.md` / `implement.md` and keep each child's acceptance criteria testable.
166
+ 将可独立规划、实现、检查和归档的交付物作为子任务。父/子结构不是依赖系统:如果一个子任务必须等待另一个子任务完成,将该顺序写在子任务的 `prd.md` / `implement.md` 中,并保持每个子任务的验收标准可独立测试。
171
167
 
172
- Create new children with `task.py create "<title>" --slug <name> --parent <parent-dir>`. Link existing tasks with `task.py add-subtask <parent> <child>`, and unlink mistakes with `task.py remove-subtask <parent> <child>`.
168
+ 使用 `task.py create "<title>" --slug <name> --parent <parent-dir>` 创建新的子任务。使用 `task.py add-subtask <parent> <child>` 链接现有任务,使用 `task.py remove-subtask <parent> <child>` 解除错误链接。
173
169
 
174
- <!-- Per-turn breadcrumb: shown when there is no active task (before Phase 1) -->
170
+ <!-- 每轮面包屑:当没有活跃任务时显示(Phase 1 之前)-->
175
171
 
176
172
  [workflow-state:no_task]
177
- No active task. First classify the current turn and ask for task-creation consent before creating any Cviauto task.
178
- Simple conversation / small task: ask only whether this turn should create a Cviauto task. If the user says no, skip Cviauto for this session.
179
- Complex task: ask the user if you can create a Cviauto task and enter the planning phase. If the user says no, explain, clarify scope, or suggest a smaller split.
173
+ 没有活跃任务。首先对当前轮次进行分类,在创建任何 Cviauto 任务之前请求任务创建同意。
174
+ 简单对话 / 小任务:仅询问本轮是否应创建 Cviauto 任务。如果用户说不需要,则在本会话中跳过 Cviauto
175
+ 复杂任务:询问用户是否可以创建 Cviauto 任务并进入规划阶段。如果用户说不需要,解释、明确范围或建议拆分为更小的任务。
180
176
  [/workflow-state:no_task]
181
177
 
182
178
  ### Phase 1: Plan
183
- - 1.0 Create task `[required · once]` (only after task-creation consent)
184
- - 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
185
- - 1.2 Research `[optional · repeatable]`
186
- - 1.3 Configure context `[required · once]` — Claude Code, OpenCode, Codex (sub-agent dispatch mode only; inline mode skips)
187
- - 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
188
- - 1.5 Completion criteria
179
+ - 1.0 创建任务 `[required · once]`(仅在获得任务创建同意之后)
180
+ - 1.1 需求探索 `[required · repeatable]`(`prd.md`;复杂任务还需要 `design.md` + `implement.md`)
181
+ - 1.2 调研 `[optional · repeatable]`
182
+ - 1.3 配置上下文 `[required · once]`——Claude CodeOpenCodeCodex(仅子 agent 分派模式;inline 模式跳过)
183
+ - 1.4 激活任务 `[required · once]`(审查门禁,然后 `task.py start`;status → in_progress
184
+ - 1.5 完成标准
189
185
 
190
- <!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
186
+ <!-- 每轮面包屑:贯穿整个 Phase 1status='planning')-->
191
187
 
192
188
  [workflow-state:planning]
193
- Load `cviauto-brainstorm`; stay in planning.
194
- Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
195
- Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
196
- Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
189
+ 加载 `cviauto-brainstorm`;保持在规划阶段。
190
+ 轻量级别:`prd.md` 可能足够。复杂级别:完成 `prd.md`、`design.md` `implement.md`;在 `task.py start` 之前请求审查。
191
+ 多交付物范围:考虑父任务加上可独立验证的子任务;依赖必须写在子产物的文档中,不能由目录树位置暗示。
192
+ agent 模式:在 start 之前将 `implement.jsonl` `check.jsonl` 整理为 spec/research 清单。
197
193
  [/workflow-state:planning]
198
194
 
199
- <!-- Per-turn breadcrumb: shown throughout Phase 1 when codex.dispatch_mode=inline.
200
- Codex-only opt-in alternate to [workflow-state:planning]. The main agent
201
- edits code directly in Phase 2, so jsonl curation is skipped —
202
- the inline workflow loads `cviauto-before-dev` instead of injecting JSONL
203
- into a sub-agent. -->
195
+ <!-- 每轮面包屑:当 codex.dispatch_mode=inline 时贯穿整个 Phase 1
196
+ Codex 的可选替代方案,对应 [workflow-state:planning]。主 agent
197
+ Phase 2 直接编辑代码,因此跳过 jsonl 整理——
198
+ inline 工作流加载 `cviauto-before-dev` 而非将 JSONL 注入
199
+ agent。-->
204
200
 
205
201
  [workflow-state:planning-inline]
206
- Load `cviauto-brainstorm`; stay in planning.
207
- Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
208
- Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
209
- Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `cviauto-before-dev`.
202
+ 加载 `cviauto-brainstorm`;保持在规划阶段。
203
+ 轻量级别:`prd.md` 可能足够。复杂级别:完成 `prd.md`、`design.md` `implement.md`;在 `task.py start` 之前请求审查。
204
+ 多交付物范围:考虑父任务加上可独立验证的子任务;依赖必须写在子产物的文档中,不能由目录树位置暗示。
205
+ Inline 模式:跳过 jsonl 整理;Phase 2 通过 `cviauto-before-dev` 读取产物/spec。
210
206
  [/workflow-state:planning-inline]
211
207
 
212
208
  ### Phase 2: Execute
213
- - 2.1 Implement `[required · repeatable]`
214
- - 2.2 Quality check `[required · repeatable]`
215
- - 2.3 Rollback `[on demand]`
209
+ - 2.1 实施 `[required · repeatable]`
210
+ - 2.2 质量检查 `[required · repeatable]`
211
+ - 2.3 回滚 `[on demand]`
216
212
 
217
- <!-- Per-turn breadcrumb: shown while status='in_progress'.
218
- Scope: all of Phase 2 + Phase 3.2-3.4 (status stays 'in_progress' from
219
- task.py start until task.py archive; only archive flips it). The body
220
- therefore must cover every required step from implementation through
221
- commit, including optional Phase 3.3 spec promotion and required
222
- Phase 3.4 commit. -->
213
+ <!-- 每轮面包屑:当 status='in_progress' 时显示。
214
+ 范围:全部 Phase 2 + Phase 3.2-3.4status 保持 'in_progress'
215
+ task.py start 直到 task.py archive;只有 archive 会翻转它)。
216
+ 因此正文必须覆盖从实现到提交的每个必需步骤,包括可选的
217
+ Phase 3.3 spec 回写和必需的 Phase 3.4 提交。-->
223
218
 
224
- Sub-agent dispatch protocol applies to all platforms that dispatch sub-agents and all sub-agents, including Codex sub-agent mode and `cviauto-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions. Implementation dispatch uses `cviauto-implement` with `implement.jsonl` context.
219
+ 子 agent 分派协议(Sub-agent dispatch protocol)适用于所有分派子 agent 的平台和所有子 agent,包括 Codex agent 模式和 `cviauto-research`:每个分派 prompt `Active task: <task path from task.py current>` 开头,然后是角色特定的指令。实现分派使用 `cviauto-implement` `implement.jsonl` 上下文。
225
220
 
226
221
  [workflow-state:in_progress]
227
- Tools: `cviauto-implement` / `cviauto-research` are sub-agent types only (Task/Agent tool, NOT Skill; there is no skill by these names). `cviauto-update-spec` is a skill. `cviauto-check` exists as both; prefer the Agent form when verifying after code changes.
228
- Flow: `cviauto-implement` -> `cviauto-check` -> commit (Phase 3.4) -> `/cviauto:finish-work`. Run `cviauto-update-spec` only when the user explicitly asks to promote a lesson into spec.
229
- Main-session default: dispatch implement/check sub-agents. Sub-agent self-exemption: if already running as `cviauto-implement`, do NOT spawn another `cviauto-implement` or `cviauto-check`; if already running as `cviauto-check`, do NOT spawn another `cviauto-check` or `cviauto-implement`. Dispatch is main session only.
230
- Dispatch prompt starts with `Active task: <task path from task.py current>`. Read context: jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`.
222
+ 工具说明:`cviauto-implement` / `cviauto-research` 仅为子 agent 类型(Task/Agent 工具,而非 Skill;不存在同名的 skill)。`cviauto-update-spec` 是一个 skill。`cviauto-check` 两者都存在;在代码变更后验证时优先使用 Agent 形式。
223
+ 流程:`cviauto-implement` -> `cviauto-check` -> 提交(Phase 3.4)-> `/cviauto:finish-work`。仅当用户明确要求将经验教训回写到 spec 时才运行 `cviauto-update-spec`。
224
+ 主会话默认:分派 implement/check agent。子 agent 自我豁免:如果已经作为 `cviauto-implement` 运行,不要再生成另一个 `cviauto-implement` `cviauto-check`;如果已经作为 `cviauto-check` 运行,不要再生成另一个 `cviauto-check` `cviauto-implement`。分派仅在主会话中进行。
225
+ 分派 prompt `Active task: <task path from task.py current>` 开头。读取上下文:jsonl 条目 -> `prd.md` -> `design.md if present` -> `implement.md if present`。
231
226
  [/workflow-state:in_progress]
232
227
 
233
- <!-- Per-turn breadcrumb: shown while status='in_progress' when
234
- codex.dispatch_mode=inline. Codex-only opt-in alternate to
235
- [workflow-state:in_progress]. The main session edits code directly
236
- instead of dispatching sub-agents. -->
228
+ <!-- 每轮面包屑:当 status='in_progress' 且 codex.dispatch_mode=inline 时显示。
229
+ Codex 的可选替代方案,对应 [workflow-state:in_progress]。主会话
230
+ 直接编辑代码而非分派子 agent。-->
237
231
 
238
232
  [workflow-state:in_progress-inline]
239
- Flow: `cviauto-before-dev` -> edit -> `cviauto-check` -> validation -> commit (Phase 3.4) -> `/cviauto:finish-work`. Run `cviauto-update-spec` only when the user explicitly asks to promote a lesson into spec.
240
- Do not dispatch implement/check sub-agents in inline mode.
241
- Read context: `prd.md` -> `design.md if present` -> `implement.md if present`, plus relevant spec/research loaded by skills.
233
+ 流程:`cviauto-before-dev` -> 编辑 -> `cviauto-check` -> 验证 -> 提交(Phase 3.4)-> `/cviauto:finish-work`。仅当用户明确要求将经验教训回写到 spec 时才运行 `cviauto-update-spec`。
234
+ inline 模式下不要分派 implement/check agent。
235
+ 读取上下文:`prd.md` -> `design.md if present` -> `implement.md if present`,加上 skill 加载的相关 spec/research
242
236
  [/workflow-state:in_progress-inline]
243
237
 
244
238
  ### Phase 3: Finish
245
- - 3.2 Debug retrospective `[on demand]`
246
- - 3.3 Spec update `[on demand]`
247
- - 3.4 Commit changes `[required · once]`
248
- - 3.5 Wrap-up reminder
239
+ - 3.2 调试回顾 `[on demand]`
240
+ - 3.3 Spec 更新 `[on demand]`
241
+ - 3.4 提交变更 `[required · once]`
242
+ - 3.5 收尾提醒
249
243
 
250
- > Note: step 3.1 was folded into 2.2 (last-iteration full-scope check) and 3.4 (commit preamble). Numbering kept stable to avoid breaking external references.
244
+ > 注意:步骤 3.1 已合并到 2.2(最后一次迭代的全范围检查)和 3.4(提交前言)。编号保持稳定以避免破坏外部引用。
251
245
 
252
- <!-- Per-turn breadcrumb: shown while status='completed'.
253
- Currently DEAD in normal flow: cmd_archive writes status='completed' in
254
- the same call that moves the task dir to archive/, so the active-task
255
- resolver loses the pointer and the hook never fires on archived tasks.
256
- Block preserved for a future status-transition redesign (e.g. an
257
- explicit in_progress→completed command). Edit through the same spec
258
- channel as the live blocks. -->
246
+ <!-- 每轮面包屑:当 status='completed' 时显示。
247
+ 目前在正常流程中为 DEADcmd_archive 在将任务目录移至 archive/
248
+ 同一调用中写入 status='completed',因此活跃任务解析器丢失了指针,
249
+ hook 永远不会在已归档任务上触发。保留此块用于未来的状态转换重新设计
250
+ (例如,显式的 in_progress→completed 命令)。通过相同的 spec
251
+ 渠道与活跃块一起编辑。-->
259
252
 
260
253
  [workflow-state:completed]
261
- Code committed. Run `/cviauto:finish-work`; if dirty, return to Phase 3.4 first.
254
+ 代码已提交。运行 `/cviauto:finish-work`;如果有未提交内容,先返回 Phase 3.4
262
255
  [/workflow-state:completed]
263
256
 
264
- ### Rules
257
+ ### 规则(Rules
265
258
 
266
- 1. Identify which Phase you're in, then continue from the next step there
267
- 2. Run steps in order inside each Phase; `[required]` steps can't be skipped
268
- 3. Phases can roll back (e.g., Execute reveals a prd defectreturn to Plan to fix, then re-enter Execute)
269
- 4. Steps tagged `[once]` are skipped if the output already exists; don't re-run
270
- 5. Artifact presence informs the next step; missing `design.md` / `implement.md` is valid for lightweight tasks and incomplete planning for complex tasks.
259
+ 1. 识别你所在的阶段,然后从该阶段的下一步继续
260
+ 2. 在每个阶段内按顺序运行步骤;`[required]` 步骤不能被跳过
261
+ 3. 阶段可以回滚(例如,Execute 发现 prd 缺陷返回 Plan 修复,然后重新进入 Execute
262
+ 4. 标记为 `[once]` 的步骤如果输出已存在则跳过;不要重新运行
263
+ 5. 产物存在性指导下一步;缺失 `design.md` / `implement.md` 对轻量任务是有效的,对复杂任务则是不完整的规划。
271
264
 
272
- ### Active Task Routing
265
+ ### 活跃任务路由(Active Task Routing
273
266
 
274
- When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
267
+ 当用户请求在活跃任务中匹配以下意图时,先路由,然后在需要时加载详细的阶段步骤。
275
268
 
276
269
  [Claude Code, OpenCode, codex-sub-agent]
277
270
 
278
- - Planning or unclear requirements -> `cviauto-brainstorm`.
279
- - `in_progress` implementation/check -> dispatch `cviauto-implement` / `cviauto-check`.
280
- - Repeated debugging -> `cviauto-break-loop`; spec updates -> `cviauto-update-spec`.
271
+ - 规划或需求不明确 -> `cviauto-brainstorm`。
272
+ - `in_progress` 实施/检查 -> 分派 `cviauto-implement` / `cviauto-check`。
273
+ - 反复调试 -> `cviauto-break-loop`;spec 更新 -> `cviauto-update-spec`。
281
274
 
282
275
  [/Claude Code, OpenCode, codex-sub-agent]
283
276
 
284
277
  [codex-inline]
285
278
 
286
- - Planning or unclear requirements -> `cviauto-brainstorm`.
287
- - Before editing -> `cviauto-before-dev`; after editing -> `cviauto-check`.
288
- - Repeated debugging -> `cviauto-break-loop`; spec updates -> `cviauto-update-spec`.
279
+ - 规划或需求不明确 -> `cviauto-brainstorm`。
280
+ - 编辑前 -> `cviauto-before-dev`;编辑后 -> `cviauto-check`。
281
+ - 反复调试 -> `cviauto-break-loop`;spec 更新 -> `cviauto-update-spec`。
289
282
 
290
283
  [/codex-inline]
291
284
 
292
- ### Guardrails
285
+ ### 护城河(Guardrails
293
286
 
294
- - Task creation approval is not implementation approval; implementation waits for `task.py start` after artifact review.
295
- - PRD-only is valid for lightweight tasks; complex tasks need `design.md` + `implement.md`.
296
- - Planning must be persisted to task artifacts; checks must run before reporting completion.
287
+ - 任务创建同意不等于实施同意;实施等待产物审查后的 `task.py start`。
288
+ - PRD 对轻量任务是有效的;复杂任务需要 `design.md` + `implement.md`。
289
+ - 规划必须持久化到任务产物中;检查必须在报告完成之前运行。
297
290
 
298
- ### Loading Step Detail
291
+ ### 加载步骤详情(Loading Step Detail
299
292
 
300
- At each step, run this to fetch detailed guidance:
293
+ 在每一步,运行以下命令获取详细指南:
301
294
 
302
295
  ```bash
303
296
  python3 ./.cviauto/scripts/get_context.py --mode phase --step <step>
304
- # e.g. python3 ./.cviauto/scripts/get_context.py --mode phase --step 1.1
297
+ # 例如 python3 ./.cviauto/scripts/get_context.py --mode phase --step 1.1
305
298
  ```
306
299
 
307
300
  ---
308
301
 
309
302
  ## Phase 1: Plan
310
303
 
311
- Goal: classify the request, get task-creation consent when a task is needed, and produce the planning artifacts required before implementation.
304
+ 目标:对请求进行分类,在需要任务时获取任务创建同意,并产出实施前所需的规划产物。
312
305
 
313
- #### 1.0 Create task `[required · once]`
306
+ #### 1.0 创建任务 `[required · once]`
314
307
 
315
- Create the task directory only after task-creation consent. The command sets status to `planning`, writes `task.json`, creates a default `prd.md`, and auto-targets the new task when session identity is available:
308
+ 仅在获得任务创建同意之后创建任务目录。该命令将 status 设置为 `planning`,写入 `task.json`,创建默认的 `prd.md`,并在会话身份可用时自动指向新任务:
316
309
 
317
310
  ```bash
318
311
  python3 ./.cviauto/scripts/task.py create "<task title>" --slug <name>
319
312
  ```
320
313
 
321
- `--slug` is the human-readable name only. Do **not** include the `MM-DD-` date prefix; `task.py create` adds that prefix automatically.
314
+ `--slug` 仅含人类可读的名称。**不要**包含 `MM-DD-` 日期前缀;`task.py create` 会自动添加该前缀。
322
315
 
323
- For task trees, create the parent task first and then create each child with `--parent <parent-dir>`. Do not start the parent just because children exist; start the child that owns the next independently verifiable deliverable.
316
+ 对于任务树,先创建父任务,然后使用 `--parent <parent-dir>` 创建每个子任务。不要因为子任务存在就启动父任务;启动拥有下一个可独立验证交付物的子任务。
324
317
 
325
- After this command succeeds, the per-turn breadcrumb auto-switches to `[workflow-state:planning]`, telling the AI to stay in planning.
318
+ 此命令成功后,每轮面包屑会自动切换到 `[workflow-state:planning]`,告知 AI 保持在规划阶段。
326
319
 
327
- Run only `create` here — do not also run `start`. `start` flips status to `in_progress`, which switches the breadcrumb to the implementation phase before planning artifacts are reviewed. Save `start` for step 1.4.
320
+ 此处只运行 `create`——不要同时运行 `start`。`start` 会将 status 翻转为 `in_progress`,这会在规划产物审查之前将面包屑切换到实施阶段。将 `start` 保留到步骤 1.4
328
321
 
329
- Skip when `python3 ./.cviauto/scripts/task.py current --source` already points to a task.
322
+ `python3 ./.cviauto/scripts/task.py current --source` 已经指向某个任务时跳过此步骤。
330
323
 
331
- #### 1.1 Requirement exploration `[required · repeatable]`
324
+ #### 1.1 需求探索 `[required · repeatable]`
332
325
 
333
- Load the `cviauto-brainstorm` skill and explore requirements interactively with the user per the skill's guidance.
326
+ 加载 `cviauto-brainstorm` skill,并根据该 skill 的指南与用户交互式地探讨需求。
334
327
 
335
- The brainstorm skill will guide you to:
336
- - Ask one question at a time
337
- - Prefer researching over asking the user
338
- - Prefer offering options over open-ended questions
339
- - Update `prd.md` immediately after each user answer
340
- - Split large scopes into a parent task plus child tasks when the deliverables can be verified independently
341
- - Keep `prd.md` focused on requirements and acceptance criteria
342
- - For complex tasks, produce `design.md` and `implement.md` before implementation starts
328
+ Brainstorm skill 将引导你:
329
+ - 一次只问一个问题
330
+ - 优先调研而非询问用户
331
+ - 优先提供选项而非开放式问题
332
+ - 在每次用户回答后立即更新 `prd.md`
333
+ - 当交付物可独立验证时,将大范围拆分为父任务加子任务
334
+ - 保持 `prd.md` 聚焦于需求和验收标准
335
+ - 对于复杂任务,在实施开始前产出 `design.md` `implement.md`
343
336
 
344
- When considering a parent/child split:
345
- - Use a parent task when one request contains several independently verifiable deliverables.
346
- - Parent tasks own source requirements, child-task mapping, cross-child acceptance criteria, and final integration review.
347
- - Child tasks own actual deliverables that can be planned, implemented, checked, and archived independently.
348
- - Parent/child structure is not a dependency system. If child B depends on child A, write that ordering in child B's `prd.md` / `implement.md`.
349
- - Start the child task that owns the next deliverable. Do not start the parent unless the parent itself has direct implementation work.
337
+ 当考虑父/子拆分时:
338
+ - 当一个请求包含多个可独立验证的交付物时使用父任务。
339
+ - 父任务拥有源需求、子任务映射、跨子任务验收标准和最终集成审查。
340
+ - 子任务拥有可独立规划、实施、检查和归档的实际交付物。
341
+ - 父/子结构不是依赖系统。如果子任务 B 依赖于子任务 A,将顺序写入子任务 B `prd.md` / `implement.md`。
342
+ - 启动拥有下一个交付物的子任务。除非父任务本身有直接的实施工作,否则不要启动父任务。
350
343
 
351
- Return to this step whenever requirements change and revise the relevant artifact.
344
+ 每当需求变更时返回此步骤,并修订相应的产物。
352
345
 
353
- #### 1.2 Research `[optional · repeatable]`
346
+ #### 1.2 调研 `[optional · repeatable]`
354
347
 
355
- Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
348
+ 调研可以在需求探索期间的任何时候进行。它不限于本地代码——你可以使用任何可用工具(MCP 服务器、skills、网络搜索等)查找外部信息,包括第三方库文档、行业实践、API 参考等。
356
349
 
357
350
  [Claude Code, OpenCode, codex-sub-agent]
358
351
 
359
- Spawn the research sub-agent:
352
+ 生成调研子 agent
360
353
 
361
- - **Agent type**: `cviauto-research`
362
- - **Task description**: Research <specific question>
363
- - **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
354
+ - **Agent 类型**:`cviauto-research`
355
+ - **任务描述**:调研 <具体问题>
356
+ - **关键要求**:调研输出必须持久化到 `{TASK_DIR}/research/`
364
357
 
365
358
  [/Claude Code, OpenCode, codex-sub-agent]
366
359
 
367
360
  [codex-inline]
368
361
 
369
- Do the research in the main session directly and write findings into `{TASK_DIR}/research/`. (For `codex-inline` this avoids the `fork_turns="none"` isolation that prevents `cviauto-research` sub-agents from resolving the active task path.)
362
+ 在主会话中直接进行调研,并将发现写入 `{TASK_DIR}/research/`。(对于 `codex-inline`,这样做避免了 `fork_turns="none"` 隔离,该隔离会阻止 `cviauto-research` agent 解析活跃任务路径。)
370
363
 
371
364
  [/codex-inline]
372
365
 
373
- **Research artifact conventions**:
374
- - One file per research topic (e.g. `research/auth-library-comparison.md`)
375
- - Record third-party library usage examples, API references, version constraints in files
376
- - Note relevant spec file paths you discovered for later reference
366
+ **调研产物规范**:
367
+ - 每个调研主题一个文件(例如 `research/auth-library-comparison.md`)
368
+ - 在文件中记录第三方库用法示例、API 参考、版本约束
369
+ - 记录你发现的未来可能有用的相关 spec 文件路径
377
370
 
378
- Brainstorm and research can interleave freely — pause to research a technical question, then return to talk with the user.
371
+ Brainstorm 和调研可以自由交错——暂停以调研一个技术问题,然后返回与用户交谈。
379
372
 
380
- **Key principle**: Research output must be written to files, not left only in the chat. Conversations get compacted; files don't.
373
+ **关键原则**:调研输出必须写入文件,而不仅仅是留在聊天中。对话可能被压缩;文件不会。
381
374
 
382
- #### 1.3 Configure context `[required · once]`
375
+ #### 1.3 配置上下文 `[required · once]`
383
376
 
384
377
  [Claude Code, OpenCode, codex-sub-agent]
385
378
 
386
- Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
379
+ 整理 `implement.jsonl` `check.jsonl`,使 Phase 2 agent 获得正确的 spec/research 上下文。这些文件在 `task create` 时以一行自描述的 `_example` 种子化;你此时的工作是填入真实的条目。
387
380
 
388
- **Location**: `{TASK_DIR}/implement.jsonl` and `{TASK_DIR}/check.jsonl` (already exist).
381
+ **位置**:`{TASK_DIR}/implement.jsonl` `{TASK_DIR}/check.jsonl`(已经存在)。
389
382
 
390
- **Format**: one JSON object per line — `{"file": "<path>", "reason": "<why>"}`. Paths are repo-root relative.
383
+ **格式**:每行一个 JSON 对象——`{"file": "<path>", "reason": "<why>"}`。路径是仓库根目录的相对路径。
391
384
 
392
- **What to put in**:
393
- - **Spec files** — `.cviauto/spec/<package>/<layer>/index.md` and any specific guideline files (`error-handling.md`, `conventions.md`, etc.) relevant to this task
394
- - **Research files** `{TASK_DIR}/research/*.md` that the sub-agent will need to consult
385
+ **应该放入什么**:
386
+ - **Spec 文件**——`.cviauto/spec/<package>/<layer>/index.md` 以及与此任务相关的任何特定指南文件(`error-handling.md`、`conventions.md` 等)
387
+ - **调研文件**——子 agent 将需要查阅的 `{TASK_DIR}/research/*.md`
395
388
 
396
- **What NOT to put in**:
397
- - Code files (`src/**`, `packages/**/*.ts`, etc.) — those are read by the sub-agent during implementation, not pre-registered here
398
- - Files you're about to modify — same reason
389
+ **不应该放入什么**:
390
+ - 代码文件(`src/**`、`packages/**/*.ts` 等)——这些由子 agent 在实施期间读取,而非在此预注册
391
+ - 你即将修改的文件——同理
399
392
 
400
- **Split between the two files**:
401
- - `implement.jsonl` → specs + research the implement sub-agent needs to write code correctly
402
- - `check.jsonl` → specs for the check sub-agent (quality guidelines, check conventions, same research if needed)
393
+ **在两个文件之间拆分**:
394
+ - `implement.jsonl` → 实施子 agent 正确编写代码所需的 spec + research
395
+ - `check.jsonl` → 检查子 agent spec(质量指南、检查规范,如果需要,相同的 research 也应放入)
403
396
 
404
- These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
397
+ 这些清单不替代 `implement.md`。`implement.md` 是复杂任务的人类可读执行计划;jsonl 文件仅列出要注入或加载的上下文文件。
405
398
 
406
- **How to discover relevant specs**:
399
+ **如何发现相关 spec**:
407
400
 
408
401
  ```bash
409
402
  python3 ./.cviauto/scripts/get_context.py --mode packages
410
403
  ```
411
404
 
412
- Lists every package + its spec layers with paths. Pick the entries that match this task's domain.
405
+ 列出每个包及其 spec 层及路径。选择与此任务领域匹配的条目。
413
406
 
414
- **How to append entries**:
407
+ **如何追加条目**:
415
408
 
416
- Either edit the jsonl file directly in your editor, or use:
409
+ 可以直接在编辑器中编辑 jsonl 文件,或使用:
417
410
 
418
411
  ```bash
419
412
  python3 ./.cviauto/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
420
413
  python3 ./.cviauto/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
421
414
  ```
422
415
 
423
- Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
416
+ 一旦有真实条目存在,删除种子 `_example` 行(可选——消费者会自动跳过它)。
424
417
 
425
- Ready gate: both `implement.jsonl` and `check.jsonl` must contain at least one real `{"file": "...", "reason": "..."}` entry before `task.py start`. The seed `_example` row alone is not ready.
418
+ 就绪门禁:`task.py start` 之前,`implement.jsonl` `check.jsonl` 必须各包含至少一条真实的 `{"file": "...", "reason": "..."}` 条目。只有种子 `_example` 行不算就绪。
426
419
 
427
- Skip this step only when both files already have real curated entries.
420
+ 仅当两个文件都已包含真实整理条目时才跳过此步骤。
428
421
 
429
422
  [/Claude Code, OpenCode, codex-sub-agent]
430
423
 
431
424
  [codex-inline]
432
425
 
433
- Skip this step. Context is loaded directly by the `cviauto-before-dev` skill in Phase 2.
426
+ 跳过此步骤。上下文由 `cviauto-before-dev` skill Phase 2 中直接加载。
434
427
 
435
428
  [/codex-inline]
436
429
 
437
- #### 1.4 Activate task `[required · once]`
430
+ #### 1.4 激活任务 `[required · once]`
438
431
 
439
- After artifact review, flip the task status to `in_progress`:
432
+ 在产物审查之后,将任务状态翻转为 `in_progress`:
440
433
 
441
434
  ```bash
442
435
  python3 ./.cviauto/scripts/task.py start <task-dir>
443
436
  ```
444
437
 
445
- For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-dispatch platforms, `implement.jsonl` and `check.jsonl` must both have real curated entries before start. Runtime consumers tolerate missing or seed-only manifests for compatibility, but that tolerance is not a planning-ready state.
438
+ 对于轻量任务,`prd.md` 可能就足够。对于复杂任务,`prd.md`、`design.md` `implement.md` 必须在 start 之前存在并已审查。在子 agent 分派平台上,`implement.jsonl` `check.jsonl` 必须在 start 之前均包含真实的整理条目。运行时消费者为兼容性会容忍缺失或仅有种子条的清单,但这种容忍并不等于规划就绪状态。
446
439
 
447
- After this command succeeds, the breadcrumb auto-switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
440
+ 此命令成功后,面包屑自动切换到 `[workflow-state:in_progress]`,Phase 2 / 3 的其余部分随即开始。
448
441
 
449
- If `task.py start` errors with a session-identity message (no context key from hook input, `TRELLIS_CONTEXT_ID`, or platform-native session env), follow the hint in the error to set up session identity, then retry.
442
+ 如果 `task.py start` 报错会话身份消息(没有来自 hook 输入、`TRELLIS_CONTEXT_ID` 或平台原生会话环境变量的 context key),按照错误提示设置会话身份,然后重试。
450
443
 
451
- #### 1.5 Completion criteria
444
+ #### 1.5 完成标准
452
445
 
453
- | Condition | Required |
446
+ | 条件(Condition | 必需(Required |
454
447
  |------|:---:|
455
- | `prd.md` exists | ✅ |
456
- | User confirms task should enter implementation | ✅ |
457
- | `task.py start` has been run (status = in_progress) | ✅ |
458
- | `research/` has artifacts (complex tasks) | recommended |
459
- | `design.md` exists (complex tasks) | ✅ |
460
- | `implement.md` exists (complex tasks) | ✅ |
448
+ | `prd.md` 存在 | ✅ |
449
+ | 用户确认任务应进入实施 | ✅ |
450
+ | `task.py start` 已运行(status = in_progress | ✅ |
451
+ | `research/` 有产物(复杂任务) | 推荐 |
452
+ | `design.md` 存在(复杂任务) | ✅ |
453
+ | `implement.md` 存在(复杂任务) | ✅ |
461
454
 
462
455
  [Claude Code, OpenCode, codex-sub-agent]
463
456
 
464
- | `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | ✅ |
457
+ | `implement.jsonl` `check.jsonl` 各包含至少一条真实整理条目(种子行不算) | ✅ |
465
458
 
466
459
  [/Claude Code, OpenCode, codex-sub-agent]
467
460
 
@@ -469,138 +462,138 @@ If `task.py start` errors with a session-identity message (no context key from h
469
462
 
470
463
  ## Phase 2: Execute
471
464
 
472
- Goal: turn reviewed planning artifacts into code that passes quality checks.
465
+ 目标:将已审查的规划产物转化为通过质量检查的代码。
473
466
 
474
- #### 2.1 Implement `[required · repeatable]`
467
+ #### 2.1 实施 `[required · repeatable]`
475
468
 
476
469
  [Claude Code, OpenCode, Pi]
477
470
 
478
- Spawn the implement sub-agent:
471
+ 生成实施子 agent
479
472
 
480
- - **Agent type**: `cviauto-implement`
481
- - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
482
- - **Dispatch prompt guard**: Tell the spawned agent it is already the `cviauto-implement` sub-agent and must implement directly, not spawn another `cviauto-implement` / `cviauto-check`.
473
+ - **Agent 类型**:`cviauto-implement`
474
+ - **任务描述**:实施已审查的任务产物,查阅 `{TASK_DIR}/research/` 下的资料;完成时运行项目 lint type-check
475
+ - **分派 prompt 守卫**:告知生成的 agent 它已经是 `cviauto-implement` agent,必须直接实施,不得生成另一个 `cviauto-implement` / `cviauto-check`。
483
476
 
484
- The platform hook/plugin auto-handles:
485
- - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
486
- - Injects `prd.md`, `design.md` if present, and `implement.md` if present
477
+ 平台 hook/plugin 自动处理:
478
+ - 读取 `implement.jsonl` 并将引用的 spec/research 文件注入到 agent prompt
479
+ - 注入 `prd.md`、`design.md`(如存在)和 `implement.md`(如存在)
487
480
 
488
481
  [/Claude Code, OpenCode, Pi]
489
482
 
490
483
  [codex-sub-agent]
491
484
 
492
- Spawn the implement sub-agent:
485
+ 生成实施子 agent
493
486
 
494
- - **Agent type**: `cviauto-implement`
495
- - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
496
- - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then explicitly say the spawned agent is already `cviauto-implement` and must implement directly without spawning another `cviauto-implement` / `cviauto-check`.
487
+ - **Agent 类型**:`cviauto-implement`
488
+ - **任务描述**:实施已审查的任务产物,查阅 `{TASK_DIR}/research/` 下的资料;完成时运行项目 lint type-check
489
+ - **分派 prompt 守卫**:Prompt 必须以 `Active task: <task path>` 开头,然后明确说明生成的 agent 已经是 `cviauto-implement`,必须直接实施,不得生成另一个 `cviauto-implement` / `cviauto-check`。
497
490
 
498
- The pull-based sub-agent definition auto-handles the context load requirement:
499
- - Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
500
- - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
491
+ Codex agent 定义自动处理上下文加载要求:
492
+ - 使用 `task.py current --source` 解析活跃任务,然后读取 `prd.md`、`design.md`(如存在)和 `implement.md`(如存在)
493
+ - 读取 `implement.jsonl` 并要求 agent 在编码之前加载每个引用的 spec/research 文件
501
494
 
502
495
  [/codex-sub-agent]
503
496
 
504
497
  [codex-inline]
505
498
 
506
- 1. Load the `cviauto-before-dev` skill to read project guidelines
507
- 2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
508
- 3. Consult materials under `{TASK_DIR}/research/`
509
- 4. Implement the code per reviewed artifacts
510
- 5. Run project lint and type-check
499
+ 1. 加载 `cviauto-before-dev` skill 以读取项目指南
500
+ 2. 读取 `{TASK_DIR}/prd.md`,然后是 `design.md`(如存在),然后是 `implement.md`(如存在)
501
+ 3. 查阅 `{TASK_DIR}/research/` 下的资料
502
+ 4. 按照已审查的产物实施代码
503
+ 5. 运行项目 lint type-check
511
504
 
512
505
  [/codex-inline]
513
506
 
514
- #### 2.2 Quality check `[required · repeatable]`
507
+ #### 2.2 质量检查 `[required · repeatable]`
515
508
 
516
509
  [Claude Code, OpenCode, Pi, codex-sub-agent]
517
510
 
518
- Spawn the check sub-agent:
511
+ 生成检查子 agent
519
512
 
520
- - **Agent type**: `cviauto-check`
521
- - **Task description**: Review all code changes against specs and task artifacts; fix any findings directly; ensure lint and type-check pass
522
- - **Dispatch prompt guard**: Tell the spawned agent it is already the `cviauto-check` sub-agent and must review/fix directly, not spawn another `cviauto-check` / `cviauto-implement`.
513
+ - **Agent 类型**:`cviauto-check`
514
+ - **任务描述**:对照 spec 和任务产物审查所有代码变更;直接修复任何发现;确保 lint type-check 通过
515
+ - **分派 prompt 守卫**:告知生成的 agent 它已经是 `cviauto-check` agent,必须直接审查/修复,不得生成另一个 `cviauto-check` / `cviauto-implement`。
523
516
 
524
- The check agent's job:
525
- - Review code changes against specs
526
- - Review code changes against `prd.md`, `design.md` if present, and `implement.md` if present
527
- - Auto-fix issues it finds
528
- - Run lint and typecheck to verify
517
+ 检查 agent 的工作:
518
+ - 对照 spec 审查代码变更
519
+ - 对照 `prd.md`、`design.md`(如存在)和 `implement.md`(如存在)审查代码变更
520
+ - 自动修复其发现的问题
521
+ - 运行 lint typecheck 进行验证
529
522
 
530
523
  [/Claude Code, OpenCode, Pi, codex-sub-agent]
531
524
 
532
525
  [codex-inline]
533
526
 
534
- Load the `cviauto-check` skill and verify the code per its guidance:
535
- - Spec compliance
527
+ 加载 `cviauto-check` skill 并按其指南验证代码:
528
+ - Spec 合规性
536
529
  - lint / type-check / tests
537
- - Cross-layer consistency (when changes span layers)
530
+ - 跨层一致性(当变更跨越多个层时)
538
531
 
539
- If issues are found fixre-check, until green.
532
+ 如果发现问题修复重新检查,直到通过。
540
533
 
541
534
  [/codex-inline]
542
535
 
543
- **Final pass (before Phase 3.4 commit)**: the last 2.2 of a task must run full-scope, not just on the latest implement chunk. List all affected packages with `python3 ./.cviauto/scripts/get_context.py --mode packages`, then load each package's spec index Quality Check section. This catches cross-layer / multi-package issues a mid-iteration local 2.2 cannot.
536
+ **最后一轮(Phase 3.4 提交之前)**:任务的最后一次 2.2 必须运行全范围检查,而不仅仅针对最新的实施块。使用 `python3 ./.cviauto/scripts/get_context.py --mode packages` 列出所有受影响的包,然后加载每个包 spec 索引中的 Quality Check 部分。这能捕获中间迭代本地 2.2 无法发现的跨层/多包问题。
544
537
 
545
- #### 2.3 Rollback `[on demand]`
538
+ #### 2.3 回滚 `[on demand]`
546
539
 
547
- - `check` reveals a prd defectreturn to Phase 1, fix `prd.md`, then redo 2.1
548
- - Implementation went wrong revert code, redo 2.1
549
- - Need more research research (same as Phase 1.2), write findings into `research/`
540
+ - `check` 发现 prd 缺陷返回 Phase 1,修复 `prd.md`,然后重新执行 2.1
541
+ - 实施方向错误撤销代码,重新执行 2.1
542
+ - 需要更多调研调研(与 Phase 1.2 相同),将发现写入 `research/`
550
543
 
551
544
  ---
552
545
 
553
546
  ## Phase 3: Finish
554
547
 
555
- Goal: ensure code quality, capture lessons, record the work.
548
+ 目标:确保代码质量,捕获经验教训,记录工作。
556
549
 
557
- #### 3.2 Debug retrospective `[on demand]`
550
+ #### 3.2 调试回顾 `[on demand]`
558
551
 
559
- If this task involved repeated debugging (the same issue was fixed multiple times), load the `cviauto-break-loop` skill to:
560
- - Classify the root cause
561
- - Explain why earlier fixes failed
562
- - Propose prevention
552
+ 如果此任务涉及反复调试(同一个问题多次修复),加载 `cviauto-break-loop` skill 以:
553
+ - 分类根本原因
554
+ - 解释为什么之前的修复失败了
555
+ - 提出预防措施
563
556
 
564
- The goal is to capture debugging lessons so the same class of issue doesn't recur.
557
+ 目标是捕获调试经验,使同类问题不再发生。
565
558
 
566
- #### 3.3 Spec update `[on demand]`
559
+ #### 3.3 Spec 更新 `[on demand]`
567
560
 
568
- Run this step only when the user explicitly asks to promote current-session knowledge into `.cviauto/spec/`, for example "沉淀当前对话中关于某功能为 spec" or "update spec with this rule".
561
+ 仅当用户明确要求将当前会话的知识回写到 `.cviauto/spec/` 时才运行此步骤,例如"沉淀当前对话中关于某功能为 spec""update spec with this rule"
569
562
 
570
- Load the `cviauto-update-spec` skill and prepare a proposal before writing anything:
571
- - Newly discovered patterns or conventions
572
- - Pitfalls you hit
573
- - New technical decisions
563
+ 加载 `cviauto-update-spec` skill,在写任何内容之前准备一个方案:
564
+ - 新发现的模式或规范
565
+ - 你遇到的陷阱
566
+ - 新的技术决策
574
567
 
575
- Report the proposed target file, exact rule to add, and why it is reusable. Write the docs under `.cviauto/spec/` only after the user confirms the proposal. If the user did not ask for spec promotion, skip this step entirely.
568
+ 报告建议的目标文件、要添加的确切规则以及为什么它是可复用的。仅在用户确认方案后才写入 `.cviauto/spec/` 下的文档。如果用户没有要求 spec 回写,完全跳过此步骤。
576
569
 
577
- #### 3.4 Commit changes `[required · once]`
570
+ #### 3.4 提交变更 `[required · once]`
578
571
 
579
- **Spec-sync preamble**: if the user explicitly asked to promote knowledge into `.cviauto/spec/`, complete Phase 3.3 before drafting commits. Otherwise do not run `cviauto-update-spec`; spec promotion is human-gated and optional.
572
+ **Spec 同步前言**:如果用户明确要求将知识回写到 `.cviauto/spec/`,先完成 Phase 3.3 然后再起草提交。否则,不要运行 `cviauto-update-spec`;spec 回写是人为门控且可选的。
580
573
 
581
- The AI drives a batched commit of this task's code changes so `/finish-work` can run cleanly afterwards. Goal: produce the meaningful work commits first. Task archive and journal records are local Cviauto bookkeeping by default and should not be mixed into work commits.
574
+ AI 驱动此任务代码变更的批量提交,使 `/finish-work` 之后可以干净地运行。目标:先产出有意义的工作提交。任务归档和日志记录默认是本地的 Cviauto 记账操作,不应混入工作提交中。
582
575
 
583
- **Step-by-step**:
576
+ **分步操作**:
584
577
 
585
- 1. **Inspect dirty state**:
578
+ 1. **检查脏状态**:
586
579
  ```bash
587
580
  git status --porcelain
588
581
  ```
589
- Snapshot every dirty path. If the working tree is clean, skip to 3.5.
582
+ 快照每个脏路径。如果工作树是干净的,跳到 3.5
590
583
 
591
- 2. **Learn commit style** from recent history (so drafted messages blend in):
584
+ 2. **从近期的提交历史中学习提交风格**(使起草的提交信息融入其中):
592
585
  ```bash
593
586
  git log --oneline -5
594
587
  ```
595
- Note the prefix convention (`feat:` / `fix:` / `chore:` / `docs:` ...), language (中文/English), and length style.
588
+ 注意前缀规范(`feat:` / `fix:` / `chore:` / `docs:` ……)、语言(中文/English)和长度风格。
596
589
 
597
- 3. **Classify dirty files into two groups**:
598
- - **AI-edited this session** — files you wrote/edited via Edit/Write/Bash tool calls in this session. You know what changed and why.
599
- - **Unrecognized** — dirty files you did NOT touch this session (could be the user's manual edits, leftover WIP from a previous session, or unrelated work). Do NOT silently include these.
590
+ 3. **将脏文件分为两组**:
591
+ - **本会话 AI 编辑的**——你在此会话中通过 Edit/Write/Bash 工具调用编写/编辑的文件。你知道变更了什么以及为什么。
592
+ - **未识别的**——你在此会话中未触碰的脏文件(可能是用户的手动编辑、前一会话遗留的 WIP 或无关工作)。不要静默包含这些文件。
600
593
 
601
- 4. **Draft a commit plan**. Group AI-edited files into logical commits (1 commit per coherent change unit, not 1 commit per file). Each entry: `<commit message>` + file list. List unrecognized files separately at the bottom.
594
+ 4. **起草提交计划**。将 AI 编辑的文件分组为逻辑提交(每个连贯变更单元一个提交,而非每个文件一个提交)。每个条目:`<提交信息(commit message)>`+ 文件列表。将未识别的文件单独列在底部。
602
595
 
603
- 5. **Present the plan once, ask for one-shot confirmation**. Format:
596
+ 5. **一次性展示计划,请求一次性确认**。格式:
604
597
  ```
605
598
  Proposed commits (in order):
606
599
  1. <message>
@@ -616,51 +609,51 @@ The AI drives a batched commit of this task's code changes so `/finish-work` can
616
609
  Reply 'ok' / '行' to execute. Reply with edits, or '我自己来' / 'manual' to abort.
617
610
  ```
618
611
 
619
- 6. **On confirmation**: run `git add <files>` + `git commit -m "<msg>"` for each batch in order. Do not amend. Do not push.
612
+ 6. **确认后**:按顺序为每个批次运行 `git add <files>` + `git commit -m "<msg>"`。不要使用 amend。不要推送。
620
613
 
621
- 7. **On rejection** (user replies "不行" / "我自己来" / "manual" / any pushback on the plan): stop. Do not attempt a second plan. The user will commit by hand; you skip ahead to 3.5 once they confirm.
614
+ 7. **拒绝后**(用户回复"不行" / "我自己来" / "manual" / 对计划的任何反对):停止。不要尝试第二个方案。用户将手动提交;一旦他们确认,你跳到 3.5
622
615
 
623
- **Rules**:
624
- - No `git commit --amend` anywhere. Work commits are the meaningful git history; finish-work writes local archive/journal records by default.
625
- - Never push to remote in this step.
626
- - If the user wants different message wording but accepts the file grouping, edit the message and re-confirm once — but if they reject the grouping, exit to manual mode.
627
- - The batched plan is one prompt; do not prompt per commit.
616
+ **规则**:
617
+ - 任何地方都不要使用 `git commit --amend`。工作提交是有意义的 git 历史;finish-work 默认写入本地归档/日志记录。
618
+ - 在此步骤中绝不推送到远程。
619
+ - 如果用户想要不同的提交信息措辞但接受文件分组,编辑信息并再次确认一次——但如果他们拒绝分组,则退出到手动模式。
620
+ - 批量方案是一次性提示;不要每个提交都提示一次。
628
621
 
629
- #### 3.5 Wrap-up reminder
622
+ #### 3.5 收尾提醒
630
623
 
631
- After the above, remind the user they can run `/finish-work` to wrap up (archive the task and record the session locally). If they want to promote a lesson into spec, they should say so explicitly when invoking finish-work.
624
+ 在上述步骤之后,提醒用户可以运行 `/finish-work` 来收尾(归档任务并在本地记录会话)。如果他们想要将经验教训回写到 spec,他们应在调用 finish-work 时明确说明。
632
625
 
633
626
  ---
634
627
 
635
- ## Customizing Cviauto (for forks)
628
+ ## 自定义 Cviauto(面向 Fork 开发者)
636
629
 
637
- This section is for developers who want to modify the Cviauto workflow itself. All customization is done by editing this file; the scripts are parsers only.
630
+ 本节面向想要修改 Cviauto 工作流本身的开发者。所有自定义都是通过编辑此文件完成的;脚本只是解析器。
638
631
 
639
- ### Changing what a step means
632
+ ### 更改某个步骤的含义
640
633
 
641
- Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. Critical invariants:
642
- - No active task must triage first and ask for task-creation consent before creating a Cviauto task.
643
- - Planning must distinguish lightweight PRD-only tasks from complex tasks that require `prd.md`, `design.md`, and `implement.md` before start.
644
- - Every required execution path must keep the Phase 3.4 commit reminder reachable before `/cviauto:finish-work`.
634
+ 编辑上文 Phase 1 / 2 / 3 章节中对应步骤的演练正文。关键约束:
635
+ - 没有活跃任务时必须先进行分类,并在创建 Cviauto 任务之前请求任务创建同意。
636
+ - 规划必须区分轻量仅 PRD 任务和在 start 之前需要 `prd.md`、`design.md` `implement.md` 的复杂任务。
637
+ - 每个必需的执行路径必须保持 Phase 3.4 提交提醒在 `/cviauto:finish-work` 之前可达。
645
638
 
646
- All tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
639
+ 所有标记块位于上方 `## Phase Index` 章节中,紧接在每个阶段摘要之后:
647
640
 
648
- | Scope | Corresponding tag |
641
+ | 范围(Scope | 对应标记 |
649
642
  |---|---|
650
- | No active task (before Phase 1) | `[workflow-state:no_task]` (after the Phase Index ASCII art) |
651
- | All of Phase 1 (task created ready for implementation) | `[workflow-state:planning]` (after Phase 1 summary) |
643
+ | 没有活跃任务(Phase 1 之前) | `[workflow-state:no_task]`(在 Phase Index ASCII 图之后) |
644
+ | 整个 Phase 1(任务已创建准备就绪可实施) | `[workflow-state:planning]`(在 Phase 1 摘要之后) |
652
645
  | Codex inline Phase 1 | `[workflow-state:planning-inline]` |
653
- | Phase 2 + Phase 3.2–3.4 (implementation + check + wrap-up) | `[workflow-state:in_progress]` (after Phase 2 summary) |
646
+ | Phase 2 + Phase 3.2–3.4(实施 + 检查 + 收尾) | `[workflow-state:in_progress]`(在 Phase 2 摘要之后) |
654
647
  | Codex inline Phase 2 + Phase 3.2–3.4 | `[workflow-state:in_progress-inline]` |
655
- | After Phase 3.5 (archived) | `[workflow-state:completed]` (after Phase 3 summary; **currently DEAD**) |
648
+ | Phase 3.5 之后(已归档) | `[workflow-state:completed]`(在 Phase 3 摘要之后;**当前为 DEAD**) |
656
649
 
657
- ### Changing the per-turn prompt text
650
+ ### 更改每轮提示文本
658
651
 
659
- Directly edit the body of the corresponding `[workflow-state:STATUS]` block. After editing, run `cviauto update` (if you're a template maintainer) or restart your AI session (if you're customizing your own project) — no script changes required.
652
+ 直接编辑对应 `[workflow-state:STATUS]` 块的正文。编辑后,运行 `cviauto update`(如果你是模板维护者)或重启你的 AI 会话(如果你在自定义自己的项目)——无需脚本变更。
660
653
 
661
- ### Adding a custom status
654
+ ### 添加自定义状态
662
655
 
663
- Add a new block:
656
+ 添加一个新块:
664
657
 
665
658
  ```
666
659
  [workflow-state:my-status]
@@ -668,14 +661,14 @@ your per-turn prompt text
668
661
  [/workflow-state:my-status]
669
662
  ```
670
663
 
671
- Constraints:
672
- - STATUS charset: `[A-Za-z0-9_-]+` (underscores and hyphens allowed, e.g. `in-review`, `blocked-by-team`)
673
- - A lifecycle hook must write `task.json.status` to your custom value, otherwise the tag is never read
674
- - Lifecycle hooks live in `task.json.hooks.after_*` and bind to one of `after_create / after_start / after_finish / after_archive`
664
+ 约束:
665
+ - STATUS 字符集:`[A-Za-z0-9_-]+`(允许下划线和连字符,例如 `in-review`、`blocked-by-team`)
666
+ - 一个生命周期 hook 必须将 `task.json.status` 写入你的自定义值,否则该标记永远不会被读取
667
+ - 生命周期 hooks 位于 `task.json.hooks.after_*`,绑定到 `after_create / after_start / after_finish / after_archive` 之一
675
668
 
676
- ### Adding a lifecycle hook
669
+ ### 添加生命周期 hook
677
670
 
678
- Add a `hooks` field to your `task.json`:
671
+ 向你的 `task.json` 添加 `hooks` 字段:
679
672
 
680
673
  ```json
681
674
  {
@@ -687,11 +680,11 @@ Add a `hooks` field to your `task.json`:
687
680
  }
688
681
  ```
689
682
 
690
- Supported events: `after_create / after_start / after_finish / after_archive`. Note that `after_finish` ≠ a status change (it only clears the active-task pointer); use `after_archive` for "task is done" notifications.
683
+ 支持的事件:`after_create / after_start / after_finish / after_archive`。注意 `after_finish` ≠ 状态变更(它仅清除活跃任务指针);使用 `after_archive` 用于"任务已完成"的通知。
691
684
 
692
- ### Full contract
685
+ ### 完整契约
693
686
 
694
- For the workflow state machine's runtime contract, the locations of all status writers, pseudo-statuses (`no_task` / `stale_<source_type>`), the hook reachability matrix, and other deep details, see:
687
+ 有关工作流状态机的运行时契约、所有状态写入器的位置、伪状态(`no_task` / `stale_<source_type>`)、hook 可达性矩阵以及其他深层细节,请参见:
695
688
 
696
- - `.cviauto/spec/cli/backend/workflow-state-contract.md` — runtime contract + writer table + test invariants
697
- - `.cviauto/scripts/inject-workflow-state.py` — actual parser (reads workflow.md only, no embedded text)
689
+ - `.cviauto/spec/cli/backend/workflow-state-contract.md`——运行时契约 + 写入器表 + 测试不变量
690
+ - `.cviauto/scripts/inject-workflow-state.py`——实际解析器(仅读取 workflow.md,无嵌入文本)