@zeyue0329/xiaoma-cli 1.0.37 → 1.0.38
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/.idea/workspace.xml +27 -26
- package/JAVA-BACKEND-COMMANDS-REFERENCE.md +62 -52
- package/JAVA-BACKEND-ITERATION-GUIDE.md +125 -18
- package/README.md +1 -1
- package/common/utils/bmad-doc-template.md +5 -5
- package/dist/agents/analyst.txt +35 -5
- package/dist/agents/architect.txt +217 -31
- package/dist/agents/automation-orchestrator.txt +4 -4
- package/dist/agents/dev.txt +3 -3
- package/dist/agents/full-requirement-orchestrator.txt +11 -11
- package/dist/agents/qa.txt +102 -102
- package/dist/agents/sm.txt +6 -6
- package/dist/agents/ux-expert.txt +6 -1
- package/dist/agents/workflow-executor.txt +879 -0
- package/dist/agents/xiaoma-master.txt +258 -37
- package/dist/teams/team-all.txt +1223 -445
- package/dist/teams/team-fullstack-with-database.txt +384 -446
- package/dist/teams/team-fullstack.txt +258 -37
- package/dist/teams/team-ide-minimal.txt +111 -111
- package/dist/teams/team-no-ui.txt +252 -36
- package/docs/architecture-sharding-modification.md +623 -0
- package/docs/automated-requirements-analysis-outputs.md +896 -0
- package/package.json +1 -1
- package/tools/builders/web-builder.js +292 -142
- package/tools/bump-all-versions.js +50 -32
- package/tools/cli.js +52 -47
- package/tools/flattener/aggregate.js +30 -12
- package/tools/flattener/binary.js +46 -43
- package/tools/flattener/discovery.js +23 -15
- package/tools/flattener/files.js +6 -6
- package/tools/flattener/ignoreRules.js +122 -121
- package/tools/flattener/main.js +249 -144
- package/tools/flattener/projectRoot.js +74 -69
- package/tools/flattener/prompts.js +12 -10
- package/tools/flattener/stats.helpers.js +90 -61
- package/tools/flattener/stats.js +1 -1
- package/tools/flattener/test-matrix.js +225 -170
- package/tools/flattener/xml.js +31 -23
- package/tools/installer/bin/xiaoma.js +199 -153
- package/tools/installer/lib/config-loader.js +76 -47
- package/tools/installer/lib/file-manager.js +101 -44
- package/tools/installer/lib/ide-base-setup.js +49 -39
- package/tools/installer/lib/ide-setup.js +694 -380
- package/tools/installer/lib/installer.js +802 -469
- package/tools/installer/lib/memory-profiler.js +22 -12
- package/tools/installer/lib/module-manager.js +16 -14
- package/tools/installer/lib/resource-locator.js +61 -35
- package/tools/lib/dependency-resolver.js +34 -23
- package/tools/lib/yaml-utils.js +7 -2
- package/tools/preview-release-notes.js +33 -25
- package/tools/shared/bannerArt.js +3 -3
- package/tools/sync-installer-version.js +16 -7
- package/tools/upgraders/v3-to-v4-upgrader.js +244 -163
- package/tools/version-bump.js +24 -18
- package/tools/xiaoma-npx-wrapper.js +15 -10
- package/tools/yaml-format.js +60 -36
- package/xiaoma-core/agent-teams/team-fullstack-with-database.yaml +0 -1
- package/xiaoma-core/agents/automated-fix-validator.yaml +2 -1
- package/xiaoma-core/agents/automated-quality-validator.yaml +10 -5
- package/xiaoma-core/agents/automation-orchestrator.md +4 -4
- package/xiaoma-core/agents/dev.md +4 -4
- package/xiaoma-core/agents/enhanced-workflow-orchestrator.yaml +2 -1
- package/xiaoma-core/agents/full-requirement-orchestrator.md +11 -11
- package/xiaoma-core/agents/global-requirements-auditor.yaml +11 -3
- package/xiaoma-core/agents/intelligent-template-adapter.yaml +19 -5
- package/xiaoma-core/agents/master-execution-engine.yaml +19 -5
- package/xiaoma-core/agents/workflow-executor.md +8 -4
- package/xiaoma-core/agents/xiaoma-master.md +1 -1
- package/xiaoma-core/data/test-levels-framework.md +12 -12
- package/xiaoma-core/tasks/analyze-existing-database.md +1 -1
- package/xiaoma-core/tasks/apply-qa-fixes.md +3 -3
- package/xiaoma-core/tasks/batch-story-generation.md +22 -22
- package/xiaoma-core/tasks/create-enhanced-story-with-database.md +6 -6
- package/xiaoma-core/tasks/nfr-assess.md +6 -6
- package/xiaoma-core/tasks/project-integration-testing.md +42 -42
- package/xiaoma-core/tasks/qa-gate.md +23 -23
- package/xiaoma-core/tasks/review-story.md +18 -18
- package/xiaoma-core/tasks/risk-profile.md +25 -25
- package/xiaoma-core/tasks/serial-development-orchestration.md +51 -51
- package/xiaoma-core/tasks/test-design.md +9 -9
- package/xiaoma-core/tasks/trace-requirements.md +21 -21
- package/xiaoma-core/templates/competitor-analysis-tmpl.yaml +35 -5
- package/xiaoma-core/templates/front-end-architecture-tmpl.yaml +77 -11
- package/xiaoma-core/templates/front-end-spec-tmpl.yaml +6 -1
- package/xiaoma-core/templates/fullstack-architecture-tmpl.yaml +140 -20
- package/xiaoma-core/templates/global-qa-monitoring-tmpl.yaml +2 -1
- package/xiaoma-core/templates/requirements-coverage-audit.yaml +2 -1
- package/xiaoma-core/workflows/automated-requirements-analysis.yaml +4 -4
- package/dist/agents/database-architect.txt +0 -322
package/tools/version-bump.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const { execSync } = require(
|
|
3
|
-
const path = require(
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
const { execSync } = require("node:child_process");
|
|
3
|
+
const path = require("node:path");
|
|
4
4
|
|
|
5
5
|
// Dynamic import for ES module
|
|
6
6
|
let chalk;
|
|
@@ -8,7 +8,7 @@ let chalk;
|
|
|
8
8
|
// Initialize ES modules
|
|
9
9
|
async function initializeModules() {
|
|
10
10
|
if (!chalk) {
|
|
11
|
-
chalk = (await import(
|
|
11
|
+
chalk = (await import("chalk")).default;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -18,33 +18,35 @@ async function initializeModules() {
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function getCurrentVersion() {
|
|
21
|
-
const packageJson = JSON.parse(fs.readFileSync(
|
|
21
|
+
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
22
22
|
return packageJson.version;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async function bumpVersion(type =
|
|
25
|
+
async function bumpVersion(type = "patch") {
|
|
26
26
|
await initializeModules();
|
|
27
27
|
|
|
28
|
-
const validTypes = [
|
|
28
|
+
const validTypes = ["patch", "minor", "major"];
|
|
29
29
|
if (!validTypes.includes(type)) {
|
|
30
|
-
console.error(
|
|
30
|
+
console.error(
|
|
31
|
+
chalk.red(`Invalid version type: ${type}. Use: ${validTypes.join(", ")}`),
|
|
32
|
+
);
|
|
31
33
|
process.exit(1);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
const currentVersion = getCurrentVersion();
|
|
35
|
-
const versionParts = currentVersion.split(
|
|
37
|
+
const versionParts = currentVersion.split(".").map(Number);
|
|
36
38
|
let newVersion;
|
|
37
39
|
|
|
38
40
|
switch (type) {
|
|
39
|
-
case
|
|
41
|
+
case "major": {
|
|
40
42
|
newVersion = `${versionParts[0] + 1}.0.0`;
|
|
41
43
|
break;
|
|
42
44
|
}
|
|
43
|
-
case
|
|
45
|
+
case "minor": {
|
|
44
46
|
newVersion = `${versionParts[0]}.${versionParts[1] + 1}.0`;
|
|
45
47
|
break;
|
|
46
48
|
}
|
|
47
|
-
case
|
|
49
|
+
case "patch": {
|
|
48
50
|
newVersion = `${versionParts[0]}.${versionParts[1]}.${versionParts[2] + 1}`;
|
|
49
51
|
break;
|
|
50
52
|
}
|
|
@@ -53,9 +55,9 @@ async function bumpVersion(type = 'patch') {
|
|
|
53
55
|
console.log(chalk.blue(`Bumping version: ${currentVersion} → ${newVersion}`));
|
|
54
56
|
|
|
55
57
|
// Update package.json
|
|
56
|
-
const packageJson = JSON.parse(fs.readFileSync(
|
|
58
|
+
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
57
59
|
packageJson.version = newVersion;
|
|
58
|
-
fs.writeFileSync(
|
|
60
|
+
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
|
|
59
61
|
|
|
60
62
|
console.log(chalk.green(`✓ Updated package.json to ${newVersion}`));
|
|
61
63
|
|
|
@@ -65,16 +67,20 @@ async function bumpVersion(type = 'patch') {
|
|
|
65
67
|
async function main() {
|
|
66
68
|
await initializeModules();
|
|
67
69
|
|
|
68
|
-
const type = process.argv[2] ||
|
|
70
|
+
const type = process.argv[2] || "patch";
|
|
69
71
|
const currentVersion = getCurrentVersion();
|
|
70
72
|
|
|
71
73
|
console.log(chalk.blue(`Current version: ${currentVersion}`));
|
|
72
74
|
|
|
73
75
|
// Check if working directory is clean
|
|
74
76
|
try {
|
|
75
|
-
execSync(
|
|
77
|
+
execSync("git diff-index --quiet HEAD --");
|
|
76
78
|
} catch {
|
|
77
|
-
console.error(
|
|
79
|
+
console.error(
|
|
80
|
+
chalk.red(
|
|
81
|
+
"❌ Working directory is not clean. Commit your changes first.",
|
|
82
|
+
),
|
|
83
|
+
);
|
|
78
84
|
process.exit(1);
|
|
79
85
|
}
|
|
80
86
|
|
|
@@ -86,7 +92,7 @@ async function main() {
|
|
|
86
92
|
|
|
87
93
|
if (require.main === module) {
|
|
88
94
|
main().catch((error) => {
|
|
89
|
-
console.error(
|
|
95
|
+
console.error("Error:", error);
|
|
90
96
|
process.exit(1);
|
|
91
97
|
});
|
|
92
98
|
}
|
|
@@ -5,29 +5,34 @@
|
|
|
5
5
|
* This file ensures proper execution when run via npx from GitHub
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const { execSync } = require(
|
|
9
|
-
const path = require(
|
|
10
|
-
const fs = require(
|
|
8
|
+
const { execSync } = require("node:child_process");
|
|
9
|
+
const path = require("node:path");
|
|
10
|
+
const fs = require("node:fs");
|
|
11
11
|
|
|
12
12
|
// Check if we're running in an npx temporary directory
|
|
13
|
-
const isNpxExecution = __dirname.includes(
|
|
13
|
+
const isNpxExecution = __dirname.includes("_npx") || __dirname.includes(".npm");
|
|
14
14
|
|
|
15
15
|
// If running via npx, we need to handle things differently
|
|
16
16
|
if (isNpxExecution) {
|
|
17
17
|
const arguments_ = process.argv.slice(2);
|
|
18
18
|
|
|
19
19
|
// Use the installer for all commands
|
|
20
|
-
const xiaomaScriptPath = path.join(
|
|
20
|
+
const xiaomaScriptPath = path.join(
|
|
21
|
+
__dirname,
|
|
22
|
+
"installer",
|
|
23
|
+
"bin",
|
|
24
|
+
"xiaoma.js",
|
|
25
|
+
);
|
|
21
26
|
|
|
22
27
|
if (!fs.existsSync(xiaomaScriptPath)) {
|
|
23
|
-
console.error(
|
|
24
|
-
console.error(
|
|
28
|
+
console.error("Error: Could not find xiaoma.js at", xiaomaScriptPath);
|
|
29
|
+
console.error("Current directory:", __dirname);
|
|
25
30
|
process.exit(1);
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
try {
|
|
29
|
-
execSync(`node "${xiaomaScriptPath}" ${arguments_.join(
|
|
30
|
-
stdio:
|
|
34
|
+
execSync(`node "${xiaomaScriptPath}" ${arguments_.join(" ")}`, {
|
|
35
|
+
stdio: "inherit",
|
|
31
36
|
cwd: path.dirname(__dirname),
|
|
32
37
|
});
|
|
33
38
|
} catch (error) {
|
|
@@ -35,5 +40,5 @@ if (isNpxExecution) {
|
|
|
35
40
|
}
|
|
36
41
|
} else {
|
|
37
42
|
// Local execution - use installer for all commands
|
|
38
|
-
require(
|
|
43
|
+
require("./installer/bin/xiaoma.js");
|
|
39
44
|
}
|
package/tools/yaml-format.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const path = require(
|
|
3
|
-
const yaml = require(
|
|
4
|
-
const { execSync } = require(
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
const yaml = require("js-yaml");
|
|
4
|
+
const { execSync } = require("node:child_process");
|
|
5
5
|
|
|
6
6
|
// Dynamic import for ES module
|
|
7
7
|
let chalk;
|
|
@@ -9,7 +9,7 @@ let chalk;
|
|
|
9
9
|
// Initialize ES modules
|
|
10
10
|
async function initializeModules() {
|
|
11
11
|
if (!chalk) {
|
|
12
|
-
chalk = (await import(
|
|
12
|
+
chalk = (await import("chalk")).default;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -24,12 +24,12 @@ async function formatYamlContent(content, filename) {
|
|
|
24
24
|
// First try to fix common YAML issues
|
|
25
25
|
let fixedContent = content
|
|
26
26
|
// Fix "commands :" -> "commands:"
|
|
27
|
-
.replaceAll(/^(\s*)(\w+)\s+:/gm,
|
|
27
|
+
.replaceAll(/^(\s*)(\w+)\s+:/gm, "$1$2:")
|
|
28
28
|
// Fix inconsistent list indentation
|
|
29
|
-
.replaceAll(/^(\s*)-\s{3,}/gm,
|
|
29
|
+
.replaceAll(/^(\s*)-\s{3,}/gm, "$1- ");
|
|
30
30
|
|
|
31
31
|
// Skip auto-fixing for .roomodes files - they have special nested structure
|
|
32
|
-
if (!filename.includes(
|
|
32
|
+
if (!filename.includes(".roomodes")) {
|
|
33
33
|
fixedContent = fixedContent
|
|
34
34
|
// Fix unquoted list items that contain special characters or multiple parts
|
|
35
35
|
.replaceAll(/^(\s*)-\s+(.*)$/gm, (match, indent, content) => {
|
|
@@ -40,15 +40,15 @@ async function formatYamlContent(content, filename) {
|
|
|
40
40
|
// If the content contains special YAML characters or looks complex, quote it
|
|
41
41
|
// BUT skip if it looks like a proper YAML key-value pair (like "key: value")
|
|
42
42
|
if (
|
|
43
|
-
(content.includes(
|
|
44
|
-
content.includes(
|
|
45
|
-
content.includes(
|
|
46
|
-
content.includes(
|
|
43
|
+
(content.includes(":") ||
|
|
44
|
+
content.includes("-") ||
|
|
45
|
+
content.includes("{") ||
|
|
46
|
+
content.includes("}")) &&
|
|
47
47
|
!/^\w+:\s/.test(content)
|
|
48
48
|
) {
|
|
49
49
|
// Remove any existing quotes first, escape internal quotes, then add proper quotes
|
|
50
50
|
const cleanContent = content
|
|
51
|
-
.replaceAll(/^["']|["']$/g,
|
|
51
|
+
.replaceAll(/^["']|["']$/g, "")
|
|
52
52
|
.replaceAll('"', String.raw`\"`);
|
|
53
53
|
return `${indent}- "${cleanContent}"`;
|
|
54
54
|
}
|
|
@@ -71,24 +71,34 @@ async function formatYamlContent(content, filename) {
|
|
|
71
71
|
});
|
|
72
72
|
return formatted;
|
|
73
73
|
} catch (error) {
|
|
74
|
-
console.error(
|
|
75
|
-
|
|
74
|
+
console.error(
|
|
75
|
+
chalk.red(`❌ YAML syntax error in ${filename}:`),
|
|
76
|
+
error.message,
|
|
77
|
+
);
|
|
78
|
+
console.error(
|
|
79
|
+
chalk.yellow(`💡 Try manually fixing the YAML structure first`),
|
|
80
|
+
);
|
|
76
81
|
return null;
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
async function processMarkdownFile(filePath) {
|
|
81
86
|
await initializeModules();
|
|
82
|
-
const content = fs.readFileSync(filePath,
|
|
87
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
83
88
|
let modified = false;
|
|
84
89
|
let newContent = content;
|
|
85
90
|
|
|
86
91
|
// Fix untyped code blocks by adding 'text' type
|
|
87
92
|
// Match ``` at start of line followed by newline, but only if it's an opening fence
|
|
88
|
-
newContent = newContent.replaceAll(
|
|
93
|
+
newContent = newContent.replaceAll(
|
|
94
|
+
/^```\n([\s\S]*?)\n```$/gm,
|
|
95
|
+
"```text\n$1\n```",
|
|
96
|
+
);
|
|
89
97
|
if (newContent !== content) {
|
|
90
98
|
modified = true;
|
|
91
|
-
console.log(
|
|
99
|
+
console.log(
|
|
100
|
+
chalk.blue(`🔧 Added 'text' type to untyped code blocks in ${filePath}`),
|
|
101
|
+
);
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
// Find YAML code blocks
|
|
@@ -101,7 +111,7 @@ async function processMarkdownFile(filePath) {
|
|
|
101
111
|
const formatted = await formatYamlContent(yamlContent, filePath);
|
|
102
112
|
if (formatted !== null) {
|
|
103
113
|
// Remove trailing newline that js-yaml adds
|
|
104
|
-
const trimmedFormatted = formatted.replace(/\n$/,
|
|
114
|
+
const trimmedFormatted = formatted.replace(/\n$/, "");
|
|
105
115
|
|
|
106
116
|
if (trimmedFormatted !== yamlContent) {
|
|
107
117
|
modified = true;
|
|
@@ -119,7 +129,8 @@ async function processMarkdownFile(filePath) {
|
|
|
119
129
|
// Apply replacements in reverse order to maintain indices
|
|
120
130
|
for (let index = replacements.length - 1; index >= 0; index--) {
|
|
121
131
|
const { start, end, replacement } = replacements[index];
|
|
122
|
-
newContent =
|
|
132
|
+
newContent =
|
|
133
|
+
newContent.slice(0, start) + replacement + newContent.slice(end);
|
|
123
134
|
}
|
|
124
135
|
|
|
125
136
|
if (modified) {
|
|
@@ -131,7 +142,7 @@ async function processMarkdownFile(filePath) {
|
|
|
131
142
|
|
|
132
143
|
async function processYamlFile(filePath) {
|
|
133
144
|
await initializeModules();
|
|
134
|
-
const content = fs.readFileSync(filePath,
|
|
145
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
135
146
|
const formatted = await formatYamlContent(content, filePath);
|
|
136
147
|
|
|
137
148
|
if (formatted === null) {
|
|
@@ -149,7 +160,7 @@ async function lintYamlFile(filePath) {
|
|
|
149
160
|
await initializeModules();
|
|
150
161
|
try {
|
|
151
162
|
// Use yaml-lint for additional validation
|
|
152
|
-
execSync(`npx yaml-lint "${filePath}"`, { stdio:
|
|
163
|
+
execSync(`npx yaml-lint "${filePath}"`, { stdio: "pipe" });
|
|
153
164
|
return true;
|
|
154
165
|
} catch (error) {
|
|
155
166
|
console.error(chalk.red(`❌ YAML lint error in ${filePath}:`));
|
|
@@ -161,10 +172,10 @@ async function lintYamlFile(filePath) {
|
|
|
161
172
|
async function main() {
|
|
162
173
|
await initializeModules();
|
|
163
174
|
const arguments_ = process.argv.slice(2);
|
|
164
|
-
const glob = require(
|
|
175
|
+
const glob = require("glob");
|
|
165
176
|
|
|
166
177
|
if (arguments_.length === 0) {
|
|
167
|
-
console.error(
|
|
178
|
+
console.error("Usage: node yaml-format.js <file1> [file2] ...");
|
|
168
179
|
process.exit(1);
|
|
169
180
|
}
|
|
170
181
|
|
|
@@ -175,7 +186,7 @@ async function main() {
|
|
|
175
186
|
// Expand glob patterns and collect all files
|
|
176
187
|
const allFiles = [];
|
|
177
188
|
for (const argument of arguments_) {
|
|
178
|
-
if (argument.includes(
|
|
189
|
+
if (argument.includes("*")) {
|
|
179
190
|
// It's a glob pattern
|
|
180
191
|
const matches = glob.sync(argument);
|
|
181
192
|
allFiles.push(...matches);
|
|
@@ -188,7 +199,11 @@ async function main() {
|
|
|
188
199
|
for (const filePath of allFiles) {
|
|
189
200
|
if (!fs.existsSync(filePath)) {
|
|
190
201
|
// Skip silently for glob patterns that don't match anything
|
|
191
|
-
if (
|
|
202
|
+
if (
|
|
203
|
+
!arguments_.some(
|
|
204
|
+
(argument) => argument.includes("*") && filePath === argument,
|
|
205
|
+
)
|
|
206
|
+
) {
|
|
192
207
|
console.error(chalk.red(`❌ File not found: ${filePath}`));
|
|
193
208
|
hasErrors = true;
|
|
194
209
|
}
|
|
@@ -200,14 +215,14 @@ async function main() {
|
|
|
200
215
|
|
|
201
216
|
try {
|
|
202
217
|
let changed = false;
|
|
203
|
-
if (extension ===
|
|
218
|
+
if (extension === ".md") {
|
|
204
219
|
changed = await processMarkdownFile(filePath);
|
|
205
220
|
} else if (
|
|
206
|
-
extension ===
|
|
207
|
-
extension ===
|
|
208
|
-
basename.includes(
|
|
209
|
-
basename.includes(
|
|
210
|
-
basename.includes(
|
|
221
|
+
extension === ".yaml" ||
|
|
222
|
+
extension === ".yml" ||
|
|
223
|
+
basename.includes("roomodes") ||
|
|
224
|
+
basename.includes(".yaml") ||
|
|
225
|
+
basename.includes(".yml")
|
|
211
226
|
) {
|
|
212
227
|
// Handle YAML files and special cases like .roomodes
|
|
213
228
|
changed = await processYamlFile(filePath);
|
|
@@ -225,27 +240,36 @@ async function main() {
|
|
|
225
240
|
filesProcessed.push(filePath);
|
|
226
241
|
}
|
|
227
242
|
} catch (error) {
|
|
228
|
-
console.error(
|
|
243
|
+
console.error(
|
|
244
|
+
chalk.red(`❌ Error processing ${filePath}:`),
|
|
245
|
+
error.message,
|
|
246
|
+
);
|
|
229
247
|
hasErrors = true;
|
|
230
248
|
}
|
|
231
249
|
}
|
|
232
250
|
|
|
233
251
|
if (hasChanges) {
|
|
234
252
|
console.log(
|
|
235
|
-
chalk.green(
|
|
253
|
+
chalk.green(
|
|
254
|
+
`\n✨ YAML formatting completed! Modified ${filesProcessed.length} files:`,
|
|
255
|
+
),
|
|
236
256
|
);
|
|
237
257
|
for (const file of filesProcessed) console.log(chalk.blue(` 📝 ${file}`));
|
|
238
258
|
}
|
|
239
259
|
|
|
240
260
|
if (hasErrors) {
|
|
241
|
-
console.error(
|
|
261
|
+
console.error(
|
|
262
|
+
chalk.red(
|
|
263
|
+
"\n💥 Some files had errors. Please fix them before committing.",
|
|
264
|
+
),
|
|
265
|
+
);
|
|
242
266
|
process.exit(1);
|
|
243
267
|
}
|
|
244
268
|
}
|
|
245
269
|
|
|
246
270
|
if (require.main === module) {
|
|
247
271
|
main().catch((error) => {
|
|
248
|
-
console.error(
|
|
272
|
+
console.error("Error:", error);
|
|
249
273
|
process.exit(1);
|
|
250
274
|
});
|
|
251
275
|
}
|
|
@@ -263,7 +263,8 @@ regression_test_management:
|
|
|
263
263
|
test_optimization:
|
|
264
264
|
techniques:
|
|
265
265
|
- technique: "test_prioritization"
|
|
266
|
-
criteria:
|
|
266
|
+
criteria:
|
|
267
|
+
["failure_probability", "execution_time", "coverage_contribution"]
|
|
267
268
|
|
|
268
269
|
- technique: "parallel_execution"
|
|
269
270
|
strategy: "resource_aware_scheduling"
|
|
@@ -113,7 +113,8 @@ layer_2_content_completeness_validation:
|
|
|
113
113
|
required_columns: ["实体名称", "表名", "主要用途", "关键字段"]
|
|
114
114
|
minimum_entities: 1
|
|
115
115
|
- data_operations_completeness:
|
|
116
|
-
required_operations:
|
|
116
|
+
required_operations:
|
|
117
|
+
["查询操作", "插入操作", "更新操作", "删除操作"]
|
|
117
118
|
operation_descriptions: "DETAILED_AND_SPECIFIC"
|
|
118
119
|
- business_rules_presence:
|
|
119
120
|
minimum_rules: 3
|
|
@@ -125,7 +126,8 @@ layer_2_content_completeness_validation:
|
|
|
125
126
|
description: "API规范完整性验证"
|
|
126
127
|
checks:
|
|
127
128
|
- api_endpoints_table_completeness:
|
|
128
|
-
required_columns:
|
|
129
|
+
required_columns:
|
|
130
|
+
["序号", "接口名称", "HTTP方法", "路径", "说明", "状态"]
|
|
129
131
|
minimum_endpoints: 1
|
|
130
132
|
- api_detailed_design_completeness:
|
|
131
133
|
required_elements:
|
|
@@ -160,7 +162,8 @@ layer_2_content_completeness_validation:
|
|
|
160
162
|
integration_context: "COMPREHENSIVE"
|
|
161
163
|
testing_context: "COMPREHENSIVE"
|
|
162
164
|
- qa_results_completeness:
|
|
163
|
-
test_categories_coverage:
|
|
165
|
+
test_categories_coverage:
|
|
166
|
+
["数据库操作正确性", "API接口功能性", "性能测试结果"]
|
|
164
167
|
results_specificity: "QUANTITATIVE_WITH_METRICS"
|
|
165
168
|
scoring_method: "IMPLEMENTATION_READINESS_SCORE"
|
|
166
169
|
pass_criteria: "IMPLEMENTATION_SCORE_85_PLUS"
|
|
@@ -476,12 +479,14 @@ layer_7_final_integration_validation:
|
|
|
476
479
|
# ========== 质量纠错和改进系统 ==========
|
|
477
480
|
quality_correction_and_improvement_system:
|
|
478
481
|
immediate_correction_triggers:
|
|
479
|
-
- critical_failures:
|
|
482
|
+
- critical_failures:
|
|
483
|
+
["syntax_errors", "missing_required_sections", "format_violations"]
|
|
480
484
|
correction_action: "IMMEDIATE_AUTO_CORRECTION"
|
|
481
485
|
retry_attempts: 3
|
|
482
486
|
escalation: "MANUAL_INTERVENTION_IF_AUTO_CORRECTION_FAILS"
|
|
483
487
|
|
|
484
|
-
- quality_deficiencies:
|
|
488
|
+
- quality_deficiencies:
|
|
489
|
+
["content_gaps", "clarity_issues", "consistency_problems"]
|
|
485
490
|
correction_action: "ITERATIVE_IMPROVEMENT"
|
|
486
491
|
improvement_rounds: 2
|
|
487
492
|
success_criteria: "QUALITY_THRESHOLD_ACHIEVED"
|
|
@@ -259,22 +259,22 @@ error_handling:
|
|
|
259
259
|
```yaml
|
|
260
260
|
agent_integration:
|
|
261
261
|
sm:
|
|
262
|
-
commands: [
|
|
262
|
+
commands: ["*draft-enhanced"]
|
|
263
263
|
input: epic_shards, database_design
|
|
264
264
|
output: story.md
|
|
265
265
|
|
|
266
266
|
po:
|
|
267
|
-
commands: [
|
|
267
|
+
commands: ["*validate-story-draft"]
|
|
268
268
|
input: story.md
|
|
269
269
|
output: validation_result, approved_story
|
|
270
270
|
|
|
271
271
|
dev:
|
|
272
|
-
commands: [
|
|
272
|
+
commands: ["*develop-story", "*run-tests"]
|
|
273
273
|
input: story.md, generated_code
|
|
274
274
|
output: implementation_files, test_results
|
|
275
275
|
|
|
276
276
|
qa:
|
|
277
|
-
commands: [
|
|
277
|
+
commands: ["*review"]
|
|
278
278
|
input: story.md, implementation_files
|
|
279
279
|
output: qa_report, approval_status
|
|
280
280
|
```
|
|
@@ -36,7 +36,7 @@ agent:
|
|
|
36
36
|
id: dev
|
|
37
37
|
title: 全栈工程师
|
|
38
38
|
icon: 💻
|
|
39
|
-
whenToUse:
|
|
39
|
+
whenToUse: "用于代码实现、调试、重构和开发最佳实践"
|
|
40
40
|
customization:
|
|
41
41
|
|
|
42
42
|
persona:
|
|
@@ -56,13 +56,13 @@ core_principles:
|
|
|
56
56
|
commands:
|
|
57
57
|
- help: 显示以下命令的编号列表以供选择
|
|
58
58
|
- develop-story:
|
|
59
|
-
- order-of-execution:
|
|
59
|
+
- order-of-execution: "读取(第一个或下一个)任务→实现任务及其子任务→编写测试→执行验证→只有在全部通过时,才用 [x] 更新任务复选框→更新故事文件的 File List 部分以确保它列出了新增、修改或删除的源文件→重复此执行顺序直至完成"
|
|
60
60
|
- story-file-updates-ONLY:
|
|
61
61
|
- 关键提示: 仅使用对下述部分的更新来更新故事文件。请勿修改任何其他部分。
|
|
62
62
|
- 关键提示: 您仅被授权编辑故事文件的这些特定部分 - Tasks / Subtasks 复选框, Dev Agent Record 部分及其所有子部分, Agent Model Used, Debug Log References, Completion Notes List, File List, Change Log, Status
|
|
63
63
|
- 关键提示: 请勿修改 Status, Story, Acceptance Criteria, Dev Notes, Testing 部分,或任何其他未在上面列出的部分
|
|
64
|
-
- blocking:
|
|
65
|
-
- ready-for-review:
|
|
64
|
+
- blocking: "在以下情况暂停:需要未经批准的依赖项,与用户确认 | 检查故事后发现内容模糊 | 尝试实现或修复某问题连续失败3次 | 缺少配置 | 回归测试失败"
|
|
65
|
+
- ready-for-review: "代码符合需求 + 所有验证通过 + 遵循标准 + File List 已完成"
|
|
66
66
|
- completion: "所有任务和子任务都标记为 [x] 并且有测试→验证和完整回归测试通过 (不要偷懒,执行所有测试并确认)→确保 File List 已完成→为清单 story-dod-checklist 运行任务 execute-checklist→设置故事状态为: 'Ready for Review'→暂停"
|
|
67
67
|
- explain: 详细地教我你刚才做了什么以及为什么这么做,以便我能学习。请像培训初级工程师一样向我解释。
|
|
68
68
|
- review-qa: 运行任务 `apply-qa-fixes.md`
|
|
@@ -209,7 +209,8 @@ quality_checkers:
|
|
|
209
209
|
"QA结果",
|
|
210
210
|
]
|
|
211
211
|
- field_formats:
|
|
212
|
-
状态:
|
|
212
|
+
状态:
|
|
213
|
+
["Draft", "Approved", "InProgress", "Review", "Done", "Completed"]
|
|
213
214
|
用户故事: "^\\*\\*作为\\*\\*.*\\*\\*我希望\\*\\*.*\\*\\*以便\\*\\*.*"
|
|
214
215
|
- structure_validation: true
|
|
215
216
|
- yaml_syntax_check: true
|
|
@@ -155,7 +155,7 @@ agent:
|
|
|
155
155
|
|
|
156
156
|
```yaml
|
|
157
157
|
stage_1_analysis:
|
|
158
|
-
duration:
|
|
158
|
+
duration: "5-10 minutes"
|
|
159
159
|
activities:
|
|
160
160
|
- prd_deep_analysis: 深度分析PRD文档结构
|
|
161
161
|
- story_identification: 识别所有用户故事
|
|
@@ -172,7 +172,7 @@ stage_1_analysis:
|
|
|
172
172
|
|
|
173
173
|
```yaml
|
|
174
174
|
stage_2_creation:
|
|
175
|
-
duration:
|
|
175
|
+
duration: "15-30 minutes"
|
|
176
176
|
activities:
|
|
177
177
|
- parallel_story_generation: 并行生成所有用户故事
|
|
178
178
|
- database_design_integration: 集成数据库设计
|
|
@@ -188,7 +188,7 @@ stage_2_creation:
|
|
|
188
188
|
|
|
189
189
|
```yaml
|
|
190
190
|
stage_3_development:
|
|
191
|
-
duration:
|
|
191
|
+
duration: "主要时间消耗阶段"
|
|
192
192
|
execution_mode: sequential
|
|
193
193
|
activities:
|
|
194
194
|
- pipeline_initialization: 初始化单条串行开发流水线
|
|
@@ -205,7 +205,7 @@ stage_3_development:
|
|
|
205
205
|
|
|
206
206
|
```yaml
|
|
207
207
|
stage_4_integration:
|
|
208
|
-
duration:
|
|
208
|
+
duration: "10-20 minutes"
|
|
209
209
|
activities:
|
|
210
210
|
- cross_module_integration: 跨模块集成测试
|
|
211
211
|
- end_to_end_testing: 端到端业务流程测试
|
|
@@ -221,7 +221,7 @@ stage_4_integration:
|
|
|
221
221
|
|
|
222
222
|
```yaml
|
|
223
223
|
stage_5_delivery:
|
|
224
|
-
duration:
|
|
224
|
+
duration: "5-10 minutes"
|
|
225
225
|
activities:
|
|
226
226
|
- deliverable_packaging: 交付物打包
|
|
227
227
|
- documentation_generation: 文档生成
|
|
@@ -260,18 +260,18 @@ parallel_scheduling:
|
|
|
260
260
|
```yaml
|
|
261
261
|
pipeline_architecture:
|
|
262
262
|
pipeline_1:
|
|
263
|
-
focus:
|
|
264
|
-
stories: [
|
|
263
|
+
focus: "核心业务功能"
|
|
264
|
+
stories: ["用户注册", "用户登录", "权限管理"]
|
|
265
265
|
priority: high
|
|
266
266
|
|
|
267
267
|
pipeline_2:
|
|
268
|
-
focus:
|
|
269
|
-
stories: [
|
|
268
|
+
focus: "业务数据管理"
|
|
269
|
+
stories: ["数据录入", "数据查询", "数据导出"]
|
|
270
270
|
priority: medium
|
|
271
271
|
|
|
272
272
|
pipeline_3:
|
|
273
|
-
focus:
|
|
274
|
-
stories: [
|
|
273
|
+
focus: "系统支撑功能"
|
|
274
|
+
stories: ["系统配置", "日志监控", "备份恢复"]
|
|
275
275
|
priority: low
|
|
276
276
|
```
|
|
277
277
|
|
|
@@ -270,9 +270,17 @@ global_audit_engine:
|
|
|
270
270
|
issue_classifier:
|
|
271
271
|
classification_dimensions:
|
|
272
272
|
- by_severity: ["critical", "high", "medium", "low"]
|
|
273
|
-
- by_type:
|
|
274
|
-
|
|
275
|
-
-
|
|
273
|
+
- by_type:
|
|
274
|
+
["functional", "non_functional", "technical_debt", "documentation"]
|
|
275
|
+
- by_component:
|
|
276
|
+
["frontend", "backend", "database", "api", "infrastructure"]
|
|
277
|
+
- by_effort:
|
|
278
|
+
[
|
|
279
|
+
"quick_fix",
|
|
280
|
+
"moderate_effort",
|
|
281
|
+
"significant_effort",
|
|
282
|
+
"major_rework",
|
|
283
|
+
]
|
|
276
284
|
priority_matrix:
|
|
277
285
|
high_impact_low_effort: "IMMEDIATE"
|
|
278
286
|
high_impact_high_effort: "HIGH"
|