aodw-skill 0.7.14 → 0.7.17

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.
Files changed (120) hide show
  1. package/.aodw-next/01-core/ai-interaction-rules-summary.md +37 -0
  2. package/.aodw-next/01-core/ai-interaction-rules.md +20 -6
  3. package/.aodw-next/01-core/ai-knowledge-rules-summary.md +25 -0
  4. package/.aodw-next/01-core/ai-knowledge-rules.md +19 -21
  5. package/.aodw-next/01-core/ai-project-overview-rules.md +11 -11
  6. package/.aodw-next/01-core/aodw-constitution.md +7 -414
  7. package/.aodw-next/01-core/csf-thinking-framework.md +14 -14
  8. package/.aodw-next/01-core/git-discipline-summary.md +36 -0
  9. package/.aodw-next/01-core/git-discipline.md +129 -73
  10. package/.aodw-next/01-core/module-doc-rules.md +2 -2
  11. package/.aodw-next/02-workflow/rt-id-generation-rules.md +16 -259
  12. package/.aodw-next/02-workflow/rt-manager-summary.md +1 -1
  13. package/.aodw-next/02-workflow/rt-manager.md +73 -344
  14. package/.aodw-next/02-workflow/spec-full-profile.md +149 -307
  15. package/.aodw-next/02-workflow/spec-lite-profile.md +170 -253
  16. package/.aodw-next/02-workflow/ui-workflow-rules-summary.md +39 -0
  17. package/.aodw-next/02-workflow/ui-workflow-rules.md +57 -292
  18. package/.aodw-next/03-standards/ai-coding-rules-common.md +1 -1
  19. package/.aodw-next/03-standards/ai-coding-rules.md +91 -25
  20. package/.aodw-next/03-standards/stacks/java-springboot/ai-coding-rules-backend.md +9 -9
  21. package/.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md +13 -13
  22. package/.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md +10 -10
  23. package/.aodw-next/03-standards/stacks/rust-axum/ai-coding-rules-backend.md +4 -4
  24. package/.aodw-next/03-standards/stacks/vue2/ai-coding-rules-frontend.md +9 -9
  25. package/.aodw-next/04-auditors/aodw-development-auditor-rules.md +15 -10
  26. package/.aodw-next/04-auditors/aodw-full-auditor-rules.md +14 -14
  27. package/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +130 -338
  28. package/.aodw-next/05-tooling/ai-tools-init-rules.md +74 -367
  29. package/.aodw-next/06-project/README.md +16 -0
  30. package/.aodw-next/07-optimization/token-usage-analysis.md +2 -2
  31. package/.aodw-next/README.md +53 -20
  32. package/.aodw-next/SKILL.md +32 -0
  33. package/.aodw-next/config.yaml +2 -2
  34. package/.aodw-next/manifest.yaml +64 -57
  35. package/.aodw-next/project.yaml +1 -0
  36. package/.aodw-next/templates/TEMPLATE-APPLICATION-GUIDE.md +21 -157
  37. package/.aodw-next/templates/ai-overview.template.md +72 -0
  38. package/.aodw-next/templates/checklists/coding-standards-template.md +24 -4
  39. package/.aodw-next/templates/modules-index.template.yaml +13 -0
  40. package/.aodw-next/templates/plan-lite-template.md +9 -0
  41. package/.aodw-next/templates/rt-intake-template.md +2 -2
  42. package/.aodw-next/templates/rt-meta-template.yaml +2 -2
  43. package/.aodw-next/templates/spec-lite-template.md +9 -0
  44. package/.aodw-next/templates/tools-config/README.md +1 -1
  45. package/.aodw-next/templates/tools-config/backend/clippy.config.template.toml +5 -0
  46. package/.aodw-next/templates/tools-config/backend/rustfmt.config.template.toml +4 -0
  47. package/.aodw-next/tools-status.yaml +51 -0
  48. package/README.md +62 -45
  49. package/bin/aodw.js +44 -16
  50. package/bin/commands/init-overview.js +3 -3
  51. package/bin/commands/init-tools.js +34 -51
  52. package/bin/utils/config.js +1 -1
  53. package/package.json +1 -1
  54. package/.aodw-next/.aodw-next/01-core/ai-interaction-rules.md +0 -218
  55. package/.aodw-next/.aodw-next/01-core/ai-knowledge-rules.md +0 -302
  56. package/.aodw-next/.aodw-next/01-core/ai-project-overview-rules.md +0 -284
  57. package/.aodw-next/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
  58. package/.aodw-next/.aodw-next/01-core/aodw-constitution.md +0 -419
  59. package/.aodw-next/.aodw-next/01-core/csf-thinking-framework.md +0 -373
  60. package/.aodw-next/.aodw-next/01-core/git-discipline.md +0 -226
  61. package/.aodw-next/.aodw-next/01-core/module-doc-rules.md +0 -90
  62. package/.aodw-next/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
  63. package/.aodw-next/.aodw-next/02-workflow/rt-id-generation-rules.md +0 -267
  64. package/.aodw-next/.aodw-next/02-workflow/rt-manager-summary.md +0 -15
  65. package/.aodw-next/.aodw-next/02-workflow/rt-manager.md +0 -399
  66. package/.aodw-next/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
  67. package/.aodw-next/.aodw-next/02-workflow/spec-full-profile.md +0 -391
  68. package/.aodw-next/.aodw-next/02-workflow/spec-lite-profile.md +0 -313
  69. package/.aodw-next/.aodw-next/02-workflow/ui-workflow-rules.md +0 -334
  70. package/.aodw-next/.aodw-next/03-standards/ai-coding-rules-common.md +0 -89
  71. package/.aodw-next/.aodw-next/03-standards/ai-coding-rules.md +0 -370
  72. package/.aodw-next/.aodw-next/03-standards/stacks/java-springboot/ai-coding-rules-backend.md +0 -231
  73. package/.aodw-next/.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md +0 -612
  74. package/.aodw-next/.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md +0 -291
  75. package/.aodw-next/.aodw-next/03-standards/stacks/rust-axum/ai-coding-rules-backend.md +0 -134
  76. package/.aodw-next/.aodw-next/03-standards/stacks/vue2/ai-coding-rules-frontend.md +0 -220
  77. package/.aodw-next/.aodw-next/03-standards/ui-kit/ui-kit.md +0 -163
  78. package/.aodw-next/.aodw-next/04-auditors/aodw-development-auditor-rules.md +0 -470
  79. package/.aodw-next/.aodw-next/04-auditors/aodw-full-auditor-rules.md +0 -365
  80. package/.aodw-next/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +0 -408
  81. package/.aodw-next/.aodw-next/05-tooling/ai-tools-init-rules.md +0 -676
  82. package/.aodw-next/.aodw-next/06-project/ai-overview.md +0 -116
  83. package/.aodw-next/.aodw-next/06-project/modules-index.yaml +0 -11
  84. package/.aodw-next/.aodw-next/07-optimization/token-usage-analysis.md +0 -253
  85. package/.aodw-next/.aodw-next/README.md +0 -26
  86. package/.aodw-next/.aodw-next/RELEASE-CHECKLIST.md +0 -144
  87. package/.aodw-next/.aodw-next/config.yaml +0 -2
  88. package/.aodw-next/.aodw-next/manifest.yaml +0 -98
  89. package/.aodw-next/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
  90. package/.aodw-next/.aodw-next/templates/TEMPLATE-APPLICATION-GUIDE.md +0 -246
  91. package/.aodw-next/.aodw-next/templates/aodw-kernel-loader-template.md +0 -70
  92. package/.aodw-next/.aodw-next/templates/audit-report-template.md +0 -232
  93. package/.aodw-next/.aodw-next/templates/changelog-template.md +0 -16
  94. package/.aodw-next/.aodw-next/templates/checklists/coding-standards-template.md +0 -110
  95. package/.aodw-next/.aodw-next/templates/csf-review-template.md +0 -201
  96. package/.aodw-next/.aodw-next/templates/impact-template.md +0 -17
  97. package/.aodw-next/.aodw-next/templates/invariants-template.md +0 -12
  98. package/.aodw-next/.aodw-next/templates/module-readme-template.md +0 -39
  99. package/.aodw-next/.aodw-next/templates/plan-lite-template.md +0 -11
  100. package/.aodw-next/.aodw-next/templates/rt-decision-template.md +0 -13
  101. package/.aodw-next/.aodw-next/templates/rt-intake-template.md +0 -33
  102. package/.aodw-next/.aodw-next/templates/rt-meta-template.yaml +0 -43
  103. package/.aodw-next/.aodw-next/templates/spec-lite-template.md +0 -17
  104. package/.aodw-next/.aodw-next/templates/tests-template.md +0 -13
  105. package/.aodw-next/.aodw-next/templates/tools-config/README.md +0 -112
  106. package/.aodw-next/.aodw-next/templates/tools-config/backend/black.config.template.toml +0 -6
  107. package/.aodw-next/.aodw-next/templates/tools-config/backend/pre-commit.config.template.yaml +0 -16
  108. package/.aodw-next/.aodw-next/templates/tools-config/backend/ruff.config.template.toml +0 -23
  109. package/.aodw-next/.aodw-next/templates/tools-config/frontend/eslint.config.template.json +0 -113
  110. package/.aodw-next/.aodw-next/templates/tools-config/frontend/prettier.config.template.json +0 -10
  111. package/.aodw-next/.aodw-next/templates/tools-config/frontend/tsconfig.paths.template.json +0 -11
  112. package/.aodw-next/.aodw-next/workflow-guide.md +0 -51
  113. package/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
  114. package/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
  115. package/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
  116. package/.aodw-next/06-project/ai-overview.md +0 -116
  117. package/.aodw-next/06-project/modules-index.yaml +0 -11
  118. package/.aodw-next/RELEASE-CHECKLIST.md +0 -144
  119. package/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
  120. package/.aodw-next/workflow-guide.md +0 -51
