@wnlen/agent-execution-template 0.8.19 → 0.8.21

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.
@@ -44,7 +44,7 @@ runtime files, result files, or metrics files during bootstrap.
44
44
 
45
45
  Read high-signal project evidence in this order:
46
46
 
47
- 1. Root docs: `README*`, `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING*`, `CHANGELOG*`
47
+ 1. Root docs: `README*`, `CONTRIBUTING*`, `CHANGELOG*`
48
48
  2. Manifests: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`,
49
49
  `pom.xml`, `build.gradle*`, `Makefile`
50
50
  3. Project docs: `docs/**`, preferring overview, architecture, setup, testing,
@@ -62,6 +62,9 @@ bounded read:
62
62
  project purpose, module boundaries, commands, and constraints;
63
63
  - do not read the whole codebase unless the human explicitly authorizes it.
64
64
 
65
+ Do not treat `AGENTS.md` or `CLAUDE.md` as project business evidence; they are
66
+ AI entrypoint routing files only.
67
+
65
68
  Do not read dependency folders, build outputs, coverage outputs, lockfiles
66
69
  except to infer package manager, secret files, environment files, or archives
67
70
  unless the human explicitly references them.
@@ -121,6 +121,11 @@ verification was not possible. A purely subjective Green is not valid.
121
121
 
122
122
  ## User-Visible Output
123
123
 
124
+ - Use the installed template language by default. When `ai/template/LANG` is
125
+ `en`, user-visible plans, L1 checklists, checkpoints, task draft handoffs,
126
+ blocked explanations, and final results should default to English. Use another
127
+ language only when the human explicitly asks, or when preserving code,
128
+ commands, file paths, or protocol field names.
124
129
  - Show the L1 checklist by default; do not show full L2/L3/L4 by default.
125
130
  - Show risk conclusions and necessary reasons; do not output long internal reasoning.
126
131
  - Show evidence; do not show internal protocol fields, full YAML,
@@ -5,23 +5,25 @@ Execute the workflow below.
5
5
 
6
6
  You are operating inside an Agent Execution Template workspace.
7
7
 
8
- First read:
8
+ This file only routes the workflow. First read minimal state:
9
9
 
10
- 1. `ai/template/protocol.md`
11
- 2. `ai/template/rules/core.md`
12
- 3. `ai/template/execution-policy.md`
10
+ 1. `ai/project/project.md` if present
11
+ 2. `ai/project/task.md` if present
12
+ 3. Shallow listings of `ai/project/inbox/`, `ai/project/inbox/ideas/`, and `ai/project/proposals/final-shape-updates/`
13
13
 
14
14
  Then choose the mode:
15
15
 
16
16
  - If the user asks to update the North Star, final shape, product constitution,
17
17
  module map, roadmap, or project direction, or if
18
18
  `ai/project/inbox/ideas/` contains non-`.gitkeep` ideas waiting for
19
- evaluation, draft a `strategy_update` task or produce the proposal directly,
20
- then stop for human confirmation.
19
+ evaluation, read `ai/template/protocol.md`, `ai/template/rules/core.md`, and
20
+ relevant direction refs, then draft a `strategy_update` task or produce the
21
+ proposal directly, then stop for human confirmation.
21
22
  - If the user explicitly confirms that a proposal under
22
23
  `ai/project/proposals/final-shape-updates/*.md` may be merged, draft or
23
- execute an `apply_strategy_update` task. If the proposal is still
24
- `proposed`, update it to `accepted` based on that explicit confirmation.
24
+ execute an `apply_strategy_update` task after reading
25
+ `ai/template/protocol.md` and `ai/template/rules/core.md`. If the proposal is
26
+ still `proposed`, update it to `accepted` based on that explicit confirmation.
25
27
  - If the user says "Start initializing this project and absorb the material in ai/project/inbox/",
26
28
  or asks to initialize while also absorbing material from
27
29
  `ai/project/inbox/`, inspect `ai/project/project.md` first. If it already
@@ -54,7 +56,8 @@ Then choose the mode:
54
56
  the human hunt through files for gaps.
55
57
  - Use Execution Mode only after `ai/project/project.md` and
56
58
  `ai/project/task.md` are ready enough to define identity, goal, scope,
57
- permission, and acceptance.
59
+ permission, and acceptance. Only then read `ai/template/protocol.md`,
60
+ `ai/template/rules/core.md`, and `ai/template/execution-policy.md`.
58
61
 
59
62
  ## Task Draft Handoff
60
63
 
@@ -5,12 +5,18 @@ execution context.
5
5
 
6
6
  ```text
7
7
  ai/template/ = reusable execution protocol
8
- ai/project/ = current project execution workspace
8
+ ai/project/ = current repo execution context
9
9
  ```
10
10
 
11
- Template is protocol. Project is the field workspace.
11
+ Template is protocol. Project is repo-local context.
12
12
 
13
- The project workspace stores both execution state and direction. The direction
13
+ Here, "repo execution context" means the repo-local `ai/project/**` context,
14
+ not an external workspace / session / sandbox runtime. An external
15
+ runtime may enter the repository and read this protocol, but should not replace
16
+ `task.md`, file modification rules, acceptance criteria, or concrete coding
17
+ context.
18
+
19
+ The repo-local context stores both execution state and direction. The direction
14
20
  layer answers "why is this worth doing and where should the project grow"; the
15
21
  execution layer answers "what is this task and how will it be accepted."
16
22
 
@@ -25,7 +25,10 @@ verification, assumptions, issues, next steps, and runtime update proposals.
25
25
 
26
26
  ## Result Markdown
27
27
 
28
- `ai/project/result.md` is the human-readable summary. Keep it short:
28
+ `ai/project/result.md` is the human-readable summary. Keep it short and use the
29
+ installed language from `ai/template/LANG` by default. In the English template,
30
+ headings and prose should default to English; preserve code, commands, file
31
+ paths, and protocol field names as written.
29
32
 
30
33
  ```md
31
34
  ## Status
@@ -7,6 +7,8 @@ template 是协议
7
7
  project 是现场工作区
8
8
  ```
9
9
 
10
+ 这里的 `project` 是仓库内 `ai/project/**` 的项目现场,不是外部 workspace、session 或 sandbox 运行时。
11
+
10
12
  ## 文件
11
13
 
12
14
  - `template/prompt.md`:AI 启动提示。
@@ -3,15 +3,15 @@
3
3
  ## 当前状态
4
4
 
5
5
  - 阶段:方向层与执行层一致性收口
6
- - 重点:保持文件协议可安装、可升级、可审计,并让项目方向治理与任务执行约束一致。
6
+ - 重点:保持协议可安装、可升级、可审计,并让方向治理与执行约束一致。
7
7
  - 阻塞:无
8
8
  - 已知风险:
9
9
  - 超出当前任务范围
10
- - 询问人类那些 Agent 可以安全推断的细节
10
+ - 询问可安全推断的细节
11
11
  - 用历史过程笔记污染运行时上下文
12
12
  - 没有验证证据就标记成功
13
13
  - 在明确权限之外运行命令
14
- - 只优化 token 节省,而忽略成本可接受前提下的输出质量
14
+ - 只省 token,忽略可接受成本下的质量
15
15
  - 方向层已升级但规则、runtime 或 doctor 仍停留在旧语义
16
16
 
17
17
  ## 硬规则
@@ -36,8 +36,8 @@
36
36
 
37
37
  ## 项目约束
38
38
 
39
- - 引导读取集从 `ai/template/bootstrap.md`、`ai/template/protocol.md`、`ai/template/rules/core.md`、根目录文档、清单、文档、引用开始;当文档不足时,进行有限源码结构检查。
40
- - 执行读取集是 `ai/template/prompt.md`、`ai/template/protocol.md`、`ai/template/rules/core.md`、`ai/project/project.md`、`ai/project/runtime.md` 和 `ai/project/task.md`。
39
+ - 引导读取集:`bootstrap.md`、`protocol.md`、`rules/core.md`、根文档、清单、项目文档、引用;文档不足时有限检查源码结构。
40
+ - 执行读取集:`prompt.md`、`protocol.md`、`rules/core.md`、`project.md`、`runtime.md`、`task.md`。
41
41
  - `ai/project/refs/` 文件只在任务要求或任务类型触发时加载。
42
42
  - `ai/project/refs/final-shape.md`、`module-map.md`、`roadmap.md` 属于方向层正式文档。
43
43
  - 方向层正式文档不能被普通 reconcile 或普通执行任务直接修改。
@@ -53,9 +53,9 @@
53
53
  ## 当前上下文
54
54
 
55
55
  这个项目是协议 / 模板,不是复杂 Agent 框架。
56
- 当前产品定位是:面向 AI Coding Agent 的项目方向治理 + 可审计任务执行协议。
57
- 当前产品目标是减少人类交互频率和输入量,同时让任务随时间变得更精确,并减少长期方向漂移。
58
- 允许增加少量服务于协议采用和治理闭环的 CLI;不要引入 UI、云同步或多 Agent 编排。
56
+ 定位:面向 AI Coding Agent 的项目方向治理 + 可审计任务执行协议。
57
+ 目标:减少人类交互和输入量,让任务随时间更精确,并降低长期方向漂移。
58
+ 允许增加少量服务协议采用和治理闭环的 CLI;不要引入 UI、云同步或多 Agent 编排。
59
59
 
60
60
  ## 引用路由
61
61
 
@@ -69,6 +69,6 @@
69
69
 
70
70
  ## 运行时更新治理
71
71
 
72
- 除非 `ai/project/task.md` 明确允许,AI 不得直接更新这个文件。
73
- 如果任务产生长期有效上下文,将建议写入 `ai/project/result.json.runtime_update`。
74
- 通过单独任务应用运行时更新,该任务唯一允许目标是 `ai/project/runtime.md`。
72
+ 除非 `task.md` 明确允许,AI 不得直接更新本文件。
73
+ 任务产生长期上下文时,写入 `result.json.runtime_update` 建议。
74
+ 运行时更新应由单独任务应用,唯一目标是 `ai/project/runtime.md`。
@@ -79,14 +79,12 @@ permission:
79
79
 
80
80
  # 任务
81
81
 
82
- 这个文件是当前执行契约。优先在引导模式中,根据简短人类目标和仓库上下文生成,
83
- 然后由人类在执行前检查。
82
+ 当前执行契约。优先由引导模式根据人类目标和仓库上下文生成,执行前由人类检查。
84
83
 
85
- 优先使用安全假设,少问额外问题。AI 应基于用户目标、项目上下文和仓库事实推断
86
- 范围、风险、权限和验收;如果推断会越过权限、安全边界或验收无法定义,将
87
- `readiness` 标为 `blocked` 或将相关任务节点标为 `Red`,等待人类确认。
88
- 如果本轮新建或重写了任务契约,默认保持 `draft_for_confirmation` 并停下来交接;
89
- 只有已有任务明确处于 `ready_to_execute` 时,才进入执行。
84
+ 优先安全假设,少问问题。AI 基于目标、上下文和仓库事实推断范围、风险、权限和验收;
85
+ 若会越权、触碰安全边界或验收不可定义,将 `readiness` 设为 `blocked` 或把相关节点设为
86
+ `Red`,等待确认。本轮新建或重写任务契约时,默认保持 `draft_for_confirmation` 并停下交接;
87
+ 只有既有任务为 `ready_to_execute` 时才执行。
90
88
 
91
89
  ## 目标
92
90
 
@@ -125,34 +123,32 @@ permission:
125
123
 
126
124
  ## 执行策略
127
125
 
128
- 默认使用 `auto`,由 AI 在执行前规划时判定是否启用连续执行,而不是等待用户口令。
129
- 如果执行前拆出的 L1 任务少于 2 个,使用 `normal`;如果 L1 任务为 2 个或更多,
130
- 自动使用 `bounded_continuous`。
126
+ 默认 `auto`:AI 执行前规划并决定是否连续执行,不等用户口令。L1 < 2 用 `normal`;
127
+ L1 >= 2 自动用 `bounded_continuous`。
131
128
 
132
129
  `bounded_continuous` 表示边界内连续执行:
133
130
 
134
- - 目标、范围、验收、权限和风险评级由 AI 基于用户目标、项目上下文和仓库事实推断;
135
- 不要求用户预先逐项提供。
131
+ - 目标、范围、验收、权限和风险由 AI 基于目标、上下文和仓库事实推断;不要求用户逐项提供。
136
132
  - `readiness = ready_to_execute` 表示没有 Red 预检项,可以执行。
137
133
  - `readiness = draft_for_confirmation` 表示需要人类确认后才能执行。
138
134
  - `readiness = blocked` 表示当前任务不可执行,必须写 blocked 结果。
139
- - 本轮如果新建或重写 `ai/project/task.md`,必须停在确认交接;不能在任务仍是草稿时执行。
140
- - 执行前必须把 L1 任务清单写入 `execution_policy.task_tree`。
141
- - 执行前必须列出 L1 任务清单;每个 L1 用待办列表表示,完成后打勾并划掉。
135
+ - 本轮新建或重写 `task.md` 时必须停在确认交接;草稿不能执行。
136
+ - 执行前必须把 L1 清单写入 `execution_policy.task_tree`。
137
+ - 执行前必须列出 L1 清单;每个 L1 用待办表示,完成后打勾并划掉。
142
138
  - L1 必须是可独立验收的垂直切片;不要把单个机械步骤拆成 L1,也不要把多个
143
139
  可独立验收的用户可见结果合并成一个 L1。
144
- - 执行某个 L1 前,AI 先规划自然衍生出的 L2;如果 L2 仍需拆分,再规划 L3。
145
- - 默认最多 3 层;只有当不拆 L4 会导致 L3 过大或不可验证时,才允许动态增加 L4。
146
- - 每个任务节点都由 AI 自己生成 Green / Yellow / Red 风险评级。
140
+ - 执行 L1 前规划 L2L2 仍过大时规划 L3。
141
+ - 默认最多 3 层;不拆 L4 会导致 L3 过大或不可验证时,才允许 L4。
142
+ - 每个节点都由 AI 生成 Green / Yellow / Red 风险评级。
147
143
  - 只有 Red 停下来让人类确认;Green 自动继续,Yellow 只允许当前 L1/L2 内的局部
148
144
  低风险修正,不能改变公共接口、数据模型、权限、安全、架构方向或验收标准。
149
- - `progress_unit` 默认是 `vertical_slice`:每轮推进都应该产生可检查的工作增量。
150
- - `checkpoint_budget` 是最多可用检查点预算,不是必须用完的次数;不要为了消耗预算而汇报。
145
+ - `progress_unit` 默认为 `vertical_slice`:每轮都应产生可检查增量。
146
+ - `checkpoint_budget` 是上限,不是必须用完;不要为消耗预算而汇报。
151
147
  - 只有在风险从 Green 变 Yellow/Red、即将扩大范围或权限、完成 L1 垂直切片、
152
148
  验证失败后准备继续、准备最终收尾时才输出 Checkpoint。
153
149
  - 每个 Checkpoint 必须包含证据:已改文件、已运行命令、验证结果或无法验证的原因。
154
- - `task_tree` 写回频率:执行前写入 L1 清单;开始或完成 L1 时更新该 L1 状态;
155
- 出现 Red、blocked、范围变化或最终收尾时立即写回;不要为每个微小 L3 操作写回。
150
+ - `task_tree` 写回:执行前写 L1 清单;L1 开始/完成、Red、blocked、范围变化或收尾时写回;
151
+ 不为微小 L3 操作写回。
156
152
  - 完成后只做一次总复盘;只对 Yellow、Red、失败验证或高影响模块做二次抽检。
157
153
  - 连续执行不改变模型策略;涉及判断、架构、失败复盘或验收争议时仍按 `model_policy` 升级。
158
154
 
@@ -163,9 +159,8 @@ permission:
163
159
 
164
160
  ## 模型策略
165
161
 
166
- 默认使用 `model_policy.default_tier` 声明的模型档位。
167
- 不要用 `strong` 做常规执行。只为 `model_policy` 声明的角色和触发条件使用 `strong`,
168
- 并在 `ai/project/metrics.json` 中记录原因。
162
+ 默认使用 `model_policy.default_tier`。不要用 `strong` 做常规执行;只在
163
+ `model_policy` 声明的角色和触发条件下使用,并在 `metrics.json` 记录原因。
169
164
 
170
165
  ## 停止条件
171
166
 
@@ -1 +1 @@
1
- 0.8.19
1
+ 0.8.21
@@ -1,15 +1,12 @@
1
1
  # AI 执行引导
2
2
 
3
3
  不要总结这个文件。
4
- 执行下面的引导流程。
4
+ 按下面流程整理项目上下文。
5
5
 
6
- 你正在为 Agent Execution Template 整理项目上下文。
6
+ 目标:建立后续任务依赖的稳定项目理解。这是发现与确认,不是实现。
7
7
 
8
- 目标:建立后续任务会依赖的稳定项目理解。
9
- 这是发现与确认步骤,不是实现步骤。
10
-
11
- 你的任务是检查项目,创建或更新 `ai/project/project.md`
12
- 以及相关的 `ai/project/refs/*`,然后在“引导后交接”处停止。
8
+ 检查项目,创建或更新 `ai/project/project.md` 和相关 `ai/project/refs/*`,
9
+ 然后在“引导后交接”处停止。
13
10
 
14
11
  ## 先读
15
12
 
@@ -31,37 +28,37 @@
31
28
  - 能推断约束时,更新 `ai/project/refs/constraints.md`
32
29
  - 只有存在持久决策证据时,更新 `ai/project/refs/decisions.md`
33
30
 
34
- 只有在人类同时提供当前任务时,才创建 `ai/project/task.md`。
35
- 如果创建了 `ai/project/task.md`,只起草任务契约,不进入执行。
31
+ 只有人类同时提供当前任务时,才创建 `ai/project/task.md`。只起草任务契约,不执行。
36
32
 
37
- 引导期间不要编辑源码、测试、应用配置、依赖文件、生成文件、
38
- 运行时文件、结果文件或指标文件。
33
+ 引导期间不要编辑源码、测试、配置、依赖、生成文件、运行时、结果或指标文件。
39
34
 
40
35
  ## 阅读顺序
41
36
 
42
37
  按下面顺序读取高价值项目证据:
43
38
 
44
- 1. 根目录文档:`README*`、`AGENTS.md`、`CLAUDE.md`、`CONTRIBUTING*`、`CHANGELOG*`
39
+ 1. 根目录文档:`README*`、`CONTRIBUTING*`、`CHANGELOG*`
45
40
  2. 清单文件:`package.json`、`pyproject.toml`、`Cargo.toml`、`go.mod`、
46
41
  `pom.xml`、`build.gradle*`、`Makefile`
47
42
  3. 项目文档:`docs/**`,优先阅读概览、架构、安装、测试、部署、API、ADR 和决策文件
48
43
  4. 现有 AI 引用:`ai/project/refs/*.md`
49
44
  5. 源码、测试、配置和文档目录的浅层仓库结构
50
45
 
51
- 如果文档和清单缺失或不足,可以有限读取代码进行推断:
46
+ 文档和清单不足时,可有限读取代码推断:
52
47
 
53
48
  - 先检查顶层目录和文件名;
54
49
  - 检查可能的入口目录,例如 `src/`、`app/`、`lib/`、`packages/`、
55
50
  `services/`、`cmd/`、`internal/`、`server/`、`client/`、`test/`、`tests/`;
56
- - 只读取足够识别项目目的、模块边界、命令和约束的路由、模块、配置和测试文件;
51
+ - 只读取足够识别目的、模块边界、命令和约束的路由、模块、配置和测试文件;
57
52
  - 除非人类明确授权,不要读取整个代码库。
58
53
 
54
+ 不要把 `AGENTS.md` 或 `CLAUDE.md` 当作项目业务证据;它们只是 AI 入口路由文件。
55
+
59
56
  除非人类明确引用或授权,不要读取依赖目录、构建产物、覆盖率输出、锁文件
60
57
  (推断包管理器除外)、密钥文件、环境文件或归档目录。
61
58
 
62
59
  ## 确认维度
63
60
 
64
- 读取后,总结并请人类确认或修正这些点:
61
+ 读取后,请人类确认或修正:
65
62
 
66
63
  - 项目名称、目的和主要用户;
67
64
  - 一句话定位、最终形态和任务是否值得做的判断标准;
@@ -74,19 +71,18 @@
74
71
  - 持久约束、安全边界、兼容性要求和高风险区域;
75
72
  - 会影响后续任务精度的未知项。
76
73
 
77
- 一次最多问 3 个问题。只问答案会改变项目身份、命令、边界、约束、风险、
78
- 权限或验收的问题。
74
+ 最多问 3 个问题。只问会改变身份、命令、边界、约束、风险、权限或验收的问题。
79
75
 
80
76
  ## 输出规则
81
77
 
82
78
  - 未知事实标记为 `Unknown`;不要把猜测当成事实。
83
- - 如果本次引导吸收了 `ai/project/inbox/*.md` 或 `ai/project/inbox/raw/*.md`,
84
- 写入上下文后必须把已吸收资料移动到 `ai/project/inbox/processed/`。保留相对路径:
85
- `ai/project/inbox/raw/file.md` 移动到 `ai/project/inbox/processed/raw/file.md`。
86
- 如果文件名冲突,保留原文件名并添加日期或序号。不要移动 `ai/project/inbox/ideas/**`。
79
+ - 若本次吸收 `ai/project/inbox/*.md` 或 `ai/project/inbox/raw/*.md`,写入上下文后移到
80
+ `ai/project/inbox/processed/`,保留相对路径:`ai/project/inbox/raw/file.md` ->
81
+ `ai/project/inbox/processed/raw/file.md`。文件名冲突时加日期或序号。不要移动
82
+ `ai/project/inbox/ideas/**`。
87
83
  - 未吸收资料必须留在原位置,并在最终回复中说明原因。
88
- - `final-shape.md`、`module-map.md`、`roadmap.md` 的初始化内容必须标明证据来源;
89
- 如果证据不足,保持占位或写 `Unknown`,不要编造愿景。
84
+ - `final-shape.md`、`module-map.md`、`roadmap.md` 的初始化内容必须标明证据来源;
85
+ 证据不足时保持占位或写 `Unknown`,不要编造愿景。
90
86
  - 有帮助时,在相关文件中记录证据来源。
91
87
  - 保持 `ai/project/project.md` 稳定、长期有效。
92
88
  - 保持 `ai/project/refs/*.md` 聚焦;不要把引用文件写成项目流水账。
@@ -95,11 +91,11 @@
95
91
 
96
92
  ## 引导后交接
97
93
 
98
- 写完项目上下文草稿后,不要只要求人类打开文件检查。
99
- 你必须在最终回复中给出可确认摘要,让人类可以直接在聊天里确认或修正。
94
+ 写完上下文草稿后,不要只要求人类打开文件检查。最终回复必须给出可确认摘要,
95
+ 让人类能直接在聊天里确认或修正。
100
96
 
101
- 如果人类在引导请求中已经给出当前任务目标,你必须同时起草 `ai/project/task.md`,
102
- 并把项目理解摘要和任务草稿摘要一起交给人类确认。
97
+ 如果引导请求已包含当前任务目标,必须同时起草 `ai/project/task.md`,
98
+ 并交付项目理解摘要和任务草稿摘要。
103
99
 
104
100
  如果人类没有给出当前任务目标,你必须根据项目现状推荐下一步最值得做的任务。
105
101
 
@@ -199,5 +195,5 @@
199
195
  - 修正:<你要改的地方>
200
196
  ```
201
197
 
202
- 如果仍有重要未知项,只在“仍不确定”中列出最多 3 条。
198
+ 重要未知项只在“仍不确定”中列最多 3 条。
203
199
  不要让人类主动去文件管理器里寻找问题;文件路径只作为可追溯记录。
@@ -104,6 +104,9 @@ Checkpoint 只在以下情况输出:风险从 Green 变 Yellow/Red、即将扩
104
104
 
105
105
  ## 用户可见输出
106
106
 
107
+ - 默认使用当前安装模板语言输出。`ai/template/LANG` 为 `zh` 时,用户可见的计划、
108
+ L1 清单、Checkpoint、任务草稿交接、阻塞说明和最终结果默认使用中文;只有用户
109
+ 明确要求其他语言,或需要保留代码、命令、文件路径、协议字段原文时才使用其他语言。
107
110
  - 默认展示 L1 清单;不要默认展示完整 L2/L3/L4。
108
111
  - 展示风险结论和必要原因;不要输出长篇内部推理。
109
112
  - 展示证据;不要展示内部协议字段、完整 YAML、`checkpoint_budget` 或 `model_policy`。
@@ -1,64 +1,56 @@
1
1
  # AI 执行提示
2
2
 
3
3
  不要总结这个文件。
4
- 执行下面的工作流。
4
+ 按下面流程执行。你正在 Agent Execution Template 工作区内操作。
5
5
 
6
- 你正在 Agent Execution Template 工作区内操作。
6
+ 本文件只负责路由。先读取最小状态:
7
7
 
8
- 先读取:
8
+ 1. `ai/project/project.md`(如果存在)
9
+ 2. `ai/project/task.md`(如果存在)
10
+ 3. `ai/project/inbox/`、`ai/project/inbox/ideas/` 和 `ai/project/proposals/final-shape-updates/` 的浅层列表
9
11
 
10
- 1. `ai/template/protocol.md`
11
- 2. `ai/template/rules/core.md`
12
- 3. `ai/template/execution-policy.md`
12
+ 选择模式:
13
13
 
14
- 然后选择模式:
15
-
16
- - 如果用户要求更新北极星、最终形态、产品宪法、模块地图、路线图、项目方向,
17
- `ai/project/inbox/ideas/` 里存在 `.gitkeep` 之外的待评估灵感,按 `strategy_update`
18
- 起草方向修订任务或直接生成提案,然后停止等待人类确认。
19
- - 如果用户明确确认某个
20
- `ai/project/proposals/final-shape-updates/*.md` 可以合并,按
21
- `apply_strategy_update` 起草或执行应用任务;如果 proposal 仍为
22
- `proposed`,先根据这次明确确认更新为 `accepted`。
14
+ - 用户要求更新北极星、最终形态、产品宪法、模块地图、路线图或项目方向,
15
+ 或 `ai/project/inbox/ideas/` 有待评估灵感:读取 `ai/template/protocol.md`、
16
+ `ai/template/rules/core.md` 和相关方向 refs,走 `strategy_update`,生成提案后停下确认。
17
+ - 用户明确确认某个 `ai/project/proposals/final-shape-updates/*.md` 可合并:
18
+ 读取 `ai/template/protocol.md` 和 `ai/template/rules/core.md`,走
19
+ `apply_strategy_update`。若 proposal 仍为 `proposed`,先改为 `accepted`。
23
20
  - 如果用户说“开始初始化这个项目,并吸收 ai/project/inbox/ 里的资料”,
24
- 或要求初始化时一并吸收 `ai/project/inbox/` 里的资料,先检查
25
- `ai/project/project.md`。如果它已经存在且不是空文件、占位内容或明显不完整,
26
- 执行 `ai/template/reconcile.md`,不要重新 bootstrap;如果它为空、只有占位内容或
27
- 明显不完整,执行 `ai/template/bootstrap.md`,并把 `ai/project/inbox/*.md`
28
- `ai/project/inbox/raw/*.md` 视为本次引导输入的一部分;在项目上下文确认后停止。
29
- - 如果用户说“整合 ai/project/inbox/ 里的新资料”,要求整合/合并/吸收/
30
- 更新上下文/处理新资料,提到 `reconcile` `ai/project/inbox/`,
31
- `ai/project/inbox/` 里存在 `.gitkeep` 之外的待吸收资料,执行 `ai/template/reconcile.md`,
32
- 并按它的两阶段流程停止或更新;但 `ai/project/inbox/processed/` 是已处理资料,
33
- 不应触发整合,`ai/project/inbox/ideas/` 应优先走 `strategy_update`。即使用户说
34
- “整合整个 inbox”,默认也只处理 `ai/project/inbox/*.md` 和
35
- `ai/project/inbox/raw/*.md`。
21
+ 或要求初始化时吸收 inbox:先检查 `ai/project/project.md`。若已存在且有效,
22
+ 执行 `ai/template/reconcile.md`,不要重新 bootstrap;若为空、占位或不完整,执行
23
+ `ai/template/bootstrap.md`,并把 `ai/project/inbox/*.md` 与
24
+ `ai/project/inbox/raw/*.md` 纳入引导输入;上下文确认后停止。
25
+ - 用户说“整合 ai/project/inbox/ 里的新资料”,要求整合/合并/吸收/更新上下文/处理新资料,提到 `reconcile`
26
+ `ai/project/inbox/`,或 inbox 有待吸收资料:执行 `ai/template/reconcile.md`。
27
+ `processed/` 不触发整合,`ideas/` 优先走 `strategy_update`。即使用户说
28
+ “整合整个 inbox”,也默认只处理 `ai/project/inbox/*.md` `ai/project/inbox/raw/*.md`。
36
29
  - 如果用户说“开始初始化这个项目”、要求初始化/整理/生成项目上下文,
37
- 或 `ai/project/project.md` 为空、只有占位内容、
38
- 或不完整,执行 `ai/template/bootstrap.md`,并在项目上下文确认后停止。
39
- - 如果 `ai/project/task.md` 为空、只有占位内容、或不完整,根据用户当前目标和
40
- 已确认的项目上下文起草它,然后停止等待人类确认。
41
- - 如果用户说“继续推进这个项目”,且没有更具体目标,先全局判断当前最值得做的
42
- 下一步:优先处理待确认上下文、待确认任务、失败结果、未完成任务或明显风险;
43
- 然后给出建议或起草 `ai/project/task.md`,不要让人类自己去文件管理器里找问题。
44
- - 只有当 `ai/project/project.md` 和 `ai/project/task.md` 已经足够定义身份、
45
- 目标、范围、权限和验收时,才进入执行模式。
30
+ 或 `ai/project/project.md` 为空、占位或不完整:执行 `ai/template/bootstrap.md`,
31
+ 上下文确认后停止。
32
+ - `ai/project/task.md` 为空、占位或不完整:按当前目标和已确认上下文起草任务,
33
+ 然后停下确认。
34
+ - 用户说“继续推进这个项目”且无更具体目标:先判断最值得做的下一步,优先处理
35
+ 待确认上下文、待确认任务、失败结果、未完成任务或明显风险;给出建议或起草
36
+ `ai/project/task.md`,不要让人类自己找问题。
37
+ - 只有当 `project.md` 和 `task.md` 足以定义身份、目标、范围、权限和验收时,
38
+ 才读取 `ai/template/protocol.md`、`ai/template/rules/core.md`、
39
+ `ai/template/execution-policy.md` 并进入执行模式。
46
40
 
47
41
  ## 任务草稿交接
48
42
 
49
43
  在任务草稿模式中:
50
44
 
51
45
  1. 读取已确认的 `ai/project/project.md` 和相关 `ai/project/refs/*.md`。
52
- 2. 根据用户当前目标、项目上下文和仓库事实,推断目标、范围、验收、权限、
53
- 验证方式和初始风险;不要要求用户逐项提供。
46
+ 2. 根据用户目标、项目上下文和仓库事实推断目标、范围、验收、权限、验证方式和初始风险;
47
+ 不要求用户逐项提供。
54
48
  3. 起草 `ai/project/task.md`,并将 `execution_policy.mode` 设为 `auto`。
55
- 4. 执行前列出 L1 任务清单并标注 Green / Yellow / Red,同时写入
56
- `execution_policy.task_tree`。L1 少于 2 个时使用 `normal`;L1 2 个或更多时
57
- 自动使用 `bounded_continuous`。
58
- 5. 本轮如果新建或重写了 `ai/project/task.md`,将 `readiness` 设为
59
- `draft_for_confirmation` 并停止交接;不要在任务仍是草稿时直接执行。
60
- 6. 只有已有任务明确处于 `ready_to_execute`,且没有 Red 预检项时,才能进入执行模式;
61
- 如果不可执行,设为 `blocked`。
49
+ 4. 执行前列出 L1 清单并标注 Green / Yellow / Red,写入 `execution_policy.task_tree`。
50
+ L1 < 2 `normal`;L1 >= 2 自动用 `bounded_continuous`。
51
+ 5. 本轮新建或重写 `task.md` 时,将 `readiness` 设为 `draft_for_confirmation` 并停止;
52
+ 草稿不能直接执行。
53
+ 6. 只有既有任务为 `ready_to_execute` 且无 Red 预检项,才进入执行;否则设为 `blocked`。
62
54
  7. 不要在任务草稿模式中修改源码或业务文件。
63
55
 
64
56
  任务草稿模式必须以下面结构结束:
@@ -108,15 +100,14 @@
108
100
  2. `ai/project/runtime.md`
109
101
  3. `ai/project/task.md`
110
102
 
111
- 然后按 `ai/template/execution-policy.md` 做执行前规划:列出 L1 清单,给每个 L1
112
- 标注 Green / Yellow / Red,并写入 `execution_policy.task_tree`。根据 L1 数量自动选择
113
- `normal` `bounded_continuous`。只有 `readiness = ready_to_execute` 才能执行;
114
- 如果本轮新建或重写任务契约,先停在确认交接。L1 必须是可独立验收的垂直切片。
115
- 执行 L1 前规划 L2,执行 L2 前按需规划 L3;默认最多 3 层,必要时允许 L4
116
- 每完成一个 L1,在清单中打勾并划掉;开始或完成 L1、出现 Red/blocked、范围变化
117
- 或最终收尾时写回 `task_tree`。只有 Red 停止等待人类确认;Green 自动继续,Yellow
118
- 只做当前 L1/L2 内的局部低风险修正。用户可见输出遵守
119
- `ai/template/execution-policy.md` 的“用户可见输出”规则。最后把结果写入:
103
+ 然后按 `ai/template/execution-policy.md` 规划:列 L1,标注 Green / Yellow / Red,
104
+ 写入 `execution_policy.task_tree`,并按 L1 数量选择 `normal` 或 `bounded_continuous`。
105
+ 只有 `readiness = ready_to_execute` 才能执行;本轮新建或重写任务契约时先停下确认。
106
+ L1 必须是可独立验收的垂直切片。执行 L1 前规划 L2,执行 L2 前按需规划 L3;
107
+ 默认最多 3 层,必要时允许 L4。每完成一个 L1,在清单中打勾并划掉;仅在 L1
108
+ 开始/完成、Red/blocked、范围变化或最终收尾时写回 `task_tree`。Red 停止确认;
109
+ Green 自动继续;Yellow 只做当前 L1/L2 内的局部低风险修正。用户可见输出遵守
110
+ “用户可见输出”规则。最后写入:
120
111
 
121
112
  - `ai/project/result.json`
122
113
  - `ai/project/result.md`