@s_s/harmonia 1.2.0 → 1.4.0
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/README.md +140 -392
- package/build/cli/setup.d.ts +4 -2
- package/build/cli/setup.js +44 -18
- package/build/cli/setup.js.map +1 -1
- package/build/core/action-registry.d.ts +36 -0
- package/build/core/action-registry.js +53 -0
- package/build/core/action-registry.js.map +1 -0
- package/build/core/artifacts.d.ts +66 -0
- package/build/core/artifacts.js +178 -0
- package/build/core/artifacts.js.map +1 -0
- package/build/core/dispatch.d.ts +18 -11
- package/build/core/dispatch.js +43 -33
- package/build/core/dispatch.js.map +1 -1
- package/build/core/issues.d.ts +37 -0
- package/build/core/issues.js +100 -0
- package/build/core/issues.js.map +1 -0
- package/build/core/overrides.d.ts +19 -26
- package/build/core/overrides.js +32 -98
- package/build/core/overrides.js.map +1 -1
- package/build/core/plugin.d.ts +86 -0
- package/build/core/plugin.js +332 -0
- package/build/core/plugin.js.map +1 -0
- package/build/core/registry.d.ts +36 -3
- package/build/core/registry.js +63 -5
- package/build/core/registry.js.map +1 -1
- package/build/core/reviews.d.ts +13 -13
- package/build/core/reviews.js +31 -32
- package/build/core/reviews.js.map +1 -1
- package/build/core/schema.d.ts +43 -15
- package/build/core/schema.js +124 -20
- package/build/core/schema.js.map +1 -1
- package/build/core/state.d.ts +29 -22
- package/build/core/state.js +49 -81
- package/build/core/state.js.map +1 -1
- package/build/core/steps.d.ts +15 -15
- package/build/core/steps.js +32 -33
- package/build/core/steps.js.map +1 -1
- package/build/core/tree-utils.d.ts +52 -0
- package/build/core/tree-utils.js +226 -0
- package/build/core/tree-utils.js.map +1 -0
- package/build/core/types.d.ts +417 -117
- package/build/core/types.js +15 -1
- package/build/core/types.js.map +1 -1
- package/build/core/workflow-engine.d.ts +68 -0
- package/build/core/workflow-engine.js +821 -0
- package/build/core/workflow-engine.js.map +1 -0
- package/build/core/workflow-validator.d.ts +22 -0
- package/build/core/workflow-validator.js +489 -0
- package/build/core/workflow-validator.js.map +1 -0
- package/build/index.js +28 -25
- package/build/index.js.map +1 -1
- package/build/setup/inject.d.ts +4 -4
- package/build/setup/inject.js +6 -6
- package/build/setup/inject.js.map +1 -1
- package/build/setup/templates.d.ts +9 -7
- package/build/setup/templates.js +68 -103
- package/build/setup/templates.js.map +1 -1
- package/build/tools/artifact-approve.d.ts +8 -0
- package/build/tools/artifact-approve.js +94 -0
- package/build/tools/artifact-approve.js.map +1 -0
- package/build/tools/artifact-schema.d.ts +12 -0
- package/build/tools/artifact-schema.js +148 -0
- package/build/tools/artifact-schema.js.map +1 -0
- package/build/tools/artifact-tools.d.ts +18 -0
- package/build/tools/artifact-tools.js +465 -0
- package/build/tools/artifact-tools.js.map +1 -0
- package/build/tools/{report-dispatch.d.ts → dispatch-report.d.ts} +7 -3
- package/build/tools/dispatch-report.js +261 -0
- package/build/tools/dispatch-report.js.map +1 -0
- package/build/tools/engine-helpers.d.ts +41 -0
- package/build/tools/engine-helpers.js +182 -0
- package/build/tools/engine-helpers.js.map +1 -0
- package/build/tools/get-project-status.d.ts +6 -4
- package/build/tools/get-project-status.js +308 -246
- package/build/tools/get-project-status.js.map +1 -1
- package/build/tools/get-role-prompt.d.ts +1 -1
- package/build/tools/get-role-prompt.js +7 -41
- package/build/tools/get-role-prompt.js.map +1 -1
- package/build/tools/issue-tools.d.ts +10 -0
- package/build/tools/issue-tools.js +169 -0
- package/build/tools/issue-tools.js.map +1 -0
- package/build/tools/iteration-start.d.ts +7 -4
- package/build/tools/iteration-start.js +51 -20
- package/build/tools/iteration-start.js.map +1 -1
- package/build/tools/loop-done.d.ts +11 -0
- package/build/tools/loop-done.js +109 -0
- package/build/tools/loop-done.js.map +1 -0
- package/build/tools/patch-start.d.ts +16 -0
- package/build/tools/patch-start.js +122 -0
- package/build/tools/patch-start.js.map +1 -0
- package/build/tools/project-init.d.ts +5 -5
- package/build/tools/project-init.js +47 -18
- package/build/tools/project-init.js.map +1 -1
- package/build/tools/role-dispatch.d.ts +55 -0
- package/build/tools/role-dispatch.js +508 -0
- package/build/tools/role-dispatch.js.map +1 -0
- package/build/tools/utils.d.ts +40 -0
- package/build/tools/utils.js +97 -0
- package/build/tools/utils.js.map +1 -0
- package/package.json +1 -1
- package/{build/hooks/claude-code.js → workflows/dev/hooks/claude.js} +34 -23
- package/{build → workflows/dev}/hooks/content.js +27 -18
- package/workflows/dev/hooks/index.js +52 -0
- package/{build → workflows/dev}/hooks/openclaw.js +31 -20
- package/{build → workflows/dev}/hooks/opencode.js +31 -20
- package/workflows/dev/roles/architect.md +68 -28
- package/workflows/dev/roles/coordinator.md +103 -0
- package/workflows/dev/roles/developer.md +5 -5
- package/workflows/dev/roles/tester.md +19 -19
- package/workflows/dev/schemas/api-contract.json +42 -0
- package/workflows/dev/schemas/api-design.json +30 -13
- package/workflows/dev/schemas/data-model.json +20 -7
- package/workflows/dev/schemas/prd.completeness-check.json +6 -5
- package/workflows/dev/schemas/prd.draft.json +13 -5
- package/workflows/dev/schemas/prd.final.json +34 -11
- package/workflows/dev/schemas/prd.json +29 -11
- package/workflows/dev/schemas/prd.requirements.json +6 -5
- package/workflows/dev/schemas/prototype.json +6 -2
- package/workflows/dev/schemas/task-breakdown.coarse.json +4 -3
- package/workflows/dev/schemas/task-breakdown.dependencies.json +5 -4
- package/workflows/dev/schemas/task-breakdown.detailed.json +8 -3
- package/workflows/dev/schemas/task-breakdown.final.json +8 -3
- package/workflows/dev/schemas/task-breakdown.json +8 -3
- package/workflows/dev/schemas/tech-design.analysis.json +6 -5
- package/workflows/dev/schemas/tech-design.draft.json +14 -5
- package/workflows/dev/schemas/tech-design.final.json +39 -13
- package/workflows/dev/schemas/tech-design.json +34 -13
- package/workflows/dev/schemas/tech-design.research.json +21 -0
- package/workflows/dev/schemas/test-plan.json +17 -7
- package/workflows/dev/schemas/test-report.json +26 -9
- package/workflows/dev/schemas/user-stories.json +7 -3
- package/workflows/dev/tools/index.js +23 -0
- package/workflows/dev/workflow.json +234 -101
- package/build/core/docs.d.ts +0 -32
- package/build/core/docs.js +0 -91
- package/build/core/docs.js.map +0 -1
- package/build/core/workflow.d.ts +0 -33
- package/build/core/workflow.js +0 -140
- package/build/core/workflow.js.map +0 -1
- package/build/hooks/claude-code.d.ts +0 -20
- package/build/hooks/claude-code.js.map +0 -1
- package/build/hooks/content.d.ts +0 -43
- package/build/hooks/content.js.map +0 -1
- package/build/hooks/install.d.ts +0 -40
- package/build/hooks/install.js +0 -63
- package/build/hooks/install.js.map +0 -1
- package/build/hooks/openclaw.d.ts +0 -24
- package/build/hooks/openclaw.js.map +0 -1
- package/build/hooks/opencode.d.ts +0 -29
- package/build/hooks/opencode.js.map +0 -1
- package/build/tools/approve-doc.d.ts +0 -6
- package/build/tools/approve-doc.js +0 -108
- package/build/tools/approve-doc.js.map +0 -1
- package/build/tools/dispatch-role.d.ts +0 -16
- package/build/tools/dispatch-role.js +0 -277
- package/build/tools/dispatch-role.js.map +0 -1
- package/build/tools/doc-tools.d.ts +0 -16
- package/build/tools/doc-tools.js +0 -389
- package/build/tools/doc-tools.js.map +0 -1
- package/build/tools/override-tools.d.ts +0 -6
- package/build/tools/override-tools.js +0 -129
- package/build/tools/override-tools.js.map +0 -1
- package/build/tools/report-dispatch.js +0 -194
- package/build/tools/report-dispatch.js.map +0 -1
- package/build/tools/set-scale.d.ts +0 -6
- package/build/tools/set-scale.js +0 -107
- package/build/tools/set-scale.js.map +0 -1
- package/build/tools/setup-project.d.ts +0 -8
- package/build/tools/setup-project.js +0 -116
- package/build/tools/setup-project.js.map +0 -1
- package/build/tools/update-phase.d.ts +0 -12
- package/build/tools/update-phase.js +0 -159
- package/build/tools/update-phase.js.map +0 -1
- package/workflows/dev/roles/pm.md +0 -99
- package/workflows/dev/schemas/deploy.json +0 -20
- package/workflows/dev/schemas/fsd.json +0 -25
- package/workflows/dev/schemas/project-plan.json +0 -20
- package/workflows/dev/schemas/retrospective.json +0 -20
- package/workflows/dev/schemas/risk-assessment.json +0 -15
- package/workflows/dev/schemas/tech-design.api-contract.json +0 -20
|
@@ -1,53 +1,229 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev",
|
|
3
3
|
"description": "软件开发流程",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"author": "harmonia",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
6
|
+
"coordinator": "coordinator",
|
|
7
|
+
"root": {
|
|
8
|
+
"type": "sequence",
|
|
9
|
+
"id": "main",
|
|
10
|
+
"children": [
|
|
11
|
+
{
|
|
12
|
+
"type": "task",
|
|
13
|
+
"id": "clarify",
|
|
14
|
+
"role": "coordinator",
|
|
15
|
+
"beforeDispatch": {
|
|
16
|
+
"inject": ["进入需求澄清阶段。请与用户沟通,理解需求意图、功能范围和约束条件,然后产出 prd(需求文档)。"]
|
|
17
|
+
},
|
|
18
|
+
"afterComplete": {
|
|
19
|
+
"inject": ["需求澄清完成。请检查 prd 是否已写入并提交用户审批。"]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "gate",
|
|
24
|
+
"id": "prd-gate",
|
|
25
|
+
"conditions": [
|
|
26
|
+
{ "type": "artifact_exists", "artifact": "prd" },
|
|
27
|
+
{ "type": "artifact_approved", "artifact": "prd" }
|
|
28
|
+
],
|
|
29
|
+
"pass": {
|
|
30
|
+
"type": "task",
|
|
31
|
+
"id": "prototype",
|
|
32
|
+
"role": "coordinator",
|
|
33
|
+
"inputArtifacts": ["prd"],
|
|
34
|
+
"beforeDispatch": {
|
|
35
|
+
"inject": ["prd 已通过用户确认。请基于 prd 创建高保真 HTML 原型,展示页面布局、交互流程和状态反馈。"]
|
|
36
|
+
},
|
|
37
|
+
"afterComplete": {
|
|
38
|
+
"inject": ["原型设计完成。请检查 prototype 是否已写入并提交用户审批。"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"fail": {
|
|
42
|
+
"goto": "clarify",
|
|
43
|
+
"maxRetries": 5,
|
|
44
|
+
"onExhausted": "escalate"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "gate",
|
|
49
|
+
"id": "prototype-gate",
|
|
50
|
+
"conditions": [
|
|
51
|
+
{ "type": "artifact_exists", "artifact": "prototype" },
|
|
52
|
+
{ "type": "artifact_approved", "artifact": "prototype" }
|
|
53
|
+
],
|
|
54
|
+
"pass": {
|
|
55
|
+
"type": "task",
|
|
56
|
+
"id": "stories",
|
|
57
|
+
"role": "coordinator",
|
|
58
|
+
"inputArtifacts": ["prd", "prototype"],
|
|
59
|
+
"beforeDispatch": {
|
|
60
|
+
"inject": ["原型已通过用户确认。请基于 prd 和已确认的原型交互设计,撰写 user-stories(用户故事 + 验收标准)。"]
|
|
61
|
+
},
|
|
62
|
+
"afterComplete": {
|
|
63
|
+
"inject": ["用户故事撰写完成。请确认 user-stories 已写入。"]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"fail": {
|
|
67
|
+
"goto": "prototype",
|
|
68
|
+
"maxRetries": 3,
|
|
69
|
+
"onExhausted": "escalate"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "gate",
|
|
74
|
+
"id": "stories-gate",
|
|
75
|
+
"conditions": [
|
|
76
|
+
{ "type": "artifact_exists", "artifact": "user-stories" }
|
|
77
|
+
],
|
|
78
|
+
"pass": {
|
|
79
|
+
"type": "task",
|
|
80
|
+
"id": "design",
|
|
81
|
+
"role": "architect",
|
|
82
|
+
"inputArtifacts": ["prd", "user-stories", "prototype"],
|
|
83
|
+
"beforeDispatch": {
|
|
84
|
+
"inject": ["需求阶段全部完成。请基于 prd、user-stories 和 prototype 进行技术设计,产出 tech-design(技术方案)。"]
|
|
85
|
+
},
|
|
86
|
+
"afterComplete": {
|
|
87
|
+
"inject": ["技术方案设计完成。请确认 tech-design 已写入并提交用户审批。"]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"fail": {
|
|
91
|
+
"goto": "stories",
|
|
92
|
+
"maxRetries": 3,
|
|
93
|
+
"onExhausted": "escalate"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "gate",
|
|
98
|
+
"id": "tech-design-gate",
|
|
99
|
+
"conditions": [
|
|
100
|
+
{ "type": "artifact_exists", "artifact": "tech-design" },
|
|
101
|
+
{ "type": "artifact_approved", "artifact": "tech-design" }
|
|
102
|
+
],
|
|
103
|
+
"pass": {
|
|
104
|
+
"type": "task",
|
|
105
|
+
"id": "design-detail",
|
|
106
|
+
"role": "architect",
|
|
107
|
+
"inputArtifacts": ["prd", "user-stories", "prototype", "tech-design"],
|
|
108
|
+
"beforeDispatch": {
|
|
109
|
+
"inject": ["tech-design 已通过用户确认。请基于已确认的技术方案,继续完成后续设计产出。"]
|
|
110
|
+
},
|
|
111
|
+
"afterComplete": {
|
|
112
|
+
"inject": ["API 设计和任务拆解完成。请确认 api-design 和 task-breakdown 已写入,task-breakdown 需提交用户审批。"]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"fail": {
|
|
116
|
+
"goto": "design",
|
|
117
|
+
"maxRetries": 3,
|
|
118
|
+
"onExhausted": "escalate"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "gate",
|
|
123
|
+
"id": "design-gate",
|
|
124
|
+
"conditions": [
|
|
125
|
+
{ "type": "artifact_exists", "artifact": "api-design" },
|
|
126
|
+
{ "type": "artifact_exists", "artifact": "task-breakdown" },
|
|
127
|
+
{ "type": "artifact_approved", "artifact": "task-breakdown" }
|
|
128
|
+
],
|
|
129
|
+
"pass": {
|
|
130
|
+
"type": "loop",
|
|
131
|
+
"id": "develop-loop",
|
|
132
|
+
"maxIterations": 20,
|
|
133
|
+
"body": {
|
|
134
|
+
"type": "task",
|
|
135
|
+
"id": "develop-batch",
|
|
136
|
+
"role": "developer",
|
|
137
|
+
"inputArtifacts": ["tech-design", "api-design", "task-breakdown", "prd"],
|
|
138
|
+
"beforeDispatch": {
|
|
139
|
+
"inject": ["按 task-breakdown 中的顺序执行开发任务,每次完成 2 条任务后提交代码并汇报。\n\n首次迭代:直接开始前 2 条任务。\n后续迭代:先向用户简要汇报上批完成情况,等用户确认后再继续下 2 条任务。"]
|
|
140
|
+
},
|
|
141
|
+
"afterComplete": {
|
|
142
|
+
"inject": ["本批任务已完成。请检查 task-breakdown,判断是否所有任务都已完成:\n- 如果还有未完成的任务:继续下一轮迭代。\n- 如果所有任务已完成:调用 loop_done 结束开发循环。"]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"fail": {
|
|
147
|
+
"goto": "design-detail",
|
|
148
|
+
"maxRetries": 3,
|
|
149
|
+
"onExhausted": "escalate"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "task",
|
|
154
|
+
"id": "test-plan",
|
|
155
|
+
"role": "tester",
|
|
156
|
+
"inputArtifacts": ["prd", "user-stories", "prototype", "api-design"],
|
|
157
|
+
"beforeDispatch": {
|
|
158
|
+
"inject": ["开发完成。请基于 user-stories 验收标准编写测试计划,产出 test-plan。"]
|
|
159
|
+
},
|
|
160
|
+
"afterComplete": {
|
|
161
|
+
"inject": ["测试计划编写完成。请确认 test-plan 已写入并提交用户审批。"]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"type": "gate",
|
|
166
|
+
"id": "test-plan-gate",
|
|
167
|
+
"conditions": [
|
|
168
|
+
{ "type": "artifact_exists", "artifact": "test-plan" },
|
|
169
|
+
{ "type": "artifact_approved", "artifact": "test-plan" }
|
|
170
|
+
],
|
|
171
|
+
"pass": {
|
|
172
|
+
"type": "task",
|
|
173
|
+
"id": "test-execute",
|
|
174
|
+
"role": "tester",
|
|
175
|
+
"inputArtifacts": ["test-plan", "api-design", "prototype", "code"],
|
|
176
|
+
"beforeDispatch": {
|
|
177
|
+
"inject": ["测试计划已通过用户确认。请按照 test-plan 执行测试,产出 test-report。"]
|
|
178
|
+
},
|
|
179
|
+
"afterComplete": {
|
|
180
|
+
"inject": ["测试执行完成。请确认 test-report 已写入并提交用户审批。"]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"fail": {
|
|
184
|
+
"goto": "test-plan",
|
|
185
|
+
"maxRetries": 3,
|
|
186
|
+
"onExhausted": "escalate"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"type": "gate",
|
|
191
|
+
"id": "test-gate",
|
|
192
|
+
"conditions": [
|
|
193
|
+
{ "type": "artifact_exists", "artifact": "test-report" },
|
|
194
|
+
{ "type": "artifact_approved", "artifact": "test-report" }
|
|
195
|
+
],
|
|
196
|
+
"pass": {
|
|
197
|
+
"type": "task",
|
|
198
|
+
"id": "deliver",
|
|
199
|
+
"role": "coordinator",
|
|
200
|
+
"beforeDispatch": {
|
|
201
|
+
"inject": ["所有测试已通过用户确认,开发流程完成。请向用户做最终交付总结。"]
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"fail": {
|
|
205
|
+
"goto": "develop-loop",
|
|
206
|
+
"maxRetries": 3,
|
|
207
|
+
"onExhausted": "escalate"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
"floatingNodes": [
|
|
38
213
|
{
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
214
|
+
"type": "task",
|
|
215
|
+
"id": "escalate",
|
|
216
|
+
"role": "coordinator",
|
|
217
|
+
"beforeDispatch": {
|
|
218
|
+
"inject": [
|
|
219
|
+
"升级处理:某个流程门控(gate)的重试次数已耗尽,流程无法继续。请检查当前工作流状态(project_status),识别失败的 gate 和对应的条件,与用户沟通决定下一步行动方案。"
|
|
220
|
+
]
|
|
221
|
+
}
|
|
45
222
|
}
|
|
46
223
|
],
|
|
47
|
-
"
|
|
224
|
+
"artifacts": {
|
|
48
225
|
"prd": {
|
|
49
226
|
"name": "需求文档",
|
|
50
|
-
"scale": { "small": "lite", "medium": "full", "large": "full" },
|
|
51
227
|
"review": true,
|
|
52
228
|
"steps": [
|
|
53
229
|
{
|
|
@@ -77,48 +253,34 @@
|
|
|
77
253
|
]
|
|
78
254
|
},
|
|
79
255
|
"user-stories": {
|
|
80
|
-
"name": "用户故事 + 验收标准"
|
|
81
|
-
"scale": { "small": "full", "medium": "full", "large": "full" },
|
|
82
|
-
"review": false
|
|
83
|
-
},
|
|
84
|
-
"fsd": {
|
|
85
|
-
"name": "功能规格",
|
|
86
|
-
"scale": { "small": "skip", "medium": "full", "large": "full" },
|
|
87
|
-
"review": false
|
|
256
|
+
"name": "用户故事 + 验收标准"
|
|
88
257
|
},
|
|
89
258
|
"prototype": {
|
|
90
259
|
"name": "高保真原型",
|
|
91
260
|
"format": "html",
|
|
92
|
-
"scale": { "small": "skip", "medium": "full", "large": "full" },
|
|
93
261
|
"review": true
|
|
94
262
|
},
|
|
95
|
-
"project-plan": {
|
|
96
|
-
"name": "项目计划",
|
|
97
|
-
"scale": { "small": "skip", "medium": "full", "large": "full" },
|
|
98
|
-
"review": false
|
|
99
|
-
},
|
|
100
263
|
"tech-design": {
|
|
101
264
|
"name": "技术方案",
|
|
102
|
-
"
|
|
103
|
-
"review": false,
|
|
265
|
+
"review": true,
|
|
104
266
|
"steps": [
|
|
105
267
|
{
|
|
106
268
|
"id": "analysis",
|
|
107
|
-
"name": "
|
|
269
|
+
"name": "技术分析",
|
|
108
270
|
"format": "json",
|
|
109
271
|
"description": "分析现有代码结构、技术约束、可行方案,输出结构化分析报告"
|
|
110
272
|
},
|
|
111
273
|
{
|
|
112
|
-
"id": "
|
|
113
|
-
"name": "
|
|
274
|
+
"id": "research",
|
|
275
|
+
"name": "技术预研",
|
|
114
276
|
"format": "json",
|
|
115
|
-
"description": "
|
|
277
|
+
"description": "三方对接/外部依赖的可行性验证、风险评估、替代方案"
|
|
116
278
|
},
|
|
117
279
|
{
|
|
118
280
|
"id": "draft",
|
|
119
281
|
"name": "技术方案草稿",
|
|
120
282
|
"format": "md",
|
|
121
|
-
"description": "
|
|
283
|
+
"description": "基于分析和预研结果,生成完整技术方案文档(含技术选型、架构决策、风险评估)"
|
|
122
284
|
},
|
|
123
285
|
{
|
|
124
286
|
"id": "final",
|
|
@@ -129,19 +291,19 @@
|
|
|
129
291
|
]
|
|
130
292
|
},
|
|
131
293
|
"data-model": {
|
|
132
|
-
"name": "数据模型设计"
|
|
133
|
-
"scale": { "small": "skip", "medium": "optional", "large": "full" },
|
|
134
|
-
"review": false
|
|
294
|
+
"name": "数据模型设计"
|
|
135
295
|
},
|
|
136
296
|
"api-design": {
|
|
137
297
|
"name": "API 设计",
|
|
138
|
-
"
|
|
139
|
-
|
|
298
|
+
"description": "内部模块 API 设计:模块划分与职责、公共方法签名(参数、返回值、异常)、模块间依赖与调用关系、数据流转路径。如有对外 HTTP 接口需求,另见 api-contract。"
|
|
299
|
+
},
|
|
300
|
+
"api-contract": {
|
|
301
|
+
"name": "对外接口契约",
|
|
302
|
+
"description": "对外 HTTP 接口定义:路由、请求/响应格式、认证鉴权方案、错误码约定(仅前后端分离或需对外暴露接口的项目)"
|
|
140
303
|
},
|
|
141
304
|
"task-breakdown": {
|
|
142
305
|
"name": "任务拆解",
|
|
143
|
-
"
|
|
144
|
-
"review": false,
|
|
306
|
+
"review": true,
|
|
145
307
|
"steps": [
|
|
146
308
|
{
|
|
147
309
|
"id": "coarse",
|
|
@@ -169,46 +331,17 @@
|
|
|
169
331
|
}
|
|
170
332
|
]
|
|
171
333
|
},
|
|
172
|
-
"risk-assessment": {
|
|
173
|
-
"name": "技术风险评估",
|
|
174
|
-
"scale": { "small": "skip", "medium": "optional", "large": "full" },
|
|
175
|
-
"review": false
|
|
176
|
-
},
|
|
177
334
|
"test-plan": {
|
|
178
335
|
"name": "测试计划",
|
|
179
|
-
"
|
|
180
|
-
"review": false
|
|
336
|
+
"review": true
|
|
181
337
|
},
|
|
182
338
|
"test-report": {
|
|
183
339
|
"name": "测试报告",
|
|
184
|
-
"
|
|
185
|
-
"review": false
|
|
186
|
-
},
|
|
187
|
-
"deploy": {
|
|
188
|
-
"name": "部署文档",
|
|
189
|
-
"scale": { "small": "skip", "medium": "optional", "large": "full" },
|
|
190
|
-
"review": false
|
|
191
|
-
},
|
|
192
|
-
"retrospective": {
|
|
193
|
-
"name": "复盘记录",
|
|
194
|
-
"scale": { "small": "skip", "medium": "optional", "large": "full" },
|
|
195
|
-
"review": false
|
|
340
|
+
"review": true
|
|
196
341
|
},
|
|
197
342
|
"code": {
|
|
198
343
|
"name": "代码实现",
|
|
199
|
-
"
|
|
200
|
-
"scale": { "small": "full", "medium": "full", "large": "full" },
|
|
201
|
-
"review": false
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
"scale_criteria": {
|
|
205
|
-
"description": "PM 根据以下维度判断项目规模",
|
|
206
|
-
"dimensions": {
|
|
207
|
-
"feature_count": { "small": "1-3", "medium": "4-10", "large": "10+" },
|
|
208
|
-
"frontend_backend_split": { "small": false, "medium": "maybe", "large": true },
|
|
209
|
-
"data_persistence": { "small": "none_or_simple", "medium": "yes", "large": "complex" },
|
|
210
|
-
"external_integrations": { "small": "none", "medium": "few", "large": "many" },
|
|
211
|
-
"parallel_developers": { "small": 1, "medium": "1-2", "large": "3+" }
|
|
344
|
+
"unmanaged": true
|
|
212
345
|
}
|
|
213
346
|
}
|
|
214
347
|
}
|
package/build/core/docs.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Document management — read/write files under <data_dir>/<project_name>/iter-<n>/docs/
|
|
3
|
-
*
|
|
4
|
-
* Supports both .md and .html files based on doc format configuration.
|
|
5
|
-
* Also supports step artifact files for sequential mode (e.g. prd.requirements.json).
|
|
6
|
-
*/
|
|
7
|
-
import type { DocDefinition } from './types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Write a document to <data_dir>/<project_name>/iter-<n>/docs/<docId>.<ext>
|
|
10
|
-
*/
|
|
11
|
-
export declare function writeDoc(projectName: string, iteration: number, docId: string, content: string, docDef?: DocDefinition): Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Read a document from <data_dir>/<project_name>/iter-<n>/docs/<docId>.<ext>
|
|
14
|
-
* Tries both .md and .html extensions.
|
|
15
|
-
*/
|
|
16
|
-
export declare function readDoc(projectName: string, iteration: number, docId: string): Promise<string>;
|
|
17
|
-
/**
|
|
18
|
-
* List all documents in <data_dir>/<project_name>/iter-<n>/docs/
|
|
19
|
-
*/
|
|
20
|
-
export declare function listDocs(projectName: string, iteration: number): Promise<string[]>;
|
|
21
|
-
/**
|
|
22
|
-
* Write a step artifact to <data_dir>/<project_name>/iter-<n>/docs/<docId>.<stepId>.<ext>
|
|
23
|
-
*
|
|
24
|
-
* @param format - "json" or "md" (determines file extension)
|
|
25
|
-
* @returns The file path written
|
|
26
|
-
*/
|
|
27
|
-
export declare function writeStepArtifact(projectName: string, iteration: number, docId: string, stepId: string, content: string, format: 'json' | 'md'): Promise<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Read a step artifact from <data_dir>/<project_name>/iter-<n>/docs/<docId>.<stepId>.<ext>
|
|
30
|
-
* Tries .json first, then .md.
|
|
31
|
-
*/
|
|
32
|
-
export declare function readStepArtifact(projectName: string, iteration: number, docId: string, stepId: string): Promise<string>;
|
package/build/core/docs.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Document management — read/write files under <data_dir>/<project_name>/iter-<n>/docs/
|
|
3
|
-
*
|
|
4
|
-
* Supports both .md and .html files based on doc format configuration.
|
|
5
|
-
* Also supports step artifact files for sequential mode (e.g. prd.requirements.json).
|
|
6
|
-
*/
|
|
7
|
-
import { mkdir, readFile, writeFile, readdir } from 'node:fs/promises';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
import { getIterationDir } from './registry.js';
|
|
10
|
-
function docsDir(projectName, iteration) {
|
|
11
|
-
return join(getIterationDir(projectName, iteration), 'docs');
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get file extension for a doc based on its definition.
|
|
15
|
-
*/
|
|
16
|
-
function getDocExtension(docDef) {
|
|
17
|
-
return docDef?.format === 'html' ? '.html' : '.md';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Write a document to <data_dir>/<project_name>/iter-<n>/docs/<docId>.<ext>
|
|
21
|
-
*/
|
|
22
|
-
export async function writeDoc(projectName, iteration, docId, content, docDef) {
|
|
23
|
-
const dir = docsDir(projectName, iteration);
|
|
24
|
-
await mkdir(dir, { recursive: true });
|
|
25
|
-
const ext = getDocExtension(docDef);
|
|
26
|
-
const filePath = join(dir, `${docId}${ext}`);
|
|
27
|
-
await writeFile(filePath, content, 'utf-8');
|
|
28
|
-
return filePath;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Read a document from <data_dir>/<project_name>/iter-<n>/docs/<docId>.<ext>
|
|
32
|
-
* Tries both .md and .html extensions.
|
|
33
|
-
*/
|
|
34
|
-
export async function readDoc(projectName, iteration, docId) {
|
|
35
|
-
const dir = docsDir(projectName, iteration);
|
|
36
|
-
// Try .md first, then .html
|
|
37
|
-
for (const ext of ['.md', '.html']) {
|
|
38
|
-
try {
|
|
39
|
-
return await readFile(join(dir, `${docId}${ext}`), 'utf-8');
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
// try next extension
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
throw new Error(`Document "${docId}" not found`);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* List all documents in <data_dir>/<project_name>/iter-<n>/docs/
|
|
49
|
-
*/
|
|
50
|
-
export async function listDocs(projectName, iteration) {
|
|
51
|
-
const dir = docsDir(projectName, iteration);
|
|
52
|
-
try {
|
|
53
|
-
const files = await readdir(dir);
|
|
54
|
-
return files.filter((f) => f.endsWith('.md') || f.endsWith('.html')).map((f) => f.replace(/\.(md|html)$/, ''));
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// ─── Step Artifact I/O ───
|
|
61
|
-
/**
|
|
62
|
-
* Write a step artifact to <data_dir>/<project_name>/iter-<n>/docs/<docId>.<stepId>.<ext>
|
|
63
|
-
*
|
|
64
|
-
* @param format - "json" or "md" (determines file extension)
|
|
65
|
-
* @returns The file path written
|
|
66
|
-
*/
|
|
67
|
-
export async function writeStepArtifact(projectName, iteration, docId, stepId, content, format) {
|
|
68
|
-
const dir = docsDir(projectName, iteration);
|
|
69
|
-
await mkdir(dir, { recursive: true });
|
|
70
|
-
const ext = format === 'json' ? '.json' : '.md';
|
|
71
|
-
const filePath = join(dir, `${docId}.${stepId}${ext}`);
|
|
72
|
-
await writeFile(filePath, content, 'utf-8');
|
|
73
|
-
return filePath;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Read a step artifact from <data_dir>/<project_name>/iter-<n>/docs/<docId>.<stepId>.<ext>
|
|
77
|
-
* Tries .json first, then .md.
|
|
78
|
-
*/
|
|
79
|
-
export async function readStepArtifact(projectName, iteration, docId, stepId) {
|
|
80
|
-
const dir = docsDir(projectName, iteration);
|
|
81
|
-
for (const ext of ['.json', '.md']) {
|
|
82
|
-
try {
|
|
83
|
-
return await readFile(join(dir, `${docId}.${stepId}${ext}`), 'utf-8');
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
// try next extension
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
throw new Error(`Step artifact "${docId}.${stepId}" not found`);
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=docs.js.map
|
package/build/core/docs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/core/docs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,SAAS,OAAO,CAAC,WAAmB,EAAE,SAAiB;IACnD,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,MAAsB;IAC3C,OAAO,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC1B,WAAmB,EACnB,SAAiB,EACjB,KAAa,EACb,OAAe,EACf,MAAsB;IAEtB,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC5C,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,G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lookup priority:
|
|
5
|
-
* 1. <data_dir>/.workflows/<name>/ (user custom — can override built-in)
|
|
6
|
-
* 2. <package>/workflows/<name>/ (built-in fallback)
|
|
7
|
-
*/
|
|
8
|
-
import type { LoadedWorkflow } from './types.js';
|
|
9
|
-
export declare class WorkflowNotFoundError extends Error {
|
|
10
|
-
constructor(name: string, searched: string[]);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Resolve the actual directory for a workflow name.
|
|
14
|
-
* Custom dir takes priority over built-in dir.
|
|
15
|
-
* Returns the resolved directory path.
|
|
16
|
-
*/
|
|
17
|
-
export declare function resolveWorkflowDir(builtinDir: string, customDir: string, name: string): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Load a single workflow by name using two-layer resolution.
|
|
20
|
-
*
|
|
21
|
-
* @param builtinDir - Package built-in workflows directory
|
|
22
|
-
* @param customDir - User custom workflows directory (<data_dir>/.workflows)
|
|
23
|
-
* @param name - Workflow name (directory name)
|
|
24
|
-
*/
|
|
25
|
-
export declare function loadWorkflow(builtinDir: string, customDir: string, name: string): Promise<LoadedWorkflow>;
|
|
26
|
-
/**
|
|
27
|
-
* List all available workflow names, merging custom and built-in.
|
|
28
|
-
* Custom workflows override built-in ones with the same name.
|
|
29
|
-
*
|
|
30
|
-
* @param builtinDir - Package built-in workflows directory
|
|
31
|
-
* @param customDir - User custom workflows directory (<data_dir>/.workflows)
|
|
32
|
-
*/
|
|
33
|
-
export declare function listWorkflows(builtinDir: string, customDir: string): Promise<string[]>;
|