speccrew 0.6.69 → 0.7.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.
Files changed (134) hide show
  1. package/.speccrew/agents/speccrew-task-worker.md +1 -1
  2. package/.speccrew/agents/speccrew-team-leader.md +336 -189
  3. package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +161 -0
  4. package/.speccrew/skills/speccrew-agentflow-manager/workflow.agentflow.xml +347 -0
  5. package/.speccrew/skills/speccrew-deploy-build/SKILL.md +3 -56
  6. package/.speccrew/skills/speccrew-deploy-build/workflow.agentflow.xml +125 -0
  7. package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +3 -64
  8. package/.speccrew/skills/speccrew-deploy-migrate/workflow.agentflow.xml +135 -0
  9. package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +4 -156
  10. package/.speccrew/skills/speccrew-deploy-smoke-test/workflow.agentflow.xml +178 -0
  11. package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +3 -135
  12. package/.speccrew/skills/speccrew-deploy-startup/workflow.agentflow.xml +223 -0
  13. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +10 -2
  14. package/.speccrew/skills/speccrew-dev-backend/workflow.agentflow.xml +254 -0
  15. package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +10 -2
  16. package/.speccrew/skills/speccrew-dev-desktop-electron/workflow.agentflow.xml +259 -0
  17. package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +10 -2
  18. package/.speccrew/skills/speccrew-dev-desktop-tauri/workflow.agentflow.xml +245 -0
  19. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +10 -2
  20. package/.speccrew/skills/speccrew-dev-frontend/workflow.agentflow.xml +262 -0
  21. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +10 -2
  22. package/.speccrew/skills/speccrew-dev-mobile/workflow.agentflow.xml +244 -0
  23. package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +10 -2
  24. package/.speccrew/skills/speccrew-dev-review-backend/workflow.agentflow.xml +251 -0
  25. package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +10 -2
  26. package/.speccrew/skills/speccrew-dev-review-desktop/workflow.agentflow.xml +214 -0
  27. package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +10 -2
  28. package/.speccrew/skills/speccrew-dev-review-frontend/workflow.agentflow.xml +213 -0
  29. package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +10 -2
  30. package/.speccrew/skills/speccrew-dev-review-mobile/workflow.agentflow.xml +214 -0
  31. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +7 -1
  32. package/.speccrew/skills/speccrew-fd-api-contract/workflow.agentflow.xml +222 -0
  33. package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +7 -1
  34. package/.speccrew/skills/speccrew-fd-feature-analyze/workflow.agentflow.xml +223 -0
  35. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +7 -1
  36. package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +322 -0
  37. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +3 -39
  38. package/.speccrew/skills/speccrew-get-timestamp/workflow.agentflow.xml +43 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +57 -508
  40. package/.speccrew/skills/{speccrew-knowledge-bizs-api-analyze-xml/SKILL.md → speccrew-knowledge-bizs-api-analyze/workflow.agentflow.xml} +1 -154
  41. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +73 -283
  42. package/.speccrew/skills/{speccrew-knowledge-bizs-api-graph-xml/SKILL.md → speccrew-knowledge-bizs-api-graph/workflow.agentflow.xml} +0 -298
  43. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +931 -801
  44. package/.speccrew/skills/{speccrew-knowledge-bizs-dispatch-xml/SKILL.md → speccrew-knowledge-bizs-dispatch/workflow.agentflow.xml} +42 -272
  45. package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +263 -71
  46. package/.speccrew/skills/{speccrew-knowledge-bizs-identify-entries-xml/SKILL.md → speccrew-knowledge-bizs-identify-entries/workflow.agentflow.xml} +8 -184
  47. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +200 -181
  48. package/.speccrew/skills/{speccrew-knowledge-bizs-init-features-xml/SKILL.md → speccrew-knowledge-bizs-init-features/workflow.agentflow.xml} +7 -134
  49. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +5 -89
  50. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/workflow.agentflow.xml +129 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +454 -326
  52. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md → speccrew-knowledge-bizs-ui-analyze/workflow.agentflow.xml} +8 -128
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +302 -247
  54. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-graph-xml/SKILL.md → speccrew-knowledge-bizs-ui-graph/workflow.agentflow.xml} +7 -199
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +267 -156
  56. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md → speccrew-knowledge-bizs-ui-style-extract/workflow.agentflow.xml} +7 -151
  57. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -122
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/workflow.agentflow.xml +106 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -80
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/workflow.agentflow.xml +152 -0
  61. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +371 -265
  62. package/.speccrew/skills/{speccrew-knowledge-module-summarize-xml/SKILL.md → speccrew-knowledge-module-summarize/workflow.agentflow.xml} +7 -197
  63. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +45 -333
  64. package/.speccrew/skills/{speccrew-knowledge-system-summarize-xml/SKILL.md → speccrew-knowledge-system-summarize/workflow.agentflow.xml} +0 -177
  65. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +174 -727
  66. package/.speccrew/skills/{speccrew-knowledge-techs-dispatch-xml/SKILL.md → speccrew-knowledge-techs-dispatch/workflow.agentflow.xml} +10 -351
  67. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +20 -150
  68. package/.speccrew/skills/{speccrew-knowledge-techs-generate-xml/SKILL.md → speccrew-knowledge-techs-generate/workflow.agentflow.xml} +0 -169
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +75 -587
  70. package/.speccrew/skills/{speccrew-knowledge-techs-generate-conventions-xml/SKILL.md → speccrew-knowledge-techs-generate-conventions/workflow.agentflow.xml} +0 -153
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +463 -297
  72. package/.speccrew/skills/{speccrew-knowledge-techs-generate-quality-xml/SKILL.md → speccrew-knowledge-techs-generate-quality/workflow.agentflow.xml} +0 -164
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +57 -292
  74. package/.speccrew/skills/{speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md → speccrew-knowledge-techs-generate-ui-style/workflow.agentflow.xml} +2 -193
  75. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +49 -335
  76. package/.speccrew/skills/{speccrew-knowledge-techs-index-xml/SKILL.md → speccrew-knowledge-techs-index/workflow.agentflow.xml} +0 -167
  77. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +28 -109
  78. package/.speccrew/skills/{speccrew-knowledge-techs-init-xml/SKILL.md → speccrew-knowledge-techs-init/workflow.agentflow.xml} +0 -189
  79. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -487
  80. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/workflow.agentflow.xml +278 -0
  81. package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +3 -71
  82. package/.speccrew/skills/speccrew-pm-knowledge-detector/workflow.agentflow.xml +108 -0
  83. package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +3 -107
  84. package/.speccrew/skills/speccrew-pm-module-initializer/workflow.agentflow.xml +139 -0
  85. package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -115
  86. package/.speccrew/skills/speccrew-pm-module-matcher/workflow.agentflow.xml +146 -0
  87. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +3 -343
  88. package/.speccrew/skills/speccrew-pm-requirement-analysis/workflow.agentflow.xml +174 -0
  89. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +3 -91
  90. package/.speccrew/skills/speccrew-pm-requirement-assess/workflow.agentflow.xml +173 -0
  91. package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +3 -224
  92. package/.speccrew/skills/speccrew-pm-requirement-clarify/workflow.agentflow.xml +159 -0
  93. package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +3 -275
  94. package/.speccrew/skills/speccrew-pm-requirement-model/workflow.agentflow.xml +210 -0
  95. package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +3 -76
  96. package/.speccrew/skills/speccrew-pm-requirement-simple/workflow.agentflow.xml +120 -0
  97. package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +7 -1
  98. package/.speccrew/skills/speccrew-pm-sub-prd-generate/workflow.agentflow.xml +218 -0
  99. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +7 -1
  100. package/.speccrew/skills/speccrew-sd-backend/workflow.agentflow.xml +264 -0
  101. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +7 -1
  102. package/.speccrew/skills/speccrew-sd-desktop/workflow.agentflow.xml +288 -0
  103. package/.speccrew/skills/speccrew-sd-framework-evaluate/SKILL.md +7 -1
  104. package/.speccrew/skills/speccrew-sd-framework-evaluate/workflow.agentflow.xml +235 -0
  105. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +7 -1
  106. package/.speccrew/skills/speccrew-sd-frontend/workflow.agentflow.xml +299 -0
  107. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +7 -1
  108. package/.speccrew/skills/speccrew-sd-mobile/workflow.agentflow.xml +301 -0
  109. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +165 -284
  110. package/.speccrew/skills/speccrew-test-case-design/workflow.agentflow.xml +210 -0
  111. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +204 -324
  112. package/.speccrew/skills/speccrew-test-code-gen/workflow.agentflow.xml +265 -0
  113. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +205 -184
  114. package/.speccrew/skills/speccrew-test-reporter/workflow.agentflow.xml +284 -0
  115. package/.speccrew/skills/speccrew-test-runner/SKILL.md +242 -241
  116. package/.speccrew/skills/speccrew-test-runner/workflow.agentflow.xml +314 -0
  117. package/bin/cli.js +8 -1
  118. package/lib/commands/validate.js +565 -0
  119. package/package.json +1 -1
  120. package/workspace-template/docs/rules/{xml-workflow-spec.md → agentflow-spec.md} +5 -5
  121. package/workspace-template/scripts/validate-agentflow.js +637 -0
  122. package/.speccrew/agents/speccrew-team-leader-xml.md +0 -480
  123. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +0 -99
  124. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +0 -176
  125. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +0 -150
  126. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +0 -106
  127. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +0 -249
  128. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/merge-features.js +0 -300
  129. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +0 -915
  130. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +0 -226
  131. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +0 -34
  132. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +0 -1087
  133. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +0 -26
  134. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +0 -550
