aodw-skill 0.7.27 → 0.7.28
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/.aodw-next/01-core/aodw-constitution.md +413 -2
- package/.aodw-next/02-workflow/autopilot-protocol.md +5 -2
- package/.aodw-next/02-workflow/rt-autopilot-readiness.md +5 -1
- package/.aodw-next/02-workflow/rt-manager.md +45 -10
- package/.aodw-next/02-workflow/spec-lite-autopilot-profile.md +8 -3
- package/.aodw-next/02-workflow/spec-lite-profile.md +2 -0
- package/.aodw-next/SKILL.md +2 -0
- package/.aodw-next/templates/aodw-kernel-loader-template.md +1 -0
- package/.aodw-next/templates/rt-autopilot-preflight.template.md +4 -0
- package/.aodw-next/templates/rt-lite.template.md +1 -1
- package/AODW_Adapters/antigravity/.agent/rules/aodw-next.md +1 -0
- package/AODW_Adapters/claude/CLAUDE.md +1 -0
- package/AODW_Adapters/cursor/.cursor/rules/aodw-next.mdc +1 -0
- package/AODW_Adapters/openclaw/AGENTS.md +141 -0
- package/AODW_Adapters/openclaw/SKILL.md +111 -0
- package/bin/aodw.js +27 -1
- package/bin/processors/index.js +13 -0
- package/package.json +1 -1
|
@@ -1,8 +1,419 @@
|
|
|
1
|
-
|
|
1
|
+
# AI-Orchestrated Development Workflow (AODW) Constitution
|
|
2
|
+
|
|
3
|
+
## 1. Purpose
|
|
4
|
+
AI-Orchestrated Development Workflow(AODW)定义了一种 **AI 主导、文档驱动、可回溯** 的软件开发范式。
|
|
5
|
+
目标:
|
|
6
|
+
|
|
7
|
+
- 由 AI 负责驱动需求 → 设计 → 实现 → 完成的全过程;
|
|
8
|
+
- 用户主要负责回答问题、提供信息、做关键选择与确认;
|
|
9
|
+
- 所有改动都有清晰的 RT 编号、文档记录与 Git 历史;
|
|
10
|
+
- 文档由 AI 持续维护,始终反映当前系统真实状态;
|
|
11
|
+
- 工作流对工具中立,可被 Cursor、Claude、Codeium 等多种 AI 工具共同遵守。
|
|
2
12
|
|
|
3
13
|
---
|
|
4
14
|
|
|
5
|
-
|
|
15
|
+
### 1.4 Universal Output Standards(通用输出标准)
|
|
16
|
+
|
|
17
|
+
- **固定指令**:在每次执行任务前,AI 应默认遵循 `Implementation Plan, Task List and Thought in Chinese`。
|
|
18
|
+
- **文档即代码**:所有文档必须与代码保持同步,文档与代码不一致视为 Bug。
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### 1.5 Universal Interaction Standards(通用交互标准)
|
|
24
|
+
|
|
25
|
+
AI 在所有阶段与用户互动时应遵循:
|
|
26
|
+
|
|
27
|
+
- **选项化提问**:始终以选项 + 推荐的形式与用户互动。
|
|
28
|
+
- **推荐理由**:对关键问题提供简短、明确的推荐理由。
|
|
29
|
+
- **透明度**:在不确定时主动说明不确定性,并请求用户判断。
|
|
30
|
+
- **业务优先**:尽量避免把实现细节问题抛给用户决定(除非涉及业务规则)。
|
|
31
|
+
|
|
32
|
+
#### 1.5.1 LLM 编码防失误行为(强制)
|
|
33
|
+
|
|
34
|
+
在进入代码实现前,AI 必须满足以下四项:
|
|
35
|
+
|
|
36
|
+
1. **假设显式化**:关键假设必须明确写出;
|
|
37
|
+
2. **歧义显式化**:存在多种解释时必须列出选项与推荐,不得静默选择;
|
|
38
|
+
3. **最小方案优先**:优先最小必要改动,禁止无请求功能扩展;
|
|
39
|
+
4. **成功标准可验证**:任务必须转写为可验证目标(测试/验收/回归路径)。
|
|
40
|
+
|
|
41
|
+
如任一项缺失,AI 必须先澄清再编码。
|
|
42
|
+
|
|
43
|
+
用户可以随时要求 AI:
|
|
44
|
+
- 展示当前 RT 的 spec / plan / impact / invariants / tests / changelog
|
|
45
|
+
- 解释某项修改或设计决策的原因
|
|
46
|
+
- 回顾本 RT 的整体变更历史
|
|
47
|
+
|
|
48
|
+
### 1.6 Universal Task Tracking(通用任务追踪)
|
|
49
|
+
|
|
50
|
+
> **规则**:在执行任何复杂任务时,AI 必须维护一个用户可见的 `task.md`。
|
|
51
|
+
|
|
52
|
+
> **触发条件**(满足任一即可):
|
|
53
|
+
> - RT 工作流中:所有 Spec-Full RT 必须创建 task.md;Spec-Lite RT 如果预计步骤 > 3 则必须创建
|
|
54
|
+
> - 非 RT 任务:预计 Tool Calls > 3 或预计执行步骤 > 3
|
|
55
|
+
> - 用户明确要求创建时
|
|
56
|
+
>
|
|
57
|
+
> **判断标准**:
|
|
58
|
+
> - 步骤数:基于 plan.md 中的阶段数或任务清单项数
|
|
59
|
+
> - Tool Calls:基于任务复杂度预估(文件操作、代码修改、文档更新等)
|
|
60
|
+
|
|
61
|
+
- **位置**:
|
|
62
|
+
- RT 工作流中:必须放在 `RT/RT-XXX/task.md`
|
|
63
|
+
- 非 RT 任务:放在当前上下文的 Artifact 区域
|
|
64
|
+
|
|
65
|
+
- **更新频率**:
|
|
66
|
+
- **必须更新**:每完成一个阶段(Phase)或主要任务项(Task Item)后立即更新
|
|
67
|
+
- **建议更新**:每完成一个子步骤(Sub-task)后更新
|
|
68
|
+
- **关键步骤定义**:
|
|
69
|
+
- 完成一个文件或一组相关文件的修改
|
|
70
|
+
- 完成一个配置文件的更新
|
|
71
|
+
- 完成一个文档的创建或更新
|
|
72
|
+
- 完成一次 Git 提交
|
|
73
|
+
- 完成一个测试或验证步骤
|
|
74
|
+
- **最小更新频率**:每 5 个 Tool Calls 或每 10 分钟(以先到为准)至少更新一次
|
|
75
|
+
|
|
76
|
+
- **内容格式**:
|
|
77
|
+
- `[x]` 已完成步骤
|
|
78
|
+
- `[/]` 进行中步骤(高亮)
|
|
79
|
+
- `[ ]` 待执行步骤
|
|
80
|
+
|
|
81
|
+
**内容格式示例**:详见 `.aodw-next/02-workflow/rt-manager.md` 第 8.3 节。
|
|
82
|
+
|
|
83
|
+
**执行检查机制**:
|
|
84
|
+
- AI 在执行任何 Tool Call 前,应检查:
|
|
85
|
+
1. 当前任务是否满足创建 task.md 的条件?
|
|
86
|
+
2. 如果已创建 task.md,当前操作是否应该更新它?
|
|
87
|
+
- 如果应该更新但未更新,AI 应在完成当前操作后立即补充更新
|
|
88
|
+
- 在每次提交代码前,AI 必须检查 task.md 是否已更新到最新状态
|
|
89
|
+
|
|
90
|
+
**目的**:确保用户能像看进度条一样实时感知 AI 的执行进度,消除"黑盒"焦虑。
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## 2. Core Architecture
|
|
96
|
+
|
|
97
|
+
AODW 由四层组成:
|
|
98
|
+
|
|
99
|
+
1. **Interaction Layer(交互层)**
|
|
100
|
+
2. **Orchestration Layer(编排层 / RT-Manager)**
|
|
101
|
+
3. **Execution Layer(执行层 / Spec-Full & Spec-Lite Profiles + Git Discipline)**
|
|
102
|
+
4. **Knowledge Layer(知识层 / 文档体系)**
|
|
103
|
+
|
|
104
|
+
### 2.1 Interaction Layer(交互层)
|
|
105
|
+
|
|
106
|
+
- 用户以自然语言提出问题、需求或目标(Feature / Bug / Enhancement / Refactor / Research 等)。
|
|
107
|
+
- AI 必须主动:
|
|
108
|
+
- 解析意图与类型;
|
|
109
|
+
- 提出澄清问题,每个问题提供多个选项;
|
|
110
|
+
- 为每个问题提供推荐选项与简短理由;
|
|
111
|
+
- 在无明确用户指令时仍能自动推进流程。
|
|
112
|
+
- 用户只需:
|
|
113
|
+
- 在选项中做选择(或提供简短自定义答案);
|
|
114
|
+
- 对关键决策进行确认或否决。
|
|
115
|
+
|
|
116
|
+
### 2.2 Orchestration Layer(RT-Manager)
|
|
117
|
+
|
|
118
|
+
RT-Manager 是 AODW 的“大脑”和总控:
|
|
119
|
+
|
|
120
|
+
- 负责统一的 **请求票编号(RT-ID)**:`RT-{seq}`,如 `RT-001`、`RT-042`;
|
|
121
|
+
- ⚠️ **重要**:RT-ID 的获取必须遵循 `.aodw-next/02-workflow/rt-id-generation-rules.md`
|
|
122
|
+
- 当前策略:统一本地生成(扫描 `RT/` 目录找最大序号并递增),不依赖远程分配服务
|
|
123
|
+
- 负责统一的 **目录结构**:`/RT/RT-XXX/`;
|
|
124
|
+
- 负责统一的 **分支命名**:`feature/RT-XXX-short-name`;
|
|
125
|
+
- 执行 **Intake(立项)流程**:
|
|
126
|
+
- 收集原始描述;
|
|
127
|
+
- 通过交互澄清范围、风险、影响模块;
|
|
128
|
+
- 记录立项信息到 `intake.md`;
|
|
129
|
+
- 做出 **流程分流决策**:
|
|
130
|
+
- 决定当前 RT 使用 Spec-Full 还是 Spec-Lite profile;
|
|
131
|
+
- 将决策记录在 `decision.md`;
|
|
132
|
+
- 初始化 RT 所需的基础文件与分支。
|
|
133
|
+
|
|
134
|
+
RT-Manager 管理统一状态机:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
created → intakeing → decided → in-progress → reviewing → done
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2.3 Execution Layer(执行层)
|
|
141
|
+
|
|
142
|
+
Execution Layer 由三部分组成:
|
|
143
|
+
|
|
144
|
+
1. **Spec-Full Profile**:适用复杂功能 / 大改动 / 高风险改动。详见 `.aodw-next/02-workflow/spec-full-profile.md`。
|
|
145
|
+
2. **Spec-Lite Profile**:适用小范围变更 / bug 修复 / 小增强。详见 `.aodw-next/02-workflow/spec-lite-profile.md`。
|
|
146
|
+
3. **Git Discipline**:统一的完成和收尾规则。详见 `.aodw-next/01-core/git-discipline.md`。
|
|
147
|
+
|
|
148
|
+
**知识蒸馏(完成前提)**:在执行 Git Discipline 前,必须通过 `modules-index.yaml` 找到对应模块文档,更新模块 README,确认文档反映最新代码状态。详见 `.aodw-next/01-core/ai-knowledge-rules.md` 第 4 节。
|
|
149
|
+
|
|
150
|
+
### 2.4 Knowledge Layer(知识层)
|
|
151
|
+
|
|
152
|
+
Knowledge Layer 定义了所有文档资产与维护规则,包括:
|
|
153
|
+
|
|
154
|
+
- 全局文档(如:`aodw-constitution.md`、`ai-overview.md`、`ai-coding-rules.md`、`ai-knowledge-rules.md`);
|
|
155
|
+
- 模块级 README(每个重要模块一个 README);
|
|
156
|
+
- 每个 RT 的本地知识库:详见 `.aodw-next/02-workflow/rt-manager.md` 第 2 节(目录结构)和 `.aodw-next/01-core/ai-knowledge-rules.md` 第 2.2 节(文档分类)
|
|
157
|
+
|
|
158
|
+
- 数据模型与合约文件(`data-model.md`、`contracts/` 等)。
|
|
159
|
+
|
|
160
|
+
AI 必须主动:
|
|
161
|
+
|
|
162
|
+
- 创建缺失文档的骨架;
|
|
163
|
+
- 识别与改动相关的文档;
|
|
164
|
+
- 在变更前后更新文档内容;
|
|
165
|
+
- 保证关键文档与代码的行为保持一致。
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 3. IDs, Branches, Directories
|
|
170
|
+
|
|
171
|
+
- 所有工作项使用统一编号:`RT-{seq}`。
|
|
172
|
+
- 每个 RT 对应目录:`/RT/RT-{seq}/`。
|
|
173
|
+
- 每个 RT 对应 feature 分支:`feature/RT-{seq}-{short-name}`。
|
|
174
|
+
|
|
175
|
+
详见 `rt-manager.md` (RT-ID, 目录结构) 和 `git-discipline.md` (分支命名)。
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 4. AI Responsibilities
|
|
180
|
+
|
|
181
|
+
AI 在 AODW 中是 **主导角色**,必须遵守:
|
|
182
|
+
|
|
183
|
+
1. **主动性**
|
|
184
|
+
- 不等待具体命令,应自动推进到下一合理阶段;
|
|
185
|
+
- 对缺失信息,主动提出问题与选项;
|
|
186
|
+
- 对不一致信息,主动提醒并提出解决方案。
|
|
187
|
+
|
|
188
|
+
2. **选项化提问**
|
|
189
|
+
- 所有关键问题应提供 2–5 个选项;
|
|
190
|
+
- 对每个问题提供一个推荐选项,并给出简短理由;
|
|
191
|
+
- 允许用户给出短自定义答案(≤ 5 个词)。
|
|
192
|
+
|
|
193
|
+
3. **显式设计与评估**
|
|
194
|
+
- 在改代码前必须做影响分析;
|
|
195
|
+
- 明确 Invariants(不可破坏边界);
|
|
196
|
+
- 至少比较多个方案并说明取舍。
|
|
197
|
+
|
|
198
|
+
4. **文档维护**
|
|
199
|
+
- 任何改动必须同步更新相关文档(详见 `ai-knowledge-rules.md`);
|
|
200
|
+
- 文档更新必须尽量自动完成,仅在必要时向用户确认。
|
|
201
|
+
|
|
202
|
+
5. **工具无关性**
|
|
203
|
+
- 行为必须通过仓库中的文档进行约束、而非绑定某个具体产品;
|
|
204
|
+
- 不依赖专有黑箱配置。
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 4.5 Checkpoint Gates(门禁检查点)
|
|
209
|
+
|
|
210
|
+
> **核心原则**:AI 在关键节点必须暂停等待用户确认,不得自动跳过。
|
|
211
|
+
|
|
212
|
+
### 4.5.1 红线规则 (Red Lines)
|
|
213
|
+
|
|
214
|
+
以下规则是**绝对禁止**的,违反任一条即为流程失败:
|
|
215
|
+
|
|
216
|
+
1. 🚫 **Never Code on Main** - 绝对禁止在 main/master 分支修改业务代码
|
|
217
|
+
2. 🚫 **Never Skip Plan Approval** - 绝对禁止在 Plan 未获用户"批准"前开始修改代码
|
|
218
|
+
3. 🚫 **Never Auto-Merge** - 绝对禁止自动执行 git merge 或 git push
|
|
219
|
+
4. 🚫 **Never Skip User Confirmation at Gates** - 在每个门禁点必须等待用户确认
|
|
220
|
+
5. 🚫 **Always Chinese** - 所有回复、文档、思考过程必须使用中文
|
|
221
|
+
|
|
222
|
+
### 4.5.2 门禁点定义
|
|
223
|
+
|
|
224
|
+
| Gate | 名称 | 触发时机 | 必须行为 | 审计选项 |
|
|
225
|
+
| ---------- | -------- | ------------------ | ------------------- | ---------- |
|
|
226
|
+
| **Gate 0** | 流程启动 | 识别到代码修改请求 | 询问是否启动 AODW | - |
|
|
227
|
+
| **Gate 1** | 需求确认 | Intake 完成后 | 展示摘要,等待确认 | 📋 需求审计 |
|
|
228
|
+
| **Gate 2** | 分支确认 | 创建分支后 | 验证分支,展示状态 | - |
|
|
229
|
+
| **Gate 3** | 计划批准 | Plan 完成后 | 展示计划,等待批准 | 📋 需求审计 |
|
|
230
|
+
| **Gate 4** | 提交确认 | 代码完成后 | 展示 diff,等待确认 | 🔧 开发审计 |
|
|
231
|
+
| **Gate 5** | 完成确认 | RT 准备关闭 | 提供脚本,等待确认 | 🔍 综合审计 |
|
|
232
|
+
|
|
233
|
+
### 4.5.3 门禁点行为规范
|
|
234
|
+
|
|
235
|
+
**在每个门禁点,AI 必须:**
|
|
236
|
+
1. 暂停当前操作
|
|
237
|
+
2. 展示当前阶段完成的工作摘要
|
|
238
|
+
3. 说明下一步将要做什么(至少 3 点)
|
|
239
|
+
4. 提供审计选项(如适用)
|
|
240
|
+
5. 等待用户明确回复("继续"/"批准"/"确认")
|
|
241
|
+
|
|
242
|
+
**禁止行为:**
|
|
243
|
+
- ❌ 不接受"沉默即同意"
|
|
244
|
+
- ❌ 不能自行推断用户意图
|
|
245
|
+
- ❌ 不能跳过任何门禁点
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 4.6 Next Step Transparency(下一步计划透明)
|
|
250
|
+
|
|
251
|
+
> **核心原则**:用户始终知道 AI 在做什么、做到哪一步、下一步是什么。
|
|
252
|
+
|
|
253
|
+
### 4.6.1 输出格式
|
|
254
|
+
|
|
255
|
+
AI 在每次回复结束后,必须输出以下格式:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
┌─────────────────────────────────────────────────────────┐
|
|
259
|
+
│ 🎯 RT-XXX: [任务标题] │
|
|
260
|
+
│ 📍 当前阶段: [阶段名称] | 🚪 Gate X: [门禁名称] │
|
|
261
|
+
└─────────────────────────────────────────────────────────┘
|
|
262
|
+
|
|
263
|
+
## ✅ 已完成
|
|
264
|
+
- [已完成的工作项]
|
|
265
|
+
|
|
266
|
+
## 📌 下一步计划
|
|
267
|
+
1. [具体行动 1]
|
|
268
|
+
2. [具体行动 2]
|
|
269
|
+
3. [具体行动 3]
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
⏸️ **等待确认**
|
|
273
|
+
- 回复"继续"进入下一阶段
|
|
274
|
+
- 回复"审计"启动审计
|
|
275
|
+
- 回复"调整"修改当前内容
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### 4.6.2 要求
|
|
279
|
+
|
|
280
|
+
- **最少 3 点**:下一步计划必须至少包含 3 点具体行动
|
|
281
|
+
- **具体可执行**:每点行动应具体到可执行的步骤
|
|
282
|
+
- **审计提醒**:在 Gate 1, 3, 4, 5 必须提供审计选项
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
## 5. User Responsibilities
|
|
288
|
+
|
|
289
|
+
用户的职责是:
|
|
290
|
+
|
|
291
|
+
- 清晰表达意图与业务目标(不必懂具体实现);
|
|
292
|
+
- 回答 AI 提出的问题(选择推荐项或给出简短自定义答案);
|
|
293
|
+
- 对重要决策进行认可或否决;
|
|
294
|
+
- 对关键文档(如 spec / plan)在必要时进行业务视角的审阅。
|
|
295
|
+
|
|
296
|
+
用户不需要:
|
|
297
|
+
|
|
298
|
+
- 手动运行繁琐流程;
|
|
299
|
+
- 手动维护分支、tag、任务状态;
|
|
300
|
+
- 自己组织复杂文档结构。
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## 6. File Loading Strategy(文件加载策略)
|
|
305
|
+
|
|
306
|
+
> ⚠️ **Token 优化原则**:为了减少 token 消耗,AI 必须遵循"按需加载"策略,只在需要时读取相关文件。
|
|
307
|
+
|
|
308
|
+
### 6.1 加载原则
|
|
309
|
+
|
|
310
|
+
1. **按阶段加载**:只在当前阶段需要时加载相关文件
|
|
311
|
+
2. **避免重复加载**:如果文件已在上下文中,不再重复读取
|
|
312
|
+
3. **按需加载**:根据任务类型和阶段,只加载必要的文件
|
|
313
|
+
4. **摘要优先**:如果存在摘要版本,优先读取摘要,需要详细信息时再读取完整版
|
|
314
|
+
|
|
315
|
+
### 6.2 阶段化加载指南
|
|
316
|
+
|
|
317
|
+
#### 阶段 1:创建 RT(最小加载)
|
|
318
|
+
**必须加载**:
|
|
319
|
+
- `.aodw-next/02-workflow/rt-manager.md`(Section 1-4, 8-9)
|
|
320
|
+
- `.aodw-next/01-core/ai-interaction-rules.md`(Section 0, 1-4)
|
|
321
|
+
- `.aodw-next/02-workflow/rt-id-generation-rules.md`(Section 1-3)
|
|
322
|
+
|
|
323
|
+
**可选加载**:
|
|
324
|
+
- `.aodw-next/01-core/aodw-constitution.md`(如果未在 Kernel Loader 中加载)
|
|
325
|
+
|
|
326
|
+
#### 阶段 2:Intake(按需加载)
|
|
327
|
+
**必须加载**:
|
|
328
|
+
- `.aodw-next/01-core/ai-interaction-rules.md`(如果未加载)
|
|
329
|
+
|
|
330
|
+
**按需加载**:
|
|
331
|
+
- 如果涉及 UI:`.aodw-next/02-workflow/ui-workflow-rules.md`(Section 1.1-1.3)
|
|
332
|
+
- 如果涉及前端/后端:相关编码规范文件(在 Plan 阶段再加载)
|
|
333
|
+
|
|
334
|
+
#### 阶段 3:决策(按需加载)
|
|
335
|
+
**必须加载**:
|
|
336
|
+
- `.aodw-next/02-workflow/rt-manager.md`(Section 5)
|
|
337
|
+
|
|
338
|
+
**按需加载**:
|
|
339
|
+
- 如果选择 Spec-Full:`.aodw-next/02-workflow/spec-full-profile.md`
|
|
340
|
+
- 如果选择 Spec-Lite:`.aodw-next/02-workflow/spec-lite-profile.md`
|
|
341
|
+
|
|
342
|
+
#### 阶段 4:Spec/Plan(按需加载)
|
|
343
|
+
**必须加载**:
|
|
344
|
+
- 对应的 Profile 文件(spec-full-profile.md 或 spec-lite-profile.md)
|
|
345
|
+
|
|
346
|
+
**按需加载**:
|
|
347
|
+
- 如果涉及 UI:`.aodw-next/02-workflow/ui-workflow-rules.md` + `.aodw-next/03-standards/ui-kit/ui-kit.md`
|
|
348
|
+
- 如果涉及前端:`.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md`
|
|
349
|
+
- 如果涉及后端:`.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md`
|
|
350
|
+
- 如果需要 CSF 审查:`.aodw-next/01-core/csf-thinking-framework.md`
|
|
351
|
+
|
|
352
|
+
**审计阶段加载**:
|
|
353
|
+
- 需求审计:`.aodw-next/04-auditors/aodw-requirement-auditor-rules.md`(仅在执行审计时加载)
|
|
354
|
+
- 开发审计:`.aodw-next/04-auditors/aodw-development-auditor-rules.md`(仅在执行审计时加载)
|
|
355
|
+
|
|
356
|
+
#### 阶段 5:实现(按需加载)
|
|
357
|
+
**必须加载**:
|
|
358
|
+
- `.aodw-next/03-standards/ai-coding-rules.md`(Section 6)
|
|
359
|
+
- `.aodw-next/03-standards/ai-coding-rules-common.md`
|
|
360
|
+
|
|
361
|
+
**按需加载**:
|
|
362
|
+
- 根据技术栈加载对应的编码规范(前端/后端)
|
|
363
|
+
- `.aodw-next/01-core/module-doc-rules.md`(如果涉及模块文档更新)
|
|
364
|
+
|
|
365
|
+
#### 阶段 6:验证/完成(按需加载)
|
|
366
|
+
**必须加载**:
|
|
367
|
+
- `.aodw-next/01-core/ai-knowledge-rules.md`(Section 5, 9)
|
|
368
|
+
- `.aodw-next/01-core/git-discipline.md`
|
|
369
|
+
|
|
370
|
+
### 6.3 UI 任务特殊处理
|
|
371
|
+
|
|
372
|
+
**UI 任务文件加载**(仅在识别为 UI 任务时):
|
|
373
|
+
- `.aodw-next/02-workflow/ui-workflow-rules.md`
|
|
374
|
+
- `.aodw-next/03-standards/ui-kit/ui-kit.md`(合并后的文件,~2KB)
|
|
375
|
+
|
|
376
|
+
**注意**:UI-Kit 文件应该合并为单个文件,减少加载次数。
|
|
377
|
+
|
|
378
|
+
### 6.4 避免重复加载
|
|
379
|
+
|
|
380
|
+
**检查机制**:
|
|
381
|
+
- 在加载文件前,检查该文件是否已在当前上下文中
|
|
382
|
+
- 如果已存在,跳过加载,直接引用
|
|
383
|
+
- 记录已加载的文件列表,避免重复
|
|
384
|
+
|
|
385
|
+
**缓存策略**:
|
|
386
|
+
- 在同一 RT 工作流中,已加载的文件可以复用
|
|
387
|
+
- 跨 RT 时,需要重新加载(因为上下文可能不同)
|
|
388
|
+
|
|
389
|
+
### 6.5 Token 消耗目标
|
|
390
|
+
|
|
391
|
+
**优化目标**:
|
|
392
|
+
- Spec-Lite RT 创建:< 8,000 tokens
|
|
393
|
+
- Spec-Full RT 创建:< 12,000 tokens
|
|
394
|
+
- UI 任务:< 3,000 tokens(额外)
|
|
395
|
+
- 代码实现阶段:< 6,000 tokens
|
|
396
|
+
|
|
397
|
+
**当前消耗**(需要优化):
|
|
398
|
+
- Spec-Lite RT 创建:~16,338 tokens
|
|
399
|
+
- Spec-Full RT 创建:~24,275 tokens
|
|
400
|
+
- UI 任务:~9,055 tokens
|
|
401
|
+
- 代码实现阶段:~10,971 tokens
|
|
402
|
+
|
|
403
|
+
> **详细分析**:请参考 `.aodw-next/07-optimization/token-usage-analysis.md`
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## 7. Tool-Agnostic Principle
|
|
408
|
+
|
|
409
|
+
AODW 所有规则必须通过 **仓库中的文档与约定** 体现,而不是特定工具配置。
|
|
410
|
+
任何具备以下能力的 AI 工具都可以实现 AODW:
|
|
411
|
+
|
|
412
|
+
- 能够读取项目文件(尤其是 `.aodw-next/` 目录与 `RT/` 目录);
|
|
413
|
+
- 能执行代码搜索与分析;
|
|
414
|
+
- 能与用户交互提问与确认。
|
|
415
|
+
|
|
416
|
+
---
|
|
6
417
|
|
|
7
418
|
**关键章节定位**:
|
|
8
419
|
- 核心原则 → § 1
|
|
@@ -65,7 +65,7 @@ flowchart TD
|
|
|
65
65
|
|
|
66
66
|
### Phase C — Preflight
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
创建并完成 `RT/RT-XXX/autopilot-preflight.md`。该文件由 `.aodw-next/templates/rt-autopilot-preflight.template.md` 复制而来;`rt-autopilot-readiness.md` 只是执行说明,不能替代 RT 目录内的实际 preflight 文件。
|
|
69
69
|
|
|
70
70
|
### Phase D — 机械 Gate-Plan(替代协作 Gate 3)
|
|
71
71
|
|
|
@@ -108,6 +108,8 @@ flowchart TD
|
|
|
108
108
|
|
|
109
109
|
- development auditor 无 P0
|
|
110
110
|
- `meta.yaml.status=done`,`state.json.phase=done`
|
|
111
|
+
- `rt-lite.md` 元数据行 `status=done`
|
|
112
|
+
- Spec-Lite Autopilot 7 件套齐全:`meta.yaml`、`rt-lite.md`、`rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md`
|
|
111
113
|
- 输出 `DONE`(对齐 Ralph 完成信号,便于外部脚本检测)
|
|
112
114
|
|
|
113
115
|
**机械 Stop 映射**:`guard` + pre-commit hook ≈ Task Platform Stop Hook;不得以纯对话判定替代上述双条件。
|
|
@@ -233,7 +235,6 @@ flowchart TD
|
|
|
233
235
|
```
|
|
234
236
|
RT/RT-XXX/
|
|
235
237
|
meta.yaml # execution_mode: autopilot
|
|
236
|
-
decision.md # 含模式确认记录
|
|
237
238
|
rt-lite.md # Goal:§1-§7
|
|
238
239
|
rt-plan.md # Plan:动态步骤
|
|
239
240
|
state.json # 机器状态
|
|
@@ -242,6 +243,8 @@ RT/RT-XXX/
|
|
|
242
243
|
autopilot-preflight.md # 开工许可
|
|
243
244
|
```
|
|
244
245
|
|
|
246
|
+
`decision.md` 可用于 Spec-Full 或协作型决策记录,但不是 Spec-Lite Autopilot 的必备文件;模式确认必须至少记录在 `meta.yaml.execution_mode` 和 `execution-log.md` 中。
|
|
247
|
+
|
|
245
248
|
---
|
|
246
249
|
|
|
247
250
|
## 10. 参考
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
|
|
16
16
|
## B. RT 级(每个 RT)
|
|
17
17
|
|
|
18
|
-
- [ ] 用户创建 RT 时已确认 **Autopilot
|
|
18
|
+
- [ ] 用户创建 RT 时已确认 **Autopilot**(至少记录在 `meta.yaml.execution_mode` 与 `execution-log.md`;如有 `decision.md` 也应同步)
|
|
19
19
|
- [ ] `rt-lite.md` §1-§4、§1.3.1、§7、§5.4 已填写
|
|
20
20
|
- [ ] Goal 质量自检 7/7(见 `autopilot-goal-spec.md` §5)
|
|
21
21
|
- [ ] Autopilot 适配度 ≥ 4/6(见 §6);不足则已改协作或用户知情
|
|
22
22
|
- [ ] §7 用户已确认「完成标准摘要」
|
|
23
23
|
- [ ] `state.json.checklist` 与 §7 对齐
|
|
24
24
|
- [ ] `rt-plan.md` 已创建并拆解步骤
|
|
25
|
+
- [ ] `loop-prompt.md` 已创建
|
|
26
|
+
- [ ] `execution-log.md` 已创建
|
|
27
|
+
- [ ] `autopilot-preflight.md` 已创建并正在勾选
|
|
25
28
|
- [ ] `feature/RT-XXX-*` 分支
|
|
26
29
|
|
|
27
30
|
---
|
|
@@ -33,6 +36,7 @@
|
|
|
33
36
|
- 跨模块高风险未升级 Spec-Full
|
|
34
37
|
- main/master 上改业务代码
|
|
35
38
|
- Goal 自检未通过
|
|
39
|
+
- Spec-Lite Autopilot 7 件套不齐
|
|
36
40
|
|
|
37
41
|
---
|
|
38
42
|
|
|
@@ -24,7 +24,11 @@ AI 在执行任何文件修改操作前,必须先执行以下检查序列:
|
|
|
24
24
|
|
|
25
25
|
### Step 1: 验证 RT 是否已创建
|
|
26
26
|
- 检查 `RT/RT-XXX/` 目录是否存在
|
|
27
|
-
- 检查 `meta.yaml`
|
|
27
|
+
- 检查 `meta.yaml` 是否已创建
|
|
28
|
+
- 按 `meta.yaml.profile` + `meta.yaml.execution_mode` 检查对应必备文件:
|
|
29
|
+
- Spec-Full:`intake.md`、`decision.md`、`spec.md`、`plan.md`、`impact.md`、`invariants.md`、`tests.md`、`task.md`、`changelog.md`
|
|
30
|
+
- Spec-Lite collaborative:`rt-lite.md`
|
|
31
|
+
- Spec-Lite autopilot:`rt-lite.md`、`rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md`
|
|
28
32
|
|
|
29
33
|
### Step 2: 验证 feature 分支是否已创建并切换
|
|
30
34
|
执行 `git branch --show-current`,检查结果:
|
|
@@ -87,7 +91,7 @@ Recommended: A(首次使用 AODW 或需求/风险尚不清晰时)
|
|
|
87
91
|
### 3.3 执行步骤
|
|
88
92
|
1. **确认执行模式**(§ 3.2,未完成则停止)
|
|
89
93
|
2. 生成 RT-ID(固定本地生成)
|
|
90
|
-
3. 创建 RT 目录结构(`execution_mode` 已写入 `meta.yaml
|
|
94
|
+
3. 创建 RT 目录结构(`execution_mode` 已写入 `meta.yaml`,并按 §5 一次性生成必备文件)
|
|
91
95
|
4. 执行交互式澄清(选项化提问)
|
|
92
96
|
5. 记录立项信息到 `intake.md`
|
|
93
97
|
6. 决定使用 Spec-Full 还是 Spec-Lite profile
|
|
@@ -112,6 +116,8 @@ Recommended: A(首次使用 AODW 或需求/风险尚不清晰时)
|
|
|
112
116
|
|
|
113
117
|
## 5. 目录结构
|
|
114
118
|
|
|
119
|
+
### 5.1 Spec-Full
|
|
120
|
+
|
|
115
121
|
```
|
|
116
122
|
RT/RT-XXX/
|
|
117
123
|
meta.yaml ← RT 元数据
|
|
@@ -120,15 +126,35 @@ RT/RT-XXX/
|
|
|
120
126
|
spec.md ← Spec-Full 完整需求
|
|
121
127
|
plan.md ← Spec-Full 技术方案
|
|
122
128
|
impact.md ← 影响分析
|
|
123
|
-
invariants.md
|
|
129
|
+
invariants.md ← 不可破坏边界
|
|
124
130
|
tests.md ← 验证计划
|
|
125
|
-
task.md
|
|
126
|
-
changelog.md
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
task.md ← AI 任务追踪
|
|
132
|
+
changelog.md ← 变更记录
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 5.2 Spec-Lite collaborative
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
RT/RT-XXX/
|
|
139
|
+
meta.yaml ← RT 元数据
|
|
129
140
|
rt-lite.md ← 单文件整合所有内容
|
|
130
141
|
```
|
|
131
142
|
|
|
143
|
+
### 5.3 Spec-Lite autopilot(强制 7 件套)
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
RT/RT-XXX/
|
|
147
|
+
meta.yaml ← RT 元数据(execution_mode: autopilot)
|
|
148
|
+
rt-lite.md ← Goal(静态):§1-§7
|
|
149
|
+
rt-plan.md ← Plan(动态):每轮更新
|
|
150
|
+
state.json ← 机器状态:checklist、phase、熔断信号
|
|
151
|
+
loop-prompt.md ← 每轮 Ralph 执行指令
|
|
152
|
+
execution-log.md ← 人读时间线
|
|
153
|
+
autopilot-preflight.md ← 开工许可清单
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**注意**:Spec-Lite 的“单文档模式”只合并需求/方案/影响/边界/验证/变更记录,不取消 Autopilot 的状态、计划、日志和开工许可文件。
|
|
157
|
+
|
|
132
158
|
---
|
|
133
159
|
|
|
134
160
|
## 6. 分支命名与隔离策略
|
|
@@ -145,12 +171,12 @@ RT/RT-XXX/
|
|
|
145
171
|
AI 根据决策结果,加载对应的 Profile:
|
|
146
172
|
|
|
147
173
|
- Spec-Full → 加载 `02-workflow/spec-full-profile.md`
|
|
148
|
-
- Spec-Lite + `execution_mode=collaborative
|
|
149
|
-
- Spec-Lite + `execution_mode=autopilot` → 加载 `02-workflow/spec-lite-autopilot-profile.md`
|
|
174
|
+
- Spec-Lite + `execution_mode=collaborative` → 加载 `02-workflow/spec-lite-profile.md`
|
|
175
|
+
- Spec-Lite + `execution_mode=autopilot` → 加载 `02-workflow/spec-lite-autopilot-profile.md` + `02-workflow/autopilot-protocol.md` + `02-workflow/rt-autopilot-readiness.md`
|
|
150
176
|
|
|
151
177
|
### 7.1 Autopilot RT 附加文件(Spec-Lite)
|
|
152
178
|
|
|
153
|
-
当 `meta.yaml.execution_mode: autopilot`
|
|
179
|
+
当 `meta.yaml.execution_mode: autopilot` 时,以下文件**必须在开工前存在**:
|
|
154
180
|
|
|
155
181
|
| 文档 | 角色 |
|
|
156
182
|
|------|------|
|
|
@@ -167,6 +193,15 @@ Autopilot 流程摘要:
|
|
|
167
193
|
1. 用户确认模式(§3.2)→ 2. Goal 定稿 + 自检 → 3. Preflight → 4. Gate-Plan → 5. Ralph 循环 → 6. Gate-Commit/Done
|
|
168
194
|
熔断时交还人工;不得跳过 Goal 自检进入循环。
|
|
169
195
|
|
|
196
|
+
### 7.2 关闭一致性检查
|
|
197
|
+
|
|
198
|
+
关闭任一 RT 前,AI 必须检查:
|
|
199
|
+
|
|
200
|
+
- `meta.yaml.status`、`state.json.phase`、`rt-lite.md` 元数据行的 `status` 三者一致。
|
|
201
|
+
- Spec-Lite autopilot RT 必须具备 §5.3 的 7 件套。
|
|
202
|
+
- `rt-plan.md` 无未完成步骤,或未完成项已明确转入后续 RT。
|
|
203
|
+
- `execution-log.md` 记录最新验证命令和关闭结论。
|
|
204
|
+
|
|
170
205
|
---
|
|
171
206
|
|
|
172
207
|
## 8. 集成规范
|
|
@@ -6,11 +6,13 @@ trigger: "当 meta.yaml 中 execution_mode=autopilot 时加载"
|
|
|
6
6
|
description: >
|
|
7
7
|
Spec-Lite 全自动变体:机械 Gate + Ralph 循环 + Goal Spec。完整协议见 autopilot-protocol.md。
|
|
8
8
|
requires_files:
|
|
9
|
+
- RT/RT-XXX/meta.yaml
|
|
9
10
|
- RT/RT-XXX/rt-lite.md
|
|
10
11
|
- RT/RT-XXX/rt-plan.md
|
|
11
12
|
- RT/RT-XXX/state.json
|
|
12
13
|
- RT/RT-XXX/loop-prompt.md
|
|
13
14
|
- RT/RT-XXX/execution-log.md
|
|
15
|
+
- RT/RT-XXX/autopilot-preflight.md
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
# Skill: aodw-spec-lite-autopilot
|
|
@@ -47,6 +49,8 @@ RT/RT-XXX/
|
|
|
47
49
|
autopilot-preflight.md
|
|
48
50
|
```
|
|
49
51
|
|
|
52
|
+
以上是 **Spec-Lite Autopilot 7 件套**。`rt-lite.md` 的“单文档模式”只表示将 spec/plan/impact/invariants/tests/changelog 合并到一个 Goal 文档中,**不代表可以省略** `rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md`。
|
|
53
|
+
|
|
50
54
|
---
|
|
51
55
|
|
|
52
56
|
## 3. 执行流程(摘要)
|
|
@@ -54,8 +58,8 @@ RT/RT-XXX/
|
|
|
54
58
|
| 阶段 | 动作 | Gate |
|
|
55
59
|
|------|------|------|
|
|
56
60
|
| 0 | `feature/RT-XXX` 分支 | 强制 |
|
|
57
|
-
| B | 定稿 rt-lite §1-§7
|
|
58
|
-
| C |
|
|
61
|
+
| B | 定稿 rt-lite §1-§7;用户确认完成标准摘要;生成 7 件套 | Goal 自检 |
|
|
62
|
+
| C | `autopilot-preflight.md` 全勾 | 人工清单 |
|
|
59
63
|
| D | `plan_complete=true` | 机械 Gate-Plan |
|
|
60
64
|
| E | Ralph 循环(读 state → 做 1-2 项 → tests/lint/guard → 写 state/plan/log) | 每轮 Quality Gate |
|
|
61
65
|
| F | commit | 机械 Gate-Commit |
|
|
@@ -71,7 +75,7 @@ RT/RT-XXX/
|
|
|
71
75
|
|
|
72
76
|
**Gate-Commit**:`tests_pass` && `lint_pass` && `guard_pass`。
|
|
73
77
|
|
|
74
|
-
**Gate-Done**:§7 全部验证;checklist 全 true;auditor 无 P0;`phase=done
|
|
78
|
+
**Gate-Done**:§7 全部验证;checklist 全 true;auditor 无 P0;`phase=done`;`meta.yaml.status=done`;`rt-lite.md` 元数据行 `status=done`;7 件套齐全。
|
|
75
79
|
|
|
76
80
|
---
|
|
77
81
|
|
|
@@ -90,6 +94,7 @@ RT/RT-XXX/
|
|
|
90
94
|
- 🚫 跳过 Goal 自检进入循环
|
|
91
95
|
- 🚫 用主观判断替代 §7 机械验收
|
|
92
96
|
- 🚫 无 `state.json` / `execution-log` 更新进入下一轮
|
|
97
|
+
- 🚫 缺 `loop-prompt.md` / `autopilot-preflight.md` 仍宣称 Autopilot RT 已就绪或已关闭
|
|
93
98
|
- 🚫 在 Autopilot 中等待人工 Gate 3/4/5(除非熔断)
|
|
94
99
|
|
|
95
100
|
---
|
|
@@ -235,6 +235,8 @@ git branch --show-current
|
|
|
235
235
|
- 🚫 **Never Add Unplanned Scope**:禁止引入 § 2 范围外的任何修改
|
|
236
236
|
- 🚫 **Never Create 6 Files**:禁止退化回旧版 6 文档模式
|
|
237
237
|
|
|
238
|
+
**边界说明**:上述“Never Create 6 Files”只禁止把 Spec-Lite 拆回旧版 `spec-lite.md / plan-lite.md / impact.md / invariants.md / tests.md / changelog.md` 六文档。若 `execution_mode=autopilot`,仍必须创建 `rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md` 等 Autopilot 运行痕迹文件。
|
|
239
|
+
|
|
238
240
|
---
|
|
239
241
|
|
|
240
242
|
## 5. 执行模式选择
|
package/.aodw-next/SKILL.md
CHANGED
|
@@ -17,6 +17,7 @@ description: AODW (AI-Orchestrated Development Workflow) — 完整的 AI 协作
|
|
|
17
17
|
|------|---------|
|
|
18
18
|
| 立项 / 创建 RT | `rt-manager.md` + `ai-interaction-rules.md` |
|
|
19
19
|
| Spec-Lite 执行 | `spec-lite-profile.md` + `git-discipline.md` |
|
|
20
|
+
| Spec-Lite Autopilot 执行 | `spec-lite-autopilot-profile.md` + `autopilot-protocol.md` + `rt-autopilot-readiness.md` + `git-discipline.md` |
|
|
20
21
|
| Spec-Full 执行 | `spec-full-profile.md` + `ai-coding-rules.md`(按技术栈) |
|
|
21
22
|
| Git 操作 / 合并 | `git-discipline.md`(完整版) |
|
|
22
23
|
| 审计 | `04-auditors/aodw-requirement-auditor-rules.md` |
|
|
@@ -28,6 +29,7 @@ description: AODW (AI-Orchestrated Development Workflow) — 完整的 AI 协作
|
|
|
28
29
|
- **一个 RT = 一个 Worktree = 一个 Feature 分支**(`feature/RT-XXX-name`)
|
|
29
30
|
- **Spec-Full**:跨模块/数据模型/API 变更/高风险 → 完整 spec+plan+审计
|
|
30
31
|
- **Spec-Lite**:单模块/bug 修复/低风险 → 单文件 `rt-lite.md`
|
|
32
|
+
- **Spec-Lite Autopilot**:在 `rt-lite.md` 外还必须有 `rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md`
|
|
31
33
|
- **确认门控**:commit/merge/push/worktree 操作前必须向用户确认
|
|
32
34
|
- **规则索引**:详见 `manifest.yaml`
|
|
33
35
|
- **新项目安装**:详见 `README.md`
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|---------|---------|------|
|
|
29
29
|
| **创建新 RT** | {{REF_PREFIX}}.aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>{{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>{{REF_PREFIX}}.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
30
30
|
| **选择模式** | {{REF_PREFIX}}.aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>{{REF_PREFIX}}.aodw-next/02-workflow/spec-full-profile.md<br/>{{REF_PREFIX}}.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
31
|
+
| **Spec-Lite Autopilot** | {{REF_PREFIX}}.aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>{{REF_PREFIX}}.aodw-next/02-workflow/autopilot-protocol.md<br/>{{REF_PREFIX}}.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>{{REF_PREFIX}}.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
31
32
|
| **工具初始化** | {{REF_PREFIX}}.aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
32
33
|
| **项目概览初始化** | {{REF_PREFIX}}.aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
33
34
|
| **分析阶段** | {{REF_PREFIX}}.aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>{{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Autopilot Preflight - RT-XXX
|
|
2
2
|
|
|
3
3
|
> 复制本清单到 RT 目录,开工前逐项勾选。全部完成后才开始 Autopilot 循环。
|
|
4
|
+
> 本文件是 Spec-Lite Autopilot 7 件套之一,必须位于 `RT/RT-XXX/autopilot-preflight.md`。
|
|
4
5
|
|
|
5
6
|
## 1) 项目准备
|
|
6
7
|
|
|
@@ -18,6 +19,9 @@
|
|
|
18
19
|
- [ ] Autopilot 适配度 ≥ 4/6 或用户已知情
|
|
19
20
|
- [ ] §7「用户确认摘要」已勾选
|
|
20
21
|
- [ ] `state.json` + `rt-plan.md` 已初始化且 checklist 对齐
|
|
22
|
+
- [ ] `loop-prompt.md` 已创建
|
|
23
|
+
- [ ] `execution-log.md` 已创建
|
|
24
|
+
- [ ] `autopilot-preflight.md` 已创建并纳入版本控制
|
|
21
25
|
- [ ] 当前分支:`feature/RT-XXX-________`
|
|
22
26
|
|
|
23
27
|
## 3) 边界锁定
|
|
@@ -32,6 +32,7 @@ trigger: always_on
|
|
|
32
32
|
|---------|---------|------|
|
|
33
33
|
| **创建新 RT** | .aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
34
34
|
| **选择模式** | .aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>.aodw-next/02-workflow/spec-full-profile.md<br/>.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
35
|
+
| **Spec-Lite Autopilot** | .aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>.aodw-next/02-workflow/autopilot-protocol.md<br/>.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
35
36
|
| **工具初始化** | .aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
36
37
|
| **项目概览初始化** | .aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
37
38
|
| **分析阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|---------|---------|------|
|
|
29
29
|
| **创建新 RT** | .aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
30
30
|
| **选择模式** | .aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>.aodw-next/02-workflow/spec-full-profile.md<br/>.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
31
|
+
| **Spec-Lite Autopilot** | .aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>.aodw-next/02-workflow/autopilot-protocol.md<br/>.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
31
32
|
| **工具初始化** | .aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
32
33
|
| **项目概览初始化** | .aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
33
34
|
| **分析阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
@@ -35,6 +35,7 @@ tags: aodw, kernel
|
|
|
35
35
|
|---------|---------|------|
|
|
36
36
|
| **创建新 RT** | @.aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>@.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>@.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
37
37
|
| **选择模式** | @.aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>@.aodw-next/02-workflow/spec-full-profile.md<br/>@.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
38
|
+
| **Spec-Lite Autopilot** | @.aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>@.aodw-next/02-workflow/autopilot-protocol.md<br/>@.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>@.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
38
39
|
| **工具初始化** | @.aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
39
40
|
| **项目概览初始化** | @.aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
40
41
|
| **分析阶段** | @.aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>@.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aodw-agents
|
|
3
|
+
version: "{VERSION}"
|
|
4
|
+
description: AODW 项目级 Agent 指引。说明规范目录结构与开发流程。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AODW-Next 项目级 Agent 指引
|
|
8
|
+
|
|
9
|
+
本文档为 OpenClaw 平台上的 AI Agent 提供项目级的工作指引。
|
|
10
|
+
|
|
11
|
+
## 1. 规范目录结构
|
|
12
|
+
|
|
13
|
+
AODW 规范文件位于项目根目录下的 `.aodw-next/` 目录中:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
.aodw-next/
|
|
17
|
+
├── manifest.yaml # 规则索引与元数据(渐进式加载)
|
|
18
|
+
├── 01-core/ # 核心宪章(最高优先级)
|
|
19
|
+
│ ├── aodw-constitution.md # 主宪章(必须首先读取)
|
|
20
|
+
│ ├── ai-interaction-rules.md # AI 交互规则
|
|
21
|
+
│ ├── ai-knowledge-rules.md # 知识管理规则
|
|
22
|
+
│ ├── csf-thinking-framework.md # CSF 思维框架
|
|
23
|
+
│ └── ...
|
|
24
|
+
├── 02-workflow/ # 工作流程
|
|
25
|
+
│ ├── rt-manager.md # RT 生命周期管理
|
|
26
|
+
│ ├── spec-full-profile.md # 完整 Spec 档案
|
|
27
|
+
│ ├── spec-lite-profile.md # 简化 Spec 档案
|
|
28
|
+
│ └── ...
|
|
29
|
+
├── 03-standards/ # 编码标准
|
|
30
|
+
│ ├── ai-coding-rules.md # AI 编码规则
|
|
31
|
+
│ └── ...
|
|
32
|
+
├── 04-auditors/ # 审计官
|
|
33
|
+
│ ├── aodw-requirement-auditor-rules.md
|
|
34
|
+
│ ├── aodw-development-auditor-rules.md
|
|
35
|
+
│ └── aodw-full-auditor-rules.md
|
|
36
|
+
├── 05-tooling/ # 工具初始化
|
|
37
|
+
│ └── ai-tools-init-rules.md
|
|
38
|
+
└── 06-project/ # 项目特化文件(用户生成)
|
|
39
|
+
├── ai-overview.md # 项目概览(技术栈、架构)
|
|
40
|
+
├── modules-index.yaml # 模块索引
|
|
41
|
+
└── tools-status.yaml # 工具状态
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 2. 规则索引系统
|
|
45
|
+
|
|
46
|
+
所有规则的元数据定义在 `manifest.yaml` 中。每个规则文件包含:
|
|
47
|
+
- `summary_preferred`: 是否使用摘要模式
|
|
48
|
+
- `load_when`: 加载时机标签
|
|
49
|
+
- `priority`: 优先级(critical/high/medium)
|
|
50
|
+
- `size_kb`: 文件大小(token 优化)
|
|
51
|
+
|
|
52
|
+
Agent 应根据当前任务阶段,从 manifest 中查询需要加载的规则文件。
|
|
53
|
+
|
|
54
|
+
## 3. 开发流程概览
|
|
55
|
+
|
|
56
|
+
AODW 定义了文档驱动的开发流程:
|
|
57
|
+
|
|
58
|
+
### 3.1 创建 RT (Request Ticket)
|
|
59
|
+
- 命令:`npx aodw-skill new`
|
|
60
|
+
- 生成 RT-ID(如 `RT-20250123-001`)
|
|
61
|
+
- 创建 feature 分支
|
|
62
|
+
- 执行 Intake 流程(需求澄清)
|
|
63
|
+
|
|
64
|
+
### 3.2 决策模式
|
|
65
|
+
- **Spec-Full**: 完整规范流程(复杂功能)
|
|
66
|
+
- **Spec-Lite**: 简化规范流程(小改动)
|
|
67
|
+
- **Spec-Lite Autopilot**: 在 `rt-lite.md` 外还必须具备 7 件套:`meta.yaml`、`rt-plan.md`、`state.json`、`loop-prompt.md`、`execution-log.md`、`autopilot-preflight.md`
|
|
68
|
+
|
|
69
|
+
### 3.3 分析阶段
|
|
70
|
+
- 影响分析 (impact.md)
|
|
71
|
+
- 不变量检查 (invariants.md)
|
|
72
|
+
- 技术方案设计
|
|
73
|
+
|
|
74
|
+
### 3.4 实现阶段
|
|
75
|
+
- 代码实现
|
|
76
|
+
- 测试编写
|
|
77
|
+
- 模块文档更新
|
|
78
|
+
|
|
79
|
+
### 3.5 验证阶段
|
|
80
|
+
- 文档与代码一致性检查
|
|
81
|
+
- RT 完整性验证
|
|
82
|
+
|
|
83
|
+
### 3.6 完成阶段
|
|
84
|
+
- 合并分支
|
|
85
|
+
- 知识蒸馏
|
|
86
|
+
- 更新 RT 状态
|
|
87
|
+
|
|
88
|
+
## 4. 核心检查点
|
|
89
|
+
|
|
90
|
+
### 4.1 分支管理
|
|
91
|
+
- 所有代码修改必须在 feature 分支进行
|
|
92
|
+
- 严禁在 main/master 分支直接修改
|
|
93
|
+
|
|
94
|
+
### 4.2 Plan 批准
|
|
95
|
+
- Plan 完成后必须执行 CSF 审查
|
|
96
|
+
- 未获批准前不得开始修改代码
|
|
97
|
+
|
|
98
|
+
### 4.3 提交确认
|
|
99
|
+
- 代码完成后展示 git status 和 diff
|
|
100
|
+
- 询问用户确认后再提交
|
|
101
|
+
|
|
102
|
+
## 5. Agent 行为准则
|
|
103
|
+
|
|
104
|
+
### 5.1 语言要求
|
|
105
|
+
- 使用中文进行所有交互和文档编写
|
|
106
|
+
|
|
107
|
+
### 5.2 上下文加载
|
|
108
|
+
- 必须首先读取 `.aodw-next/01-core/aodw-constitution.md`
|
|
109
|
+
- 根据任务阶段按需加载其他规则
|
|
110
|
+
- 遵循 token 优化原则
|
|
111
|
+
|
|
112
|
+
### 5.3 质量标准
|
|
113
|
+
- 遵循编码规范(见 `03-standards/`)
|
|
114
|
+
- 执行相应的审计流程(见 `04-auditors/`)
|
|
115
|
+
- 保持文档与代码同步
|
|
116
|
+
|
|
117
|
+
## 6. 常用命令参考
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# 初始化项目
|
|
121
|
+
npx aodw-skill init
|
|
122
|
+
|
|
123
|
+
# 创建新 RT
|
|
124
|
+
npx aodw-skill new
|
|
125
|
+
|
|
126
|
+
# 初始化开发工具
|
|
127
|
+
npx aodw-skill init-tools
|
|
128
|
+
|
|
129
|
+
# 更新 AODW
|
|
130
|
+
npx aodw-skill update
|
|
131
|
+
|
|
132
|
+
# 启用 guard hook
|
|
133
|
+
npx aodw-skill enable-guard-hook
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 7. 获取帮助
|
|
137
|
+
|
|
138
|
+
- 项目概览:`.aodw-next/06-project/ai-overview.md`
|
|
139
|
+
- 模块索引:`.aodw-next/06-project/modules-index.yaml`
|
|
140
|
+
- 主宪章:`.aodw-next/01-core/aodw-constitution.md`
|
|
141
|
+
- 规则索引:`.aodw-next/manifest.yaml`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aodw
|
|
3
|
+
version: "{VERSION}"
|
|
4
|
+
description: AODW 开发工作流规范。触发词:RT、立项、新需求、feature 分支、spec、intake、审计、worktree。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AODW-Next Kernel Loader
|
|
8
|
+
# 版本: {VERSION} (OpenClaw 适配)
|
|
9
|
+
|
|
10
|
+
## 0. 语言要求 (Language Requirement)
|
|
11
|
+
|
|
12
|
+
**中文交流 (Chinese Communication)**:所有回复、思考过程、任务清单、文档内容均须使用中文。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
你是一个 **AODW-Next (AI 编排开发工作流) 协作 Agent**。
|
|
17
|
+
|
|
18
|
+
## 1. 核心指令 (The Prime Directive)
|
|
19
|
+
|
|
20
|
+
你 **必须** 在开始任何任务前,优先读取并遵循以下 **Kernel (宪章)** 文件:
|
|
21
|
+
|
|
22
|
+
- `.aodw-next/01-core/aodw-constitution.md`
|
|
23
|
+
|
|
24
|
+
**注意**:
|
|
25
|
+
- 该文件是你行为的最高准则。
|
|
26
|
+
- 该文件包含了所有阶段的 **Context Loading Directives (上下文加载指令)**。
|
|
27
|
+
- 你必须根据宪章的指示,在不同阶段**按需加载**其他规则文件。
|
|
28
|
+
- ⚠️ **Token 优化原则**:只在需要时加载相关文件,避免一次性加载所有文件。详见 `.aodw-next/01-core/aodw-constitution.md` 第 6 节"文件加载策略"。
|
|
29
|
+
|
|
30
|
+
## 2. 规则加载顺序 (Rule Loading Order)
|
|
31
|
+
|
|
32
|
+
AODW 规则系统采用渐进式加载策略。所有规则的元数据定义在:
|
|
33
|
+
|
|
34
|
+
- `.aodw-next/manifest.yaml` (规则索引与元数据)
|
|
35
|
+
|
|
36
|
+
**核心规则文件结构**:
|
|
37
|
+
- `01-core/`: 核心宪章与知识规则(最高优先级)
|
|
38
|
+
- `02-workflow/`: 工作流程规范(RT 管理、Spec 档案)
|
|
39
|
+
- `03-standards/`: 编码标准与质量规范
|
|
40
|
+
- `04-auditors/`: 审计官规则(需求审计、开发审计)
|
|
41
|
+
- `05-tooling/`: 工具初始化规则
|
|
42
|
+
- `06-project/`: 项目特化文件(用户生成)
|
|
43
|
+
|
|
44
|
+
**加载时机**:
|
|
45
|
+
- 每个规则文件定义了 `load_when` 标签(如 'init', 'plan', 'implement' 等)
|
|
46
|
+
- 根据当前任务阶段,仅加载相关的规则文件
|
|
47
|
+
- 优先级:critical > high > medium
|
|
48
|
+
|
|
49
|
+
## 3. 命令索引 (Command Index)
|
|
50
|
+
|
|
51
|
+
当用户表达以下意图时,参考对应的核心规则:
|
|
52
|
+
|
|
53
|
+
| 用户意图 | 核心规则 | 说明 |
|
|
54
|
+
|---------|---------|------|
|
|
55
|
+
| **创建新 RT** | `.aodw-next/02-workflow/rt-manager.md` (Sec 1-4, 8-9)<br>`.aodw-next/01-core/ai-knowledge-rules.md` (Sec 3.1)<br>`.aodw-next/01-core/ai-interaction-rules.md` (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
56
|
+
| **选择模式** | `.aodw-next/02-workflow/rt-manager.md` (Sec 5)<br>`.aodw-next/02-workflow/spec-full-profile.md`<br>`.aodw-next/02-workflow/spec-lite-profile.md` | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
57
|
+
| **Spec-Lite Autopilot** | `.aodw-next/02-workflow/spec-lite-autopilot-profile.md`<br>`.aodw-next/02-workflow/autopilot-protocol.md`<br>`.aodw-next/02-workflow/rt-autopilot-readiness.md`<br>`.aodw-next/01-core/git-discipline.md` | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
58
|
+
| **工具初始化** | `.aodw-next/05-tooling/ai-tools-init-rules.md` | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
59
|
+
| **项目概览初始化** | `.aodw-next/01-core/ai-project-overview-rules.md` | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
60
|
+
| **分析阶段** | `.aodw-next/03-standards/ai-coding-rules.md` (Sec 2-3)<br>`.aodw-next/01-core/ai-knowledge-rules.md` (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
61
|
+
| **实现阶段** | `.aodw-next/03-standards/ai-coding-rules.md` (Sec 6)<br>`.aodw-next/01-core/ai-knowledge-rules.md` (Sec 3.5)<br>`.aodw-next/01-core/module-doc-rules.md` | 代码实现、测试编写、模块文档更新 |
|
|
62
|
+
| **验证阶段** | `.aodw-next/01-core/ai-knowledge-rules.md` (Sec 5) | 验证文档与代码一致,检查 RT 完整性 |
|
|
63
|
+
| **CSF 审查** | `.aodw-next/01-core/csf-thinking-framework.md` | 执行 CSF 思维框架审查(以终为始、结构化分解、关键要素识别等) |
|
|
64
|
+
| **执行需求审计** | `.aodw-next/04-auditors/aodw-requirement-auditor-rules.md` | 调用需求阶段审计官,对需求文档进行审计(自动触发或手动触发) |
|
|
65
|
+
| **执行开发审计** | `.aodw-next/04-auditors/aodw-development-auditor-rules.md` | 调用开发阶段审计官,对代码进行审计(自动触发或手动触发) |
|
|
66
|
+
| **执行综合审计** | `.aodw-next/04-auditors/aodw-full-auditor-rules.md` | 调用综合审计官,执行全流程审计(需求 + 开发) |
|
|
67
|
+
| **完成 RT** | `.aodw-next/01-core/git-discipline.md`<br>`.aodw-next/01-core/ai-knowledge-rules.md` (Sec 9) | 合并分支,知识蒸馏,更新状态 |
|
|
68
|
+
| **打开 RT** | `.aodw-next/02-workflow/rt-manager.md` | 打开已有 RT,加载上下文 |
|
|
69
|
+
| **流程控制** | `.aodw-next/01-core/ai-interaction-rules.md` (Sec 5) | 暂停/恢复流程 |
|
|
70
|
+
|
|
71
|
+
## 4. RT 生命周期
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
创建 → 立项 → 决策 → 分析 → 实现 → 验证 → 完成
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
每个阶段对应的核心规则和操作,详见上述命令索引。
|
|
78
|
+
|
|
79
|
+
## 5. 关键检查点
|
|
80
|
+
|
|
81
|
+
### 5.1 分支管理(必须)
|
|
82
|
+
- 所有代码修改必须在 feature 分支上进行
|
|
83
|
+
- 严禁在 main/master 分支直接修改业务代码
|
|
84
|
+
- 在修改代码前必须验证当前分支
|
|
85
|
+
|
|
86
|
+
### 5.2 Plan 批准节点(必须)
|
|
87
|
+
- Plan 完成后,必须执行 CSF 审查
|
|
88
|
+
- Plan 批准前必须通过 CSF 审查
|
|
89
|
+
- 严禁未获批准前开始修改代码
|
|
90
|
+
|
|
91
|
+
### 5.3 提交前确认(必须)
|
|
92
|
+
- 代码修改完成后,必须展示 git status 和关键 diff
|
|
93
|
+
- 询问用户"修改已完成,是否提交?"
|
|
94
|
+
- 严禁未获用户确认前直接 Commit
|
|
95
|
+
|
|
96
|
+
## 6. 兜底机制
|
|
97
|
+
|
|
98
|
+
如果你无法读取 `.aodw-next/01-core/aodw-constitution.md`,请立即停止并要求用户提供该文件。
|
|
99
|
+
|
|
100
|
+
## 7. OpenClaw 特化说明
|
|
101
|
+
|
|
102
|
+
在 OpenClaw 平台下,本 SKILL.md 是项目级的主入口文件。相关的 Agent 规范请参考 `AGENTS.md` 文件。
|
|
103
|
+
|
|
104
|
+
**触发条件**:
|
|
105
|
+
- 用户明确提及 RT、立项、新需求、feature 分支、spec、intake、审计、worktree 等关键词
|
|
106
|
+
- 用户要求创建新的功能开发分支
|
|
107
|
+
- 用户要求进行代码审查或审计
|
|
108
|
+
|
|
109
|
+
**环境要求**:
|
|
110
|
+
- 确保项目已通过 `npx aodw-skill init` 完成初始化
|
|
111
|
+
- 确保 `.aodw-next/` 目录存在且包含完整的规则文件
|
package/bin/aodw.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
AntigravityProcessor,
|
|
13
13
|
CursorProcessor,
|
|
14
14
|
ClaudeProcessor,
|
|
15
|
+
OpenClawProcessor,
|
|
15
16
|
BaseProcessor
|
|
16
17
|
} from './processors/index.js';
|
|
17
18
|
|
|
@@ -277,7 +278,8 @@ async function runInit() {
|
|
|
277
278
|
choices: [
|
|
278
279
|
{ name: 'Cursor (IDE with AI)', value: 'cursor', checked: true },
|
|
279
280
|
{ name: 'Antigravity (Google Gemini)', value: 'antigravity', checked: true },
|
|
280
|
-
{ name: 'Claude Desktop', value: 'claude', checked: false }
|
|
281
|
+
{ name: 'Claude Desktop', value: 'claude', checked: false },
|
|
282
|
+
{ name: 'OpenClaw (AI Agent Orchestration)', value: 'openclaw', checked: false }
|
|
281
283
|
],
|
|
282
284
|
validate: (answer) => {
|
|
283
285
|
if (answer.length < 1) {
|
|
@@ -409,6 +411,26 @@ async function runInit() {
|
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
|
|
414
|
+
// OpenClaw
|
|
415
|
+
if (platforms.includes('openclaw')) {
|
|
416
|
+
console.log(chalk.yellow(' • 安装 OpenClaw 适配器...'));
|
|
417
|
+
const sourceOpenclaw = path.join(SOURCE_ADAPTERS, 'openclaw');
|
|
418
|
+
if (fs.existsSync(sourceOpenclaw)) {
|
|
419
|
+
// 安装 SKILL.md
|
|
420
|
+
await installFile(
|
|
421
|
+
path.join(sourceOpenclaw, 'SKILL.md'),
|
|
422
|
+
path.join(process.cwd(), 'SKILL.md'),
|
|
423
|
+
OpenClawProcessor
|
|
424
|
+
);
|
|
425
|
+
// 安装 AGENTS.md
|
|
426
|
+
await installFile(
|
|
427
|
+
path.join(sourceOpenclaw, 'AGENTS.md'),
|
|
428
|
+
path.join(process.cwd(), 'AGENTS.md'),
|
|
429
|
+
OpenClawProcessor
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
412
434
|
// 4. Enable v0 guard hook automatically in user project
|
|
413
435
|
await enableGuardHook({ silent: true });
|
|
414
436
|
|
|
@@ -453,6 +475,10 @@ async function runUninstall() {
|
|
|
453
475
|
// Claude
|
|
454
476
|
await removeIfExists(path.join(cwd, '.claude', 'CLAUDE.md'));
|
|
455
477
|
|
|
478
|
+
// OpenClaw
|
|
479
|
+
await removeIfExists(path.join(cwd, 'SKILL.md'));
|
|
480
|
+
await removeIfExists(path.join(cwd, 'AGENTS.md'));
|
|
481
|
+
|
|
456
482
|
console.log(chalk.green('✅ AODW-Next 已卸载。'));
|
|
457
483
|
}
|
|
458
484
|
}
|
package/bin/processors/index.js
CHANGED
|
@@ -83,3 +83,16 @@ export class ClaudeProcessor extends BaseProcessor {
|
|
|
83
83
|
return processed;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
export class OpenClawProcessor extends BaseProcessor {
|
|
88
|
+
transform(content) {
|
|
89
|
+
// Replace template placeholders: empty for OpenClaw
|
|
90
|
+
let processed = content.replace(/\{\{REF_PREFIX\}\}/g, '');
|
|
91
|
+
// Replace AODW_DIR placeholder (Next version - fixed to .aodw-next)
|
|
92
|
+
processed = processed.replace(/\{\{AODW_DIR\}\}/g, '.aodw-next');
|
|
93
|
+
// Replace VERSION placeholder with actual version
|
|
94
|
+
processed = processed.replace(/\{VERSION\}/g, '0.7.27');
|
|
95
|
+
// OpenClaw uses YAML frontmatter + markdown
|
|
96
|
+
return processed;
|
|
97
|
+
}
|
|
98
|
+
}
|