aodw-skill 0.7.13 → 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.
- 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/aodw-kernel-loader-template.md +19 -19
- 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/AODW_Adapters/antigravity/.agent/rules/aodw-next.md +2 -2
- package/AODW_Adapters/claude/CLAUDE.md +2 -2
- package/AODW_Adapters/cursor/.cursor/rules/aodw-next.mdc +2 -2
- package/AODW_Adapters/gemini/.agent/rules/aodw-next.md +2 -2
- package/AODW_Adapters/gemini/GEMINI.md +6 -5
- package/AODW_Adapters/general/AGENTS.md +2 -2
- package/README.md +62 -45
- package/bin/aodw.js +44 -16
- package/bin/commands/init-overview.js +3 -3
- package/bin/commands/init-tools.js +34 -51
- 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
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
|
|
136
|
-
const
|
|
137
|
-
|
|
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
|
|
145
|
-
const hasOnlyComments = /^version: 1\s*\n\s*#
|
|
146
|
-
|
|
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
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
415
|
-
// 直接使用 uv pip compile 和 sync
|
|
401
|
+
|
|
416
402
|
console.log(chalk.blue('📦 编译依赖(uv pip compile)...'));
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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
|
|
package/bin/utils/config.js
CHANGED
package/package.json
CHANGED
|
@@ -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 分支上修改了业务代码,必须立即回滚。
|