@@ -37,283 +37,11 @@ Applies ISA-95 Stages 1-3 as structured analysis framework:
37
37
 
38
38
  ---
39
39
 
40
- # Workflow
40
+ # AgentFlow Definition
41
41
 
42
- ## Absolute Constraints
42
+ <!-- @agentflow: workflow.agentflow.xml -->
43
43
 
44
- > **Violation = task failure**
45
-
46
- 1. **FORBIDDEN:** `create_file` for documents — use `search_replace` on templates
47
- 2. **FORBIDDEN:** Full-file rewrite — use targeted `search_replace`
48
- 3. **MANDATORY:** Template-first workflow
49
-
50
- ## Step 1: Verify Prerequisites
51
-
52
- **MANDATORY:** `.clarification-summary.md` MUST exist in the iteration directory.
53
-
54
- **IF missing → ABORT immediately:**
55
- ```
56
- ❌ ERROR: .clarification-summary.md not found.
57
- Path: {iteration_path}/01.product-requirement/.clarification-summary.md
58
-
59
- This skill requires completed clarification. Please run speccrew-pm-requirement-clarify first.
60
- ```
61
-
62
- **Actions:**
63
- 1. Read `.clarification-summary.md`
64
- 2. Extract: complexity level, key decisions, clarified scope, business rules
65
- 3. IF complexity == "simple" → Skip to Step 4 (minimal module design)
66
-
67
- ## Step 2: ISA-95 Business Modeling (Complex Requirements)
68
-
69
- > ⚠️ **This is a THINKING PROCESS with user checkpoints.**
70
-
71
- ### 2.1 Stage 1 - Domain Description
72
-
73
- **Actions:**
74
- - Define domain boundary (in-scope, out-of-scope)
75
- - Identify external participants (users, systems, agents)
76
- - Create domain glossary (business terms only)
77
-
78
- **Output format:**
79
- ```markdown
80
- ### Domain Description
81
- - **System Boundary**: [what's included/excluded]
82
- - **Actors**: [user roles, external systems]
83
- - **Domain Glossary**:
84
- | Term | Definition |
85
- |------|-----------|
86
- | [term] | [definition] |
87
- ```
88
-
89
- **Checkpoint A:** Present to user for confirmation.
90
- ```
91
- 📝 Domain Description Complete
92
-
93
- System Boundary: [summary]
94
- Actors: [list]
95
-
96
- Does this match your understanding? Reply "确认" to proceed or provide corrections.
97
- ```
98
-
99
- **HARD STOP** — Wait for user confirmation before proceeding.
100
-
101
- ### 2.2 Stage 2 - Functions in Domain (WBS)
102
-
103
- **Actions:**
104
- - Create WBS decomposition (2-3 levels)
105
- - Map functions to business capabilities
106
- - Identify module boundaries
107
-
108
- **Output format:**
109
- ```markdown
110
- ### Domain Functions (WBS)
111
- - Function 1
112
- - Sub-function 1.1
113
- - Sub-function 1.2
114
- - Function 2
115
- - Sub-function 2.1
116
- ```
117
-
118
- ### 2.3 Stage 3 - Functions of Interest (MoSCoW)
119
-
120
- **Actions:**
121
- - Apply MoSCoW prioritization
122
- - Identify core vs non-core functions
123
- - Define MVP scope
124
-
125
- **Output format:**
126
- ```markdown
127
- ### Focus Functions (MoSCoW)
128
- | Priority | Function | Rationale |
129
- |----------|----------|-----------|
130
- | Must | [function] | [why core] |
131
- | Should | [function] | [why important] |
132
- | Could | [function] | [why deferred] |
133
- | Won't | [function] | [why excluded] |
134
- ```
135
-
136
- **Checkpoint B:** Present MVP scope for confirmation.
137
- ```
138
- 📝 MVP Scope Defined
139
-
140
- Must-have (Phase 1): [list]
141
- Should-have (Phase 2): [list]
142
-
143
- Is this prioritization correct? Reply "确认" to proceed.
144
- ```
145
-
146
- **HARD STOP** — Wait for user confirmation.
147
-
148
- **Checkpoint C:** Present complete analysis summary.
149
- ```
150
- 📝 ISA-95 Analysis Complete
151
-
152
- [Summary of all 3 stages]
153
-
154
- Ready to proceed with module decomposition? Reply "确认".
155
- ```
156
-
157
- **HARD STOP** — Wait for final confirmation before Step 3.
158
-
159
- ## Step 3: Module Decomposition & Ordering
160
-
161
- ### 3.1 Define Module List
162
-
163
- **Actions:**
164
- - Map WBS functions to modules
165
- - Define scope for each module
166
- - Identify key entities per module
167
-
168
- **Output format:**
169
- ```markdown
170
- ## Module List (Total: {N} modules)
171
- | Module | Key | Scope | Key Entities | Owner Domain |
172
- |--------|-----|-------|-------------|--------------|
173
- | [Name] | [key] | [scope] | [entities] | [domain] |
174
- ```
175
-
176
- > ⚠️ **MANDATORY:** Replace `{N}` with the actual module count. This count is used by downstream skills for structure validation.
177
-
178
- ### 3.2 Cross-Module Dependency Matrix
179
-
180
- **Actions:**
181
- - Identify data flows between modules
182
- - Document dependency types (Data/API/Event)
183
- - Note shared entities
184
-
185
- **Output format:**
186
- ```markdown
187
- ## Dependency Matrix
188
- | Source Module | Target Module | Type | Description |
189
- |--------------|---------------|------|-------------|
190
- | [A] | [B] | Data | [shared entity] |
191
- ```
192
-
193
- ### 3.3 Implementation Phases
194
-
195
- **Actions:**
196
- - Sort modules by dependency (least dependent first)
197
- - Group into phases (typically 3)
198
- - Validate no circular dependencies
199
-
200
- **Output format:**
201
- ```markdown
202
- ## Implementation Phases
203
- - **Phase 1** (Foundation): [modules with no upstream deps]
204
- - **Phase 2** (Core): [modules depending on Phase 1]
205
- - **Phase 3** (Extension): [remaining modules]
206
- ```
207
-
208
- **User Confirmation:**
209
- ```
210
- 📝 Module Decomposition Complete
211
-
212
- [Module list table]
213
- [Dependency matrix]
214
- [Implementation phases]
215
-
216
- Please review. Reply "确认" to finalize or request changes.
217
- ```
218
-
219
- **HARD STOP** — Wait for user confirmation.
220
-
221
- ## Step 4: Generate .module-design.md
222
-
223
- **Output:** `{iteration_path}/01.product-requirement/.module-design.md`
224
-
225
- **Complete format:**
226
- ```markdown
227
- # Module Design
228
-
229
- ## ISA-95 Analysis Summary
230
-
231
- ### Domain Description
232
- - **System Boundary**: [description]
233
- - **Actors**: [list]
234
- - **Domain Glossary**:
235
- | Term | Definition |
236
- |------|-----------|
237
- | [term] | [definition] |
238
-
239
- ### Domain Functions (WBS)
240
- [WBS structure]
241
-
242
- ### Focus Functions (MoSCoW)
243
- | Priority | Function | Rationale |
244
- |----------|----------|-----------|
245
- | Must | [fn] | [rationale] |
246
- | Should | [fn] | [rationale] |
247
- | Could | [fn] | [rationale] |
248
-
249
- ## Module List (Total: {N} modules)
250
- | Module | Key | Scope | Key Entities | Owner Domain | Phase |
251
- |--------|-----|-------|-------------|--------------|-------|
252
- | [name] | [key] | [scope] | [entities] | [domain] | [1/2/3] |
253
-
254
- ## Dependency Matrix
255
- | Source | Target | Type | Description |
256
- |--------|--------|------|-------------|
257
- | [A] | [B] | [type] | [desc] |
258
-
259
- ## Implementation Phases
260
- - **Phase 1**: [foundation modules]
261
- - **Phase 2**: [dependent modules]
262
- - **Phase 3**: [independent modules]
263
- ```
264
-
265
- **For simple requirements:** Include minimal sections (Domain Description + Module List with 1 module).
266
-
267
- ## Step 5: Update .checkpoints.json
268
-
269
- > ⚠️ **MANDATORY: Use `update-progress.js` script for all JSON files.**
270
-
271
- ```bash
272
- node speccrew-workspace/scripts/update-progress.js write-checkpoint \
273
- --file {iteration_path}/01.product-requirement/.checkpoints.json \
274
- --checkpoint requirement_modeling \
275
- --passed true
276
- ```
277
-
278
- **Generated structure:**
279
- ```json
280
- {
281
- "stage": "01_prd",
282
- "checkpoints": {
283
- "requirement_clarification": { ... },
284
- "requirement_modeling": {
285
- "passed": true,
286
- "confirmed_at": "2026-04-10T12:00:00.000Z",
287
- "description": "ISA-95 modeling and module decomposition completed",
288
- "module_design_file": ".module-design.md",
289
- "isa95_stages": {
290
- "domain_description": true,
291
- "functions_in_domain": true,
292
- "functions_of_interest": true
293
- },
294
- "module_count": 3,
295
- "implementation_phases": 3
296
- }
297
- }
298
- }
299
- ```
300
-
301
- ## Step 6: Output Completion
302
-
303
- ```
304
- ✅ Requirement Modeling Complete
305
-
306
- Module Design File: {path}/.module-design.md
307
- Checkpoint File: {path}/.checkpoints.json
308
-
309
- Summary:
310
- - Complexity: [simple | complex]
311
- - Modules: [count]
312
- - Phases: [count]
313
- - Dependencies: [count]
314
-
315
- Next: Proceed to PRD generation.
316
- ```
44
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
317
45
 
