aodw-skill 0.7.14 → 0.7.18
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/ai-interaction-rules-summary.md +37 -0
- package/.aodw-next/01-core/ai-interaction-rules.md +20 -6
- package/.aodw-next/01-core/ai-knowledge-rules-summary.md +25 -0
- package/.aodw-next/01-core/ai-knowledge-rules.md +19 -21
- package/.aodw-next/01-core/ai-project-overview-rules.md +11 -11
- package/.aodw-next/01-core/aodw-constitution.md +7 -414
- package/.aodw-next/01-core/csf-thinking-framework.md +14 -14
- package/.aodw-next/01-core/git-discipline-summary.md +36 -0
- package/.aodw-next/01-core/git-discipline.md +129 -73
- package/.aodw-next/01-core/module-doc-rules.md +2 -2
- package/.aodw-next/02-workflow/rt-id-generation-rules.md +16 -259
- package/.aodw-next/02-workflow/rt-manager-summary.md +1 -1
- package/.aodw-next/02-workflow/rt-manager.md +73 -344
- package/.aodw-next/02-workflow/spec-full-profile.md +149 -307
- package/.aodw-next/02-workflow/spec-lite-profile.md +170 -253
- package/.aodw-next/02-workflow/ui-workflow-rules-summary.md +39 -0
- package/.aodw-next/02-workflow/ui-workflow-rules.md +57 -292
- package/.aodw-next/03-standards/ai-coding-rules-common.md +1 -1
- package/.aodw-next/03-standards/ai-coding-rules.md +91 -25
- package/.aodw-next/03-standards/stacks/java-springboot/ai-coding-rules-backend.md +9 -9
- package/.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md +13 -13
- package/.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md +10 -10
- package/.aodw-next/03-standards/stacks/rust-axum/ai-coding-rules-backend.md +4 -4
- package/.aodw-next/03-standards/stacks/vue2/ai-coding-rules-frontend.md +9 -9
- package/.aodw-next/04-auditors/aodw-development-auditor-rules.md +15 -10
- package/.aodw-next/04-auditors/aodw-full-auditor-rules.md +14 -14
- package/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +130 -338
- package/.aodw-next/05-tooling/ai-tools-init-rules.md +74 -367
- package/.aodw-next/06-project/README.md +16 -0
- package/.aodw-next/07-optimization/token-usage-analysis.md +2 -2
- package/.aodw-next/README.md +53 -20
- package/.aodw-next/SKILL.md +32 -0
- package/.aodw-next/config.yaml +2 -2
- package/.aodw-next/manifest.yaml +64 -57
- package/.aodw-next/project.yaml +1 -0
- package/.aodw-next/templates/TEMPLATE-APPLICATION-GUIDE.md +21 -157
- package/.aodw-next/templates/ai-overview.template.md +72 -0
- package/.aodw-next/templates/checklists/coding-standards-template.md +24 -4
- package/.aodw-next/templates/modules-index.template.yaml +13 -0
- package/.aodw-next/templates/plan-lite-template.md +9 -0
- package/.aodw-next/templates/rt-intake-template.md +2 -2
- package/.aodw-next/templates/rt-meta-template.yaml +2 -2
- package/.aodw-next/templates/spec-lite-template.md +9 -0
- package/.aodw-next/templates/tools-config/README.md +1 -1
- package/.aodw-next/templates/tools-config/backend/clippy.config.template.toml +5 -0
- package/.aodw-next/templates/tools-config/backend/rustfmt.config.template.toml +4 -0
- package/.aodw-next/tools-status.yaml +51 -0
- package/README.md +107 -45
- package/bin/aodw.js +54 -124
- package/bin/commands/init-overview.js +3 -3
- package/bin/commands/init-tools.js +34 -51
- package/bin/commands/new.js +4 -120
- package/bin/utils/config.js +1 -1
- package/package.json +1 -1
- package/.aodw-next/.aodw-next/01-core/ai-interaction-rules.md +0 -218
- package/.aodw-next/.aodw-next/01-core/ai-knowledge-rules.md +0 -302
- package/.aodw-next/.aodw-next/01-core/ai-project-overview-rules.md +0 -284
- package/.aodw-next/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
- package/.aodw-next/.aodw-next/01-core/aodw-constitution.md +0 -419
- package/.aodw-next/.aodw-next/01-core/csf-thinking-framework.md +0 -373
- package/.aodw-next/.aodw-next/01-core/git-discipline.md +0 -226
- package/.aodw-next/.aodw-next/01-core/module-doc-rules.md +0 -90
- package/.aodw-next/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
- package/.aodw-next/.aodw-next/02-workflow/rt-id-generation-rules.md +0 -267
- package/.aodw-next/.aodw-next/02-workflow/rt-manager-summary.md +0 -15
- package/.aodw-next/.aodw-next/02-workflow/rt-manager.md +0 -399
- package/.aodw-next/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
- package/.aodw-next/.aodw-next/02-workflow/spec-full-profile.md +0 -391
- package/.aodw-next/.aodw-next/02-workflow/spec-lite-profile.md +0 -313
- package/.aodw-next/.aodw-next/02-workflow/ui-workflow-rules.md +0 -334
- package/.aodw-next/.aodw-next/03-standards/ai-coding-rules-common.md +0 -89
- package/.aodw-next/.aodw-next/03-standards/ai-coding-rules.md +0 -370
- package/.aodw-next/.aodw-next/03-standards/stacks/java-springboot/ai-coding-rules-backend.md +0 -231
- package/.aodw-next/.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md +0 -612
- package/.aodw-next/.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md +0 -291
- package/.aodw-next/.aodw-next/03-standards/stacks/rust-axum/ai-coding-rules-backend.md +0 -134
- package/.aodw-next/.aodw-next/03-standards/stacks/vue2/ai-coding-rules-frontend.md +0 -220
- package/.aodw-next/.aodw-next/03-standards/ui-kit/ui-kit.md +0 -163
- package/.aodw-next/.aodw-next/04-auditors/aodw-development-auditor-rules.md +0 -470
- package/.aodw-next/.aodw-next/04-auditors/aodw-full-auditor-rules.md +0 -365
- package/.aodw-next/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +0 -408
- package/.aodw-next/.aodw-next/05-tooling/ai-tools-init-rules.md +0 -676
- package/.aodw-next/.aodw-next/06-project/ai-overview.md +0 -116
- package/.aodw-next/.aodw-next/06-project/modules-index.yaml +0 -11
- package/.aodw-next/.aodw-next/07-optimization/token-usage-analysis.md +0 -253
- package/.aodw-next/.aodw-next/README.md +0 -26
- package/.aodw-next/.aodw-next/RELEASE-CHECKLIST.md +0 -144
- package/.aodw-next/.aodw-next/config.yaml +0 -2
- package/.aodw-next/.aodw-next/manifest.yaml +0 -98
- package/.aodw-next/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
- package/.aodw-next/.aodw-next/templates/TEMPLATE-APPLICATION-GUIDE.md +0 -246
- package/.aodw-next/.aodw-next/templates/aodw-kernel-loader-template.md +0 -70
- package/.aodw-next/.aodw-next/templates/audit-report-template.md +0 -232
- package/.aodw-next/.aodw-next/templates/changelog-template.md +0 -16
- package/.aodw-next/.aodw-next/templates/checklists/coding-standards-template.md +0 -110
- package/.aodw-next/.aodw-next/templates/csf-review-template.md +0 -201
- package/.aodw-next/.aodw-next/templates/impact-template.md +0 -17
- package/.aodw-next/.aodw-next/templates/invariants-template.md +0 -12
- package/.aodw-next/.aodw-next/templates/module-readme-template.md +0 -39
- package/.aodw-next/.aodw-next/templates/plan-lite-template.md +0 -11
- package/.aodw-next/.aodw-next/templates/rt-decision-template.md +0 -13
- package/.aodw-next/.aodw-next/templates/rt-intake-template.md +0 -33
- package/.aodw-next/.aodw-next/templates/rt-meta-template.yaml +0 -43
- package/.aodw-next/.aodw-next/templates/spec-lite-template.md +0 -17
- package/.aodw-next/.aodw-next/templates/tests-template.md +0 -13
- package/.aodw-next/.aodw-next/templates/tools-config/README.md +0 -112
- package/.aodw-next/.aodw-next/templates/tools-config/backend/black.config.template.toml +0 -6
- package/.aodw-next/.aodw-next/templates/tools-config/backend/pre-commit.config.template.yaml +0 -16
- package/.aodw-next/.aodw-next/templates/tools-config/backend/ruff.config.template.toml +0 -23
- package/.aodw-next/.aodw-next/templates/tools-config/frontend/eslint.config.template.json +0 -113
- package/.aodw-next/.aodw-next/templates/tools-config/frontend/prettier.config.template.json +0 -10
- package/.aodw-next/.aodw-next/templates/tools-config/frontend/tsconfig.paths.template.json +0 -11
- package/.aodw-next/.aodw-next/workflow-guide.md +0 -51
- package/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
- package/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
- package/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
- package/.aodw-next/06-project/ai-overview.md +0 -116
- package/.aodw-next/06-project/modules-index.yaml +0 -11
- package/.aodw-next/RELEASE-CHECKLIST.md +0 -144
- package/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
- package/.aodw-next/workflow-guide.md +0 -51
|
@@ -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 |
|
|
16
|
+
# 可选值:created | intaking | decided | in-progress | reviewing | done
|
|
17
17
|
status: created
|
|
18
18
|
|
|
19
19
|
# 涉及的业务/技术模块标识,来自你的模块体系(例如 orders / users / auth 等)
|
|
@@ -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 (
|
|
3
|
+
> AODW-Next: AI-Orchestrated Development Workflow (Skill 化版本)
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/aodw)
|
|
5
|
+
[](https://www.npmjs.com/package/aodw-skill)
|
|
6
6
|
|
|
7
7
|
## 简介
|
|
8
8
|
|
|
9
|
-
`aodw`
|
|
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
|
|
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
|
-
- ✓
|
|
43
|
-
- ✓
|
|
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
|
-
|
|
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
|
|
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,100 @@ npx aodw-skill uninstall
|
|
|
92
78
|
|
|
93
79
|
```
|
|
94
80
|
your-project/
|
|
95
|
-
├── .aodw
|
|
96
|
-
│ ├──
|
|
97
|
-
│ ├──
|
|
98
|
-
│ ├──
|
|
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、
|
|
90
|
+
└── [适配器文件] # 如 .cursor、CLAUDE.md 等
|
|
102
91
|
```
|
|
103
92
|
|
|
104
93
|
## 支持的 AI 工具
|
|
105
94
|
|
|
106
|
-
- **Cursor**: 安装 `.cursor`
|
|
107
|
-
- **
|
|
108
|
-
- **Anthropic Claude**: 安装
|
|
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。
|
|
126
|
+
|
|
127
|
+
## 维护者发布流程
|
|
128
|
+
|
|
129
|
+
后续版本发布统一采用以下方式:
|
|
130
|
+
|
|
131
|
+
1. 进入目录并确认状态
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
cd cli
|
|
135
|
+
git status
|
|
136
|
+
npm whoami
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
2. 版本升级(会同步模板并更新版本号)
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
./publish.sh patch # 或 minor / major
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
3. 发布到 npm
|
|
146
|
+
|
|
147
|
+
- OTP 模式(账号策略要求 2FA):
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm publish --otp=<6位验证码>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
- Token 模式(Granular Access Token + bypass 2FA):
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm config set //registry.npmjs.org/:_authToken=<TOKEN>
|
|
157
|
+
npm publish
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
4. 发布校验
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm view aodw-skill version
|
|
164
|
+
npx aodw-skill@latest --help
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
5. 收尾
|
|
168
|
+
|
|
169
|
+
- 如 `package.json` 版本号变更未提交,请补充 commit 并 push。
|
|
170
|
+
- 若 token 曾在不安全位置暴露,请立即撤销并更换。
|
|
109
171
|
|
|
110
172
|
## 了解更多
|
|
111
173
|
|
|
112
|
-
- [AODW 完整文档](#)
|
|
174
|
+
- [AODW-Next 完整文档](#)
|
|
113
175
|
- [贡献指南](#)
|
|
114
176
|
- [问题反馈](https://github.com/your-repo/issues)
|
|
115
177
|
|
package/bin/aodw.js
CHANGED
|
@@ -7,7 +7,6 @@ import fs from 'fs-extra';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { createRequire } from 'module';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
|
-
import fetch from 'node-fetch';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
AntigravityProcessor,
|
|
@@ -126,32 +125,30 @@ async function isTemplateFile(filePath) {
|
|
|
126
125
|
if (!fs.existsSync(filePath)) {
|
|
127
126
|
return false;
|
|
128
127
|
}
|
|
129
|
-
|
|
128
|
+
|
|
130
129
|
try {
|
|
131
130
|
const content = await fs.readFile(filePath, 'utf8');
|
|
132
|
-
|
|
131
|
+
|
|
133
132
|
// Check for template markers in ai-overview.md
|
|
134
133
|
if (filePath.endsWith('ai-overview.md')) {
|
|
135
|
-
// Template has
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const hasPlaceholder = /(由 AI 或人工在首次接入 AODW-Next 时填写/.test(content);
|
|
139
|
-
return hasEmptyTechStack || hasPlaceholder;
|
|
134
|
+
// Template has "待补充" placeholders
|
|
135
|
+
const hasPlaceholder = /(待补充)/.test(content);
|
|
136
|
+
return hasPlaceholder;
|
|
140
137
|
}
|
|
141
|
-
|
|
138
|
+
|
|
142
139
|
// Check for template markers in modules-index.yaml
|
|
143
140
|
if (filePath.endsWith('modules-index.yaml')) {
|
|
144
|
-
// Template has
|
|
145
|
-
const hasOnlyComments = /^version: 1\s*\n\s*#
|
|
146
|
-
|
|
141
|
+
// Template has comment "# ⚠️ 项目特化文件..." and no actual modules
|
|
142
|
+
const hasOnlyComments = /^version: 1\s*\n\s*# ⚠️ 项目特化文件/.test(content) &&
|
|
143
|
+
/^modules:\s*\n\s*# 示例格式/m.test(content);
|
|
147
144
|
return hasOnlyComments;
|
|
148
145
|
}
|
|
149
|
-
|
|
146
|
+
|
|
150
147
|
// tools-status.yaml is always user-generated if it exists
|
|
151
148
|
if (filePath.endsWith('tools-status.yaml')) {
|
|
152
149
|
return false; // If it exists, it's user-generated
|
|
153
150
|
}
|
|
154
|
-
|
|
151
|
+
|
|
155
152
|
return false;
|
|
156
153
|
} catch (e) {
|
|
157
154
|
return false;
|
|
@@ -207,37 +204,12 @@ async function returnToMenu() {
|
|
|
207
204
|
}]);
|
|
208
205
|
}
|
|
209
206
|
|
|
210
|
-
// Helper: Check server health
|
|
211
|
-
async function checkServerHealth(url) {
|
|
212
|
-
try {
|
|
213
|
-
// Ensure URL has protocol
|
|
214
|
-
if (!url.startsWith('http')) {
|
|
215
|
-
url = `http://${url}`;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Create timeout signal
|
|
219
|
-
const controller = new AbortController();
|
|
220
|
-
const timeout = setTimeout(() => controller.abort(), 3000); // 3s timeout
|
|
221
|
-
|
|
222
|
-
const res = await fetch(`${url}/api/health`, {
|
|
223
|
-
method: 'GET',
|
|
224
|
-
signal: controller.signal
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
clearTimeout(timeout);
|
|
228
|
-
return res.ok;
|
|
229
|
-
} catch (error) {
|
|
230
|
-
return false;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
207
|
async function runInit() {
|
|
235
208
|
console.log(chalk.blue('🚀 正在初始化 AODW-Next...'));
|
|
236
209
|
|
|
237
210
|
// --- Safeguard: Prevent running in AODW-Next Source Repo ---
|
|
238
211
|
if (fs.existsSync(path.join(process.cwd(), 'cli/bin/aodw.js')) &&
|
|
239
|
-
|
|
240
|
-
fs.existsSync(path.join(process.cwd(), 'templates/.aodw-next')))) {
|
|
212
|
+
fs.existsSync(path.join(process.cwd(), 'templates/.aodw-next'))) {
|
|
241
213
|
console.log(chalk.red('\n🛑 严重错误: 您正在 AODW-Next 源码仓库中运行 "aodw-skill init"!'));
|
|
242
214
|
console.log(chalk.yellow(' 这将导致开发模板覆盖源文件。'));
|
|
243
215
|
console.log(chalk.yellow(' 如需更新模板,请使用: cd cli && ./build-local.sh'));
|
|
@@ -292,10 +264,11 @@ async function runInit() {
|
|
|
292
264
|
await saveProjectConfig({ project_name: projectName });
|
|
293
265
|
}
|
|
294
266
|
|
|
295
|
-
// --- Step 2:
|
|
267
|
+
// --- Step 2: Fixed Local Mode (independent only) ---
|
|
296
268
|
const userConfig = getUserConfig();
|
|
297
|
-
if (
|
|
298
|
-
await
|
|
269
|
+
if (userConfig.mode !== 'independent' || userConfig.server_url) {
|
|
270
|
+
await saveUserConfig({ mode: 'independent', server_url: '' });
|
|
271
|
+
console.log(chalk.gray('已固定为独立模式(本地生成 ID)'));
|
|
299
272
|
}
|
|
300
273
|
|
|
301
274
|
// --- Step 3: Platform Selection (Multi-select) ---
|
|
@@ -323,7 +296,7 @@ async function runInit() {
|
|
|
323
296
|
// 1. Install Core Rules (channel-aware core dir)
|
|
324
297
|
const targetCore = path.join(process.cwd(), CORE_DIRNAME);
|
|
325
298
|
const isUpdate = fs.existsSync(targetCore);
|
|
326
|
-
|
|
299
|
+
|
|
327
300
|
if (isUpdate) {
|
|
328
301
|
console.log(chalk.blue('正在更新核心规则(保留用户生成的文件)...'));
|
|
329
302
|
await copyCoreWithPreservation(SOURCE_CORE, targetCore, true);
|
|
@@ -332,6 +305,37 @@ async function runInit() {
|
|
|
332
305
|
await fs.copy(SOURCE_CORE, targetCore);
|
|
333
306
|
}
|
|
334
307
|
|
|
308
|
+
// 2. Initialize project files from templates (first time only)
|
|
309
|
+
if (!isUpdate) {
|
|
310
|
+
console.log(chalk.blue('正在初始化项目文件...'));
|
|
311
|
+
const projectDir = path.join(targetCore, '06-project');
|
|
312
|
+
const templateDir = path.join(SOURCE_CORE, 'templates');
|
|
313
|
+
|
|
314
|
+
// Check if project files need to be initialized
|
|
315
|
+
const aiOverviewExists = fs.existsSync(path.join(projectDir, 'ai-overview.md'));
|
|
316
|
+
const modulesIndexExists = fs.existsSync(path.join(projectDir, 'modules-index.yaml'));
|
|
317
|
+
|
|
318
|
+
if (!aiOverviewExists && !modulesIndexExists) {
|
|
319
|
+
// Copy templates from templates/ directory
|
|
320
|
+
if (fs.existsSync(templateDir)) {
|
|
321
|
+
const aiOverviewTemplate = path.join(templateDir, 'ai-overview.template.md');
|
|
322
|
+
const modulesIndexTemplate = path.join(templateDir, 'modules-index.template.yaml');
|
|
323
|
+
|
|
324
|
+
if (fs.existsSync(aiOverviewTemplate)) {
|
|
325
|
+
await fs.copy(aiOverviewTemplate, path.join(projectDir, 'ai-overview.md'));
|
|
326
|
+
console.log(chalk.yellow(' • 已生成 ai-overview.md(模板)'));
|
|
327
|
+
}
|
|
328
|
+
if (fs.existsSync(modulesIndexTemplate)) {
|
|
329
|
+
await fs.copy(modulesIndexTemplate, path.join(projectDir, 'modules-index.yaml'));
|
|
330
|
+
console.log(chalk.yellow(' • 已生成 modules-index.yaml(模板)'));
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
console.log(chalk.gray(' 💡 运行 "aodw-skill init-overview" 来自动填充项目信息'));
|
|
334
|
+
} else {
|
|
335
|
+
console.log(chalk.gray(' • 项目文件已存在,跳过初始化'));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
335
339
|
// 3. Install Adapters based on selected platforms
|
|
336
340
|
console.log(chalk.blue('正在安装适配器...'));
|
|
337
341
|
|
|
@@ -451,11 +455,7 @@ async function runInit() {
|
|
|
451
455
|
console.log(chalk.green('\n✅ AODW-Next 初始化成功!'));
|
|
452
456
|
console.log(chalk.white(`项目: ${projectName}`));
|
|
453
457
|
|
|
454
|
-
|
|
455
|
-
console.log(chalk.white(`模式: ${updatedConfig.mode === 'independent' ? '独立模式 (本地)' : '协作模式 (联网)'}`));
|
|
456
|
-
if (updatedConfig.mode === 'collaborative') {
|
|
457
|
-
console.log(chalk.white(`服务器: ${updatedConfig.server_url}`));
|
|
458
|
-
}
|
|
458
|
+
console.log(chalk.white('模式: 独立模式 (本地)'));
|
|
459
459
|
console.log(chalk.white(`平台: ${platforms.join(', ')}`));
|
|
460
460
|
}
|
|
461
461
|
|
|
@@ -642,68 +642,6 @@ async function generateToolsPrompt() {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
|
|
645
|
-
async function configureMode(pause = true, forceConnect = false) {
|
|
646
|
-
const { mode } = await inquirer.prompt([{
|
|
647
|
-
type: 'list',
|
|
648
|
-
name: 'mode',
|
|
649
|
-
message: '选择开发模式:',
|
|
650
|
-
choices: [
|
|
651
|
-
{ name: '独立模式 (本地生成 ID, 适合个人开发)', value: 'independent' },
|
|
652
|
-
{ name: '协作模式 (联网获取 ID, 适合团队开发)', value: 'collaborative' }
|
|
653
|
-
]
|
|
654
|
-
}]);
|
|
655
|
-
|
|
656
|
-
let serverUrl = '';
|
|
657
|
-
if (mode === 'collaborative') {
|
|
658
|
-
while (true) {
|
|
659
|
-
const answers = await inquirer.prompt([{
|
|
660
|
-
type: 'input',
|
|
661
|
-
name: 'serverUrl',
|
|
662
|
-
message: '请输入 AODW-Next ID 服务器地址:',
|
|
663
|
-
default: 'http://114.67.218.31:2005',
|
|
664
|
-
validate: (input) => {
|
|
665
|
-
if (!input || input.trim() === '') {
|
|
666
|
-
return '协作模式必须提供服务器地址';
|
|
667
|
-
}
|
|
668
|
-
return true;
|
|
669
|
-
}
|
|
670
|
-
}]);
|
|
671
|
-
serverUrl = answers.serverUrl.trim();
|
|
672
|
-
|
|
673
|
-
process.stdout.write(chalk.gray(`正在测试连接 ${serverUrl}... `));
|
|
674
|
-
const healthy = await checkServerHealth(serverUrl);
|
|
675
|
-
|
|
676
|
-
if (healthy) {
|
|
677
|
-
console.log(chalk.green('✅ 连接成功'));
|
|
678
|
-
break;
|
|
679
|
-
} else {
|
|
680
|
-
console.log(chalk.red('❌ 连接失败'));
|
|
681
|
-
const { action } = await inquirer.prompt([{
|
|
682
|
-
type: 'list',
|
|
683
|
-
name: 'action',
|
|
684
|
-
message: '无法连接到 ID 服务器,请选择:',
|
|
685
|
-
choices: [
|
|
686
|
-
{ name: '重试输入', value: 'retry' },
|
|
687
|
-
{ name: '强制保存 (离线使用)', value: 'force' },
|
|
688
|
-
{ name: '切换回独立模式', value: 'switch_independent' }
|
|
689
|
-
]
|
|
690
|
-
}]);
|
|
691
|
-
|
|
692
|
-
if (action === 'force') break;
|
|
693
|
-
if (action === 'switch_independent') {
|
|
694
|
-
await saveUserConfig({ mode: 'independent', server_url: '' });
|
|
695
|
-
console.log(chalk.green('✅ 全局配置已保存 (切换为独立模式)'));
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
// retry continues loop
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
await saveUserConfig({ mode, server_url: serverUrl });
|
|
704
|
-
console.log(chalk.green('✅ 全局配置已保存!'));
|
|
705
|
-
}
|
|
706
|
-
|
|
707
645
|
async function showMainMenu() {
|
|
708
646
|
while (true) {
|
|
709
647
|
console.clear();
|
|
@@ -711,9 +649,7 @@ async function showMainMenu() {
|
|
|
711
649
|
console.log(chalk.gray('版本: ' + packageJson.version));
|
|
712
650
|
|
|
713
651
|
// Show current config summary
|
|
714
|
-
|
|
715
|
-
const modeStr = config.mode === 'independent' ? '🏠 独立模式' : '🌐 协作模式';
|
|
716
|
-
console.log(chalk.gray(`当前配置: ${modeStr} ${config.mode === 'collaborative' ? `(${config.server_url})` : ''}`));
|
|
652
|
+
console.log(chalk.gray('当前配置: 🏠 独立模式 (本地生成 ID)'));
|
|
717
653
|
console.log('');
|
|
718
654
|
|
|
719
655
|
const { action } = await inquirer.prompt([{
|
|
@@ -724,15 +660,14 @@ async function showMainMenu() {
|
|
|
724
660
|
choices: [
|
|
725
661
|
new inquirer.Separator('--- 核心功能 ---'),
|
|
726
662
|
{ name: '1. 初始化 / 更新 AODW-Next (在本项目)', value: 'init' },
|
|
727
|
-
{ name: '2. 配置全局开发模式 (单机/联网)', value: 'config' },
|
|
728
663
|
|
|
729
664
|
new inquirer.Separator('--- 工具箱 ---'),
|
|
730
|
-
{ name: '
|
|
731
|
-
{ name: '
|
|
665
|
+
{ name: '2. 项目概览初始化 (Architecture) - 生成提示词', value: 'init-overview-prompt' },
|
|
666
|
+
{ name: '3. 工具初始化 (ESLint/Ruff/Stack) - 生成提示词', value: 'init-tools-prompt' },
|
|
732
667
|
|
|
733
668
|
new inquirer.Separator('--- 帮助与维护 ---'),
|
|
734
|
-
{ name: '
|
|
735
|
-
{ name: '
|
|
669
|
+
{ name: '4. 查看帮助 & 部署指南', value: 'help' },
|
|
670
|
+
{ name: '5. 卸载 AODW-Next', value: 'uninstall' },
|
|
736
671
|
new inquirer.Separator(),
|
|
737
672
|
{ name: '0. 退出 (Exit)', value: 'exit' }
|
|
738
673
|
]
|
|
@@ -749,10 +684,6 @@ async function showMainMenu() {
|
|
|
749
684
|
await runInit();
|
|
750
685
|
await returnToMenu();
|
|
751
686
|
break;
|
|
752
|
-
case 'config':
|
|
753
|
-
await configureMode();
|
|
754
|
-
await returnToMenu();
|
|
755
|
-
break;
|
|
756
687
|
case 'init-overview-prompt':
|
|
757
688
|
await generateOverviewPrompt();
|
|
758
689
|
await returnToMenu();
|
|
@@ -803,7 +734,6 @@ program
|
|
|
803
734
|
program
|
|
804
735
|
.command('new')
|
|
805
736
|
.description('Create a new Request Ticket (RT)')
|
|
806
|
-
.option('--server <url>', 'URL of the ID server')
|
|
807
737
|
.option('--project <name>', 'Project identifier')
|
|
808
738
|
.option('--title <string>', 'Title of the RT')
|
|
809
739
|
.action(createNewRT);
|
|
@@ -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() {
|