@zeyue0329/xiaoma-cli 1.0.40 → 1.0.42
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 +8 -1
- package/.xiaoma-core/.coordinator-state.json +19 -0
- package/dist/agents/architect.txt +192 -0
- package/dist/agents/workflow-executor.txt +151 -1
- package/dist/agents/workflow-helper.txt +93 -0
- package/dist/teams/team-all.txt +396 -191
- package/dist/teams/team-fullstack-with-database.txt +2 -0
- package/dist/teams/team-fullstack.txt +2 -0
- package/dist/teams/team-no-ui.txt +2 -0
- package/docs/architecture/workflow-coordinator-implementation.md +1188 -0
- package/docs/prd/workflow-coordinator-prd.md +1214 -0
- package/package.json +6 -1
- package/tools/api-server.js +367 -0
- package/tools/installer/package.json +1 -1
- package/tools/workflow-coordinator/README.md +38 -0
- package/tools/workflow-coordinator/USAGE.md +548 -0
- package/tools/workflow-coordinator/package-lock.json +4868 -0
- package/tools/workflow-coordinator/package.json +35 -0
- package/tools/workflow-coordinator/src/api/server.js +207 -0
- package/tools/workflow-coordinator/src/controller/workflow-controller.js +263 -0
- package/tools/workflow-coordinator/src/index.js +113 -0
- package/tools/workflow-coordinator/src/parser/workflow-parser.js +144 -0
- package/tools/workflow-coordinator/src/utils/state-manager.js +59 -0
- package/tools/workflow-coordinator/src/utils/validator.js +86 -0
- package/tools/workflow-coordinator/test/integration-test.js +266 -0
- package/tools/workflow-coordinator/test/quick-test.js +127 -0
- package/xiaoma-core/agents/workflow-executor.md +155 -1
- package/xiaoma-core/agents/workflow-helper.md +481 -0
- package/xiaoma-core/workflows/automated-requirements-development.yaml +739 -0
package/.idea/workspace.xml
CHANGED
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="4ca3d6ad-bc27-4e67-9acd-07dccd21dd95" name="Changes" comment="drop unchecked message"
|
|
7
|
+
<list default="true" id="4ca3d6ad-bc27-4e67-9acd-07dccd21dd95" name="Changes" comment="drop unchecked message">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/dist/agents/architect.txt" beforeDir="false" afterPath="$PROJECT_DIR$/dist/agents/architect.txt" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/dist/teams/team-all.txt" beforeDir="false" afterPath="$PROJECT_DIR$/dist/teams/team-all.txt" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/dist/teams/team-fullstack-with-database.txt" beforeDir="false" afterPath="$PROJECT_DIR$/dist/teams/team-fullstack-with-database.txt" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/dist/teams/team-fullstack.txt" beforeDir="false" afterPath="$PROJECT_DIR$/dist/teams/team-fullstack.txt" afterDir="false" />
|
|
12
|
+
<change beforePath="$PROJECT_DIR$/dist/teams/team-no-ui.txt" beforeDir="false" afterPath="$PROJECT_DIR$/dist/teams/team-no-ui.txt" afterDir="false" />
|
|
13
|
+
</list>
|
|
8
14
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
15
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
16
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -67,6 +73,7 @@
|
|
|
67
73
|
<workItem from="1762494963355" duration="2769000" />
|
|
68
74
|
<workItem from="1762781553645" duration="3390000" />
|
|
69
75
|
<workItem from="1762933631198" duration="16000" />
|
|
76
|
+
<workItem from="1763045898895" duration="4599000" />
|
|
70
77
|
</task>
|
|
71
78
|
<task id="LOCAL-00001" summary="drop unchecked message">
|
|
72
79
|
<option name="closed" value="true" />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"workflowId": "test-1763048289115",
|
|
3
|
+
"workflowName": "自动化需求分析和架构设计流程",
|
|
4
|
+
"status": "in_progress",
|
|
5
|
+
"startTime": "2025-11-13T15:38:09.121Z",
|
|
6
|
+
"currentStepIndex": 1,
|
|
7
|
+
"completedSteps": [
|
|
8
|
+
{
|
|
9
|
+
"stepId": "pre_workflow_validation",
|
|
10
|
+
"status": "completed",
|
|
11
|
+
"outputs": [],
|
|
12
|
+
"duration": 5000,
|
|
13
|
+
"completedAt": "2025-11-13T15:38:09.126Z"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"context": {},
|
|
17
|
+
"errors": [],
|
|
18
|
+
"retries": {}
|
|
19
|
+
}
|
|
@@ -84,6 +84,7 @@ commands:
|
|
|
84
84
|
- execute-checklist {checklist}: 运行任务 execute-checklist (默认为->architect-checklist)
|
|
85
85
|
- research {topic}: 执行任务 create-deep-research-prompt
|
|
86
86
|
- shard-prd: 为提供的 architecture.md 运行任务 shard-doc.md (如果未找到则询问)
|
|
87
|
+
- shard-doc: 执行任务 shard-doc.md 切分大型文档到多个小文档
|
|
87
88
|
- yolo: 切换 Yolo 模式
|
|
88
89
|
- exit: 作为架构师道别,然后放弃扮演此角色
|
|
89
90
|
dependencies:
|
|
@@ -96,6 +97,7 @@ dependencies:
|
|
|
96
97
|
- create-doc.md
|
|
97
98
|
- document-project.md
|
|
98
99
|
- execute-checklist.md
|
|
100
|
+
- shard-doc.md
|
|
99
101
|
templates:
|
|
100
102
|
- architecture-tmpl.yaml
|
|
101
103
|
- brownfield-architecture-tmpl.yaml
|
|
@@ -932,6 +934,196 @@ The LLM will:
|
|
|
932
934
|
- Offer to provide detailed analysis of any section, especially those with warnings or failures
|
|
933
935
|
==================== END: .xiaoma-core/tasks/execute-checklist.md ====================
|
|
934
936
|
|
|
937
|
+
==================== START: .xiaoma-core/tasks/shard-doc.md ====================
|
|
938
|
+
<!-- Powered by XiaoMa™ Core -->
|
|
939
|
+
|
|
940
|
+
# Document Sharding Task
|
|
941
|
+
|
|
942
|
+
## Purpose
|
|
943
|
+
|
|
944
|
+
- Split a large document into multiple smaller documents based on level 2 sections
|
|
945
|
+
- Create a folder structure to organize the sharded documents
|
|
946
|
+
- Maintain all content integrity including code blocks, diagrams, and markdown formatting
|
|
947
|
+
|
|
948
|
+
## Primary Method: Automatic with markdown-tree
|
|
949
|
+
|
|
950
|
+
[[LLM: First, check if markdownExploder is set to true in .xiaoma-core/core-config.yaml. If it is, attempt to run the command: `md-tree explode {input file} {output path}`.
|
|
951
|
+
|
|
952
|
+
If the command succeeds, inform the user that the document has been sharded successfully and STOP - do not proceed further.
|
|
953
|
+
|
|
954
|
+
If the command fails (especially with an error indicating the command is not found or not available), inform the user: "The markdownExploder setting is enabled but the md-tree command is not available. Please either:
|
|
955
|
+
|
|
956
|
+
1. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
|
|
957
|
+
2. Or set markdownExploder to false in .xiaoma-core/core-config.yaml
|
|
958
|
+
|
|
959
|
+
**IMPORTANT: STOP HERE - do not proceed with manual sharding until one of the above actions is taken.**"
|
|
960
|
+
|
|
961
|
+
If markdownExploder is set to false, inform the user: "The markdownExploder setting is currently false. For better performance and reliability, you should:
|
|
962
|
+
|
|
963
|
+
1. Set markdownExploder to true in .xiaoma-core/core-config.yaml
|
|
964
|
+
2. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
|
|
965
|
+
|
|
966
|
+
I will now proceed with the manual sharding process."
|
|
967
|
+
|
|
968
|
+
Then proceed with the manual method below ONLY if markdownExploder is false.]]
|
|
969
|
+
|
|
970
|
+
### Installation and Usage
|
|
971
|
+
|
|
972
|
+
1. **Install globally**:
|
|
973
|
+
|
|
974
|
+
```bash
|
|
975
|
+
npm install -g @kayvan/markdown-tree-parser
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
2. **Use the explode command**:
|
|
979
|
+
|
|
980
|
+
```bash
|
|
981
|
+
# For PRD
|
|
982
|
+
md-tree explode docs/prd.md docs/prd
|
|
983
|
+
|
|
984
|
+
# For Architecture
|
|
985
|
+
md-tree explode docs/architecture.md docs/architecture
|
|
986
|
+
|
|
987
|
+
# For any document
|
|
988
|
+
md-tree explode [source-document] [destination-folder]
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
3. **What it does**:
|
|
992
|
+
- Automatically splits the document by level 2 sections
|
|
993
|
+
- Creates properly named files
|
|
994
|
+
- Adjusts heading levels appropriately
|
|
995
|
+
- Handles all edge cases with code blocks and special markdown
|
|
996
|
+
|
|
997
|
+
If the user has @kayvan/markdown-tree-parser installed, use it and skip the manual process below.
|
|
998
|
+
|
|
999
|
+
---
|
|
1000
|
+
|
|
1001
|
+
## Manual Method (if @kayvan/markdown-tree-parser is not available or user indicated manual method)
|
|
1002
|
+
|
|
1003
|
+
### Task Instructions
|
|
1004
|
+
|
|
1005
|
+
1. Identify Document and Target Location
|
|
1006
|
+
|
|
1007
|
+
- Determine which document to shard (user-provided path)
|
|
1008
|
+
- Create a new folder under `docs/` with the same name as the document (without extension)
|
|
1009
|
+
- Example: `docs/prd.md` → create folder `docs/prd/`
|
|
1010
|
+
|
|
1011
|
+
2. Parse and Extract Sections
|
|
1012
|
+
|
|
1013
|
+
CRITICAL AEGNT SHARDING RULES:
|
|
1014
|
+
|
|
1015
|
+
1. Read the entire document content
|
|
1016
|
+
2. Identify all level 2 sections (## headings)
|
|
1017
|
+
3. For each level 2 section:
|
|
1018
|
+
- Extract the section heading and ALL content until the next level 2 section
|
|
1019
|
+
- Include all subsections, code blocks, diagrams, lists, tables, etc.
|
|
1020
|
+
- Be extremely careful with:
|
|
1021
|
+
- Fenced code blocks (```) - ensure you capture the full block including closing backticks and account for potential misleading level 2's that are actually part of a fenced section example
|
|
1022
|
+
- Mermaid diagrams - preserve the complete diagram syntax
|
|
1023
|
+
- Nested markdown elements
|
|
1024
|
+
- Multi-line content that might contain ## inside code blocks
|
|
1025
|
+
|
|
1026
|
+
CRITICAL: Use proper parsing that understands markdown context. A ## inside a code block is NOT a section header.]]
|
|
1027
|
+
|
|
1028
|
+
### 3. Create Individual Files
|
|
1029
|
+
|
|
1030
|
+
For each extracted section:
|
|
1031
|
+
|
|
1032
|
+
1. **Generate filename**: Convert the section heading to lowercase-dash-case
|
|
1033
|
+
- Remove special characters
|
|
1034
|
+
- Replace spaces with dashes
|
|
1035
|
+
- Example: "## Tech Stack" → `tech-stack.md`
|
|
1036
|
+
|
|
1037
|
+
2. **Adjust heading levels**:
|
|
1038
|
+
- The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
|
|
1039
|
+
- All subsection levels decrease by 1:
|
|
1040
|
+
|
|
1041
|
+
```txt
|
|
1042
|
+
- ### → ##
|
|
1043
|
+
- #### → ###
|
|
1044
|
+
- ##### → ####
|
|
1045
|
+
- etc.
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
3. **Write content**: Save the adjusted content to the new file
|
|
1049
|
+
|
|
1050
|
+
### 4. Create Index File
|
|
1051
|
+
|
|
1052
|
+
Create an `index.md` file in the sharded folder that:
|
|
1053
|
+
|
|
1054
|
+
1. Contains the original level 1 heading and any content before the first level 2 section
|
|
1055
|
+
2. Lists all the sharded files with links:
|
|
1056
|
+
|
|
1057
|
+
```markdown
|
|
1058
|
+
# Original Document Title
|
|
1059
|
+
|
|
1060
|
+
[Original introduction content if any]
|
|
1061
|
+
|
|
1062
|
+
## Sections
|
|
1063
|
+
|
|
1064
|
+
- [Section Name 1](./section-name-1.md)
|
|
1065
|
+
- [Section Name 2](./section-name-2.md)
|
|
1066
|
+
- [Section Name 3](./section-name-3.md)
|
|
1067
|
+
...
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
### 5. Preserve Special Content
|
|
1071
|
+
|
|
1072
|
+
1. **Code blocks**: Must capture complete blocks including:
|
|
1073
|
+
|
|
1074
|
+
```language
|
|
1075
|
+
content
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
2. **Mermaid diagrams**: Preserve complete syntax:
|
|
1079
|
+
|
|
1080
|
+
```mermaid
|
|
1081
|
+
graph TD
|
|
1082
|
+
...
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
3. **Tables**: Maintain proper markdown table formatting
|
|
1086
|
+
|
|
1087
|
+
4. **Lists**: Preserve indentation and nesting
|
|
1088
|
+
|
|
1089
|
+
5. **Inline code**: Preserve backticks
|
|
1090
|
+
|
|
1091
|
+
6. **Links and references**: Keep all markdown links intact
|
|
1092
|
+
|
|
1093
|
+
7. **Template markup**: If documents contain {{placeholders}} ,preserve exactly
|
|
1094
|
+
|
|
1095
|
+
### 6. Validation
|
|
1096
|
+
|
|
1097
|
+
After sharding:
|
|
1098
|
+
|
|
1099
|
+
1. Verify all sections were extracted
|
|
1100
|
+
2. Check that no content was lost
|
|
1101
|
+
3. Ensure heading levels were properly adjusted
|
|
1102
|
+
4. Confirm all files were created successfully
|
|
1103
|
+
|
|
1104
|
+
### 7. Report Results
|
|
1105
|
+
|
|
1106
|
+
Provide a summary:
|
|
1107
|
+
|
|
1108
|
+
```text
|
|
1109
|
+
Document sharded successfully:
|
|
1110
|
+
- Source: [original document path]
|
|
1111
|
+
- Destination: docs/[folder-name]/
|
|
1112
|
+
- Files created: [count]
|
|
1113
|
+
- Sections:
|
|
1114
|
+
- section-name-1.md: "Section Title 1"
|
|
1115
|
+
- section-name-2.md: "Section Title 2"
|
|
1116
|
+
...
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
## Important Notes
|
|
1120
|
+
|
|
1121
|
+
- Never modify the actual content, only adjust heading levels
|
|
1122
|
+
- Preserve ALL formatting, including whitespace where significant
|
|
1123
|
+
- Handle edge cases like sections with code blocks containing ## symbols
|
|
1124
|
+
- Ensure the sharding is reversible (could reconstruct the original from shards)
|
|
1125
|
+
==================== END: .xiaoma-core/tasks/shard-doc.md ====================
|
|
1126
|
+
|
|
935
1127
|
==================== START: .xiaoma-core/templates/architecture-tmpl.yaml ====================
|
|
936
1128
|
template:
|
|
937
1129
|
id: architecture-template-v2
|
|
@@ -83,6 +83,7 @@ commands:
|
|
|
83
83
|
- help: 显示以下命令的编号列表以供选择
|
|
84
84
|
- run-requirements-analysis: 🔥 自动化需求分析工作流(完全自动执行,不暂停)- 加载 automated-requirements-analysis.yaml 并连续执行所有 6 个步骤,从 req.txt 到最终的架构设计文档,全程自动化无需人工干预
|
|
85
85
|
- run-story-development: 🔥 自动化用户故事开发工作流(完全自动执行,不暂停)- 加载 automated-story-development.yaml 并循环执行所有用户故事的 SM→PO→Dev→QA 完整开发周期,全程自动化无需人工干预
|
|
86
|
+
- run-requirements-development: '🔥🔥🔥 端到端全自动化工作流(完全自动执行,不暂停)- 加载 automated-requirements-development.yaml 并连续执行从需求分析到用户故事开发完成的完整流程 (阶段1: 需求分析 6步 + 阶段2: 用户故事开发循环), 实现从 req.txt 到所有代码完成的端到端自动化'
|
|
86
87
|
- status: 显示当前工作流执行状态和进度
|
|
87
88
|
- validate-prerequisites: 验证工作流执行的前置条件
|
|
88
89
|
- resume-workflow: 从上次中断的位置恢复工作流执行(同样会自动连续执行剩余步骤)
|
|
@@ -92,6 +93,7 @@ dependencies:
|
|
|
92
93
|
workflows:
|
|
93
94
|
- automated-requirements-analysis.yaml
|
|
94
95
|
- automated-story-development.yaml
|
|
96
|
+
- automated-requirements-development.yaml
|
|
95
97
|
```
|
|
96
98
|
|
|
97
99
|
---
|
|
@@ -205,7 +207,77 @@ workflow_stages:
|
|
|
205
207
|
|
|
206
208
|
---
|
|
207
209
|
|
|
208
|
-
### 2.
|
|
210
|
+
### 2. 🔥🔥🔥 端到端全自动化工作流 (新增)
|
|
211
|
+
|
|
212
|
+
**命令**: `*run-requirements-development`
|
|
213
|
+
|
|
214
|
+
**功能**: 执行从需求分析到用户故事开发完成的完整端到端自动化流程
|
|
215
|
+
|
|
216
|
+
**工作流文件**: `xiaoma-core/workflows/automated-requirements-development.yaml`
|
|
217
|
+
|
|
218
|
+
**核心价值**:
|
|
219
|
+
- ✅ **一键启动**: 只需执行一个命令,完成从 req.txt 到所有代码的端到端开发
|
|
220
|
+
- ✅ **无缝衔接**: 需求分析阶段自动衔接用户故事开发阶段,无需人工干预
|
|
221
|
+
- ✅ **全程自动化**: 整合了两个子工作流的所有优势,实现完整的自动化流程
|
|
222
|
+
- ✅ **质量保证**: 两个阶段的所有质量门控都会自动执行
|
|
223
|
+
|
|
224
|
+
**执行流程**:
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
端到端工作流结构:
|
|
228
|
+
|
|
229
|
+
阶段 1: 需求分析阶段 (1.5-2.5小时)
|
|
230
|
+
├─ 步骤 0/6: 前置环境验证
|
|
231
|
+
├─ 步骤 1/6: Analyst 需求分析
|
|
232
|
+
├─ 步骤 2/6: Architect 架构分析
|
|
233
|
+
├─ 步骤 3/6: PM 创建 PRD
|
|
234
|
+
├─ 步骤 4/6: PM 拆分史诗
|
|
235
|
+
├─ 步骤 5/6: Architect 架构设计
|
|
236
|
+
└─ 步骤 6/6: 生成需求分析报告
|
|
237
|
+
↓
|
|
238
|
+
阶段间验证(无缝衔接)
|
|
239
|
+
↓
|
|
240
|
+
阶段 2: 用户故事开发阶段 (40-70分钟/故事)
|
|
241
|
+
循环执行(直到所有用户故事完成):
|
|
242
|
+
├─ 步骤 1: SM 创建用户故事
|
|
243
|
+
├─ 步骤 1.5: 快速构建验证
|
|
244
|
+
├─ 步骤 2: PO 验证故事
|
|
245
|
+
├─ 步骤 2.5: 预开发构建检查
|
|
246
|
+
├─ 步骤 3: Dev 开发故事
|
|
247
|
+
├─ 步骤 4: QA 测试验证
|
|
248
|
+
└─ 步骤 5: 质量门控决策
|
|
249
|
+
↓
|
|
250
|
+
生成端到端完成报告
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**总耗时**:
|
|
254
|
+
- 阶段 1(需求分析): 约 1.5-2.5 小时
|
|
255
|
+
- 阶段 2(用户故事开发): 约 40-70 分钟 × 用户故事数量
|
|
256
|
+
- **典型小型项目(5-10个故事)**: 4-8 小时
|
|
257
|
+
- **典型中型项目(10-20个故事)**: 8-16 小时
|
|
258
|
+
|
|
259
|
+
**成功标准**:
|
|
260
|
+
|
|
261
|
+
阶段 1 成功标准:
|
|
262
|
+
- ✅ 所有需求分析文档生成完成
|
|
263
|
+
- ✅ PRD 和 Epic 文档创建完成
|
|
264
|
+
- ✅ 架构设计和数据库脚本生成完成
|
|
265
|
+
- ✅ 所有质量门控通过
|
|
266
|
+
|
|
267
|
+
阶段 2 成功标准:
|
|
268
|
+
- ✅ 所有用户故事状态为 Done
|
|
269
|
+
- ✅ 所有测试通过(覆盖率 ≥80%)
|
|
270
|
+
- ✅ 所有 QA 质量门控通过
|
|
271
|
+
- ✅ 代码质量达标
|
|
272
|
+
|
|
273
|
+
整体成功标准:
|
|
274
|
+
- ✅ 两个阶段全部完成
|
|
275
|
+
- ✅ 完整的文档和代码生成
|
|
276
|
+
- ✅ 准备就绪进入集成测试和部署阶段
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### 3. 自动化用户故事开发工作流
|
|
209
281
|
|
|
210
282
|
**命令**: `*run-story-development`
|
|
211
283
|
|
|
@@ -391,6 +463,84 @@ quality_gates:
|
|
|
391
463
|
|
|
392
464
|
## 📊 使用示例
|
|
393
465
|
|
|
466
|
+
### 🔥🔥🔥 执行端到端全自动化工作流(推荐)
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
# 1. 准备工作
|
|
470
|
+
# 确保 docs/req.txt 文件存在且包含 PM 提供的需求
|
|
471
|
+
|
|
472
|
+
# 2. 激活工作流执行器
|
|
473
|
+
/workflow-executor
|
|
474
|
+
|
|
475
|
+
# 3. 执行端到端全自动化工作流(完全自动化,一键到底)
|
|
476
|
+
*run-requirements-development
|
|
477
|
+
|
|
478
|
+
# ⚡ 核心优势:一个命令完成从需求分析到代码实现的全部工作!
|
|
479
|
+
# ⚠️ 重要提示:工作流执行器会自动连续执行两个阶段的所有步骤,不会在中间暂停
|
|
480
|
+
# 如果工作流在某个步骤停止,说明遇到了错误或质量门控失败,请查看错误信息
|
|
481
|
+
|
|
482
|
+
# 工作流执行器将自动完成以下所有工作(典型小项目 4-8 小时):
|
|
483
|
+
#
|
|
484
|
+
# 【阶段 1: 需求分析】(约 1.5-2.5 小时)
|
|
485
|
+
# ✓ 步骤 0/6: 前置环境验证
|
|
486
|
+
# ✓ 步骤 1/6: Analyst 需求分析 → 生成需求分析报告
|
|
487
|
+
# ✓ 步骤 2/6: Architect 架构分析 → 生成架构分析报告
|
|
488
|
+
# ✓ 步骤 3/6: PM 创建 PRD → 生成 Brownfield PRD
|
|
489
|
+
# ✓ 步骤 4/6: PM 拆分史诗 → 生成 Epic 文档
|
|
490
|
+
# ✓ 步骤 5/6: Architect 架构设计 → 生成架构设计和数据库脚本
|
|
491
|
+
# ✓ 步骤 6/6: 生成需求分析完成报告
|
|
492
|
+
# ↓
|
|
493
|
+
# ✓ 阶段间无缝衔接验证
|
|
494
|
+
# ↓
|
|
495
|
+
# 【阶段 2: 用户故事开发】(约 40-70 分钟 × 故事数量)
|
|
496
|
+
# 对每个用户故事循环执行:
|
|
497
|
+
# ✓ SM 创建用户故事 → 快速构建验证
|
|
498
|
+
# ✓ PO 验证故事(10步验证)
|
|
499
|
+
# ✓ 预开发构建检查
|
|
500
|
+
# ✓ Dev 开发实现 + 自测
|
|
501
|
+
# ✓ QA 测试验证(真实数据测试)
|
|
502
|
+
# ✓ 质量门控决策 → Done
|
|
503
|
+
# 直到所有用户故事完成
|
|
504
|
+
# ↓
|
|
505
|
+
# ✓ 生成端到端完成报告
|
|
506
|
+
|
|
507
|
+
# 4. 工作流完成后检查所有输出
|
|
508
|
+
# 阶段 1 输出:
|
|
509
|
+
# - docs/requirements/requirements-analysis.md
|
|
510
|
+
# - docs/architecture/current-architecture-analysis.md
|
|
511
|
+
# - docs/prd/brownfield-iteration-prd.md
|
|
512
|
+
# - docs/epics/史诗-*.md
|
|
513
|
+
# - docs/architecture/iteration-backend-design.md
|
|
514
|
+
# - docs/architecture/db-migration-scripts.sql
|
|
515
|
+
# - docs/architecture/*.md (7个模块文档)
|
|
516
|
+
#
|
|
517
|
+
# 阶段 2 输出:
|
|
518
|
+
# - docs/stories/epic{X}-story{Y}.md (所有故事状态: Done)
|
|
519
|
+
# - src/ 目录下的实现代码
|
|
520
|
+
# - 测试报告
|
|
521
|
+
# - QA gate 文件
|
|
522
|
+
#
|
|
523
|
+
# 完成报告:
|
|
524
|
+
# - docs/end-to-end-completion-report.md
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
**🌟 端到端工作流的特殊优势**:
|
|
528
|
+
|
|
529
|
+
- ✅ **一键到底**: 只需一个命令,无需在两个阶段间手动切换
|
|
530
|
+
- ✅ **无缝衔接**: 阶段1完成后自动验证并进入阶段2,完全自动化
|
|
531
|
+
- ✅ **全程监控**: 统一的进度追踪和质量控制
|
|
532
|
+
- ✅ **完整报告**: 生成包含两个阶段的综合完成报告
|
|
533
|
+
- ✅ **节省时间**: 避免手动操作和阶段间切换的开销
|
|
534
|
+
- ⚠️ **执行时长**: 适合有充足时间的场景(典型小项目 4-8 小时)
|
|
535
|
+
|
|
536
|
+
**🔥 适用场景**:
|
|
537
|
+
- 从零开始的新需求迭代
|
|
538
|
+
- 需要完整的需求分析和代码实现
|
|
539
|
+
- 有充足的执行时间(半天到一天)
|
|
540
|
+
- 希望最小化人工干预
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
394
544
|
### 执行需求分析工作流
|
|
395
545
|
|
|
396
546
|
```bash
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Web Agent Bundle Instructions
|
|
2
|
+
|
|
3
|
+
You are now operating as a specialized AI agent from the XiaoMa-Cli framework. This is a bundled web-compatible version containing all necessary resources for your role.
|
|
4
|
+
|
|
5
|
+
## Important Instructions
|
|
6
|
+
|
|
7
|
+
1. **Follow all startup commands**: Your agent configuration includes startup instructions that define your behavior, personality, and approach. These MUST be followed exactly.
|
|
8
|
+
|
|
9
|
+
2. **Resource Navigation**: This bundle contains all resources you need. Resources are marked with tags like:
|
|
10
|
+
|
|
11
|
+
- `==================== START: .xiaoma-core/folder/filename.md ====================`
|
|
12
|
+
- `==================== END: .xiaoma-core/folder/filename.md ====================`
|
|
13
|
+
|
|
14
|
+
When you need to reference a resource mentioned in your instructions:
|
|
15
|
+
|
|
16
|
+
- Look for the corresponding START/END tags
|
|
17
|
+
- The format is always the full path with dot prefix (e.g., `.xiaoma-core/personas/analyst.md`, `.xiaoma-core/tasks/create-story.md`)
|
|
18
|
+
- If a section is specified (e.g., `{root}/tasks/create-story.md#section-name`), navigate to that section within the file
|
|
19
|
+
|
|
20
|
+
**Understanding YAML References**: In the agent configuration, resources are referenced in the dependencies section. For example:
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
dependencies:
|
|
24
|
+
utils:
|
|
25
|
+
- template-format
|
|
26
|
+
tasks:
|
|
27
|
+
- create-story
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
These references map directly to bundle sections:
|
|
31
|
+
|
|
32
|
+
- `utils: template-format` → Look for `==================== START: .xiaoma-core/utils/template-format.md ====================`
|
|
33
|
+
- `tasks: create-story` → Look for `==================== START: .xiaoma-core/tasks/create-story.md ====================`
|
|
34
|
+
|
|
35
|
+
3. **Execution Context**: You are operating in a web environment. All your capabilities and knowledge are contained within this bundle. Work within these constraints to provide the best possible assistance.
|
|
36
|
+
|
|
37
|
+
4. **Primary Directive**: Your primary goal is defined in your agent configuration below. Focus on fulfilling your designated role according to the XiaoMa-Cli framework.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
==================== START: .xiaoma-core/agents/workflow-helper.md ====================
|
|
43
|
+
# agent
|
|
44
|
+
|
|
45
|
+
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
on_failure:
|
|
49
|
+
max_retries: 3
|
|
50
|
+
escalation: 请检查架构模板完整性
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 调试
|
|
54
|
+
|
|
55
|
+
### 启用详细日志
|
|
56
|
+
|
|
57
|
+
在协调器启动时查看详细日志:
|
|
58
|
+
```bash
|
|
59
|
+
DEBUG=* node src/index.js start automated-requirements-analysis
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 查看状态文件
|
|
63
|
+
|
|
64
|
+
工作流状态保存在:`.xiaoma-core/.coordinator-state.json`
|
|
65
|
+
|
|
66
|
+
查看:
|
|
67
|
+
```bash
|
|
68
|
+
cat .xiaoma-core/.coordinator-state.json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 使用提示
|
|
72
|
+
|
|
73
|
+
1. **先启动协调器**:在Claude Code中启动工作流前,确保协调器已运行
|
|
74
|
+
2. **保持终端开启**:协调器需要持续运行,不要关闭终端
|
|
75
|
+
3. **监控日志**:协调器日志会显示详细的执行进度和问题
|
|
76
|
+
4. **状态恢复**:如果中断,状态文件允许从中断点恢复
|
|
77
|
+
5. **工作流定义**:所有工作流定义在`xiaoma-core/workflows/`目录
|
|
78
|
+
|
|
79
|
+
## 与workflow-executor的区别
|
|
80
|
+
|
|
81
|
+
**workflow-executor**(旧方案):
|
|
82
|
+
- 完全由AI驱动,基于AI判断决定下一步
|
|
83
|
+
- 会在关键点暂停询问用户
|
|
84
|
+
- 无法完全自动化
|
|
85
|
+
|
|
86
|
+
**workflow-helper + Coordinator**(新方案):
|
|
87
|
+
- 程序化流程控制,消除AI决策延迟
|
|
88
|
+
- 完全自动执行,无需人工确认
|
|
89
|
+
- 状态持久化,支持恢复
|
|
90
|
+
- 质量门控,自动验证输出
|
|
91
|
+
|
|
92
|
+
workflow-helper专注于"执行层",协调器负责"控制层",实现关注点分离和更可靠的自动化。
|
|
93
|
+
==================== END: .xiaoma-core/agents/workflow-helper.md ====================
|