aodw-skill 0.7.19 → 0.7.23

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.
@@ -193,7 +193,7 @@ Recommended: A(理由:...)
193
193
 
194
194
  ### 自动检测的内容
195
195
  ```markdown
196
- <!-- AUTO-DETECTED: 以下内容由 aodw-skill init-overview 自动检测 -->
196
+ <!-- AUTO-DETECTED: 以下内容由 aodw-skill init 自动检测 -->
197
197
  - 前端:React 18.3.0
198
198
  - 后端:FastAPI 0.104.0
199
199
  <!-- END AUTO-DETECTED -->
@@ -249,18 +249,18 @@ Recommended: A(理由:...)
249
249
  2. **逐步完善**:不要一次性要求用户完善所有信息,可以分步骤进行
250
250
  3. **提供建议**:AI 应该基于代码分析提供建议,而不是只询问用户
251
251
  4. **格式规范**:确保生成的内容符合 `ai-overview.md` 的模板格式
252
- 5. **及时更新**:当项目结构发生变化时,提醒用户运行 `aodw-skill init-overview` 更新
252
+ 5. **及时更新**:当项目结构发生重大变化时,可以运行 `aodw-skill init` 重新检测(会保留用户手动添加的内容)
253
253
 
254
254
  ---
255
255
 
256
256
  ## 8. 与 CLI 命令的关系
257
257
 
258
- - **CLI 命令**(`aodw-skill init-overview`):负责自动检测和生成基础信息
258
+ - **CLI 命令**(`aodw-skill init`):负责自动检测和生成基础信息
259
259
  - **AI 规则**(本文件):负责引导用户完善复杂信息(架构描述、模块职责等)
260
260
 
261
261
  两者配合使用:
262
- 1. 用户运行 `aodw-skill init-overview` 生成基础信息
263
- 2. 用户运行"初始化项目概览"命令,AI 引导完善详细信息
262
+ 1. 用户运行 `aodw-skill init` 自动生成基础项目信息
263
+ 2. 用户通过 AI 对话进一步完善详细信息(架构描述、模块职责等)
264
264
 
265
265
 
266
266
 
@@ -32,8 +32,8 @@
32
32
 
33
33
  **如果文件不存在或不完整**:
34
34
  - AI 必须停止当前流程。
35
- - AI 必须提示用户:"**检测到项目概览尚未初始化。为了更准确地配置工具,请先执行项目概览初始化。**"
36
- - 建议运行命令:"初始化项目概览"(`aodw-skill init-overview`)。
35
+ - AI 必须提示用户:"**检测到项目概览尚未初始化。为了更准确地配置工具,请先运行 `aodw-skill init` 重新初始化项目。**"
36
+ - 说明:项目概览会在 `aodw-skill init` 时自动生成,无需额外命令。
37
37
 
38
38
  ### Step 2: 读取项目配置
39
39
 
@@ -3,9 +3,10 @@ name: aodw
3
3
  description: AODW (AI-Orchestrated Development Workflow) — 完整的 AI 协作开发工作流体系。当用户涉及以下任意场景时必须加载本 skill:新建 RT / 需求 / 功能 / 任务、立项、分支管理、worktree 创建与清理、Spec-Full / Spec-Lite 开发流程、代码提交与合并、RT 审查与完成、AODW 规范检查。关键触发词:RT、立项、新需求、开发任务、feature 分支、worktree、spec、intake、决策、实现、验收。本 skill 管理从立项到合并的完整开发生命周期。
4
4
  ---
5
5
 
6
- # AODW — AI 编排开发工作流 (v0.5.1)
6
+ # AODW — AI 编排开发工作流
7
7
 
8
8
  用 **RT(Request Ticket)** 追踪每个开发任务,通过文档驱动、分支隔离、Gate 检查点和确认门控执行。
9
+ 版本以 npm 包 `aodw-skill` 为准。
9
10
 
10
11
  ## 加载顺序(渐进式披露,优先读 summary)
11
12
 
package/README.md CHANGED
@@ -20,8 +20,9 @@ npx aodw-skill
20
20
 
21
21
  该命令会:
22
22
  1. 安装 AODW-Next 核心规范(`.aodw-next` 目录)
23
- 2. 根据您的选择安装对应的 AI 工具适配器(Cursor / Claude / Antigravity)
24
- 3. 初始化 `RT` 目录用于管理开发任务
23
+ 2. 自动检测项目信息(技术栈、架构、模块结构)
24
+ 3. 生成项目概览文档(`ai-overview.md` `modules-index.yaml`)
25
+ 4. 根据您的选择安装对应的 AI 工具适配器(Cursor / Claude / Antigravity)
25
26
 
26
27
  ## 使用方法
27
28
 
@@ -96,14 +97,6 @@ your-project/
96
97
 
97
98
  ## 更多命令
98
99
 
99
- ### 项目概览初始化
100
-
101
- ```bash
102
- npx aodw-skill init-overview
103
- ```
104
-
105
- 自动检测项目的技术栈、架构和模块结构,生成项目概览文档。
106
-
107
100
  ### 工具初始化
108
101
 
109
102
  ```bash