@@ -0,0 +1,13 @@
1
+ version: 1
2
+
3
+ # ⚠️ 项目特化文件:描述当前项目的模块结构。
4
+ # 在新项目中安装 AODW 时,必须清空并重写本文件。
5
+ # 模块索引 - 由 AI 在知识蒸馏时自动维护
6
+ # 每当新增模块或修改模块结构时,AI 必须更新此文件
7
+
8
+ modules:
9
+ # 示例格式:
10
+ # - name: <模块名称>
11
+ # path: docs/modules/<模块名>.md
12
+ # root: <代码根目录模式>
13
+ # description: <模块职责描述>
@@ -9,3 +9,12 @@
9
9
  ## 3. 风险与注意事项(Risks & Caveats)
10
10
  - 潜在风险:
11
11
  - 需要注意的边界情形:
12
+
13
+ ## 4. 目标与验证(Goals & Verification)
14
+ - 目标 1:<描述> → 验证方式:<测试/回归/手动步骤>
15
+ - 目标 2:<描述> → 验证方式:<测试/回归/手动步骤>
16
+
17
+ ## 5. 实施边界(Execution Boundaries)
18
+ - 明确不做(Out of Scope):
19
+ - 是否存在无关重构/额外功能引入风险:有 / 无
20
+ - 若“有”,规避策略:
@@ -23,10 +23,10 @@
23
23
  > **注意**:AI 根据需求内容判断是否涉及前端/后端开发,如涉及则填写本节。
