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.
@@ -205,8 +205,25 @@ git branch --show-current
205
205
  ### 6.2 用户可感知变化
206
206
 
207
207
  ### 6.3 内部重要变化
208
+
209
+ ---
210
+
211
+ ## § 7. 完成条件清单 (Done Checklist)
212
+
213
+ > Autopilot 模式必填;协作模式建议填写,便于验收。
214
+
215
+ | ID | 条件 | 验证方式 | state.json 字段 |
216
+ |----|------|----------|-----------------|
217
+ | C1 | 计划完整 | §1-§4 非空 | `plan_complete` |
218
+ | C2 | 测试通过 | §5.4 tests 命令 exit 0 | `tests_pass` |
219
+ | C3 | lint 通过 | §5.4 lint 命令 exit 0 | `lint_pass` |
220
+ | C4 | 流程痕迹完整 | `aodw-skill guard` 通过 | `guard_pass` |
221
+ | C5 | 文档同步 | §5-§6 已更新 | `docs_synced` |
222
+ | C6 | 审计通过 | development auditor 无 P0 | `auditor_pass` |
208
223
  ```
209
224
 
225
+ > 完整模板见:`.aodw-next/templates/rt-lite.template.md`
226
+
210
227
  ---
211
228
 
212
229
  ## 4. 禁止行为(Red Lines)
@@ -220,7 +237,21 @@ git branch --show-current
220
237
 
221
238
  ---
222
239
 
223
- ## 5. Skill 升级路径
240
+ ## 5. 执行模式选择
241
+
242
+ | 模式 | 适用 | 规则文件 |
243
+ |------|------|----------|
244
+ | **协作模式** | 需要人工 Gate 3/4/5 | 本文件 |
245
+ | **Autopilot** | 可机械验收、低风险、希望 AI 循环推进至 DONE | `spec-lite-autopilot-profile.md` |
246
+
247
+ **创建 RT 时必选**(见 `rt-manager.md` § 3.2):AI 须先获用户明确选择,再写入 `meta.yaml.execution_mode`;未经确认不得继续。
248
+
249
+ - 协作:`execution_mode: collaborative`(`aodw-skill new` 或 AI 代建时由用户选 A)
250
+ - Autopilot:`execution_mode: autopilot`;按 `autopilot-protocol.md` 初始化 `rt-plan.md`、`state.json` 等;开工前完成 `autopilot-goal-spec.md` 自检
251
+
252
+ ---
253
+
254
+ ## 6. Skill 升级路径
224
255
 
225
256
  - **如遇以下情况,立即建议升级至 `aodw-spec-full`**:
226
257
  - 影响数据模型或对外 API
@@ -39,6 +39,34 @@ rules:
39
39
  description: Lightweight workflow for low-risk changes.
40
40
  path: 02-workflow/spec-lite-profile.md
41
41
 
42
+ - id: autopilot-protocol
43
+ name: Autopilot Protocol
44
+ description: Full autonomous RT protocol (Ralph loop, gates, observability, circuit breakers).
45
+ path: 02-workflow/autopilot-protocol.md
46
+ load_when: [autopilot, execution_mode]
47
+ priority: high
48
+
49
+ - id: autopilot-goal-spec
50
+ name: Autopilot Goal Spec
51
+ description: Done criteria standard (Scope + Evidence + Test) and suitability triage.
52
+ path: 02-workflow/autopilot-goal-spec.md
53
+ load_when: [autopilot, goal, checklist]
54
+ priority: high
55
+
56
+ - id: spec-lite-autopilot-profile
57
+ name: Spec-Lite Autopilot Profile
58
+ description: Autonomous Spec-Lite workflow with mechanical gates and state.json loop.
59
+ path: 02-workflow/spec-lite-autopilot-profile.md
60
+ load_when: [autopilot, execution_mode]
61
+ priority: high
62
+
63
+ - id: rt-autopilot-readiness
64
+ name: RT Autopilot Readiness
65
+ description: Pre-flight checklist before starting autonomous RT execution.
66
+ path: 02-workflow/rt-autopilot-readiness.md
67
+ load_when: [autopilot, preflight]
68
+ priority: high
69
+
42
70
  - id: ui-workflow-rules
43
71
  name: UI Workflow Rules
44
72
  description: UI-specific process requirements and gates.
@@ -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,36 @@
1
+ # Autopilot Preflight - RT-XXX
2
+
3
+ > 复制本清单到 RT 目录,开工前逐项勾选。全部完成后才开始 Autopilot 循环。
4
+
5
+ ## 1) 项目准备
6
+
7
+ - [ ] `.aodw-next/06-project/ai-overview.md` 已深度初始化
8
+ - [ ] `.aodw-next/06-project/modules-index.yaml` 已深度初始化
9
+ - [ ] tests 命令:`________________`(可执行,exit 0/非0 可解释)
10
+ - [ ] lint 命令:`________________`
11
+ - [ ] guard 命令:`npx aodw-skill guard`
12
+
13
+ ## 2) RT 准备
14
+
15
+ - [ ] `meta.yaml.execution_mode = autopilot`(创建 RT 时用户已确认)
16
+ - [ ] `rt-lite.md` §1-§4、§1.3.1、§7、§5.4 已填写
17
+ - [ ] Goal 质量自检通过(`autopilot-goal-spec.md` §5)
18
+ - [ ] Autopilot 适配度 ≥ 4/6 或用户已知情
19
+ - [ ] §7「用户确认摘要」已勾选
20
+ - [ ] `state.json` + `rt-plan.md` 已初始化且 checklist 对齐
21
+ - [ ] 当前分支:`feature/RT-XXX-________`
22
+
23
+ ## 3) 边界锁定
24
+
25
+ - [ ] §2.1 修改文件清单已列出
26
+ - [ ] §1.3.1「不改什么」≥ 3 项
27
+ - [ ] §4 invariants 已列出
28
+ - [ ] 无范围外改动计划
29
+
30
+ ## 4) 开工许可
31
+
32
+ - [ ] 以上全部勾选
33
+ - [ ] 负责人:________
34
+ - [ ] 时间:________
35
+
36
+ **许可后开始**:按 `loop-prompt.md` 进入第 1 轮迭代。
@@ -0,0 +1,117 @@
1
+ # RT-Lite: RT-XXX - <任务标题>
2
+
3
+ <!-- 元数据行(单行,勿删) -->
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
+ }
package/README.md CHANGED
@@ -68,8 +68,9 @@ npx aodw-skill uninstall
68
68
  ### 安装后
69
69
 
70
70
  1. **重启编辑器**:确保 AI 工具识别新的规则文件
71
- 2. **开始使用**:您的 AI 助手现在会遵循 AODW-Next 规范工作
72
- 3. **查看文档**:`.aodw-next/01-core/aodw-constitution.md` 包含完整的工作流说明
71
+ 2. **项目深度初始化(推荐)**:`init` 结束时会输出一段提示词,复制到 AI 对话窗口执行,完善 `06-project/` 文档
72
+ 3. **开始使用**:您的 AI 助手现在会遵循 AODW-Next 规范工作
73
+ 4. **查看文档**:`.aodw-next/01-core/aodw-constitution.md` 包含完整的工作流说明
73
74
 
74
75
  ## 项目结构
75
76
 
package/bin/aodw.js CHANGED
@@ -262,11 +262,10 @@ async function runInit() {
262
262
  await saveProjectConfig({ project_name: projectName });
263
263
  }
264
264
 
265
- // --- Step 2: Fixed Local Mode (independent only) ---
265
+ // --- Step 2: Normalize legacy user config (no mode prompt) ---
266
266
  const userConfig = getUserConfig();
267
267
  if (userConfig.mode !== 'independent' || userConfig.server_url) {
268
268
  await saveUserConfig({ mode: 'independent', server_url: '' });
269
- console.log(chalk.gray('已固定为独立模式(本地生成 ID)'));
270
269
  }
271
270
 
272
271
  // --- Step 3: Platform Selection (Multi-select) ---
@@ -415,9 +414,9 @@ async function runInit() {
415
414
 
416
415
  console.log(chalk.green('\n✅ AODW-Next 初始化成功!'));
417
416
  console.log(chalk.white(`项目: ${projectName}`));
418
-
419
- console.log(chalk.white('模式: 独立模式 (本地)'));
420
417
  console.log(chalk.white(`平台: ${platforms.join(', ')}`));
418
+
419
+ await printProjectInitPrompt({ writeFile: true });
421
420
  }
422
421
 
423
422
  async function runUpdate() {
@@ -469,55 +468,70 @@ async function showHelp() {
469
468
  }
470
469
  }
471
470
 
472
- async function generateOverviewPrompt() {
473
- console.clear();
474
- console.log(chalk.bold.cyan('\n=== 项目概览初始化提示词 ===\n'));
475
- console.log(chalk.yellow('📋 请将以下提示词复制给您的 AI 助手(Cursor/Claude/Gemini 等):\n'));
476
-
471
+ function buildProjectInitPrompt() {
477
472
  const overviewFile = path.join(process.cwd(), CORE_DIRNAME, '06-project/ai-overview.md');
478
473
  const modulesIndexFile = path.join(process.cwd(), CORE_DIRNAME, '06-project/modules-index.yaml');
479
474
  const hasOverview = fs.existsSync(overviewFile);
480
475
  const hasModulesIndex = fs.existsSync(modulesIndexFile);
481
-
482
- let overviewPrompt = `请帮我${hasOverview || hasModulesIndex ? '更新' : '初始化'}项目的 AODW-Next 项目概览文档。
476
+ const action = hasOverview || hasModulesIndex ? '更新' : '初始化';
483
477
 
