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.
Files changed (121) 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 +107 -45
  49. package/bin/aodw.js +54 -124
  50. package/bin/commands/init-overview.js +3 -3
  51. package/bin/commands/init-tools.js +34 -51
  52. package/bin/commands/new.js +4 -120
  53. package/bin/utils/config.js +1 -1
  54. package/package.json +1 -1
  55. package/.aodw-next/.aodw-next/01-core/ai-interaction-rules.md +0 -218
  56. package/.aodw-next/.aodw-next/01-core/ai-knowledge-rules.md +0 -302
  57. package/.aodw-next/.aodw-next/01-core/ai-project-overview-rules.md +0 -284
  58. package/.aodw-next/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
  59. package/.aodw-next/.aodw-next/01-core/aodw-constitution.md +0 -419
  60. package/.aodw-next/.aodw-next/01-core/csf-thinking-framework.md +0 -373
  61. package/.aodw-next/.aodw-next/01-core/git-discipline.md +0 -226
  62. package/.aodw-next/.aodw-next/01-core/module-doc-rules.md +0 -90
  63. package/.aodw-next/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
  64. package/.aodw-next/.aodw-next/02-workflow/rt-id-generation-rules.md +0 -267
  65. package/.aodw-next/.aodw-next/02-workflow/rt-manager-summary.md +0 -15
  66. package/.aodw-next/.aodw-next/02-workflow/rt-manager.md +0 -399
  67. package/.aodw-next/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
  68. package/.aodw-next/.aodw-next/02-workflow/spec-full-profile.md +0 -391
  69. package/.aodw-next/.aodw-next/02-workflow/spec-lite-profile.md +0 -313
  70. package/.aodw-next/.aodw-next/02-workflow/ui-workflow-rules.md +0 -334
  71. package/.aodw-next/.aodw-next/03-standards/ai-coding-rules-common.md +0 -89
  72. package/.aodw-next/.aodw-next/03-standards/ai-coding-rules.md +0 -370
  73. package/.aodw-next/.aodw-next/03-standards/stacks/java-springboot/ai-coding-rules-backend.md +0 -231
  74. package/.aodw-next/.aodw-next/03-standards/stacks/python-fastapi/ai-coding-rules-backend.md +0 -612
  75. package/.aodw-next/.aodw-next/03-standards/stacks/react-typescript/ai-coding-rules-frontend.md +0 -291
  76. package/.aodw-next/.aodw-next/03-standards/stacks/rust-axum/ai-coding-rules-backend.md +0 -134
  77. package/.aodw-next/.aodw-next/03-standards/stacks/vue2/ai-coding-rules-frontend.md +0 -220
  78. package/.aodw-next/.aodw-next/03-standards/ui-kit/ui-kit.md +0 -163
  79. package/.aodw-next/.aodw-next/04-auditors/aodw-development-auditor-rules.md +0 -470
  80. package/.aodw-next/.aodw-next/04-auditors/aodw-full-auditor-rules.md +0 -365
  81. package/.aodw-next/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +0 -408
  82. package/.aodw-next/.aodw-next/05-tooling/ai-tools-init-rules.md +0 -676
  83. package/.aodw-next/.aodw-next/06-project/ai-overview.md +0 -116
  84. package/.aodw-next/.aodw-next/06-project/modules-index.yaml +0 -11
  85. package/.aodw-next/.aodw-next/07-optimization/token-usage-analysis.md +0 -253
  86. package/.aodw-next/.aodw-next/README.md +0 -26
  87. package/.aodw-next/.aodw-next/RELEASE-CHECKLIST.md +0 -144
  88. package/.aodw-next/.aodw-next/config.yaml +0 -2
  89. package/.aodw-next/.aodw-next/manifest.yaml +0 -98
  90. package/.aodw-next/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
  91. package/.aodw-next/.aodw-next/templates/TEMPLATE-APPLICATION-GUIDE.md +0 -246
  92. package/.aodw-next/.aodw-next/templates/aodw-kernel-loader-template.md +0 -70
  93. package/.aodw-next/.aodw-next/templates/audit-report-template.md +0 -232
  94. package/.aodw-next/.aodw-next/templates/changelog-template.md +0 -16
  95. package/.aodw-next/.aodw-next/templates/checklists/coding-standards-template.md +0 -110
  96. package/.aodw-next/.aodw-next/templates/csf-review-template.md +0 -201
  97. package/.aodw-next/.aodw-next/templates/impact-template.md +0 -17
  98. package/.aodw-next/.aodw-next/templates/invariants-template.md +0 -12
  99. package/.aodw-next/.aodw-next/templates/module-readme-template.md +0 -39
  100. package/.aodw-next/.aodw-next/templates/plan-lite-template.md +0 -11
  101. package/.aodw-next/.aodw-next/templates/rt-decision-template.md +0 -13
  102. package/.aodw-next/.aodw-next/templates/rt-intake-template.md +0 -33
  103. package/.aodw-next/.aodw-next/templates/rt-meta-template.yaml +0 -43
  104. package/.aodw-next/.aodw-next/templates/spec-lite-template.md +0 -17
  105. package/.aodw-next/.aodw-next/templates/tests-template.md +0 -13
  106. package/.aodw-next/.aodw-next/templates/tools-config/README.md +0 -112
  107. package/.aodw-next/.aodw-next/templates/tools-config/backend/black.config.template.toml +0 -6
  108. package/.aodw-next/.aodw-next/templates/tools-config/backend/pre-commit.config.template.yaml +0 -16
  109. package/.aodw-next/.aodw-next/templates/tools-config/backend/ruff.config.template.toml +0 -23
  110. package/.aodw-next/.aodw-next/templates/tools-config/frontend/eslint.config.template.json +0 -113
  111. package/.aodw-next/.aodw-next/templates/tools-config/frontend/prettier.config.template.json +0 -10
  112. package/.aodw-next/.aodw-next/templates/tools-config/frontend/tsconfig.paths.template.json +0 -11
  113. package/.aodw-next/.aodw-next/workflow-guide.md +0 -51
  114. package/.aodw-next/01-core/aodw-constitution-summary.md +0 -20
  115. package/.aodw-next/02-workflow/aodw-development-stages.md +0 -235
  116. package/.aodw-next/02-workflow/spec-full-profile-summary.md +0 -13
  117. package/.aodw-next/06-project/ai-overview.md +0 -116
  118. package/.aodw-next/06-project/modules-index.yaml +0 -11
  119. package/.aodw-next/RELEASE-CHECKLIST.md +0 -144
  120. package/.aodw-next/templates/SOURCE-TO-DISTRIBUTION-GUIDE.md +0 -276
  121. package/.aodw-next/workflow-guide.md +0 -51