24
24
 
25
25
  - **是否涉及前端开发**?
26
- - [ ] 是 → 参考 `.aodw/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md`
26
+ - [ ] 是 → 参考 `.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md`
27
27
  - [ ] 否
28
28
  - **是否涉及后端开发**?
29
- - [ ] 是 → 参考 `.aodw/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md`
29
+ - [ ] 是 → 参考 `.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md`
30
30
  - [ ] 否
31
31
  - **技术栈要求**(如已知):
32
32
  - 前端:[React / Vue / Angular 等]
@@ -1,5 +1,5 @@
1
1
  # RT 元数据模板(单个 RT 的权威信息)
2
- # 路径建议:.aodw/templates/rt-meta-template.yaml
2
+ # 路径建议:.aodw-next/templates/rt-meta-template.yaml
3
3
 
4
4
  id: RT-XXX # 由 RT-Manager 生成,例如 RT-001
5
5
  title: <在此填写简短标题> # 例如 "修复订单列表加载缓慢的问题"
@@ -13,7 +13,7 @@ type: Bug
13
13
  profile: Spec-Lite
14
14
 
15
15
  # 当前状态
16
- # 可选值:created | intakeing | decided | in-progress | reviewing | done
16
+ # 可选值:created | intaking | decided | in-progress | reviewing | done
17
17
  status: created
18
18
 
19
19
  # 涉及的业务/技术模块标识,来自你的模块体系(例如 orders / users / auth 等)
@@ -15,3 +15,12 @@
15
15
  ## 5. 影响范围(Scope)
16
16
  - 涉及模块 / 文件:
17
17
  - 预期不应影响的功能:
18
+
19
+ ## 6. 实现前对齐(Implementation Alignment)
20
+ - 关键假设(输入/边界/依赖):
21
+ - 歧义点与解释选项:
22
+ - 解释 A:
23
+ - 解释 B:
24
+ - 推荐选项与理由:
25
+ - 最小必要改动说明(为何不是更大方案):
26
+ - 成功标准(可验证):
@@ -24,7 +24,7 @@ tools-config/
24
24
  ### 方式 1:通过 CLI 命令
25
25
 
26
26
  ```bash
27
- aodw init-tools
27
+ aodw-skill init-tools
28
28
  ```
29
29
 
30
30
  CLI 会自动检测项目类型,并使用相应的模板生成配置文件。
