aodw-skill 0.7.26 → 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.
@@ -0,0 +1,27 @@
1
+ # RT Execution Log: RT-XXX
2
+
3
+ > 每轮 Autopilot 迭代追加一条,解决「黑盒执行」问题(对齐 Task Platform iteration 事件)。
4
+
5
+ ## 格式
6
+
7
+ ```markdown
8
+ ## Iteration N — <phase>
9
+ - **time**: ISO8601
10
+ - **focus**: 本轮完成的 plan 步骤
11
+ - **checklist**: C2✓ C3✓ C5○ …
12
+ - **commands**: tests/lint/guard 结果摘要
13
+ - **diff_scope**: 改动文件列表(应与 §2.1 一致)
14
+ - **blockers**: 无 | …
15
+ - **next**: 下轮焦点 1 句
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Iteration 0 — initialized
21
+ - **time**:
22
+ - **focus**: RT scaffold created
23
+ - **checklist**: 全部 false
24
+ - **commands**: —
25
+ - **diff_scope**: —
26
+ - **blockers**: 无
27
+ - **next**: 完成 Goal 定稿与 Preflight
@@ -0,0 +1,40 @@
1
+ # Autopilot Preflight - RT-XXX
2
+
3
+ > 复制本清单到 RT 目录,开工前逐项勾选。全部完成后才开始 Autopilot 循环。
4
+ > 本文件是 Spec-Lite Autopilot 7 件套之一,必须位于 `RT/RT-XXX/autopilot-preflight.md`。
5
+
6
+ ## 1) 项目准备
7
+
8
+ - [ ] `.aodw-next/06-project/ai-overview.md` 已深度初始化
9
+ - [ ] `.aodw-next/06-project/modules-index.yaml` 已深度初始化
10
+ - [ ] tests 命令:`________________`(可执行,exit 0/非0 可解释)
11
+ - [ ] lint 命令:`________________`
12
+ - [ ] guard 命令:`npx aodw-skill guard`
13
+
14
+ ## 2) RT 准备
15
+
16
+ - [ ] `meta.yaml.execution_mode = autopilot`(创建 RT 时用户已确认)
17
+ - [ ] `rt-lite.md` §1-§4、§1.3.1、§7、§5.4 已填写
18
+ - [ ] Goal 质量自检通过(`autopilot-goal-spec.md` §5)
19
+ - [ ] Autopilot 适配度 ≥ 4/6 或用户已知情
20
+ - [ ] §7「用户确认摘要」已勾选
21
+ - [ ] `state.json` + `rt-plan.md` 已初始化且 checklist 对齐
22
+ - [ ] `loop-prompt.md` 已创建
23
+ - [ ] `execution-log.md` 已创建
24
+ - [ ] `autopilot-preflight.md` 已创建并纳入版本控制
25
+ - [ ] 当前分支:`feature/RT-XXX-________`
26
+
27
+ ## 3) 边界锁定
28
+
29
+ - [ ] §2.1 修改文件清单已列出
30
+ - [ ] §1.3.1「不改什么」≥ 3 项
31
+ - [ ] §4 invariants 已列出
32
+ - [ ] 无范围外改动计划
33
+
34
+ ## 4) 开工许可
35
+
36
+ - [ ] 以上全部勾选
37
+ - [ ] 负责人:________
38
+ - [ ] 时间:________
39
+
40
+ **许可后开始**:按 `loop-prompt.md` 进入第 1 轮迭代。
@@ -0,0 +1,117 @@
1
+ # RT-Lite: RT-XXX - <任务标题>
2
+
3
+ <!-- 元数据行(单行,勿删)。关闭 RT 时必须与 meta.yaml.status / state.json.phase 同步。 -->
4
+ > profile: Spec-Lite | execution_mode: collaborative | status: in-progress | branch: feature/RT-XXX
5
+
6
+ ---
7
+
8
+ ## § 1. 背景与目标 (Context & Goal)
9
+
10
+ ### 1.1 问题描述
11
+ <!-- 当前存在的问题或需求 -->
12
+
13
+ ### 1.2 目标
14
+ <!-- 本次改动希望达成的效果(用户视角) -->
15
+
16
+ ### 1.3 影响范围
17
+ <!-- 涉及的模块/文件 -->
18
+
19
+ ### 1.3.1 不改什么(Autopilot 必填,至少 3 项)
20
+ <!-- 明确排除的文件、功能、行为;防止 scope creep -->
21
+ - [ ] 不修改:
22
+ - [ ] 不添加:
23
+ - [ ] 不改变:
24
+
25
+ ### 1.4 实现前对齐 (Implementation Alignment)
26
+ - **关键假设**:
27
+ - **歧义点与推荐选项**:
28
+ - **最小必要改动**:
29
+ - **可验证成功标准**:
30
+
31
+ ---
32
+
33
+ ## § 2. 方案设计 (Solution & Design)
34
+
35
+ ### 2.1 修改点(checklist,对齐 Goal Spec「改什么」)
36
+ - [ ] `path/to/file` — 具体改什么
37
+ - [ ] `path/to/file` — 具体改什么
38
+
39
+ ### 2.2 方案描述
40
+ <!-- 技术方案简述 -->
41
+
42
+ ### 2.3 风险与注意事项
43
+ <!-- 边界情况、隐含耦合 -->
44
+
45
+ ---
46
+
47
+ ## § 3. 影响分析 (Impact Analysis)
48
+
49
+ ### 3.1 直接影响
50
+
51
+ ### 3.2 间接影响
52
+
53
+ ### 3.3 风险评估
54
+
55
+ ---
56
+
57
+ ## § 4. 不可破坏边界 (Invariants)
58
+
59
+ ### 4.1 业务行为边界
60
+
61
+ ### 4.2 接口边界
62
+
63
+ ### 4.3 技术结构边界
64
+
65
+ ---
66
+
67
+ ## § 5. 验证计划 (Verification Plan)
68
+
69
+ ### 5.1 本次新增测试
70
+ - [ ] 测试用例 1:
71
+
72
+ ### 5.2 回归测试
73
+ - [ ] 回归场景 1:
74
+
75
+ ### 5.3 手动验证步骤
76
+ - [ ] 手动步骤 1:
77
+
78
+ ### 5.4 机械验证命令(Autopilot 必填)
79
+ - tests: `<例如: npm test / pytest>`
80
+ - lint: `<例如: npm run lint / ruff check>`
81
+ - guard: `npx aodw-skill guard --auto-fix --stage-audit`
82
+
83
+ ---
84
+
85
+ ## § 6. 变更记录 (Changelog)
86
+
87
+ ### 6.1 变更摘要
88
+
89
+ ### 6.2 用户可感知变化
90
+
91
+ ### 6.3 内部重要变化
92
+
93
+ ---
94
+
95
+ ## § 7. 完成条件清单 (Done Checklist)
96
+
97
+ > 标准见 `02-workflow/autopilot-goal-spec.md`
98
+ > 每条必须:**Scope(范围)+ Evidence(证据)+ Test(shell 命令,exit 0)**
99
+
100
+ | ID | 条件(Scope + Evidence) | 验证命令(Test) | state.json |
101
+ |----|--------------------------|------------------|------------|
102
+ | C1 | §1-§4、本节、§1.3.1 已填写且可执行 | 人工/AI 字段检查 | `plan_complete` |
103
+ | C2 | 相关测试全部通过 | `§5.4 tests` | `tests_pass` |
104
+ | C3 | lint/type 无错误 | `§5.4 lint` | `lint_pass` |
105
+ | C4 | 提交含 RT 痕迹 | `§5.4 guard` | `guard_pass` |
106
+ | C5 | §5-§6 与实现一致 | diff 与文档对照 | `docs_synced` |
107
+ | C6 | 开发审计无 P0 | development auditor | `auditor_pass` |
108
+
109
+ **Fuse(熔断,任务级)**:
110
+ - `max_iterations`: 20(默认,见 `state.json`)
111
+ - 达上限或连续 2 轮无进展 → `phase=blocked`,交还人工
112
+
113
+ **用户确认摘要**(Autopilot 定稿后填写,创建循环前须用户点头):
114
+ - 完成标准摘要:(AI 用 3–5 条自然语言列出,对应上表)
115
+ - 用户确认:是 / 否 / 日期
116
+
117
+ **反例(禁止)**:~~功能做完~~、~~代码改好~~、~~差不多通过~~
@@ -0,0 +1,45 @@
1
+ 你正在以 **AODW Autopilot** 模式自主推进 RT:{RT_ID}(第 **{ITERATION}** / **{MAX_ITERATIONS}** 次迭代)。
2
+
3
+ ## 任务目标
4
+ {GOAL_SUMMARY}
5
+
6
+ ## 完成条件(机械验收,rt-lite.md §7)
7
+ {CHECKLIST_ITEMS}
8
+
9
+ ## 当前进度
10
+
11
+ ### state.json
12
+ ```json
13
+ {STATE_JSON}
14
+ ```
15
+
16
+ ### rt-plan.md(只处理未完成步骤)
17
+ > 开工前读取 `RT/{RT_ID}/rt-plan.md`,本轮完成后更新勾选与「当前焦点」。
18
+
19
+ ## 本轮规则(Ralph Loop)
20
+
21
+ 1. **续接而非重做**:`state.json` 与 `rt-plan.md` 中已 true/已勾选的项不要重复
22
+ 2. **小步前进**:本轮只完成 1–2 个未完成 plan 步骤,并推进对应 §7 条件
23
+ 3. **验证驱动(Backpressure)**:每项改动后立即运行 §5.4 对应命令(tests → lint → guard)
24
+ 4. **如实写状态**:更新 `state.json`、`rt-plan.md`、`execution-log.md`;决策写入 `decisions`
25
+ 5. **范围锁定**:不修改 rt-lite §1.3「不改什么」所列路径;不引入 §2 范围外功能
26
+
27
+ ## 反模式(出现则换方案或 blocked)
28
+
29
+ | 信号 | 处理 |
30
+ |------|------|
31
+ | 同一文件第 4 次修改 | 换实现,记入 decisions |
32
+ | 同一测试连续 2 轮失败 | 重读代码与 §1,写入 blockers |
33
+ | checklist 与上轮完全相同 | `stall_count++`;≥2 则 `phase=blocked` 并说明原因 |
34
+
35
+ ## 机械 Gate
36
+
37
+ - **Plan**:`plan_complete` ← §1-§4、§7、§5.4 就绪
38
+ - **Commit**:tests + lint + guard 全 pass
39
+ - **Done**:checklist 全 true + auditor 无 P0
40
+
41
+ ## 本轮结束
42
+
43
+ 1. 更新上述文件
44
+ 2. 若全部完成: `phase=done`,`meta.yaml.status=done`,输出 **`DONE`**
45
+ 3. 否则输出 **`CONTINUE`** 与 1 句下轮焦点
@@ -12,6 +12,12 @@ type: Bug
12
12
  # 可选值:Spec-Full | Spec-Lite
13
13
  profile: Spec-Lite
14
14
 
15
+ # 执行模式(Spec-Lite 专用)— 创建 RT 时由用户明确确认,禁止 AI 静默默认
16
+ # collaborative: 人工 Gate 3/4/5
17
+ # autopilot: 机械 Gate + state.json 循环推进
18
+ # 未确认前不得创建本 RT;见 rt-manager.md § 3.2
19
+ execution_mode: <user-confirmed: collaborative | autopilot>
20
+
15
21
  # 当前状态
16
22
  # 可选值:created | intaking | decided | in-progress | reviewing | done
17
23
  status: created
@@ -0,0 +1,35 @@
1
+ # Plan: {RT_ID} — <任务标题>
2
+
3
+ > 动态实现计划(对应 Ralph 的 IMPLEMENTATION_PLAN)。每轮迭代更新;AI 只处理未完成项。
4
+
5
+ ## 进度
6
+
7
+ - [ ] 步骤 1 — (从 rt-lite §2 拆解)
8
+ - [ ] 步骤 2 —
9
+ - [ ] 步骤 3 —
10
+
11
+ ## 当前焦点
12
+
13
+ - 本轮目标:(1-2 个步骤)
14
+ - 对应 §7 条件:C?
15
+
16
+ ## 阻塞(blockers)
17
+
18
+ - (无则留空)
19
+
20
+ ## 决策(decisions)
21
+
22
+ - (技术选型及理由,避免下轮重复讨论)
23
+
24
+ ## 完成判定(与 state.json 双条件)
25
+
26
+ 仅当 **同时** 满足才可输出 `DONE`:
27
+
28
+ 1. 本节「进度」全部 `[x]`
29
+ 2. `state.json.checklist` 全 `true`,且 §5.4 tests/lint/guard 已通过
30
+
31
+ ## 迭代记录
32
+
33
+ | 轮次 | 完成步骤 | 验证结果 | 备注 |
34
+ |------|----------|----------|------|
35
+ | 0 | scaffold | — | RT 创建 |
@@ -0,0 +1,26 @@
1
+ {
2
+ "rt": "RT-XXX",
3
+ "execution_mode": "autopilot",
4
+ "execution_submode": "ralph-loop",
5
+ "phase": "initialized",
6
+ "iteration": 0,
7
+ "max_iterations": 20,
8
+ "stall_count": 0,
9
+ "goal": "见 rt-lite.md §7 完成条件清单",
10
+ "checklist": {
11
+ "plan_complete": false,
12
+ "tests_pass": false,
13
+ "lint_pass": false,
14
+ "guard_pass": false,
15
+ "docs_synced": false,
16
+ "auditor_pass": false
17
+ },
18
+ "signals": {
19
+ "same_file_edits": {},
20
+ "last_checklist_snapshot": null
21
+ },
22
+ "blockers": [],
23
+ "decisions": [],
24
+ "started_at": "<ISO8601>",
25
+ "updated_at": "<ISO8601>"
26
+ }
@@ -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
  }
@@ -703,6 +729,7 @@ program
703
729
  .description('Create a new Request Ticket (RT)')
704
730
  .option('--project <name>', 'Project identifier')
705
731
  .option('--title <string>', 'Title of the RT')
732
+ .option('--execution-mode <mode>', 'Execution mode: collaborative | autopilot (skips interactive prompt)')
706
733
  .action(createNewRT);
707
734
 
708
735
  program