@@ -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
 
@@ -1,11 +1,8 @@
1
1
  import fs from 'fs-extra';
2
2
  import path from 'path';
3
- import http from 'http';
4
- import https from 'https';
5
- import { URL } from 'url';
6
3
  import inquirer from 'inquirer';
7
4
  import chalk from 'chalk';
8
- import { getProjectConfig, getUserConfig } from '../utils/config.js';
5
+ import { getProjectConfig } from '../utils/config.js';
9
6
 
10
7
  function getProjectName() {
11
8
  // 1. Try .aodw/project.yaml
@@ -25,35 +22,6 @@ function getProjectName() {
25
22
  return path.basename(process.cwd());
26
23
  }
27
24
 
28
- function fetchIdFromServer(serverUrl, project) {
29
- return new Promise((resolve, reject) => {
30
- const url = new URL('/api/next-id', serverUrl);
31
- url.searchParams.set('project', project);
32
-
33
- const client = url.protocol === 'https:' ? https : http;
34
-
35
- const req = client.get(url.toString(), (res) => {
36
- if (res.statusCode !== 200) {
37
- reject(new Error(`Server returned status ${res.statusCode}`));
38
- return;
39
- }
40
-
41
- let data = '';
42
- res.on('data', (chunk) => data += chunk);
43
- res.on('end', () => {
44
- try {
45
- const json = JSON.parse(data);
46
- resolve(json.id);
47
- } catch (e) {
48
- reject(e);
49
- }
50
- });
51
- });
52
-
53
- req.on('error', (e) => reject(e));
54
- });
55
- }
56
-
57
25
  function getLocalMaxSeq() {
58
26
  const rtDir = path.join(process.cwd(), 'RT');
59
27
  if (!fs.existsSync(rtDir)) return 0;
@@ -77,34 +45,7 @@ function getLocalNextId() {
77
45
  return `RT-${String(maxSeq + 1).padStart(3, '0')}`;
78
46
  }
79
47
 
80
- function syncIdToServer(serverUrl, project, seq) {
81
- return new Promise((resolve, reject) => {
82
- const url = new URL('/api/sync-id', serverUrl);
83
- url.searchParams.set('project', project);
84
- url.searchParams.set('seq', seq.toString());
85
-
86
- const client = url.protocol === 'https:' ? https : http;
87
-
88
- const req = client.request(url.toString(), { method: 'POST' }, (res) => {
89
- if (res.statusCode === 200) {
90
- resolve(true);
91
- } else {
92
- reject(new Error(`Server returned status ${res.statusCode}`));
93
- }
94
- });
95
-
96
- req.on('error', (e) => reject(e));
97
- req.end();
98
- });
99
- }
100
-
101
-
102
48
  export async function createNewRT(options) {
103
- const userConfig = getUserConfig();
104
-
105
- // Determine Server URL: Flag > Config > Env Var
106
- const serverUrl = options.server || userConfig.server_url || process.env.AODW_ID_SERVER;
107
-
108
49
  // Determine Project Name: Flag > Config/Package/Dir
109
50
  const project = options.project || getProjectName();
110
51
 
@@ -120,66 +61,9 @@ export async function createNewRT(options) {
120
61
  title = answers.title;
121
62
  }
122
63
 
123
- let id;
124
- // Check if user has configured collaborative mode
125
- const isCollaborativeMode = userConfig.mode === 'collaborative';
126
-
127
- if (isCollaborativeMode) {
128
- // In collaborative mode, server URL is required
129
- if (!serverUrl || serverUrl.trim() === '') {
130
- console.error(chalk.red('Error: Collaborative mode requires a server URL.'));
131
- console.error(chalk.yellow('Please configure the server URL by running: aodw config'));
132
- console.error(chalk.yellow('Or set the AODW_ID_SERVER environment variable.'));
133
- process.exit(1);
134
- }
135
-
136
- try {
137
- console.log(chalk.blue(`Fetching ID from server (${serverUrl})...`));
138
- const serverId = await fetchIdFromServer(serverUrl, project);
139
- const serverSeq = parseInt(serverId.replace('RT-', ''), 10);
140
-
141
- // Get local max ID and compare
142
- const localMaxSeq = getLocalMaxSeq();
143
-
144
- if (serverSeq <= localMaxSeq) {
145
- // Server ID is outdated, use local max + 1
146
- const finalSeq = localMaxSeq + 1;
147
- id = `RT-${String(finalSeq).padStart(3, '0')}`;
148
- console.log(chalk.yellow(`⚠ Server ID (${serverId}) ≤ local max (RT-${String(localMaxSeq).padStart(3, '0')})`));
149
- console.log(chalk.green(`Using local ID: ${id}`));
150
-
151
- // Sync to server
152
- try {
153
- await syncIdToServer(serverUrl, project, finalSeq);
154
- console.log(chalk.blue(`✔ Synced ID to server: ${id}`));
155
- } catch (syncErr) {
156
- console.warn(chalk.yellow(`⚠ Failed to sync ID to server: ${syncErr.message}`));
157
- console.warn(chalk.yellow(' The server may not support sync-id API, but RT creation will continue.'));
158
- }
159
- } else {
160
- id = serverId;
161
- console.log(chalk.green(`Obtained ID: ${id}`));
162
- }
163
- } catch (e) {
164
- console.error(chalk.red(`Failed to fetch ID from server: ${e.message}`));
165
- const { useLocal } = await inquirer.prompt([{
166
- type: 'confirm',
167
- name: 'useLocal',
168
- message: 'Do you want to fall back to local ID generation? (Warning: Risk of collision)',
169
- default: false
170
- }]);
171
- if (!useLocal) process.exit(1);
172
- id = getLocalNextId();
173
- }
174
- } else {
175
- // Independent mode: always use local generation, ignore server_url
176
- // This ensures that when user chooses independent mode, no network request is made
177
- id = getLocalNextId();
178
- console.log(chalk.yellow(`Using local ID generation: ${id}`));
179
- if (serverUrl) {
180
- console.log(chalk.gray(`Note: server_url is configured but ignored in independent mode`));
181
- }
182
- }
64
+ // 固定独立模式:始终本地生成 RT-ID
65
+ const id = getLocalNextId();
66
+ console.log(chalk.yellow(`Using local ID generation: ${id}`));
183
67
 
184
68
  // Create Directory
185
69
  const rtPath = path.join(process.cwd(), 'RT', id);
@@ -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.18",
4
4
  "description": "Next-channel CLI tool to scaffold AODW in your project",
5
5
  "main": "bin/aodw.js",
6
6
  "files": [
@@ -1,218 +0,0 @@
1
- 0. UI 任务判断(前置检查)
2
-
3
- 在执行任何任务之前,AI 必须首先进行 **任务类型判断**,识别是否为 UI 相关任务。
4
-
5
- ### 0.1 UI 相关任务判定条件
6
-
7
- 以下任意条件满足,即视为 **UI 相关任务**:
8
- - ✅ 涉及页面、界面、布局、组件、表单、Dashboard
9
- - ✅ 涉及用户操作流程、交互体验、可视化
10
- - ✅ 涉及前端 UI、样式、视觉呈现
11
- - ✅ 用户明确提到"界面 / UI / 好看 / 丑 / 设计"
12
- - ✅ 涉及 UI 改造、UI 新建、UI 优化
13
-
14
- ### 0.2 判断时机
15
-
16
- - **RT 创建阶段**:在 `intake.md` 生成时进行判断
17
- - **任务执行阶段**:在执行任何代码修改前进行判断
18
- - **需求变更阶段**:当用户提出新需求时重新判断
19
-
20
- ### 0.3 判断结果处理
21
-
22
- - **非 UI 相关任务**:按正常 AODW 流程执行
23
- - **UI 相关任务**:**必须进入 UI 专用流程**
24
-
25
- > **详细规则**:请参考 `.aodw/02-workflow/ui-workflow-rules.md`
26
-
27
- ---
28
-
29
- 1. 问题类型(两大类)
30
- AI 所提出的所有问题必须明确属于:
31
- 1. 决策型(Decision Question)
32
- • 必须提供选项
33
- • 必须明确推荐项
34
- • 必须给出推荐理由
35
- • 必须支持 "custom: …"(≤ 5 个词)
36
- 2. 信息型(Information Question)
37
- • 用于收集信息
38
- • 必须提供示例答案
39
- • 必须限制用户输入不超过 10 个词
40
- • 必须保证问题可被快速回答
41
-
42
-
43
-
44
- 2. 问题的格式规范
45
- 所有问题必须遵守格式(AI 必须严格采用):
46
- Q1. <问题内容>
47
-
48
- A. <选项1>
49
- B. <选项2>
50
- C. <选项3>
51
- D. <选项4>
52
-
53
- Recommended: B(理由:……)
54
-
55
- 请回复:A/B/C/D 或 custom:<你的答案>
56
-
57
- 信息型问题格式:
58
- Q2. <要确认的信息>
59
-
60
- 示例答案:
61
- - "订单服务"
62
- - "支付模块"
63
- - "只影响前端"
64
-
65
- 请给我一个 ≤10个词的回答。
66
-
67
- 3. 每轮最多提出的问题数量
68
- • 🚫 单轮禁止提出超过 5 个问题
69
- • 建议每轮 3 个 以内
70
- • 超过 3 个必须提示用户原因(例如:需求范围大,需要更多澄清)
71
-
72
-
73
-
74
- 4. AI 问题的节奏(Flow Control)
75
- AI 必须遵守:
76
- • 不得一次性问一大堆问题
77
- • 必须逐步推进(Ask → Wait → Respond → Continue)
78
- • 每轮问题结束后必须总结本轮收集到的信息
79
- • 不能在用户未回答的情况下继续提出下一组问题
80
-
81
-
82
-
83
- 5. 用户中断与暂停机制
84
- AI 必须支持以下命令:
85
- • "先暂停 AODW"
86
- • "等一下,不继续流程"
87
- • "跳过这一步"
88
-
89
- AI 必须立即:
90
- • 停止流程推进
91
- • 切换到「普通代码助手模式」
92
- • 并要求用户说"继续 AODW"才能回到流程
93
-
94
-
95
-
96
- 5.5. UI 流程主动触发机制
97
-
98
- 用户可以在任何时候主动触发 UI 相关流程,AI 必须识别并执行以下命令:
99
-
100
- ### 5.5.1 UI 流程触发命令识别
101
-
102
- AI 必须识别以下用户指令(支持多种表达方式):
103
-
104
- | 触发类型 | 触发词示例 | 执行动作 |
105
- |---------|-----------|---------|
106
- | **UI 设计** | "请 AODW 规范,帮我就当前这个 RT 任务的界面进行设计"<br>"按 AODW 规范设计界面"<br>"设计 UI"<br>"生成界面原型" | 执行 UI 设计流程(规则文件读取 → UI 结构与设计说明 → 静态 HTML 原型生成 → 用户确认) |
107
- | **UI 审计/审查** | "请 AODW 规范,帮我就当前这个 RT 任务的界面进行审计"<br>"审计界面"<br>"审查 UI"<br>"检查界面" | 执行 UI Critic 审查流程(切换到 UI Critic 角色,按 `.aodw/03-standards/ui-kit/ui-kit.md` 第 4 节标准审查) |
108
- | **UI 挑毛病** | "请 AODW 规范,帮我就当前这个 RT 任务的界面挑毛病"<br>"挑 UI 毛病"<br>"找界面问题"<br>"UI 有什么问题" | 执行 UI Critic 审查流程(严格审查,指出所有问题) |
109
-
110
- ### 5.5.2 触发条件检查
111
-
112
- 当用户触发 UI 流程时,AI 必须:
113
-
114
- 1. **检查当前 RT 上下文**
115
- - 确认是否存在当前 RT(检查 `RT/RT-XXX/` 目录)
116
- - 如果不存在,提示用户:"未找到当前 RT,请先创建或打开一个 RT"
117
- - 如果存在,读取 `intake.md` 或 `spec.md` / `spec-lite.md` 了解任务内容
118
-
119
- 2. **检查是否为 UI 相关任务**
120
- - 如果 `intake.md` 中标注了 `ui_related: true`,直接进入 UI 流程
121
- - 如果未标注,但任务涉及 UI(根据第 0 节判断),提示用户:"检测到当前 RT 可能涉及 UI,是否执行 UI 流程?"
122
- - 如果完全不涉及 UI,提示用户:"当前 RT 不涉及 UI,是否仍要执行 UI 审查?"
123
-
124
- 3. **执行对应的 UI 流程**
125
- - **UI 设计**:按照 `.aodw/02-workflow/ui-workflow-rules.md` 第 2 节执行
126
- - **UI 审计/审查/挑毛病**:按照 `.aodw/02-workflow/ui-workflow-rules.md` 第 3 节执行
127
-
128
- ### 5.5.3 执行响应模板
129
-
130
- 当用户触发 UI 流程时,AI 应回复:
131
-
132
- ```
133
- ✅ **UI 流程已触发**
134
- - 当前 RT:[RT-XXX]
135
- - 触发类型:[设计 / 审计 / 挑毛病]
136
- - 执行动作:[具体要执行的内容]
137
- - 参考规范:[.aodw/03-standards/ui-kit/ui-kit.md]
138
- ```
139
-
140
- ### 5.5.4 执行优先级
141
-
142
- - **用户主动触发** > **自动流程触发**
143
- - 如果用户主动触发 UI 流程,即使当前不在 UI 相关阶段,也应立即执行
144
- - 执行完成后,询问用户是否继续原流程
145
-
146
-
147
-
148
- 6. 错误恢复机制
149
- 如果用户回答不清晰或违背格式,AI 必须:
150
- • 或再次提出简化问题
151
- • 并提供新的建议选项
152
-
153
-
154
-
155
- 7. 透明度与确认机制
156
-
157
- AI 必须主动维护流程的透明度:
158
- - **复杂任务追踪**:当任务步骤超过 3 步时,必须创建 `task.md` 并实时更新。
159
- - **任务追踪检查**:
160
- - 在执行复杂任务时,AI 应在每个阶段结束后主动检查 task.md 是否需要更新
161
- - 如果发现 task.md 已过时,必须立即更新并告知用户
162
- - 在每次提交代码前,AI 必须检查 task.md 是否已更新到最新状态
163
- - **关键节点确认**:
164
- - Plan 完成后,必须暂停并请求批准。
165
- - 代码提交前,必须暂停并请求确认。
166
-
167
-
168
-
169
- 8. 门禁检查点与用户确认
170
-
171
- > **重要**:详细的门禁检查点定义见 `aodw-constitution.md` 第 4.5 节。
172
-
173
- ### 8.1 确认词汇表
174
-
175
- AI 必须识别以下用户确认指令:
176
-
177
- | 确认类型 | 触发词 | 范围 |
178
- | ------------ | -------------------------------- | -------------------------------- |
179
- | **单步确认** | "继续"、"下一步"、"好"、"ok" | 只批准当前 Gate,进入下一阶段 |
180
- | **批准执行** | "批准"、"执行"、"approved"、"go" | 批准 Plan,允许开始编码 |
181
- | **跳过确认** | "跳过"、"skip" | 跳过当前检查点(需二次确认风险) |
182
- | **暂停流程** | "暂停"、"pause"、"等等"、"停" | 暂停 AODW 流程,切换到普通模式 |
183
- | **启动审计** | "审计"、"audit" | 启动对应阶段的审计 |
184
-
185
- ### 8.2 确认边界
186
-
187
- **关键规则**:
188
- - ⚠️ 用户说"继续"只意味着"通过当前 Gate",**不是"执行到底"**
189
- - ⚠️ AI 必须在下一个 Gate 再次等待确认
190
- - ⚠️ 默认模式下,每个 Gate 只能通过一个确认
191
-
192
- ### 8.3 确认后响应模板
193
-
194
- 当用户确认后,AI 应回复:
195
-
196
- ```
197
- ✅ **确认收到**
198
- - 当前操作:[刚才批准的内容]
199
- - 正在执行:[即将做的事情]
200
- - 下一检查点:[下一个 Gate 的位置]
201
- ```
202
-
203
-
204
-
205
- 9. 分支验证前置
206
-
207
- AI 在执行任何代码修改操作(`write_to_file`、`replace_file_content`)前,必须:
208
-
209
- 1. 运行 `git branch --show-current`
210
- 2. 检查结果:
211
- - ✅ 如果显示 `feature/RT-XXX-xxx`:继续执行
212
- - ❌ 如果显示 `main` 或 `master`:**立即停止**
213
- 3. 如果在 main/master 分支:
214
- - 提示用户当前在主分支
215
- - 询问是否创建 feature 分支
216
- - 创建并切换到分支后才能继续
217
-
218
- **违规处理**:如果 AI 在 main/master 分支上修改了业务代码,必须立即回滚。