484
- **任务说明**:
485
- 根据当前项目的代码结构、技术栈和架构,生成或完善以下文档:
486
- 1. \`${CORE_DIRNAME}/06-project/ai-overview.md\` - 项目概览文档
487
- 2. \`${CORE_DIRNAME}/06-project/modules-index.yaml\` - 模块索引文件
478
+ return `请帮我对当前仓库执行 AODW-Next 的「项目深度初始化」(${action})。
488
479
 
489
- **文件位置**:
490
- - 项目概览文档:\`${overviewFile}\`
491
- - 模块索引文件:\`${modulesIndexFile}\`
480
+ **背景**:
481
+ CLI 已完成规则安装,并生成了检测草稿。请你基于项目真实代码,补全可被 AI 长期使用的项目知识。
492
482
 
493
- **参考规则**:
494
- - 请参考 \`${CORE_DIRNAME}/01-core/ai-project-overview-rules.md\` 中的详细规则
495
- - 需要检测项目的技术栈(前端、后端、数据库、消息系统等)
496
- - 需要识别项目的模块结构
497
- - 需要分析项目的架构模式
483
+ **必须先读取的规则**:
484
+ 1. \`${CORE_DIRNAME}/01-core/ai-project-overview-rules.md\`
485
+ 2. \`${CORE_DIRNAME}/01-core/module-doc-rules.md\`
498
486
 
499
- **执行步骤**:
500
- 1. 先读取 \`${CORE_DIRNAME}/01-core/ai-project-overview-rules.md\` 了解规则
501
- 2. ${hasOverview ? `读取现有的 \`${CORE_DIRNAME}/06-project/ai-overview.md\` 了解当前项目信息` : '分析项目结构,检测技术栈'}
502
- 3. ${hasModulesIndex ? `读取现有的 \`${CORE_DIRNAME}/06-project/modules-index.yaml\` 了解当前模块结构` : '识别项目模块'}
503
- 4. 生成或更新 \`ai-overview.md\` 和 \`modules-index.yaml\`
487
+ **必须完善的目标文件**:
488
+ 1. \`${overviewFile}\`
489
+ 2. \`${modulesIndexFile}\`
504
490
 
505
- **重要提示**:
506
- - ✅ **这些文件在更新 AODW-Next 时会被保护,不会被覆盖**
507
- - ${hasOverview ? '如果项目已经有部分概览文档,请基于现有内容进行完善' : '如果项目已经有部分概览文档,请基于现有内容进行完善'}
508
- - 确保技术栈信息准确
509
- - 确保模块索引完整
510
- - **此命令可以重复执行**,每次执行会基于现有内容进行更新和完善
491
+ **执行要求**:
492
+ 1. 扫描并理解当前项目代码结构(前端/后端/公共模块/基础设施)
493
+ 2. 识别技术栈、目录结构、核心业务模块
494
+ 3. ${hasOverview ? '在现有 ai-overview.md 基础上完善,不要无意义覆盖用户内容' : '生成 ai-overview.md(含技术栈、架构、目录、模块、系统级 invariants)'}
495
+ 4. ${hasModulesIndex ? '在现有 modules-index.yaml 基础上完善' : '生成 modules-index.yaml(模块名、root、文档路径)'}
496
+ 5. 对重要模块,如缺少模块文档,按规则补 \`docs/modules/<module>.md\`(或项目既有模块文档路径)
497
+ 6. 最后输出简短结果:修改了哪些文件、还有哪些待人工确认项
498
+
499
+ **约束**:
500
+ - 不要修改与本次初始化无关的代码
501
+ - 保持 AODW 文档结构一致
502
+ - 信息不确定时标注“待确认”,不要编造
511
503
 
512
504
  请开始执行。`;