318
46
  ---
319
47
 
@@ -0,0 +1,210 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="requirement-model-main" status="pending" version="1.0" desc="ISA-95 business modeling and module decomposition">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="iteration_path" required="true" type="string" desc="Path to iteration directory"/>
9
+ <field name="clarification_file" required="false" type="string" desc="Path to clarification summary (default: {iteration_path}/01.product-requirement/.clarification-summary.md)"/>
10
+ <field name="language" required="true" type="string" desc="Language code for generated content"/>
11
+ </block>
12
+
13
+ <!-- ============================================================
14
+ Global Constraints
15
+ ============================================================ -->
16
+ <block type="rule" id="R1" level="mandatory" desc="Execution constraints">
17
+ <field name="text">Verify .clarification-summary.md exists before starting</field>
18
+ <field name="text">Use 3 checkpoints (A/B/C) for progressive user confirmation</field>
19
+ <field name="text">Define clear module boundaries with minimal coupling</field>
20
+ <field name="text">Use update-progress.js for JSON files</field>
21
+ </block>
22
+
23
+ <block type="rule" id="R2" level="forbidden" desc="Forbidden actions">
24
+ <field name="text">Skip user checkpoints in complex mode</field>
25
+ <field name="text">Include technical implementation details</field>
26
+ <field name="text">Create circular module dependencies</field>
27
+ <field name="text">Manually write JSON files</field>
28
+ </block>
29
+
30
+ <!-- ============================================================
31
+ Main Processing Sequence
32
+ ============================================================ -->
33
+ <sequence id="S1" name="Requirement Modeling" status="pending" desc="Apply ISA-95 Stages 1-3 for business modeling">
34
+
35
+ <!-- Step 1: Verify Prerequisites -->
36
+ <block type="task" id="B1" action="read-file" desc="Read clarification summary">
37
+ <field name="path" value="${clarification_file}"/>
38
+ <field name="output" var="clarification_content"/>
39
+ </block>
40
+
41
+ <!-- Gateway: Validate prerequisite -->
42
+ <block type="gateway" id="G1" mode="guard" desc="Verify clarification file exists"
43
+ test="${clarification_content} != null"
44
+ fail-action="stop">
45
+ <field name="message">ERROR: .clarification-summary.md not found. Run speccrew-pm-requirement-clarify first.</field>
46
+ </block>
47
+
48
+ <!-- Check complexity -->
49
+ <block type="gateway" id="G2" mode="exclusive" desc="Check complexity level">
50
+ <branch test="${clarification_content.complexity} == 'simple'" name="Simple - Skip to Step 4">
51
+ <block type="task" id="B2" action="analyze" desc="Set simple mode flag">
52
+ <field name="set_var" name="is_simple" value="true"/>
53
+ </block>
54
+ </branch>
55
+ <branch name="Complex - Full ISA-95" default="true">
56
+ <block type="task" id="B3" action="analyze" desc="Set complex mode flag">
57
+ <field name="set_var" name="is_simple" value="false"/>
58
+ </block>
59
+ </branch>
60
+ </block>
61
+
62
+ <!-- Step 2: ISA-95 Business Modeling (Complex Only) -->
63
+ <block type="gateway" id="G3" mode="exclusive" desc="Skip if simple mode">
64
+ <branch test="${is_simple} == false" name="Full ISA-95 Modeling">
65
+ <!-- 2.1 Stage 1 - Domain Description -->
66
+ <block type="task" id="B4" action="analyze" desc="Stage 1: Domain Description">
67
+ <field name="define">
68
+ - System Boundary: what's included/excluded
69
+ - Actors: user roles, external systems
70
+ - Domain Glossary: business terms only
71
+ </field>
72
+ <field name="output" var="domain_description"/>
73
+ </block>
74
+
75
+ <block type="event" id="E1" action="confirm" title="Checkpoint A" type="yesno" desc="Confirm domain description">
76
+ <field name="preview">Domain Description Complete. Does this match your understanding?</field>
77
+ </block>
78
+
79
+ <!-- 2.2 Stage 2 - Functions in Domain (WBS) -->
80
+ <block type="task" id="B5" action="analyze" desc="Stage 2: Functions in Domain (WBS)">
81
+ <field name="create">
82
+ - WBS decomposition (2-3 levels)
83
+ - Map functions to business capabilities
84
+ - Identify module boundaries
85
+ </field>
86
+ <field name="output" var="wbs_structure"/>
87
+ </block>
88
+
89
+ <!-- 2.3 Stage 3 - Functions of Interest (MoSCoW) -->
90
+ <block type="task" id="B6" action="analyze" desc="Stage 3: Functions of Interest (MoSCoW)">
91
+ <field name="apply">
92
+ - MoSCoW prioritization
93
+ - Identify core vs non-core functions
94
+ - Define MVP scope
95
+ </field>
96
+ <field name="output" var="moscow_priorities"/>
97
+ </block>
98
+
99
+ <block type="event" id="E2" action="confirm" title="Checkpoint B" type="yesno" desc="Confirm MVP scope">
100
+ <field name="preview">MVP Scope Defined. Is this prioritization correct?</field>
101
+ </block>
102
+
103
+ <block type="event" id="E3" action="confirm" title="Checkpoint C" type="yesno" desc="Confirm complete analysis">
104
+ <field name="preview">ISA-95 Analysis Complete. Ready to proceed with module decomposition?</field>
105
+ </block>
106
+ </branch>
107
+ <branch test="${is_simple} == true" name="Simple - Minimal Modeling">
108
+ <block type="event" id="E4" action="log" level="info" desc="Log simple mode">
109
+ <field name="message">Simple requirement - skipping full ISA-95 modeling</field>
110
+ </block>
111
+ </branch>
112
+ </block>
113
+
114
+ <!-- Step 3: Module Decomposition & Ordering -->
115
+ <block type="gateway" id="G4" mode="exclusive" desc="Module decomposition">
116
+ <branch test="${is_simple} == false" name="Complex - Full Decomposition">
117
+ <!-- 3.1 Define Module List -->
118
+ <block type="task" id="B7" action="analyze" desc="Define module list">
119
+ <field name="input" value="${wbs_structure}"/>
120
+ <field name="define">
121
+ - Map WBS functions to modules
122
+ - Define scope for each module
123
+ - Identify key entities per module
124
+ </field>
125
+ <field name="output" var="module_list"/>
126
+ </block>
127
+
128
+ <!-- 3.2 Cross-Module Dependency Matrix -->
129
+ <block type="task" id="B8" action="analyze" desc="Build dependency matrix">
130
+ <field name="identify">
131
+ - Data flows between modules
132
+ - Dependency types (Data/API/Event)
133
+ - Shared entities
134
+ </field>
135
+ <field name="output" var="dependency_matrix"/>
136
+ </block>
137
+
138
+ <!-- 3.3 Implementation Phases -->
139
+ <block type="task" id="B9" action="analyze" desc="Determine implementation phases">
140
+ <field name="sort">
141
+ - Sort modules by dependency (least dependent first)
142
+ - Group into phases (typically 3)
143
+ - Validate no circular dependencies
144
+ </field>
145
+ <field name="output" var="implementation_phases"/>
146
+ </block>
147
+
148
+ <block type="event" id="E5" action="confirm" title="Module Decomposition" type="yesno" desc="Confirm module decomposition">
149
+ <field name="preview">Module Decomposition Complete. Please review module list, dependency matrix, and implementation phases.</field>
150
+ </block>
151
+ </branch>
152
+ <branch test="${is_simple} == true" name="Simple - Single Module">
153
+ <block type="task" id="B10" action="analyze" desc="Create minimal module list">
154
+ <field name="create">
155
+ module_list: Single module from clarification
156
+ dependency_matrix: Empty
157
+ implementation_phases: Single phase
158
+ </field>
159
+ <field name="output" var="module_list"/>
160
+ </block>
161
+ </branch>
162
+ </block>
163
+
164
+ <!-- Step 4: Generate .module-design.md -->
165
+ <block type="task" id="B11" action="generate" desc="Generate module design document">
166
+ <field name="output_path" value="${iteration_path}/01.product-requirement/.module-design.md"/>
167
+ <field name="sections">
168
+ - ISA-95 Analysis Summary (if complex)
169
+ - Module List (Total: N modules)
170
+ - Dependency Matrix
171
+ - Implementation Phases
172
+ </field>
173
+ <field name="data">
174
+ domain_description: ${domain_description}
175
+ wbs_structure: ${wbs_structure}
176
+ moscow_priorities: ${moscow_priorities}
177
+ module_list: ${module_list}
178
+ dependency_matrix: ${dependency_matrix}
179
+ implementation_phases: ${implementation_phases}
180
+ </field>
181
+ <field name="output" var="module_design_path"/>
182
+ </block>
183
+
184
+ <!-- Step 5: Update .checkpoints.json -->
185
+ <block type="task" id="B12" action="run-script" desc="Update checkpoints via script">
186
+ <field name="command">node "${workspace_path}/scripts/update-progress.js" write-checkpoint --file "${iteration_path}/01.product-requirement/.checkpoints.json" --checkpoint requirement_modeling --passed true</field>
187
+ <field name="output" var="checkpoint_result"/>
188
+ </block>
189
+
190
+ <!-- Checkpoint: Modeling complete -->
191
+ <block type="checkpoint" id="CP1" name="modeling-complete" desc="Verify modeling completed">
192
+ <field name="file" value="${module_design_path}"/>
193
+ <field name="verify" value="file_exists(${module_design_path})"/>
194
+ </block>
195
+
196
+ </sequence>
197
+
198
+ <!-- ============================================================
199
+ Output Results
200
+ ============================================================ -->
201
+ <block type="output" id="O1" desc="Workflow output results">
202
+ <field name="module_design_file" from="${module_design_path}" type="string" desc="Path to module design file"/>
203
+ <field name="checkpoint_file" value="${iteration_path}/01.product-requirement/.checkpoints.json" type="string" desc="Path to checkpoints file"/>
204
+ <field name="complexity" from="${clarification_content.complexity}" type="string" desc="Complexity level"/>
205
+ <field name="module_count" from="${module_list.count}" type="number" desc="Number of modules"/>
206
+ <field name="phases" from="${implementation_phases.count}" type="number" desc="Number of implementation phases"/>
207
+ <field name="message" value="Requirement modeling completed" type="string" desc="Status message"/>
208
+ </block>
209
+
210
+ </workflow>
@@ -52,84 +52,11 @@ This skill applies ISA-95 Stages 1-3 in lightweight mode:
52
52
 
