aodw-skill 0.7.25 → 0.7.27

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.
@@ -26,6 +26,41 @@
26
26
 
27
27
  ---
28
28
 
29
+ ## RT 创建:执行模式确认(强制)
30
+
31
+ 在**任何** RT 立项动作之前(含 `aodw-skill new`、手工建目录、AI 代建 `RT/RT-XXX/`),必须先向用户确认执行模式:
32
+
33
+ - **A. 人工干预模式(协作)** → `execution_mode: collaborative`
34
+ - **B. 全自动模式(Autopilot)** → `execution_mode: autopilot`
35
+
36
+ 规则:
37
+ - 必须使用决策型问题(2 选项 + Recommended + 理由)
38
+ - 用户未明确回复前,**不得**创建 RT 目录或文件
39
+ - 不得静默默认任一模式;历史 RT 若无 `execution_mode` 字段,须补问后再继续
40
+
41
+ 详见 `02-workflow/rt-manager.md` § 3.2。
42
+
43
+ ### Autopilot:完成标准二次确认(友好但强制)
44
+
45
+ 用户已选 **B. 全自动** 且 `rt-lite.md` §7 起草完成后,AI 必须用 **3–5 条自然语言**复述完成标准,并问:
46
+
47
+ ```
48
+ Q. 以上完成标准是否正确?
49
+
50
+ A. 是,按此 Autopilot 执行
51
+ B. 否,需要调整(请说明)
52
+
53
+ Recommended: A(若 §7 已与用户讨论一致)
54
+
55
+ 请回复:A/B
56
+ ```
57
+
58
+ - 用户选 **B** 或提出修改 → 修订 §7 后再次确认
59
+ - 用户选 **A** 前 → **禁止** 进入 Ralph 循环(`autopilot-protocol.md` Phase E)
60
+ - 定稿后写入 rt-lite §7「用户确认摘要」
61
+
62
+ ---
63
+
29
64
  1. 问题类型(两大类)
30
65
  AI 所提出的所有问题必须明确属于:
31
66
  1. 决策型(Decision Question)