505
+ }
513
506
 
514
- console.log(chalk.white(overviewPrompt));
515
- console.log(chalk.gray('\n' + '='.repeat(60)));
516
- console.log(chalk.green('\n✅ 提示词已生成,请复制上面的内容给您的 AI 助手。'));
517
- if (hasOverview || hasModulesIndex) {
518
- console.log(chalk.blue('\n📝 检测到已有文件,将基于现有内容进行更新。'));
507
+ async function printProjectInitPrompt(options = {}) {
508
+ const { writeFile = false, heading = true } = options;
509
+ const prompt = buildProjectInitPrompt();
510
+ const promptFile = path.join(process.cwd(), CORE_DIRNAME, '06-project/ai-init-prompt.md');
511
+
512
+ if (heading) {
513
+ console.log(chalk.cyan('\n--- 下一步:项目深度初始化(复制到 AI 对话) ---'));
514
+ console.log(chalk.gray('CLI 已完成安装与检测草稿;请让 AI 阅读真实代码后完善 06-project 文档。\n'));
519
515
  }
520
- console.log(chalk.yellow('\n💡 提示:完成项目概览初始化后,再执行"工具初始化"可以更准确地识别技术栈。\n'));
516
+
517
+ console.log(chalk.yellow('📋 请复制以下提示词到 Cursor / Claude / Antigravity:\n'));
518
+ console.log(chalk.white(prompt));
519
+
520
+ if (writeFile) {
521
+ await fs.ensureDir(path.dirname(promptFile));
522
+ await fs.writeFile(promptFile, `${prompt}\n`, 'utf8');
523
+ console.log(chalk.green(`\n💾 提示词已保存: ${path.relative(process.cwd(), promptFile)}`));
524
+ }
525
+
526
+ console.log(chalk.gray('\n' + '='.repeat(60)));
527
+ }
528
+
529
+ async function generateOverviewPrompt() {
530
+ console.clear();
531
+ console.log(chalk.bold.cyan('\n=== 项目深度初始化提示词 ===\n'));
532
+ await printProjectInitPrompt({ writeFile: true, heading: false });
533
+ console.log(chalk.green('\n✅ 请复制上面的内容给您的 AI 助手。'));
534
+ console.log(chalk.yellow('\n💡 完成后再执行工具初始化(可选):npx aodw-skill init-tools\n'));
521
535
  }
522
536
 
523
537
  async function generateToolsPrompt() {
@@ -599,8 +613,10 @@ async function showMainMenu() {
599
613
  console.log(chalk.bold.blue('=== AODW-Next CLI 管理器 ==='));
600
614
  console.log(chalk.gray('版本: ' + packageJson.version));
601
615
 
602
- // Show current config summary
603
- console.log(chalk.gray('当前配置: 🏠 独立模式 (本地生成 ID)'));
616
+ const projectConfig = getProjectConfig();
617
+ if (projectConfig.project_name) {
618
+ console.log(chalk.gray(`当前项目: ${projectConfig.project_name}`));
619
+ }
604
620
  console.log('');
605
621
 
606
622
  const { action } = await inquirer.prompt([{
@@ -613,7 +629,7 @@ async function showMainMenu() {
613
629
  { name: '1. 初始化 / 更新 AODW-Next (在本项目)', value: 'init' },
614
630
 
615
631
  new inquirer.Separator('--- 工具箱 ---'),
616
- { name: '2. 项目概览初始化 (Architecture) - 生成提示词', value: 'init-overview-prompt' },
632
+ { name: '2. 项目深度初始化 - 生成提示词', value: 'init-overview-prompt' },
617
633
  { name: '3. 工具初始化 (ESLint/Ruff/Stack) - 生成提示词', value: 'init-tools-prompt' },
618
634
 
619
635
  new inquirer.Separator('--- 帮助与维护 ---'),
@@ -687,6 +703,7 @@ program
687
703
  .description('Create a new Request Ticket (RT)')
688
704
  .option('--project <name>', 'Project identifier')
689
705
  .option('--title <string>', 'Title of the RT')
706
+ .option('--execution-mode <mode>', 'Execution mode: collaborative | autopilot (skips interactive prompt)')
690
707
  .action(createNewRT);
691
708
 
692
709
  program