@@ -0,0 +1,5 @@
1
+ # clippy — copy to project root as clippy.toml when not using Cargo.toml [lints]
2
+ # See: https://doc.rust-lang.org/clippy/configuration.html
3
+ cognitive-complexity-threshold = 15
4
+ too-many-lines-threshold = 400
5
+
@@ -0,0 +1,4 @@
1
+ # rustfmt — copy to project root as rustfmt.toml (or merge into existing)
2
+ edition = "2021"
3
+ max_width = 100
4
+ use_small_heuristics = "Max"
@@ -0,0 +1,51 @@
1
+ # AODW Tools Status
2
+ # 工具初始化状态文件 - 由 CLI 或 AI 维护
3
+ # 首次安装时生成,后续工具初始化时更新
4
+
5
+ tools_init:
6
+ initialized: false
7
+ initialized_at: ""
8
+ last_updated_at: ""
9
+ initialized_by: ""
10
+ project_type: ""
11
+
12
+ frontend:
13
+ eslint:
14
+ installed: false
15
+ configured: false
16
+ config_file: ""
17
+ config_source: ""
18
+ prettier:
19
+ installed: false
20
+ configured: false
21
+ config_file: ""
22
+ config_source: ""
23
+ typescript_path_alias:
24
+ configured: false
25
+ config_file: ""
26
+ config_source: ""
27
+
28
+ backend:
29
+ dependency_manager:
30
+ uv_installed: false
31
+ pip_tools_installed: false
32
+ configured: false
33
+ requirements_in_exists: false
34
+ requirements_dev_in_exists: false
35
+ makefile_exists: false
36
+ ruff:
37
+ installed: false
38
+ configured: false
39
+ config_file: ""
40
+ config_source: ""
41
+ black:
42
+ installed: false
43
+ configured: false
44
+ config_file: ""
45
+ config_source: ""
46
+ pre_commit:
47
+ installed: false
48
+ configured: false
49
+ hooks_installed: false
50
+ config_file: ""
51
+ config_source: ""
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # aodw
1
+ # aodw-skill
2
2
 
3
- > AI-Orchestrated Development Workflow (AODW) CLI 工具
3
+ > AODW-Next: AI-Orchestrated Development Workflow (Skill 化版本)
4
4
 