53
53
  ---
54
54
 
55
- ## Workflow
55
+ ## AgentFlow Definition
56
56
 
57
- ### Step 1: Read Clarification Summary
57
+ <!-- @agentflow: workflow.agentflow.xml -->
58
58
 
59
- **Actions:**
60
- 1. Read `.clarification-summary.md` from `{iteration_path}/01.product-requirement/`
61
- 2. Extract: complexity level, key decisions, clarification Q&A, sufficiency checks
62
-
63
- **Verify complexity:**
64
- - IF complexity = "complex" → STOP and redirect to `speccrew-pm-requirement-analysis`
65
- - IF complexity = "simple" → proceed
66
-
67
- > **ISA-95 Stage 1 Thinking** — Scope boundary already confirmed in clarification. Extract module boundary and impacted roles from summary.
68
-
69
- ### Step 2: Read PRD Template
70
-
71
- **Locate and read the PRD template:**
72
-
73
- 1. **Search** for the template using glob pattern:
74
- ```
75
- **/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md
76
- ```
77
- > Note: Simple requirement skill shares the PRD template with the complex requirement skill.
78
-
79
- 2. **Read** the found template file.
80
-
81
- > ⚠️ **DO NOT search in bizs/, knowledges/, or project source directories.**
82
- > The template is ALWAYS located in the skill's own `templates/` subfolder.
83
- > If glob returns no results, check if speccrew was properly initialized (`speccrew init`).
84
-
85
- ### Step 3: Generate Single PRD
86
-
87
- Create PRD at: `speccrew-workspace/iterations/{iteration}/01.product-requirement/{feature-name}-prd.md`
88
-
89
- > **ISA-95 Stage 2 Thinking** — List only directly affected functions. No full WBS needed.
90
-
91
- **Section filling guidance:**
92
-
93
- | PRD Section | Simple Requirement Approach |
94
- |---|---|
95
- | 1. Background & Goals | 2-3 sentences. What's changing and why. |
96
- | 1.2 Domain Boundary | In-scope: the specific change. Out-of-scope: everything else. |
97
- | 1.3/1.4 Glossary | Only if new business terms introduced. Skip if unnecessary. |
98
- | 2. User Stories | 1-3 user stories maximum. |
99
- | 3. Functional Requirements | Brief description of the change. |
100
- | 3.3 Feature List | Simple table, 1-5 rows. |
101
- | 3.4 Feature Breakdown | 1-5 features. All P0. |
102
- | 4. Non-Functional Requirements | Only if relevant. Skip if not applicable. |
103
- | 5. Acceptance Criteria | 3-5 concrete, testable criteria. |
104
- | 6. Boundary | Clear in/out scope. |
105
- | 7. Assumptions | Only if there are assumptions to document. |
106
-
107
- > ⚠️ **Content Boundary Reminder for each section:**
108
- > - Background & Goals → Business reason only, NO technical architecture
109
- > - User Stories → "As a [role] I want [business action]" — NOT implementation method
110
- > - Functional Requirements → WHAT changes, not HOW to implement
111
- > - Feature List/Breakdown → Feature description is business outcome, NOT technical solution
112
- > - Acceptance Criteria → Business acceptance (e.g., "User can see result"), NOT technical tests (e.g., "API returns 200")
113
-
114
- > **ISA-95 Stage 3 Thinking** — All identified features are Must-have (P0). No MoSCoW filtering needed.
115
-
116
- ### Step 4: Return to PM Agent
117
-
118
- **Output:**
119
- ```
120
- 📄 PRD Generated: {feature-name}-prd.md
121
-
122
- Summary:
123
- - Scope: {brief scope from clarification summary}
124
- - Features: {count} features
125
- - Modules affected: {module names}
126
- - Complexity: simple
127
-
128
- Returning to PM Agent for review and confirmation.
129
- ```
130
-
131
- > **DO NOT wait for user confirmation in this skill.**
132
- > Verification and confirmation are handled by PM Agent Phase 5.
59
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
133
60
 
134
61
  ---
135
62