package/bin/aodw.js CHANGED
@@ -18,8 +18,14 @@ import {
18
18
  import { serve } from './commands/serve.js';
19
19
  import { createNewRT } from './commands/new.js';
20
20
  import { initTools } from './commands/init-tools.js';
21
- import { initOverview } from './commands/init-overview.js';
22
21
  import { saveProjectConfig, saveUserConfig, getProjectConfig, getUserConfig } from './utils/config.js';
22
+ import {
23
+ detectTechStack,
24
+ analyzeDirectoryStructure,
25
+ detectModules,
26
+ generateOverviewFile,
27
+ generateModulesIndex
28
+ } from './commands/init-overview.js';
23
29
 
24
30
  const require = createRequire(import.meta.url);
25
31
  const packageJson = require('../package.json');
@@ -293,35 +299,46 @@ async function runInit() {
293
299
  await fs.copy(SOURCE_CORE, targetCore);
294
300
  }
295
301
 
296
- // 2. Initialize project files from templates (first time only)
297
- if (!isUpdate) {
298
- console.log(chalk.blue('正在初始化项目文件...'));
299
- const projectDir = path.join(targetCore, '06-project');
300
- const templateDir = path.join(SOURCE_CORE, 'templates');
301
-
302
- // Check if project files need to be initialized
303
- const aiOverviewExists = fs.existsSync(path.join(projectDir, 'ai-overview.md'));
304
- const modulesIndexExists = fs.existsSync(path.join(projectDir, 'modules-index.yaml'));
305
-
306
- if (!aiOverviewExists && !modulesIndexExists) {
307
- // Copy templates from templates/ directory
308
- if (fs.existsSync(templateDir)) {
309
- const aiOverviewTemplate = path.join(templateDir, 'ai-overview.template.md');
310
- const modulesIndexTemplate = path.join(templateDir, 'modules-index.template.yaml');
311
-
312
- if (fs.existsSync(aiOverviewTemplate)) {
313
- await fs.copy(aiOverviewTemplate, path.join(projectDir, 'ai-overview.md'));
314
- console.log(chalk.yellow(' • 已生成 ai-overview.md(模板)'));
315
- }
316
- if (fs.existsSync(modulesIndexTemplate)) {
317
- await fs.copy(modulesIndexTemplate, path.join(projectDir, 'modules-index.yaml'));
318
- console.log(chalk.yellow(' • 已生成 modules-index.yaml(模板)'));
319
- }
320
- }
321
- console.log(chalk.gray(' 💡 运行 "aodw-skill init-overview" 来自动填充项目信息'));
322
- } else {
323
- console.log(chalk.gray(' 项目文件已存在,跳过初始化'));
302
+ // 2. Initialize project files from templates (for both init and update)
303
+ console.log(chalk.blue('正在初始化项目文件...'));
304
+ const projectDir = path.join(targetCore, '06-project');
305
+ const aiOverviewPath = path.join(projectDir, 'ai-overview.md');
306
+ const modulesIndexPath = path.join(projectDir, 'modules-index.yaml');
307
+
308
+ // Regenerate files when they are missing OR still template placeholders
309
+ const aiOverviewExists = fs.existsSync(aiOverviewPath);
310
+ const modulesIndexExists = fs.existsSync(modulesIndexPath);
311
+ const aiOverviewIsTemplate = aiOverviewExists ? await isTemplateFile(aiOverviewPath) : true;
312
+ const modulesIndexIsTemplate = modulesIndexExists ? await isTemplateFile(modulesIndexPath) : true;
313
+ const shouldGenerateProjectFiles =
314
+ !aiOverviewExists || !modulesIndexExists || aiOverviewIsTemplate || modulesIndexIsTemplate;
315
+
316
+ if (shouldGenerateProjectFiles) {
317
+ // Auto-detect project info and generate files
318
+ console.log(chalk.blue('正在检测项目信息...'));
319
+ const techStack = await detectTechStack();
320
+ const directoryStructure = await analyzeDirectoryStructure();
321
+ const modules = await detectModules();
322
+
323
+ console.log(chalk.green(' • 技术栈检测完成'));
324
+ const techStackSummary = [];
325
+ if (techStack.frontend.length > 0) techStackSummary.push(`前端: ${techStack.frontend.join(', ')}`);
326
+ if (techStack.backend.length > 0) techStackSummary.push(`后端: ${techStack.backend.join(', ')}`);
327
+ if (techStack.database.length > 0) techStackSummary.push(`数据库: ${techStack.database.join(', ')}`);
328
+ if (techStackSummary.length > 0) {
329
+ console.log(chalk.gray(` 检测到: ${techStackSummary.join(' | ')}`));
324
330
  }
331
+
332
+ console.log(chalk.green(' • 目录结构分析完成'));
333
+ console.log(chalk.green(' • 模块识别完成'));
334
+
335
+ // Generate files with detected info
336
+ await generateOverviewFile({ techStack, directoryStructure, modules }, null, modules);
337
+ await generateModulesIndex(modules);
338
+ console.log(chalk.yellow(' • 已生成 ai-overview.md(自动检测)'));
339
+ console.log(chalk.yellow(' • 已生成 modules-index.yaml(自动检测)'));
340
+ } else {
341
+ console.log(chalk.gray(' • 项目文件已存在且为用户内容,跳过初始化'));
325
342
  }
326
343
 
327
344
  // 3. Install Adapters based on selected platforms
@@ -673,22 +690,6 @@ program
673
690
  .description('Initialize development tools (ESLint, Prettier, Ruff, Black, etc.)')
674
691
  .action(initTools);
675
692
 
676
- program
677
- .command('init-overview')
678
- .alias('overview')
679
- .description('Initialize or update project overview (tech stack, architecture, modules)')
680
- .option('--update', 'Update mode: only update changed parts (default)', true)
681
- .option('--force', 'Force mode: full rescan and update', false)
682
- .option('--scan-only', 'Scan only: detect changes without updating files', false)
683
- .option('--no-interactive', 'Non-interactive mode: skip confirmations', false)
684
- .action((options) => {
685
- initOverview({
686
- update: options.update !== false,
687
- force: options.force || false,
688
- scanOnly: options.scanOnly || false,
689
- interactive: options.interactive !== false,
690
- });
691
- });
692
693
 
693
694
  // Main Entry Point
694
695
  if (!process.argv.slice(2).length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aodw-skill",
3
- "version": "0.7.19",
3
+ "version": "0.7.23",
4
4
  "description": "Next-channel CLI tool to scaffold AODW in your project",
5
5
  "main": "bin/aodw.js",
6
6
  "files": [