5
- [![npm version](https://badge.fury.io/js/aodw.svg)](https://www.npmjs.com/package/aodw)
5
+ [![npm version](https://badge.fury.io/js/aodw-skill.svg)](https://www.npmjs.com/package/aodw-skill)
6
6
 
7
7
  ## 简介
8
8
 
9
- `aodw` 是一个命令行工具,用于在您的项目中快速初始化 AODW (AI-Orchestrated Development Workflow) 开发规范。
9
+ `aodw-skill` AODW-Next 的命令行工具,用于在您的项目中快速初始化 AODW 开发规范。
10
10
 
11
11
  AODW 定义了一种 **AI 主导、文档驱动、可回溯** 的软件开发范式,帮助团队通过统一的工作流提升协作效率和代码质量。
12
12
 
@@ -14,19 +14,13 @@ AODW 定义了一种 **AI 主导、文档驱动、可回溯** 的软件开发范
14
14
 
15
15
  在您的项目根目录运行:
16
16
 
17
- ```bash
18
- npx aodw
19
- ```
20
-
21
- next 版本(独立安装,不覆盖 legacy):
22
-
23
17
  ```bash
24
18
  npx aodw-skill
25
19
  ```
26
20
 
27
21
  该命令会:
28
- 1. 安装 AODW 核心规范(`.aodw` 或 `.aodw-next` 目录)
29
- 2. 根据您的选择安装对应的 AI 工具适配器(Cursor / Gemini / Claude)
22
+ 1. 安装 AODW-Next 核心规范(`.aodw-next` 目录)
23
+ 2. 根据您的选择安装对应的 AI 工具适配器(Cursor / Gemini / Claude / General
30
24
  3. 初始化 `RT` 目录用于管理开发任务
31
25
 
32
26
  ## 使用方法
@@ -34,57 +28,49 @@ npx aodw-skill
34
28
  ### 初始化安装
35
29
 
36
30
  ```bash
37
- npx aodw
31
+ npx aodw-skill
38
32
  ```
39
33
 
40
34
  系统会询问:
41
35
  - 您正在使用哪个 AI 工具?(可多选)
42
- - ✓ All (Install all adapters)
43
- - ✓ Cursor
44
- - ✓ Google Gemini
36
+ - ✓ Cursor (IDE with AI)
37
+ - ✓ Antigravity (Google Gemini)
45
38
  - ✓ Anthropic Claude
39
+ - ✓ Gemini (Web / API)
40
+ - ✓ General Agents (OpenAI, etc.)
46
41
 
47
- 根据您的选择,工具会自动安装相应的配置文件。
42
+ 根据您的选择,工具会自动安装相应的配置文件。
48
43
 
49
- ### 更新 AODW
44
+ ### 更新 AODW-Next
50
45
 
51
46
  更新到最新版本:
52
47
 
53
- ```bash
54
- npx aodw update
55
- ```
56
-
57
- next 版本更新:
58
48
  ```bash
59
49
  npx aodw-skill update
60
50
  ```
61
51
 
62
52
  该命令会:
63
- - 更新 `.aodw` 核心规范到最新版本
53
+ - 更新 `.aodw-next` 核心规范到最新版本
54
+ - 保留用户生成的文件(如 `ai-overview.md`、`modules-index.yaml`、`tools-status.yaml`)
64
55
  - 可选:同时更新已安装的适配器文件
65
56
 
66
- ### 卸载 AODW
67
-
68
- 从当前项目移除 AODW:
57
+ ### 卸载 AODW-Next
69
58
 
70
- ```bash
71
- npx aodw uninstall
72
- ```
59
+ 从当前项目移除 AODW-Next:
73
60
 
74
- next 版本卸载:
75
61
  ```bash
76
62
  npx aodw-skill uninstall
77
63
  ```
78
64
 
79
65
  该命令会删除:
80
- - `.aodw` 或 `.aodw-next` 目录
81
- - 渠道对应的适配器文件(.cursor、.agent 等)
66
+ - `.aodw-next` 目录
67
+ - 渠道对应的适配器文件(.cursor、.agent、.claude 等)
82
68
 
83
69
  ### 安装后
84
70
 
85
71
  1. **重启编辑器**:确保 AI 工具识别新的规则文件
86
- 2. **开始使用**:您的 AI 助手现在会遵循 AODW 规范工作
87
- 3. **查看文档**:`.aodw/aodw-constitution.md` 包含完整的工作流说明
72
+ 2. **开始使用**:您的 AI 助手现在会遵循 AODW-Next 规范工作
73
+ 3. **查看文档**:`.aodw-next/01-core/aodw-constitution.md` 包含完整的工作流说明
88
74
 
89
75
  ## 项目结构
90
76
 
@@ -92,24 +78,55 @@ npx aodw-skill uninstall
92
78
 
93
79
  ```
94
80
  your-project/
95
- ├── .aodw/ 或 .aodw-next/ # AODW 核心规范
96
- │ ├── aodw-constitution.md
97
- │ ├── rt-manager.md
98
- │ ├── git-discipline.md
99
- └── ...
81
+ ├── .aodw-next/ # AODW-Next 核心规范
82
+ │ ├── 01-core/ # 核心规则
83
+ │ ├── 02-workflow/ # 工作流程
84
+ │ ├── 03-standards/ # 编码规范
85
+ ├── 04-auditors/ # 审计器
86
+ │ ├── 05-tooling/ # 工具初始化
87
+ │ ├── 06-project/ # 项目概览(用户生成)
88
+ │ └── tools-status.yaml # 工具状态(用户生成)
100
89
  ├── RT/ # 运行时任务目录
101
- └── [适配器文件] # 如 .cursor、GEMINI.md 等
90
+ └── [适配器文件] # 如 .cursor、CLAUDE.md 等
102
91
  ```
103
92
 
104
93
  ## 支持的 AI 工具
105
94
 
106
- - **Cursor**: 安装 `.cursor` 目录
107
- - **Google Gemini**: 安装 `.agent` 目录和 `GEMINI.md`
108
- - **Anthropic Claude**: 安装 `CLAUDE.md`
95
+ - **Cursor**: 安装 `.cursor` 目录和 `aodw-next.mdc`
96
+ - **Antigravity**: 安装 `.agent` 目录
97
+ - **Anthropic Claude**: 安装 `.claude/CLAUDE.md`
98
+ - **Gemini**: 安装 `.agent` 目录和 `.gemini/GEMINI.md`
99
+ - **General**: 安装通用适配器(如 `.github/copilot-instructions.md`)
100
+
101
+ ## 更多命令
102
+
103
+ ### 项目概览初始化
104
+
105
+ ```bash
106
+ npx aodw-skill init-overview
107
+ ```
108
+
109
+ 自动检测项目的技术栈、架构和模块结构,生成项目概览文档。
110
+
111
+ ### 工具初始化
112
+
113
+ ```bash
114
+ npx aodw-skill init-tools
115
+ ```
116
+
117
+ 根据项目技术栈,初始化相应的开发工具(ESLint、Prettier、Ruff、Black、rustfmt、clippy 等)。
118
+
119
+ ### 创建 RT (Request Ticket)
120
+
121
+ ```bash
122
+ npx aodw-skill new
123
+ ```
124
+
125
+ 交互式创建新的开发任务 Ticket。
109
126
 
110
127
  ## 了解更多
111
128
 
112
- - [AODW 完整文档](#)
129
+ - [AODW-Next 完整文档](#)
113
130
  - [贡献指南](#)
114
131
  - [问题反馈](https://github.com/your-repo/issues)
115
132
 
package/bin/aodw.js CHANGED
@@ -126,32 +126,30 @@ async function isTemplateFile(filePath) {
126
126
  if (!fs.existsSync(filePath)) {
127
127
  return false;
128
128
  }
129
-
129
+
130
130
  try {
131
131
  const content = await fs.readFile(filePath, 'utf8');
132
-
132
+
133
133
  // Check for template markers in ai-overview.md
134
134
  if (filePath.endsWith('ai-overview.md')) {
135
- // Template has empty tech stack sections like "- 前端:\n- 后端:"
136
- const hasEmptyTechStack = /- 前端:\s*\n\s*- 后端:/.test(content);
137
- // Template has placeholder text
138
- const hasPlaceholder = /(由 AI 或人工在首次接入 AODW-Next 时填写/.test(content);
139
- return hasEmptyTechStack || hasPlaceholder;
135
+ // Template has "待补充" placeholders
136
+ const hasPlaceholder = /(待补充)/.test(content);
137
+ return hasPlaceholder;
140
138
  }
141
-
139
+
142
140
  // Check for template markers in modules-index.yaml
143
141
  if (filePath.endsWith('modules-index.yaml')) {
144
- // Template has only example comments, no actual modules
145
- const hasOnlyComments = /^version: 1\s*\n\s*# 模块索引/.test(content) &&
146
- !/^modules:\s*\n\s*- name:/.test(content);
142
+ // Template has comment "# ⚠️ 项目特化文件..." and no actual modules
143
+ const hasOnlyComments = /^version: 1\s*\n\s*# ⚠️ 项目特化文件/.test(content) &&
144
+ /^modules:\s*\n\s*# 示例格式/m.test(content);
147
145
  return hasOnlyComments;
148
146
  }
149
-
147
+
150
148
  // tools-status.yaml is always user-generated if it exists
151
149
  if (filePath.endsWith('tools-status.yaml')) {
152
150
  return false; // If it exists, it's user-generated
153
151
  }
154
-
152
+
155
153
  return false;
156
154
  } catch (e) {
157
155
  return false;
@@ -236,8 +234,7 @@ async function runInit() {
236
234
 
237
235
  // --- Safeguard: Prevent running in AODW-Next Source Repo ---
238
236
  if (fs.existsSync(path.join(process.cwd(), 'cli/bin/aodw.js')) &&
239
- (fs.existsSync(path.join(process.cwd(), 'templates/.aodw')) ||
240
- fs.existsSync(path.join(process.cwd(), 'templates/.aodw-next')))) {
237
+ fs.existsSync(path.join(process.cwd(), 'templates/.aodw-next'))) {
241
238
  console.log(chalk.red('\n🛑 严重错误: 您正在 AODW-Next 源码仓库中运行 "aodw-skill init"!'));
242
239
  console.log(chalk.yellow(' 这将导致开发模板覆盖源文件。'));
243
240
  console.log(chalk.yellow(' 如需更新模板,请使用: cd cli && ./build-local.sh'));
@@ -323,7 +320,7 @@ async function runInit() {
323
320
  // 1. Install Core Rules (channel-aware core dir)
324
321
  const targetCore = path.join(process.cwd(), CORE_DIRNAME);
325
322
  const isUpdate = fs.existsSync(targetCore);
326
-
323
+
327
324
  if (isUpdate) {
328
325
  console.log(chalk.blue('正在更新核心规则(保留用户生成的文件)...'));
329
326
  await copyCoreWithPreservation(SOURCE_CORE, targetCore, true);
@@ -332,6 +329,37 @@ async function runInit() {
332
329
  await fs.copy(SOURCE_CORE, targetCore);
333
330
  }
334
331
 
332
+ // 2. Initialize project files from templates (first time only)
333
+ if (!isUpdate) {
334
+ console.log(chalk.blue('正在初始化项目文件...'));
335
+ const projectDir = path.join(targetCore, '06-project');
336
+ const templateDir = path.join(SOURCE_CORE, 'templates');
337
+
338
+ // Check if project files need to be initialized
339
+ const aiOverviewExists = fs.existsSync(path.join(projectDir, 'ai-overview.md'));
340
+ const modulesIndexExists = fs.existsSync(path.join(projectDir, 'modules-index.yaml'));
341
+
342
+ if (!aiOverviewExists && !modulesIndexExists) {
343
+ // Copy templates from templates/ directory
344
+ if (fs.existsSync(templateDir)) {
345
+ const aiOverviewTemplate = path.join(templateDir, 'ai-overview.template.md');
346
+ const modulesIndexTemplate = path.join(templateDir, 'modules-index.template.yaml');
347
+
348
+ if (fs.existsSync(aiOverviewTemplate)) {
349
+ await fs.copy(aiOverviewTemplate, path.join(projectDir, 'ai-overview.md'));
350
+ console.log(chalk.yellow(' • 已生成 ai-overview.md(模板)'));
351
+ }
352
+ if (fs.existsSync(modulesIndexTemplate)) {
353
+ await fs.copy(modulesIndexTemplate, path.join(projectDir, 'modules-index.yaml'));
354
+ console.log(chalk.yellow(' • 已生成 modules-index.yaml(模板)'));
355
+ }
356
+ }
357
+ console.log(chalk.gray(' 💡 运行 "aodw-skill init-overview" 来自动填充项目信息'));
358
+ } else {
359
+ console.log(chalk.gray(' • 项目文件已存在,跳过初始化'));
360
+ }
361
+ }
362
+
335
363
  // 3. Install Adapters based on selected platforms
336
364
  console.log(chalk.blue('正在安装适配器...'));
337
365
 
@@ -5,9 +5,9 @@ import chalk from 'chalk';
5
5
  import yaml from 'js-yaml';
6
6
  import inquirer from 'inquirer';
7
7
 
8
- const CORE_DIR = process.env.AODW_CORE_DIR || '.aodw';
9
- const OVERVIEW_FILE = `${CORE_DIR}/ai-overview.md`;
10
- const MODULES_INDEX_FILE = `${CORE_DIR}/modules-index.yaml`;
8
+ const CORE_DIR = process.env.AODW_CORE_DIR || '.aodw-next';
9
+ const OVERVIEW_FILE = `${CORE_DIR}/06-project/ai-overview.md`;
10
+ const MODULES_INDEX_FILE = `${CORE_DIR}/06-project/modules-index.yaml`;
11
11
 
12
12
  // 检测技术栈
13
13
  async function detectTechStack() {
@@ -5,8 +5,8 @@ import chalk from 'chalk';
5
5
  import yaml from 'js-yaml';
6
6
  import inquirer from 'inquirer';
7
7
 
8
- const CORE_DIR = process.env.AODW_CORE_DIR || '.aodw';
9
- const PACKAGE_NAME = process.env.AODW_PACKAGE_NAME || 'aodw';
8
+ const CORE_DIR = process.env.AODW_CORE_DIR || '.aodw-next';
9
+ const PACKAGE_NAME = process.env.AODW_PACKAGE_NAME || 'aodw-skill';
10
10
  const TOOLS_STATUS_FILE = `${CORE_DIR}/tools-status.yaml`;
11
11
 
12
12
  // 获取模板目录路径(支持开发环境和发布环境)
@@ -19,14 +19,14 @@ function getTemplatesDir() {
19
19
  }
20
20
  // 如果不存在,尝试 CLI 包内的模板(发布后的模板)
21
21
  // 注意:CLI 包内的模板路径是相对于 CLI 源码目录的
22
- // 路径:cli/.aodw/templates/tools-config(开发环境)
23
- // 或:node_modules/<package>/.aodw/templates/tools-config(发布后)
24
- const cliTemplates = path.join(__dirname, '../../.aodw/templates/tools-config');
22
+ // 路径:cli/.aodw-next/templates/tools-config(开发环境,与 publish.sh 同步目录一致)
23
+ // 或:node_modules/<package>/.aodw-next/templates/tools-config(发布后)
24
+ const cliTemplates = path.join(__dirname, '../../.aodw-next/templates/tools-config');
25
25
  if (fs.existsSync(cliTemplates)) {
26
26
  return cliTemplates;
27
27
  }
28
28
  // 尝试发布后的路径(node_modules)
29
- const nodeModulesTemplates = path.join(cwd, `node_modules/${PACKAGE_NAME}/.aodw/templates/tools-config`);
29
+ const nodeModulesTemplates = path.join(cwd, `node_modules/${PACKAGE_NAME}/.aodw-next/templates/tools-config`);
30
30
  if (fs.existsSync(nodeModulesTemplates)) {
31
31
  return nodeModulesTemplates;
32
32
  }
@@ -328,7 +328,6 @@ async function installESLint() {
328
328
  async function installPrettier() {
329
329
  console.log(chalk.blue('📦 正在安装 Prettier...'));
330
330
  try {
331
- // 先尝试正常安装
332
331
  execSync('npm install -D prettier', {
333
332
  stdio: 'inherit',
334
333
  cwd: process.cwd()
@@ -336,7 +335,6 @@ async function installPrettier() {
336
335
  console.log(chalk.green('✔ Prettier 安装完成\n'));
337
336
  return true;
338
337
  } catch (error) {
339
- // 如果出现依赖冲突,尝试使用 --legacy-peer-deps
340
338
  if (error.message.includes('ERESOLVE') || error.message.includes('could not resolve')) {
341
339
  console.log(chalk.yellow('⚠️ 检测到依赖冲突,尝试使用 --legacy-peer-deps 安装...'));
342
340
  try {
@@ -348,7 +346,7 @@ async function installPrettier() {
348
346
  return true;
349
347
  } catch (retryError) {
350
348
  console.error(chalk.red(`✗ Prettier 安装失败: ${retryError.message}\n`));
351
- console.log(chalk.yellow('💡 提示:您可以手动运行 "npm install -D prettier --legacy-peer-deps" 或 "npm install -D prettier --force"\n'));
349
+ console.log(chalk.yellow('💡 提示:您可以手动运行 \"npm install -D prettier --legacy-peer-deps\" 或 \"npm install -D prettier --force\"\n'));
352
350
  return false;
353
351
  }
354
352
  } else {
@@ -372,33 +370,26 @@ function ensureRequirementsDevIn() {
372
370
  // 通过 uv + pip-tools 安装后端工具
373
371
  async function installBackendToolViaPipTools(toolName, versionConstraint) {
374
372
  const requirementsDevInPath = ensureRequirementsDevIn();
375
-
376
- // 检查依赖是否已存在
377
373
  const content = fs.readFileSync(requirementsDevInPath, 'utf8');
378
- if (content.includes(toolName)) {
374
+ if (!content.includes(toolName)) {
375
+ console.log(chalk.blue(`📝 添加 ${toolName} 到 requirements-dev.in...`));
376
+ fs.appendFileSync(requirementsDevInPath, `${toolName}${versionConstraint}\n`);
377
+ console.log(chalk.green(`✔ ${toolName} 已添加到 requirements-dev.in\n`));
378
+ } else {
379
379
  console.log(chalk.yellow(`⚠️ ${toolName} 已在 requirements-dev.in 中\n`));
380
- return true;
381
380
  }
382
-
383
- // 添加依赖到 requirements-dev.in
384
- console.log(chalk.blue(`📝 添加 ${toolName} 到 requirements-dev.in...`));
385
- fs.appendFileSync(requirementsDevInPath, `${toolName}${versionConstraint}\n`);
386
- console.log(chalk.green(`✔ ${toolName} 已添加到 requirements-dev.in\n`));
387
-
388
- // 检查是否有 Makefile
381
+
389
382
  const makefilePath = path.join(process.cwd(), 'Makefile');
390
383
  const hasMakefile = fs.existsSync(makefilePath);
391
-
392
- if (hasMakefile) {
393
- // 使用 Makefile
394
- console.log(chalk.blue('📦 编译依赖(make compile-deps)...'));
395
- try {
384
+
385
+ try {
386
+ if (hasMakefile) {
387
+ console.log(chalk.blue('📦 编译依赖(make compile-deps)...'));
396
388
  execSync('make compile-deps', {
397
389
  stdio: 'inherit',
398
390
  cwd: process.cwd()
399
391
  });
400
392
  console.log(chalk.green('✔ 依赖编译完成\n'));
401
-
402
393
  console.log(chalk.blue('📦 同步环境(make sync)...'));
403
394
  execSync('make sync', {
404
395
  stdio: 'inherit',
@@ -406,33 +397,25 @@ async function installBackendToolViaPipTools(toolName, versionConstraint) {
406
397
  });
407
398
  console.log(chalk.green('✔ 环境同步完成\n'));
408
399
  return true;
409
- } catch (error) {
410
- console.error(chalk.red(`✗ 依赖安装失败: ${error.message}\n`));
411
- console.log(chalk.yellow('💡 提示:请确保已安装 uv 和 pip-tools,并配置了 Makefile\n'));
412
- return false;
413
400
  }
414
- } else {
415
- // 直接使用 uv pip compile 和 sync
401
+
416
402
  console.log(chalk.blue('📦 编译依赖(uv pip compile)...'));
417
- try {
418
- execSync('uv pip compile requirements-dev.in -o requirements-dev.txt', {
419
- stdio: 'inherit',
420
- cwd: process.cwd()
421
- });
422
- console.log(chalk.green(' 依赖编译完成\n'));
423
-
424
- console.log(chalk.blue('📦 同步环境(uv pip sync)...'));
425
- execSync('uv pip sync requirements-dev.txt', {
426
- stdio: 'inherit',
427
- cwd: process.cwd()
428
- });
429
- console.log(chalk.green('✔ 环境同步完成\n'));
430
- return true;
431
- } catch (error) {
432
- console.error(chalk.red(`✗ 依赖安装失败: ${error.message}\n`));
433
- console.log(chalk.yellow('💡 提示:请确保已安装 uv 和 pip-tools\n'));
434
- return false;
435
- }
403
+ execSync('uv pip compile requirements-dev.in -o requirements-dev.txt', {
404
+ stdio: 'inherit',
405
+ cwd: process.cwd()
406
+ });
407
+ console.log(chalk.green('✔ 依赖编译完成\n'));
408
+ console.log(chalk.blue('📦 同步环境(uv pip sync)...'));
409
+ execSync('uv pip sync requirements-dev.txt', {
410
+ stdio: 'inherit',
411
+ cwd: process.cwd()
412
+ });
413
+ console.log(chalk.green('✔ 环境同步完成\n'));
414
+ return true;
415
+ } catch (error) {
416
+ console.error(chalk.red(`✗ 依赖安装失败: ${error.message}\n`));
417
+ console.log(chalk.yellow('💡 提示:请确保已安装 uv 和 pip-tools\n'));
418
+ return false;
436
419
  }
437
420
  }
438
421
 
@@ -3,7 +3,7 @@ import path from 'path';
3
3
  import yaml from 'js-yaml';
4
4
 
5
5
  function getCoreDir() {
6
- return process.env.AODW_CORE_DIR || '.aodw';
6
+ return process.env.AODW_CORE_DIR || '.aodw-next';
7
7
  }
8
8
 
9
9
  function getProjectConfigFile() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aodw-skill",
3
- "version": "0.7.14",
3
+ "version": "0.7.17",
4
4
  "description": "Next-channel CLI tool to scaffold AODW in your project",
5
5
  "main": "bin/aodw.js",
6
6
  "files": [