@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.
- package/README.md +19 -2
- package/README.zh-CN.md +14 -0
- package/bin/agent-execution-template.js +220 -27
- package/docs/SPEC.md +55 -12
- package/package.json +1 -1
- package/template/en/ai/README.md +4 -1
- package/template/en/ai/template/VERSION +1 -1
- package/template/en/ai/template/bootstrap.md +4 -1
- package/template/en/ai/template/execution-policy.md +5 -0
- package/template/en/ai/template/prompt.md +12 -9
- package/template/en/ai/template/protocol.md +9 -3
- package/template/en/ai/template/rules/output.md +4 -1
- package/template/zh/ai/README.md +2 -0
- package/template/zh/ai/project/runtime.md +11 -11
- package/template/zh/ai/project/task.md +20 -25
- package/template/zh/ai/template/VERSION +1 -1
- package/template/zh/ai/template/bootstrap.md +24 -28
- package/template/zh/ai/template/execution-policy.md +3 -0
- package/template/zh/ai/template/prompt.md +45 -54
- package/template/zh/ai/template/protocol.md +32 -33
- package/template/zh/ai/template/reconcile.md +21 -28
- package/template/zh/ai/template/rules/core.md +19 -24
- package/template/zh/ai/template/rules/output.md +3 -1
- package/test/selftest.js +144 -7
|
@@ -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*`, `
|
|
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/
|
|
11
|
-
2. `ai/
|
|
12
|
-
3. `ai/
|
|
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,
|
|
20
|
-
then
|
|
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
|
|
24
|
-
`
|
|
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
|
|
8
|
+
ai/project/ = current repo execution context
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Template is protocol. Project is
|
|
11
|
+
Template is protocol. Project is repo-local context.
|
|
12
12
|
|
|
13
|
-
|
|
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
|
package/template/zh/ai/README.md
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
## 当前状态
|
|
4
4
|
|
|
5
5
|
- 阶段:方向层与执行层一致性收口
|
|
6
|
-
-
|
|
6
|
+
- 重点:保持协议可安装、可升级、可审计,并让方向治理与执行约束一致。
|
|
7
7
|
- 阻塞:无
|
|
8
8
|
- 已知风险:
|
|
9
9
|
- 超出当前任务范围
|
|
10
|
-
-
|
|
10
|
+
- 询问可安全推断的细节
|
|
11
11
|
- 用历史过程笔记污染运行时上下文
|
|
12
12
|
- 没有验证证据就标记成功
|
|
13
13
|
- 在明确权限之外运行命令
|
|
14
|
-
-
|
|
14
|
+
- 只省 token,忽略可接受成本下的质量
|
|
15
15
|
- 方向层已升级但规则、runtime 或 doctor 仍停留在旧语义
|
|
16
16
|
|
|
17
17
|
## 硬规则
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
## 项目约束
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
除非 `
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
`
|
|
88
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
自动使用 `bounded_continuous`。
|
|
126
|
+
默认 `auto`:AI 执行前规划并决定是否连续执行,不等用户口令。L1 < 2 用 `normal`;
|
|
127
|
+
L1 >= 2 自动用 `bounded_continuous`。
|
|
131
128
|
|
|
132
129
|
`bounded_continuous` 表示边界内连续执行:
|
|
133
130
|
|
|
134
|
-
-
|
|
135
|
-
不要求用户预先逐项提供。
|
|
131
|
+
- 目标、范围、验收、权限和风险由 AI 基于目标、上下文和仓库事实推断;不要求用户逐项提供。
|
|
136
132
|
- `readiness = ready_to_execute` 表示没有 Red 预检项,可以执行。
|
|
137
133
|
- `readiness = draft_for_confirmation` 表示需要人类确认后才能执行。
|
|
138
134
|
- `readiness = blocked` 表示当前任务不可执行,必须写 blocked 结果。
|
|
139
|
-
-
|
|
140
|
-
- 执行前必须把 L1
|
|
141
|
-
- 执行前必须列出 L1
|
|
135
|
+
- 本轮新建或重写 `task.md` 时必须停在确认交接;草稿不能执行。
|
|
136
|
+
- 执行前必须把 L1 清单写入 `execution_policy.task_tree`。
|
|
137
|
+
- 执行前必须列出 L1 清单;每个 L1 用待办表示,完成后打勾并划掉。
|
|
142
138
|
- L1 必须是可独立验收的垂直切片;不要把单个机械步骤拆成 L1,也不要把多个
|
|
143
139
|
可独立验收的用户可见结果合并成一个 L1。
|
|
144
|
-
-
|
|
145
|
-
- 默认最多 3
|
|
146
|
-
-
|
|
140
|
+
- 执行 L1 前规划 L2;L2 仍过大时规划 L3。
|
|
141
|
+
- 默认最多 3 层;不拆 L4 会导致 L3 过大或不可验证时,才允许 L4。
|
|
142
|
+
- 每个节点都由 AI 生成 Green / Yellow / Red 风险评级。
|
|
147
143
|
- 只有 Red 停下来让人类确认;Green 自动继续,Yellow 只允许当前 L1/L2 内的局部
|
|
148
144
|
低风险修正,不能改变公共接口、数据模型、权限、安全、架构方向或验收标准。
|
|
149
|
-
- `progress_unit`
|
|
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`
|
|
155
|
-
|
|
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
|
-
|
|
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.
|
|
1
|
+
0.8.21
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
# AI 执行引导
|
|
2
2
|
|
|
3
3
|
不要总结这个文件。
|
|
4
|
-
|
|
4
|
+
按下面流程整理项目上下文。
|
|
5
5
|
|
|
6
|
-
|
|
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
|
-
|
|
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*`、`
|
|
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
|
-
|
|
78
|
-
权限或验收的问题。
|
|
74
|
+
最多问 3 个问题。只问会改变身份、命令、边界、约束、风险、权限或验收的问题。
|
|
79
75
|
|
|
80
76
|
## 输出规则
|
|
81
77
|
|
|
82
78
|
- 未知事实标记为 `Unknown`;不要把猜测当成事实。
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
`ai/project/inbox/
|
|
86
|
-
|
|
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
|
-
-
|
|
89
|
-
|
|
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
|
-
|
|
102
|
-
|
|
97
|
+
如果引导请求已包含当前任务目标,必须同时起草 `ai/project/task.md`,
|
|
98
|
+
并交付项目理解摘要和任务草稿摘要。
|
|
103
99
|
|
|
104
100
|
如果人类没有给出当前任务目标,你必须根据项目现状推荐下一步最值得做的任务。
|
|
105
101
|
|
|
@@ -199,5 +195,5 @@
|
|
|
199
195
|
- 修正:<你要改的地方>
|
|
200
196
|
```
|
|
201
197
|
|
|
202
|
-
|
|
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
|
-
|
|
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
|
-
|
|
11
|
-
2. `ai/template/rules/core.md`
|
|
12
|
-
3. `ai/template/execution-policy.md`
|
|
12
|
+
选择模式:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
25
|
-
`ai/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- 只有当 `
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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`
|