@@ -0,0 +1,167 @@
1
+ ---
2
+ id: aodw-autopilot-goal-spec
3
+ version: 1.0.0
4
+ category: aodw/execution-profile
5
+ trigger: "Autopilot 开工前编写或审查 rt-lite.md §7 时加载"
6
+ description: >
7
+ 完成条件书写标准:范围 + 证据 + 测试。决定 Autopilot 能否收敛,比循环机制更重要。
8
+ ---
9
+
10
+ # Autopilot Goal Spec(完成条件标准)
11
+
12
+ > 借鉴:Task Platform `goal-specification-standard.md`、Ralph Loop(Huntley)、Claude Goal Mode(Scope + Evidence + Fuse)
13
+
14
+ **核心结论**:同样的 Ralph 循环,目标写得精确可快 62% 收敛且零 scope creep;目标模糊则过度实现或无限振荡。
15
+
16
+ ---
17
+
18
+ ## 1. 双层文档结构(AODW 映射)
19
+
20
+ | 层级 | 文件 | 角色 | 谁维护 |
21
+ |------|------|------|--------|
22
+ | **Goal(静态)** | `rt-lite.md` §1-§4、§7 | 定义「完成长什么样」「改什么/不改什么」 | 人 + AI 开工前共同定稿 |
23
+ | **Plan(动态)** | `rt-plan.md` + `state.json` | 记录「做到哪了」、阻塞、决策 | AI 每轮迭代更新 |
24
+
25
+ ```
26
+ rt-lite.md (Goal) → 不变的目标与边界
27
+ rt-plan.md (Plan) → 每轮更新的步骤清单
28
+ state.json → 机器可读的 checklist + 信号
29
+ loop-prompt.md → 每轮注入的执行指令
30
+ execution-log.md → 人可读的迭代时间线(防黑盒)
31
+ ```
32
+
33
+ ---
34
+
35
+ ## 2. 三要素公式(每条完成条件必备)
36
+
37
+ 对齐 Task Platform / Goal Mode:**Scope + Evidence + Test**;任务级还需 **Fuse(熔断)**。
38
+
39
+ | 要素 | 含义 | 示例 |
40
+ |------|------|------|
41
+ | **Scope(范围)** | 改哪些文件/模块;明确排除项 | `src/auth/login.ts` 及测试;不改 `register.ts` |
42
+ | **Evidence(证据)** | 完成时日志/输出/diff 中可见什么 | `execution-log` 记录 tests exit 0;diff 仅 §2.1 文件 |
43
+ | **Test(测试)** | 可执行 shell 命令,exit 0 = 通过 | `npm test -- auth`;`npx aodw-skill guard` |
44
+ | **Fuse(熔断)** | 轮次/时间上限,防无限循环 | `state.json.max_iterations: 20`;达上限必须停并交还人工 |
45
+
46
+ **判断标准**:能否写进 shell 脚本让机器自动检查?不能 = 条件太模糊。
47
+
48
+ **机械完成判定(双条件,缺一不可)**——对齐 Ralph「计划清空 + 测试通过」:
49
+
50
+ 1. `rt-plan.md` 进度区 **全部 `[x]`**(无未完成步骤)
51
+ 2. `state.json.checklist` **全 `true`**,且 §5.4 的 tests/lint/guard **均已 exit 0**
52
+
53
+ ### 2.1 好坏对比
54
+
55
+ | ❌ 坏条件 | ✅ 好条件 |
56
+ |----------|----------|
57
+ | 功能做完 | `curl -X POST /api/x` 返回 201 且 body 含 `id` |
58
+ | 代码改好 | `npm run lint` exit 0 |
59
+ | 测试差不多通过 | `pytest tests/auth -q` 0 failed |
60
+ | 优化性能 | `pytest tests/bench_login.py` p95 < 200ms |
61
+
62
+ ### 2.2 §7 表格写法(rt-lite.md)
63
+
64
+ | ID | 条件(Scope + Evidence) | 验证命令(Test) | state.json 字段 |
65
+ |----|--------------------------|------------------|-----------------|
66
+ | C1 | … | `...` | `plan_complete` |
67
+
68
+ ---
69
+
70
+ ## 3. 「不改什么」强制节(§1.3 / §2.1 旁)
71
+
72
+ 至少列出 **3 项**排除,典型类别:
73
+
74
+ - 明确不修改的文件/目录
75
+ - 明确不添加的功能
76
+ - 明确不变的行为(兼容性、API 契约)
77
+
78
+ 无边界 = 最大 scope creep 来源(Ralph 过度烘焙的首要诱因)。
79
+
80
+ ---
81
+
82
+ ## 4. 长度与可读性
83
+
84
+ - **Goal 核心块**(§1.2 目标 + §2.1 改什么 + §1.3.1 不改什么 + §7)建议 **≤ 60 行**(对齐 HumanLayer / Task Platform PROMPT.md 上限;过长会被模型忽略)
85
+ - 完整 `rt-lite.md` 可含 §3–§6,但注入 `loop-prompt.md` 时优先摘录 Goal 核心块
86
+ - §7 checklist **3–8 条**为宜;过多拆成多个 RT
87
+ - 禁止主观词:适当、合理、较好、差不多
88
+
89
+ ## 4.1 机械 Stop(AODW 映射 Task Platform Stop Hook)
90
+
91
+ Task Platform 用 Claude **Stop Hook**(shell exit 0/2)判定能否结束。AODW 等价链路:
92
+
93
+ | 机制 | 作用 |
94
+ |------|------|
95
+ | `npx aodw-skill guard` | 提交前痕迹检查(RT/文档是否齐全) |
96
+ | pre-commit guard hook | 与 Stop Hook 同思路:不通过则不允许结束本轮 |
97
+ | §5.4 tests/lint | Backpressure,非「感觉完成」 |
98
+
99
+ **禁止**仅用对话里的「我做完了」作为 Done 依据(Goal Mode Evaluator 盲区同理)。
100
+
101
+ ---
102
+
103
+ ## 5. Goal 质量自检(AI 在开工前必须跑)
104
+
105
+ | # | 检查项 | 不通过则 |
106
+ |---|--------|----------|
107
+ | 1 | 目标一句话说清 | 与用户澄清后再写 §7 |
108
+ | 2 | §2.1 改动文件 checklist | 补全路径 |
109
+ | 3 | 「不改什么」≥ 3 项 | 补边界 |
110
+ | 4 | §7 每条可机械验证 | 改写为 Scope+Evidence+Test |
111
+ | 5 | §5.4 tests/lint/guard 可运行 | 填真实命令 |
112
+ | 6 | 无模糊词 | 重写 |
113
+ | 7 | Autopilot 适配度(见下) | 建议改协作模式或升级 Spec-Full |
114
+
115
+ **任一项不通过 → 禁止进入 Ralph 循环**,只能做 Goal 修订或与用户确认。
116
+
117
+ ---
118
+
119
+ ## 6. Autopilot 适配度(AI 自主判断)
120
+
121
+ AI 在确认 `execution_mode: autopilot` 后、写 §7 前,用以下清单评估(不必全满足,但 **≥ 4/6 为推荐开工**):
122
+
123
+ | # | 条件 | 权重 |
124
+ |---|------|------|
125
+ | 1 | Spec-Lite 范围(单模块/低风险) | 高 |
126
+ | 2 | 完成条件可全部用命令验证 | 高 |
127
+ | 3 | 无未决架构/产品二选一 | 高 |
128
+ | 4 | 预计 ≤ max_iterations(默认 20)可完成 | 中 |
129
+ | 5 | 有现成 tests/lint | 中 |
130
+ | 6 | 不涉及数据模型/API 契约变更 | 高 |
131
+
132
+ - **< 4 分**:向用户建议改为 `collaborative` 或升级 Spec-Full,并说明理由(决策型问题 A/B)。
133
+ - **4–5 分**:可 Autopilot,但收紧 §7、降低 `max_iterations`。
134
+ - **6 分**:理想 Autopilot 场景。
135
+
136
+ **现实预期(FeatureBench)**:复杂端到端功能 Agent 成功率远低于修 bug(约 7–12% vs 70%+)。若适配度偏低或 §7 条目多且跨模块,应优先 **协作模式** 或 **拆 RT**,而非提高 `max_iterations` 硬跑。
137
+
138
+ ---
139
+
140
+ ## 7. 与执行模式的关系
141
+
142
+ ### 7.0 命名对照(Task Platform ↔ AODW)
143
+
144
+ | Task Platform(Job) | AODW(RT) | 说明 |
145
+ |---------------------|------------|------|
146
+ | `single` | `collaborative` + 单次实现 | 无循环 |
147
+ | `ralph-loop` | `autopilot` + `execution_submode: ralph-loop` | 默认 Autopilot |
148
+ | `goal` | `autopilot` + `execution_submode: goal-session` | 单 session,仍机械验收 |
149
+
150
+ ---
151
+
152
+ ## 7.1 与执行子模式的关系
153
+
154
+ | AODW 模式 | 对应 Task Platform | 完成判定 |
155
+ |-----------|------------------|----------|
156
+ | Autopilot + 多轮(默认) | Ralph Loop | `rt-plan` 全 `[x]` + checklist 全 true + §5.4 通过 |
157
+ | Autopilot + 单 session(可选) | Goal Mode 思想 | 同上;禁止纯对话判定完成 |
158
+
159
+ 详见 `autopilot-protocol.md` §4 模式选择。
160
+
161
+ ---
162
+
163
+ ## 8. 参考
164
+
165
+ - `02-workflow/autopilot-protocol.md` — 完整执行协议
166
+ - `02-workflow/spec-lite-autopilot-profile.md` — Gate 与循环
167
+ - Task Platform: `docs/goal-specification-standard.md`
@@ -0,0 +1,251 @@
1
+ ---
2
+ id: aodw-autopilot-protocol
3
+ version: 1.0.0
4
+ category: aodw/execution-profile
5
+ trigger: "meta.yaml execution_mode=autopilot 时加载(与 spec-lite-autopilot-profile 一并)"
6
+ description: >
7
+ AODW 全自动模式总协议:Goal Spec + Ralph 循环 + 机械 Gate + AI 研判 + 可观测 + 熔断。
8
+ priority: high
9
+ ---
10
+
11
+ # AODW Autopilot 执行协议
12
+
13
+ > 版本 1.0 | 融合 Task Platform 持续编程实践与 AODW RT 体系
14
+ > 关联:`autopilot-goal-spec.md`、`spec-lite-autopilot-profile.md`、`rt-manager.md` §3.2
15
+
16
+ ---
17
+
18
+ ## 0. 设计原则
19
+
20
+ | 原则 | 含义 |
21
+ |------|------|
22
+ | **规格驱动** | `rt-lite.md` + `rt-plan.md` 是每轮迭代的「大脑」,从磁盘重读,不靠对话记忆 |
23
+ | **文件系统即记忆** | `state.json` 跨轮持久化;每次迭代可全新 AI 上下文 |
24
+ | **机械 Backpressure** | 改动后必须跑 tests/lint/guard,禁止凭感觉声称完成 |
25
+ | **可观测** | `execution-log.md` 每轮一条,避免 RT-002 式黑盒 |
26
+ | **智能但可熔断** | LLM 负责研判与拆解;卡住/超轮/无进展则交还人工 |
27
+ | **用户已确认模式** | `execution_mode` 仅在创建 RT 时由用户选定,AI 不得静默默认 |
28
+
29
+ ---
30
+
31
+ ## 1. 生命周期总览
32
+
33
+ ```mermaid
34
+ flowchart TD
35
+ A[用户确认 Autopilot] --> B[创建 RT 脚手架]
36
+ B --> C[AI: 适配度研判 + Goal 质量自检]
37
+ C -->|不通过| D[修订 rt-lite / 改协作模式]
38
+ C -->|通过| E[Preflight 勾选]
39
+ E --> F[机械 Gate-Plan]
40
+ F --> G[Ralph 循环]
41
+ G --> H{Done?}
42
+ H -->|否| G
43
+ H -->|是| I[机械 Gate-Commit]
44
+ I --> J[机械 Gate-Done]
45
+ J --> K[RT done + 文档同步]
46
+ G -->|熔断| L[请求人工]
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 2. 阶段说明
52
+
53
+ ### Phase A — 模式确认(强制,RT 创建时)
54
+
55
+ 见 `rt-manager.md` §3.2、`ai-interaction-rules.md`。未获用户 A/B 答复前不得创建 `RT/RT-XXX/`。
56
+
57
+ ### Phase B — Goal 定稿(AI + 用户,可 1–2 轮对话)
58
+
59
+ 1. AI 根据 intake 起草 `rt-lite.md` §1-§4、§7、§5.4
60
+ 2. 运行 `autopilot-goal-spec.md` §5 质量自检 + §6 适配度
61
+ 3. 不通过 → 用决策型问题请用户收窄范围或改协作模式
62
+ 4. 通过 → 初始化 `state.json`、`rt-plan.md`(空计划)
63
+
64
+ **友好行为**:用自然语言向用户展示 §7 摘要(3–5 条),请用户确认「是否就是这些完成标准」;仅确认后写入终稿。
65
+
66
+ ### Phase C — Preflight
67
+
68
+ 完成 `rt-autopilot-preflight.template.md` 或 `rt-autopilot-readiness.md` 全部勾选。
69
+
70
+ ### Phase D — 机械 Gate-Plan(替代协作 Gate 3)
71
+
72
+ | 条件 | 检查方式 |
73
+ |------|----------|
74
+ | §1-§4、§7 非空且通过 Goal 自检 | 文档 + AI 清单 |
75
+ | §5.4 三条命令已填且可执行 | 试跑或 `--help` 可解释 |
76
+ | 已在 `feature/RT-XXX-*` 分支 | `git branch --show-current` |
77
+
78
+ 通过 → `state.json.checklist.plan_complete=true`,`phase=implementing`。
79
+
80
+ ### Phase E — Ralph 实现循环
81
+
82
+ 每轮四步(与 Task Platform §4.2 对齐):
83
+
84
+ 1. **Read** — `state.json` + `rt-plan.md` + `loop-prompt.md`(注入当前 iteration)
85
+ 2. **Execute** — 完成 `rt-plan.md` 中 1–2 个未完成步骤;对应推进 §7 checklist
86
+ 3. **Backpressure** — 跑 §5.4 tests → lint → guard;更新 checklist 布尔值
87
+ 4. **Write** — 更新 `state.json`、`rt-plan.md`、`execution-log.md`;必要时 `rt-lite.md` §5-§6
88
+
89
+ **迭代上限**:`max_iterations` 默认 **20**(与 Task Platform `MAX_ITERATIONS` 一致;Spec-Lite 单 RT 可协商降为 15)。写在 `state.json`,创建 RT 时可与用户确认。
90
+
91
+ **冷却**:连续 API/工具失败时,记录 `blockers`,下一轮再试(不在单轮内死磕 >3 次同一错误)。
92
+
93
+ ### Phase F — 机械 Gate-Commit(替代协作 Gate 4)
94
+
95
+ 全部满足才允许 `git commit`:
96
+
97
+ - `tests_pass` && `lint_pass` && `guard_pass`
98
+ - 本轮 diff 与 §2.1 范围一致(guard 辅助)
99
+
100
+ ### Phase G — 机械 Gate-Done(替代协作 Gate 5)
101
+
102
+ **双条件完成**(对齐 Task Platform Goal Spec §三、Ralph「计划清空 + 验证通过」):
103
+
104
+ 1. `rt-plan.md`「进度」区全部 `[x]`(无 `[ ]` 步骤)
105
+ 2. `state.json.checklist` 全 `true`,且 §5.4 tests/lint/guard 均已在本轮或上一轮验证通过
106
+
107
+ 另需:
108
+
109
+ - development auditor 无 P0
110
+ - `meta.yaml.status=done`,`state.json.phase=done`
111
+ - 输出 `DONE`(对齐 Ralph 完成信号,便于外部脚本检测)
112
+
113
+ **机械 Stop 映射**:`guard` + pre-commit hook ≈ Task Platform Stop Hook;不得以纯对话判定替代上述双条件。
114
+
115
+ ---
116
+
117
+ ## 3. 质量控制
118
+
119
+ ### 3.1 每轮 Quality Gate
120
+
121
+ - [ ] 代码可解析/编译
122
+ - [ ] 相关测试通过
123
+ - [ ] lint/type 无新增错误
124
+ - [ ] 改动范围 ≤ 本轮 `rt-plan.md` 目标
125
+ - [ ] `state.json` 已更新
126
+ - [ ] `execution-log.md` 已追加本条
127
+
128
+ ### 3.2 Final Gate
129
+
130
+ - [ ] 所有 §7 条件已验证
131
+ - [ ] 完整测试套件(非抽样)通过
132
+ - [ ] 无临时 debug / 大范围 commented-out
133
+ - [ ] 无新增未说明的 TODO(除非原有问题)
134
+ - [ ] `phase=done`
135
+
136
+ ### 3.3 反模式检测(AI 每轮自检)
137
+
138
+ | 信号 | 含义 | 处理 |
139
+ |------|------|------|
140
+ | 同一文件修改 > 3 次 | 方案可能错误 | 换实现,记入 `decisions` |
141
+ | 同一测试点连续失败 | 理解有误 | 重读 §1、模块 README,更新 `blockers` |
142
+ | checklist 2 轮无进展 | 任务过大 | 拆 `rt-plan.md` 子步骤或 `phase=blocked` |
143
+ | diff 出现 §2.1 外文件 | scope creep | 回滚无关改动,收紧 prompt |
144
+ | 新增「过度烘焙」功能 | 循环过久/目标模糊 | 停止迭代,收紧 §7 或改协作模式 |
145
+
146
+ ---
147
+
148
+ ## 4. 执行子模式(AI 自主选用)
149
+
150
+ 在 **已确认 Autopilot** 的前提下,AI 根据任务特征选择子模式(**无需再次问用户**,但须写入 `state.json.execution_submode`):
151
+
152
+ ```
153
+ 任务评估
154
+
155
+ ├─ 预计多轮、>100K token、需跨重启续接?
156
+ │ └─ 是 → ralph-loop(默认):每轮新上下文,读 state.json
157
+
158
+ ├─ 可在单 session 内完成且 §7 ≤5 条?
159
+ │ └─ 是 → goal-session:单 session 推进,仍须机械验收
160
+
161
+ └─ 默认 → ralph-loop
162
+ ```
163
+
164
+ | 子模式 | 适用 | 风险缓解 |
165
+ |--------|------|----------|
166
+ | `ralph-loop` | 多步骤、长任务、需断点续跑 | `state.json` + `execution-log` |
167
+ | `goal-session` | 小改动、明确终点 | 仍跑 §5.4;避免「Evaluator 式」纯对话判定 |
168
+
169
+ ---
170
+
171
+ ## 5. 与用户交互边界(智能友好)
172
+
173
+ ### 5.1 不打断用户
174
+
175
+ - 每轮实现、测试、更新 state
176
+ - 自动 commit(Gate-Commit 通过后)
177
+ - 文档 §5-§6 同步
178
+
179
+ ### 5.2 必须打断用户
180
+
181
+ 1. `blockers` 非空且 **2 轮**无法消除
182
+ 2. 产品/架构 **二选一**(无默认安全项)
183
+ 3. 熔断:无进展 2 轮 / 达 `max_iterations` / 适配度中途恶化(如出现 schema 变更)
184
+ 4. Goal 自检失败且用户不愿收窄范围
185
+
186
+ ### 5.3 进度友好(推荐)
187
+
188
+ 每 **3 轮**或 **phase 变化**时,向用户发送简短进度(非请求确认):
189
+
190
+ ```
191
+ [RT-012 Autopilot] 迭代 3/15 | phase=implementing
192
+ ✓ C2 tests ✓ C3 lint ○ C5 docs
193
+ 下一步:更新 §6 changelog
194
+ ```
195
+
196
+ ---
197
+
198
+ ## 6. 错误恢复
199
+
200
+ | 场景 | 行为 |
201
+ |------|------|
202
+ | 单轮工具/测试失败 | 记入 `blockers`,下轮续接;**不**整 RT 失败 |
203
+ | 上下文耗尽 | 下轮全新上下文,读 `state.json` |
204
+ | 用户中断 | 保留 `state.json`,下次从 checklist 续跑 |
205
+ | 需改协作模式 | 更新 `meta.yaml.execution_mode=collaborative`,记录 `decisions`,交还 Gate 3/4/5 |
206
+
207
+ ---
208
+
209
+ ## 7. 配置参考
210
+
211
+ | 参数 | 默认 | 说明 |
212
+ |------|------|------|
213
+ | `max_iterations` | 20 | 防无限循环 / 过度烘焙(可对小型 RT 降为 15) |
214
+ | `stall_threshold` | 2 | 连续无进展轮数 → blocked |
215
+ | `same_file_edit_limit` | 3 | 反模式熔断 |
216
+ | `progress_notify_every` | 3 | 可选进度摘要间隔 |
217
+
218
+ ---
219
+
220
+ ## 8. 开工自检(AI)
221
+
222
+ - [ ] 用户已确认 `execution_mode: autopilot`
223
+ - [ ] Goal 质量自检 7/7 通过
224
+ - [ ] Autopilot 适配度 ≥ 4/6(或用户坚持并已知晓风险)
225
+ - [ ] Preflight 完成
226
+ - [ ] `feature/RT-XXX` 分支
227
+ - [ ] `loop-prompt.md` iteration 已设为 1
228
+
229
+ ---
230
+
231
+ ## 9. 文件清单
232
+
233
+ ```
234
+ RT/RT-XXX/
235
+ meta.yaml # execution_mode: autopilot
236
+ decision.md # 含模式确认记录
237
+ rt-lite.md # Goal:§1-§7
238
+ rt-plan.md # Plan:动态步骤
239
+ state.json # 机器状态
240
+ loop-prompt.md # 轮次 prompt
241
+ execution-log.md # 人读时间线
242
+ autopilot-preflight.md # 开工许可
243
+ ```
244
+
245
+ ---
246
+
247
+ ## 10. 参考
248
+
249
+ - Task Platform: `docs/continuous-programming-protocol.md`
250
+ - Task Platform: `docs/goal-specification-standard.md`
251
+ - AODW: `spec-lite-autopilot-profile.md`、`autopilot-goal-spec.md`
@@ -0,0 +1,55 @@
1
+ # RT Autopilot 开工前准备(必读)
2
+
3
+ > `execution_mode: autopilot` 时,实现循环前必须完成。
4
+ > 总协议:`02-workflow/autopilot-protocol.md` | Goal 标准:`02-workflow/autopilot-goal-spec.md`
5
+
6
+ ---
7
+
8
+ ## A. 项目级(一次性)
9
+
10
+ - [ ] `aodw-skill init` 且 `06-project/` 已深度初始化
11
+ - [ ] §5.4 tests / lint / guard 命令本地可执行
12
+ - [ ] pre-commit guard 已启用
13
+
14
+ ---
15
+
16
+ ## B. RT 级(每个 RT)
17
+
18
+ - [ ] 用户创建 RT 时已确认 **Autopilot**(`decision.md` 有记录)
19
+ - [ ] `rt-lite.md` §1-§4、§1.3.1、§7、§5.4 已填写
20
+ - [ ] Goal 质量自检 7/7(见 `autopilot-goal-spec.md` §5)
21
+ - [ ] Autopilot 适配度 ≥ 4/6(见 §6);不足则已改协作或用户知情
22
+ - [ ] §7 用户已确认「完成标准摘要」
23
+ - [ ] `state.json.checklist` 与 §7 对齐
24
+ - [ ] `rt-plan.md` 已创建并拆解步骤
25
+ - [ ] `feature/RT-XXX-*` 分支
26
+
27
+ ---
28
+
29
+ ## C. 禁止开工
30
+
31
+ - 完成条件含模糊词或不可机械验证
32
+ - 「不改什么」少于 3 项
33
+ - 跨模块高风险未升级 Spec-Full
34
+ - main/master 上改业务代码
35
+ - Goal 自检未通过
36
+
37
+ ---
38
+
39
+ ## D. 每轮固定动作
40
+
41
+ 1. 读 `state.json` + `rt-plan.md` + `loop-prompt.md`
42
+ 2. 完成 1–2 个 plan 步骤
43
+ 3. tests → lint → guard(Backpressure)
44
+ 4. 更新 `state.json`、`rt-plan.md`、`execution-log.md`
45
+ 5. 反模式自检(见 `autopilot-protocol.md` §3.3)
46
+
47
+ ---
48
+
49
+ ## E. 关联规则
50
+
51
+ | 文档 | 用途 |
52
+ |------|------|
53
+ | `autopilot-protocol.md` | 总协议、熔断、子模式 |
54
+ | `autopilot-goal-spec.md` | 三要素、适配度 |
55
+ | `spec-lite-autopilot-profile.md` | Gate 速查 |
@@ -56,12 +56,41 @@ RT-Manager 统一管理全局状态机更新。
56
56
  - 改进
57
57
  - 重构
58
58
 
59
- ### 3.2 执行步骤
60
- 1. 生成 RT-ID(固定本地生成)
61
- 2. 创建 RT 目录结构
62
- 3. 执行交互式澄清(选项化提问)
63
- 4. 记录立项信息到 `intake.md`
64
- 5. 决定使用 Spec-Full 还是 Spec-Lite profile
59
+ ### 3.2 执行模式确认(强制,最先执行)
60
+
61
+ **在生成 RT-ID、创建目录或写入任何 RT 文件之前**,AI 必须与用户确认执行模式,并获得**明确答复**。
62
+
63
+ | 模式 | `execution_mode` | 含义 |
64
+ |------|------------------|------|
65
+ | 人工干预(协作) | `collaborative` | Gate 3/4/5 需用户确认后再推进 |
66
+ | 全自动(Autopilot) | `autopilot` | 机械 Gate + `state.json` 循环;仅熔断时打断用户 |
67
+
68
+ **提问格式**(决策型,见 `01-core/ai-interaction-rules.md`):
69
+
70
+ ```
71
+ Q. 本 RT 采用哪种执行模式?
72
+
73
+ A. 人工干预模式(协作)— Gate 3/4/5 需我确认
74
+ B. 全自动模式(Autopilot)— 机械验收 + 循环推进
75
+
76
+ Recommended: A(首次使用 AODW 或需求/风险尚不清晰时)
77
+
78
+ 请回复:A/B
79
+ ```
80
+
81
+ **强制规则**:
82
+ - 🚫 用户未明确选择 A 或 B(或等价 custom)前,**禁止**创建 `RT/RT-XXX/`、禁止写 `meta.yaml`、禁止进入 intake/decision/实现
83
+ - 🚫 **禁止** AI 自行默认 `collaborative` 或 `autopilot` 并继续
84
+ - ✅ 用户确认后,立即写入 `meta.yaml.execution_mode` 与 `decision.md` 的「Execution Mode」节,并记录确认时间
85
+ - ✅ CLI:`aodw-skill new` 会在创建前交互选择;非交互须显式 `--execution-mode`
86
+
87
+ ### 3.3 执行步骤
88
+ 1. **确认执行模式**(§ 3.2,未完成则停止)
89
+ 2. 生成 RT-ID(固定本地生成)
90
+ 3. 创建 RT 目录结构(`execution_mode` 已写入 `meta.yaml`)
91
+ 4. 执行交互式澄清(选项化提问)
92
+ 5. 记录立项信息到 `intake.md`
93
+ 6. 决定使用 Spec-Full 还是 Spec-Lite profile
65
94
 
66
95
  ---
67
96
 
@@ -116,7 +145,27 @@ RT/RT-XXX/
116
145
  AI 根据决策结果,加载对应的 Profile:
117
146
 
118
147
  - Spec-Full → 加载 `02-workflow/spec-full-profile.md`
119
- - Spec-Lite 加载 `02-workflow/spec-lite-profile.md`
148
+ - Spec-Lite + `execution_mode=collaborative`(默认)→ 加载 `02-workflow/spec-lite-profile.md`
149
+ - Spec-Lite + `execution_mode=autopilot` → 加载 `02-workflow/spec-lite-autopilot-profile.md`
150
+
151
+ ### 7.1 Autopilot RT 附加文件(Spec-Lite)
152
+
153
+ 当 `meta.yaml.execution_mode: autopilot` 时:
154
+
155
+ | 文档 | 角色 |
156
+ |------|------|
157
+ | `rt-lite.md` | Goal(静态):§7 完成条件,三要素写法见 `autopilot-goal-spec.md` |
158
+ | `rt-plan.md` | Plan(动态):每轮更新的步骤清单 |
159
+ | `state.json` | 机器状态:checklist、phase、熔断信号 |
160
+ | `loop-prompt.md` | 每轮 Ralph 执行指令 |
161
+ | `execution-log.md` | 人读时间线(防黑盒) |
162
+ | `autopilot-preflight.md` | 开工许可 |
163
+
164
+ **总协议**:`02-workflow/autopilot-protocol.md`(Ralph 循环、机械 Gate、反模式、子模式、进度友好)。
165
+
166
+ Autopilot 流程摘要:
167
+ 1. 用户确认模式(§3.2)→ 2. Goal 定稿 + 自检 → 3. Preflight → 4. Gate-Plan → 5. Ralph 循环 → 6. Gate-Commit/Done
168
+ 熔断时交还人工;不得跳过 Goal 自检进入循环。
120
169
 
121
170
  ---
122
171
 
@@ -0,0 +1,101 @@
1
+ ---
2
+ id: aodw-spec-lite-autopilot
3
+ version: 2.0.0
4
+ category: aodw/execution-profile
5
+ trigger: "当 meta.yaml 中 execution_mode=autopilot 时加载"
6
+ description: >
7
+ Spec-Lite 全自动变体:机械 Gate + Ralph 循环 + Goal Spec。完整协议见 autopilot-protocol.md。
8
+ requires_files:
9
+ - RT/RT-XXX/rt-lite.md
10
+ - RT/RT-XXX/rt-plan.md
11
+ - RT/RT-XXX/state.json
12
+ - RT/RT-XXX/loop-prompt.md
13
+ - RT/RT-XXX/execution-log.md
14
+ ---
15
+
16
+ # Skill: aodw-spec-lite-autopilot
17
+ AODW Spec-Lite Autopilot 执行规范 v2.0
18
+
19
+ > **总协议**:`02-workflow/autopilot-protocol.md`
20
+ > **Goal 标准**:`02-workflow/autopilot-goal-spec.md`
21
+ > **开工清单**:`02-workflow/rt-autopilot-readiness.md`
22
+
23
+ 将协作模式的 Gate 3/4/5 替换为机械 Gate;用 `state.json` + `rt-plan.md` 驱动 Ralph 循环直至 DONE。
24
+
25
+ ---
26
+
27
+ ## 1. 前置条件
28
+
29
+ 1. 用户创建 RT 时已**明确确认** `execution_mode: autopilot`(见 `rt-manager.md` §3.2)
30
+ 2. 通过 `autopilot-goal-spec.md` Goal 质量自检与适配度研判(≥4/6 或用户知情坚持)
31
+ 3. 完成 Preflight(`autopilot-preflight.md`)
32
+
33
+ 不满足 → 回退 `spec-lite-profile.md`(`collaborative`)。
34
+
35
+ ---
36
+
37
+ ## 2. RT 必备文件
38
+
39
+ ```
40
+ RT/RT-XXX/
41
+ meta.yaml
42
+ rt-lite.md # Goal(静态)
43
+ rt-plan.md # Plan(每轮更新)
44
+ state.json
45
+ loop-prompt.md
46
+ execution-log.md
47
+ autopilot-preflight.md
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 3. 执行流程(摘要)
53
+
54
+ | 阶段 | 动作 | Gate |
55
+ |------|------|------|
56
+ | 0 | `feature/RT-XXX` 分支 | 强制 |
57
+ | B | 定稿 rt-lite §1-§7;用户确认完成标准摘要 | Goal 自检 |
58
+ | C | Preflight 全勾 | 人工清单 |
59
+ | D | `plan_complete=true` | 机械 Gate-Plan |
60
+ | E | Ralph 循环(读 state → 做 1-2 项 → tests/lint/guard → 写 state/plan/log) | 每轮 Quality Gate |
61
+ | F | commit | 机械 Gate-Commit |
62
+ | G | `status=done` | 机械 Gate-Done |
63
+
64
+ 细节、反模式、子模式、熔断:**见 `autopilot-protocol.md`**。
65
+
66
+ ---
67
+
68
+ ## 4. 机械 Gate 条件(速查)
69
+
70
+ **Gate-Plan**:§1-§4、§7、§5.4 就绪;Goal 自检通过;`plan_complete=true`。
71
+
72
+ **Gate-Commit**:`tests_pass` && `lint_pass` && `guard_pass`。
73
+
74
+ **Gate-Done**:§7 全部验证;checklist 全 true;auditor 无 P0;`phase=done`。
75
+
76
+ ---
77
+
78
+ ## 5. 熔断(交还人工)
79
+
80
+ - 同一文件修改 > 3 次
81
+ - checklist 连续 2 轮无进展 → `phase=blocked`
82
+ - 达到 `max_iterations`(默认 20)
83
+ - 出现 schema/API/多模块架构决策
84
+
85
+ ---
86
+
87
+ ## 6. Red Lines
88
+
89
+ - 🚫 未确认 execution_mode 即创建 RT
90
+ - 🚫 跳过 Goal 自检进入循环
91
+ - 🚫 用主观判断替代 §7 机械验收
92
+ - 🚫 无 `state.json` / `execution-log` 更新进入下一轮
93
+ - 🚫 在 Autopilot 中等待人工 Gate 3/4/5(除非熔断)
94
+
95
+ ---
96
+
97
+ ## 7. 参考
98
+
99
+ - `autopilot-protocol.md` — 总协议
100
+ - `autopilot-goal-spec.md` — 三要素与适配度
101
+ - `spec-lite-profile.md` — 协作模式对照