speccrew 0.6.69 → 0.7.1

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 (137) 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/init.js +11 -3
  119. package/lib/commands/update.js +11 -3
  120. package/lib/commands/validate.js +565 -0
  121. package/lib/utils.js +43 -0
  122. package/package.json +1 -1
  123. package/workspace-template/docs/rules/{xml-workflow-spec.md → agentflow-spec.md} +5 -5
  124. package/workspace-template/scripts/validate-agentflow.js +637 -0
  125. package/.speccrew/agents/speccrew-team-leader-xml.md +0 -480
  126. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +0 -99
  127. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +0 -176
  128. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +0 -150
  129. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +0 -106
  130. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +0 -249
  131. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/merge-features.js +0 -300
  132. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +0 -915
  133. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +0 -226
  134. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +0 -34
  135. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +0 -1087
  136. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +0 -26
  137. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +0 -550
@@ -10,7 +10,13 @@ tools: Read, Write, Glob, Grep
10
10
  - Feature Spec has been confirmed, user requests desktop system design
11
11
  - User asks "Create desktop design for this platform" or "Generate desktop module design"
12
12
 
13
- # Workflow
13
+ ## AgentFlow Definition
14
+
15
+ <!-- @agentflow: workflow.agentflow.xml -->
16
+
17
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
18
+
19
+ ## Workflow
14
20
 
15
21
  ## Absolute Constraints
16
22
 
@@ -0,0 +1,288 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="sd-desktop-main" status="pending" version="1.0" desc="Desktop System Design workflow">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="feature_name" required="true" type="string" desc="Feature name"/>
9
+ <field name="platform_id" required="true" type="string" desc="Target platform, e.g., desktop-electron, desktop-tauri"/>
10
+ <field name="iteration_path" required="true" type="string" desc="Absolute path to iteration directory"/>
11
+ <field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew-workspace"/>
12
+ <field name="task_id" required="false" type="string" desc="Task ID from dispatch context"/>
13
+ </block>
14
+
15
+ <!-- ============================================================
16
+ Global Constraints
17
+ ============================================================ -->
18
+ <block type="rule" id="R1" level="forbidden" desc="Document creation constraints">
19
+ <field name="text">NEVER use create_file to write design documents or INDEX directly</field>
20
+ <field name="text">MUST create by copying template then filling with search_replace</field>
21
+ </block>
22
+
23
+ <block type="rule" id="R2" level="forbidden" desc="Full-file rewrite prohibition">
24
+ <field name="text">NEVER replace entire document content in single operation</field>
25
+ <field name="text">ALWAYS use targeted search_replace on specific sections</field>
26
+ </block>
27
+
28
+ <block type="rule" id="R3" level="mandatory" desc="Template-first workflow">
29
+ <field name="text">Copy template MUST execute before fill sections</field>
30
+ <field name="text">Skipping copy and writing content directly is FORBIDDEN</field>
31
+ </block>
32
+
33
+ <block type="rule" id="R4" level="mandatory" desc="Actual framework syntax">
34
+ <field name="text">All pseudo-code MUST use actual framework syntax from techs knowledge</field>
35
+ <field name="text">Include actual import statements and API patterns</field>
36
+ </block>
37
+
38
+ <!-- ============================================================
39
+ Main Processing Sequence
40
+ ============================================================ -->
41
+ <sequence id="S1" name="Desktop System Design" status="pending" desc="Generate desktop detailed design documents">
42
+
43
+ <!-- Step 1: Read Inputs -->
44
+ <block type="task" id="B1" action="read-file" desc="Read Feature Spec document">
45
+ <field name="path">${iteration_path}/02.feature-design/${feature_name}-feature-spec.md</field>
46
+ <field name="output" var="feature_spec"/>
47
+ </block>
48
+
49
+ <block type="task" id="B2" action="read-file" desc="Read API Contract">
50
+ <field name="path">${iteration_path}/02.feature-design/${feature_name}-api-contract.md</field>
51
+ <field name="output" var="api_contract"/>
52
+ </block>
53
+
54
+ <!-- Read Techs Knowledge -->
55
+ <block type="task" id="B3" action="read-file" desc="Read tech-stack.md">
56
+ <field name="path">${workspace_path}/knowledges/techs/${platform_id}/tech-stack.md</field>
57
+ <field name="output" var="tech_stack"/>
58
+ </block>
59
+
60
+ <block type="task" id="B4" action="read-file" desc="Read architecture.md">
61
+ <field name="path">${workspace_path}/knowledges/techs/${platform_id}/architecture.md</field>
62
+ <field name="output" var="architecture"/>
63
+ </block>
64
+
65
+ <block type="task" id="B5" action="read-file" desc="Read conventions-design.md">
66
+ <field name="path">${workspace_path}/knowledges/techs/${platform_id}/conventions-design.md</field>
67
+ <field name="output" var="conventions_design"/>
68
+ </block>
69
+
70
+ <block type="task" id="B6" action="read-file" desc="Read conventions-dev.md">
71
+ <field name="path">${workspace_path}/knowledges/techs/${platform_id}/conventions-dev.md</field>
72
+ <field name="output" var="conventions_dev"/>
73
+ </block>
74
+
75
+ <!-- Step 2: Analyze Existing Code Structure -->
76
+ <block type="task" id="B7" action="analyze" desc="Analyze desktop codebase structure">
77
+ <field name="analysis_targets">
78
+ - Main process: src/main/**/*.{ts,js} or src-tauri/src/**/*.rs
79
+ - Renderer process: src/renderer/**/*.{tsx,vue,html}
80
+ - IPC definitions: src/main/ipc/**/* or src-tauri/src/commands/**/*.rs
81
+ - Window management patterns
82
+ - Preload scripts: src/preload/**/* or preload.{ts,js}
83
+ - Native modules: src/main/native/**/*
84
+ - State management: src/renderer/stores/**/* or src/stores/**/*
85
+ - API layer: src/renderer/apis/**/* or src/apis/**/*
86
+ </field>
87
+ <field name="output" var="codebase_analysis"/>
88
+ </block>
89
+
90
+ <!-- Step 3: Extract Functions from Feature Spec -->
91
+ <block type="task" id="B8" action="analyze" desc="Extract desktop functions">
92
+ <field name="input" value="${feature_spec}">${api_contract}</field>
93
+ <field name="extraction_rules">
94
+ - Parse Feature Spec Section 2.N pattern
95
+ - Extract UI prototype for each function
96
+ - Extract interaction flow
97
+ - Extract backend API calls from API Contract
98
+ - Extract local operations (file system, native API, local DB)
99
+ - Extract data requirements
100
+ - Mark components as [EXISTING], [MODIFIED], or [NEW]
101
+ </field>
102
+ <field name="output" var="extracted_functions"/>
103
+ </block>
104
+
105
+ <!-- Checkpoint A: Present function extraction summary -->
106
+ <block type="event" id="E1" action="confirm" title="Function Extraction Confirmation" type="yesno" desc="Present function extraction summary">
107
+ <field name="preview">Desktop Functions Extracted for: ${feature_name}
108
+ Platform: ${platform_id}
109
+
110
+ Function Extraction Summary:
111
+ ${extracted_functions.summary}
112
+
113
+ Component Markers:
114
+ - [NEW]: ${extracted_functions.new_count} components
115
+ - [MODIFIED]: ${extracted_functions.modified_count} components
116
+ - [EXISTING]: ${extracted_functions.existing_count} components
117
+
118
+ Confirm function extraction before proceeding?</field>
119
+ </block>
120
+
121
+ <!-- Step 4: Generate Module Design Documents -->
122
+ <block type="task" id="B9" action="read-file" desc="Read design template">
123
+ <field name="path">speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md</field>
124
+ <field name="output" var="design_template"/>
125
+ </block>
126
+
127
+ <!-- Loop: Generate design for each function -->
128
+ <block type="loop" id="L1" over="${extracted_functions.functions}" as="function" desc="Generate module design documents">
129
+ <block type="task" id="B10" action="generate" desc="Copy template and create document">
130
+ <field name="template" value="${design_template}"/>
131
+ <field name="placeholders">
132
+ - {Module Name} → ${function.module_name}
133
+ - {Feature Name} → ${feature_name}
134
+ - {Platform ID} → ${platform_id}
135
+ </field>
136
+ <field name="output_path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
137
+ <field name="output" var="module_doc_created"/>
138
+ </block>
139
+
140
+ <block type="task" id="B11" action="edit-file" desc="Fill Process Architecture section">
141
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
142
+ <field name="operation">search_replace</field>
143
+ <field name="content_source">${architecture}${tech_stack}</field>
144
+ <field name="section">Process Architecture</field>
145
+ </block>
146
+
147
+ <block type="task" id="B12" action="edit-file" desc="Fill IPC Channels section">
148
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
149
+ <field name="operation">search_replace</field>
150
+ <field name="content_source">${conventions_design}${function}</field>
151
+ <field name="section">IPC Channels</field>
152
+ </block>
153
+
154
+ <block type="task" id="B13" action="edit-file" desc="Fill Window Design section">
155
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
156
+ <field name="operation">search_replace</field>
157
+ <field name="content_source">${feature_spec}${conventions_design}</field>
158
+ <field name="section">Window Design</field>
159
+ </block>
160
+
161
+ <block type="task" id="B14" action="edit-file" desc="Fill Native Integration section">
162
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
163
+ <field name="operation">search_replace</field>
164
+ <field name="content_source">${function}${tech_stack}</field>
165
+ <field name="section">Native Integration</field>
166
+ </block>
167
+
168
+ <block type="task" id="B15" action="edit-file" desc="Fill Local Storage section">
169
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
170
+ <field name="operation">search_replace</field>
171
+ <field name="content_source">${conventions_data}</field>
172
+ <field name="section">Local Storage</field>
173
+ </block>
174
+
175
+ <block type="task" id="B16" action="edit-file" desc="Fill Security section">
176
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
177
+ <field name="operation">search_replace</field>
178
+ <field name="content_source">${architecture}${conventions_design}</field>
179
+ <field name="section">Security</field>
180
+ </block>
181
+
182
+ <block type="task" id="B17" action="edit-file" desc="Fill Auto-update section">
183
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
184
+ <field name="operation">search_replace</field>
185
+ <field name="content_source">${tech_stack}</field>
186
+ <field name="section">Auto-update</field>
187
+ </block>
188
+
189
+ <block type="task" id="B18" action="edit-file" desc="Fill Pseudo-code section">
190
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/${function.module_name}-design.md</field>
191
+ <field name="operation">search_replace</field>
192
+ <field name="content_source">${conventions_dev}${function}</field>
193
+ <field name="section">Pseudo-code</field>
194
+ </block>
195
+ </block>
196
+
197
+ <!-- Step 5: Generate Platform INDEX.md -->
198
+ <block type="task" id="B19" action="read-file" desc="Read index template">
199
+ <field name="path">speccrew-sd-desktop/templates/INDEX-TEMPLATE.md</field>
200
+ <field name="output" var="index_template"/>
201
+ </block>
202
+
203
+ <block type="task" id="B20" action="generate" desc="Create INDEX.md from template">
204
+ <field name="template" value="${index_template}"/>
205
+ <field name="placeholders">
206
+ - {Platform Name} → ${platform_id}
207
+ - {Feature Name} → ${feature_name}
208
+ </field>
209
+ <field name="output_path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
210
+ </block>
211
+
212
+ <block type="task" id="B21" action="edit-file" desc="Fill Tech Stack Summary">
213
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
214
+ <field name="operation">search_replace</field>
215
+ <field name="content_source">${tech_stack}</field>
216
+ <field name="section">Tech Stack Summary</field>
217
+ </block>
218
+
219
+ <block type="task" id="B22" action="edit-file" desc="Fill Target Operating Systems">
220
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
221
+ <field name="operation">search_replace</field>
222
+ <field name="content_source">${tech_stack}</field>
223
+ <field name="section">Target Operating Systems</field>
224
+ </block>
225
+
226
+ <block type="task" id="B23" action="edit-file" desc="Fill Process Architecture Strategy">
227
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
228
+ <field name="operation">search_replace</field>
229
+ <field name="content_source">${architecture}</field>
230
+ <field name="section">Process Architecture Strategy</field>
231
+ </block>
232
+
233
+ <block type="task" id="B24" action="edit-file" desc="Fill IPC Patterns">
234
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
235
+ <field name="operation">search_replace</field>
236
+ <field name="content_source">${conventions_design}</field>
237
+ <field name="section">IPC Patterns</field>
238
+ </block>
239
+
240
+ <block type="task" id="B25" action="edit-file" desc="Fill Security Model">
241
+ <field name="path">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
242
+ <field name="operation">search_replace</field>
243
+ <field name="content_source">${architecture}</field>
244
+ <field name="section">Security Model</field>
245
+ </block>
246
+
247
+ <!-- Step 6: Present Summary -->
248
+ <block type="event" id="E2" action="log" level="info" desc="Present design summary">
249
+ <field name="message">Desktop System Design Summary for: ${feature_name}
250
+ Platform: ${platform_id}
251
+ Framework: ${tech_stack.framework}
252
+
253
+ Module Design Documents: ${extracted_functions.design_count}
254
+ ${extracted_functions.file_list}
255
+
256
+ Key Design Decisions:
257
+ - Process Architecture: ${architecture.process_model}
258
+ - IPC Strategy: ${conventions_design.ipc_pattern}
259
+ - State Management: ${conventions_design.state_management}
260
+ - Security Model: ${architecture.security_model}
261
+ - Auto-Update: ${tech_stack.updater}
262
+
263
+ Please confirm:
264
+ 1. Are the process architectures appropriate?
265
+ 2. Is the IPC communication design correct?
266
+ 3. Do the pseudo-code patterns match project conventions?
267
+ 4. Are all API calls from API Contract covered?
268
+ 5. Is the native integration approach suitable?</field>
269
+ </block>
270
+
271
+ </sequence>
272
+
273
+ <!-- ============================================================
274
+ Output Results
275
+ ============================================================ -->
276
+ <block type="output" id="O1" desc="Workflow output results">
277
+ <field name="status" value="SUCCESS" type="string" desc="Task completion status"/>
278
+ <field name="task_id" from="${task_id}" type="string" desc="Task ID"/>
279
+ <field name="platform" value="${platform_id}" type="string" desc="Target platform"/>
280
+ <field name="feature" value="${feature_name}" type="string" desc="Feature name"/>
281
+ <field name="output_files" type="array" desc="List of generated files">
282
+ <field name="file">${iteration_path}/03.system-design/${platform_id}/INDEX.md</field>
283
+ <field name="files" from="${extracted_functions.output_files}"/>
284
+ </field>
285
+ <field name="summary" value="Desktop system design completed for ${feature_name} on ${platform_id}" type="string" desc="Completion summary"/>
286
+ </block>
287
+
288
+ </workflow>
@@ -10,7 +10,13 @@ tools: Read, Write, Glob, Grep
10
10
  - User requests framework evaluation for current iteration
11
11
  - Need to assess technology stack gaps before system design
12
12
 
13
- # Workflow
13
+ ## AgentFlow Definition
14
+
15
+ <!-- @agentflow: workflow.agentflow.xml -->
16
+
17
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
18
+
19
+ ## Workflow
14
20
 
15
21
  ## Absolute Constraints
16
22
 
@@ -0,0 +1,235 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="sd-framework-evaluate-main" status="pending" version="1.0" desc="Framework Evaluation workflow">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="feature_spec_paths" required="true" type="array" desc="Array of Feature Spec file paths"/>
9
+ <field name="api_contract_paths" required="true" type="array" desc="Array of API Contract file paths"/>
10
+ <field name="techs_knowledge_paths" required="true" type="object" desc="Platform_id to knowledge paths mapping"/>
11
+ <field name="iteration_path" required="true" type="string" desc="Current iteration directory path"/>
12
+ <field name="output_path" required="false" type="string" desc="Output file path (default: iteration_path/03.system-design/framework-evaluation.md)"/>
13
+ <field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew-workspace"/>
14
+ </block>
15
+
16
+ <!-- ============================================================
17
+ Global Constraints
18
+ ============================================================ -->
19
+ <block type="rule" id="R1" level="forbidden" desc="Read-only inputs">
20
+ <field name="text">NEVER modify Feature Spec or API Contract documents</field>
21
+ <field name="text">Only read for analysis</field>
22
+ </block>
23
+
24
+ <block type="rule" id="R2" level="forbidden" desc="Read-only techs knowledge">
25
+ <field name="text">NEVER modify techs knowledge files</field>
26
+ <field name="text">Only read for capability assessment</field>
27
+ </block>
28
+
29
+ <block type="rule" id="R3" level="mandatory" desc="Evidence-based evaluation">
30
+ <field name="text">Every recommendation MUST cite specific Feature Spec requirements</field>
31
+ <field name="text">Every recommendation MUST cite specific tech stack limitations</field>
32
+ </block>
33
+
34
+ <block type="rule" id="R4" level="forbidden" desc="No assumptions">
35
+ <field name="text">DO NOT assume framework capabilities</field>
36
+ <field name="text">Only recommend frameworks with documented capabilities</field>
37
+ </block>
38
+
39
+ <!-- ============================================================
40
+ Main Processing Sequence
41
+ ============================================================ -->
42
+ <sequence id="S1" name="Framework Evaluation" status="pending" desc="Evaluate frameworks and generate report">
43
+
44
+ <!-- Step 1: Read Inputs -->
45
+ <!-- Loop: Read all Feature Spec documents -->
46
+ <block type="loop" id="L1" over="${feature_spec_paths}" as="spec_path" desc="Read all Feature Spec documents">
47
+ <block type="task" id="B1" action="read-file" desc="Read Feature Spec">
48
+ <field name="path" value="${spec_path}"/>
49
+ <field name="output" var="feature_spec_${index}"/>
50
+ </block>
51
+ </block>
52
+
53
+ <!-- Loop: Read all API Contract documents -->
54
+ <block type="loop" id="L2" over="${api_contract_paths}" as="contract_path" desc="Read all API Contract documents">
55
+ <block type="task" id="B2" action="read-file" desc="Read API Contract">
56
+ <field name="path" value="${contract_path}"/>
57
+ <field name="output" var="api_contract_${index}"/>
58
+ </block>
59
+ </block>
60
+
61
+ <!-- Loop: Read techs knowledge per platform -->
62
+ <block type="loop" id="L3" over="${techs_knowledge_paths}" as="platform" desc="Read techs knowledge per platform">
63
+ <block type="task" id="B3" action="read-file" desc="Read tech-stack.md">
64
+ <field name="path">${platform.path}/tech-stack.md</field>
65
+ <field name="output" var="tech_stack_${platform.id}"/>
66
+ </block>
67
+
68
+ <block type="task" id="B4" action="read-file" desc="Read architecture.md">
69
+ <field name="path">${platform.path}/architecture.md</field>
70
+ <field name="output" var="architecture_${platform.id}"/>
71
+ </block>
72
+
73
+ <block type="task" id="B5" action="read-file" desc="Read conventions-design.md">
74
+ <field name="path">${platform.path}/conventions-design.md</field>
75
+ <field name="output" var="conventions_design_${platform.id}"/>
76
+ </block>
77
+
78
+ <block type="task" id="B6" action="read-file" desc="Read conventions-dev.md">
79
+ <field name="path">${platform.path}/conventions-dev.md</field>
80
+ <field name="output" var="conventions_dev_${platform.id}"/>
81
+ </block>
82
+ </block>
83
+
84
+ <!-- Step 2: Gap Analysis -->
85
+ <block type="task" id="B7" action="analyze" desc="Extract requirements from Feature Specs">
86
+ <field name="input" value="${feature_specs}">${api_contracts}</field>
87
+ <field name="extraction_rules">
88
+ Extract requirements for:
89
+ - Real-time features (WebSocket, SSE, push notifications)
90
+ - File processing (upload, download, preview, conversion)
91
+ - Data visualization (charts, dashboards, reports)
92
+ - Rich text / editor features
93
+ - Map / geolocation features
94
+ - Payment / third-party integrations
95
+ - Search / filtering / pagination patterns
96
+ - Media processing (image, video, audio)
97
+ - Communication protocols (REST, GraphQL, WebSocket, gRPC)
98
+ - Authentication patterns (JWT, OAuth, Session)
99
+ - Data formats (JSON, protobuf, multipart)
100
+ </field>
101
+ <field name="output" var="requirements"/>
102
+ </block>
103
+
104
+ <!-- Step 2.1: Build Capability Matrix -->
105
+ <block type="task" id="B8" action="analyze" desc="Build capability matrix">
106
+ <field name="input" value="${requirements}">${tech_stacks}</field>
107
+ <field name="analysis_rules">
108
+ For each requirement, evaluate against current tech stack:
109
+ - Requirement Category
110
+ - Specific Requirement
111
+ - Source (Feature ID)
112
+ - Current Stack Support (YES/NO/PARTIAL)
113
+ - Gap? (YES/NO)
114
+ </field>
115
+ <field name="output" var="capability_matrix"/>
116
+ </block>
117
+
118
+ <!-- Step 2.2: Categorize Gaps -->
119
+ <block type="task" id="B9" action="analyze" desc="Categorize gaps by severity">
120
+ <field name="input" value="${capability_matrix}"/>
121
+ <field name="categorization_rules">
122
+ - Critical Gaps: Core functionality cannot be implemented
123
+ - Enhancement Gaps: Functionality possible but better with library
124
+ - Optional Gaps: Nice-to-have improvements
125
+ </field>
126
+ <field name="output" var="categorized_gaps"/>
127
+ </block>
128
+
129
+ <!-- Step 3: Framework Research -->
130
+ <block type="gateway" id="G1" mode="exclusive" desc="Check if gaps exist">
131
+ <branch test="${categorized_gaps.critical_count} == 0 AND ${categorized_gaps.enhancement_count} == 0" name="No gaps found">
132
+ <block type="event" id="E1" action="log" level="info" desc="No framework gaps found">
133
+ <field name="message">All Feature Spec requirements can be implemented with current tech stack. No new frameworks needed.</field>
134
+ </block>
135
+ </branch>
136
+ <branch default="true" name="Gaps found - research frameworks">
137
+ <!-- Loop: Evaluate candidates for each gap -->
138
+ <block type="loop" id="L4" over="${categorized_gaps.gaps}" as="gap" desc="Evaluate framework candidates">
139
+ <block type="task" id="B10" action="analyze" desc="Evaluate framework candidates">
140
+ <field name="input" value="${gap}"/>
141
+ <field name="evaluation_criteria">
142
+ - Functionality Fit: Does it solve the gap?
143
+ - License: MIT, Apache 2.0, BSD preferred (flag GPL)
144
+ - Maturity: GitHub stars, downloads, last release
145
+ - Bundle Size: Impact on frontend bundle
146
+ - Integration Complexity: Code modification needed
147
+ - Community & Docs: Documentation quality, support
148
+ </field>
149
+ <field name="output" var="framework_evaluation_${gap.id}"/>
150
+ </block>
151
+
152
+ <block type="task" id="B11" action="analyze" desc="Make primary recommendation">
153
+ <field name="input" value="${framework_evaluation_${gap.id}}"/>
154
+ <field name="selection_rules">
155
+ - Select single primary recommendation
156
+ - Provide justification
157
+ - List alternatives considered
158
+ </field>
159
+ <field name="output" var="recommendation_${gap.id}"/>
160
+ </block>
161
+ </block>
162
+ </branch>
163
+ </block>
164
+
165
+ <!-- Step 4: Generate Report -->
166
+ <block type="gateway" id="G2" mode="exclusive" desc="Select report structure">
167
+ <branch test="${categorized_gaps.critical_count} == 0 AND ${categorized_gaps.enhancement_count} == 0" name="Simplified report">
168
+ <block type="task" id="B12" action="generate" desc="Generate simplified report">
169
+ <field name="template">speccrew-sd-framework-evaluate/templates/FRAMEWORK-EVALUATION-SIMPLE-TEMPLATE.md</field>
170
+ <field name="output_path">${output_path}</field>
171
+ <field name="data">
172
+ - feature_count: ${feature_spec_paths.length}
173
+ - platform_count: ${techs_knowledge_paths.length}
174
+ - capabilities_confirmed: ${capability_matrix.supported}
175
+ </field>
176
+ </block>
177
+ </branch>
178
+ <branch default="true" name="Full report with recommendations">
179
+ <block type="task" id="B13" action="generate" desc="Generate full framework evaluation report">
180
+ <field name="template">speccrew-sd-framework-evaluate/templates/FRAMEWORK-EVALUATION-TEMPLATE.md</field>
181
+ <field name="output_path">${output_path}</field>
182
+ <field name="data">
183
+ - iteration_name: ${iteration_path}
184
+ - feature_count: ${feature_spec_paths.length}
185
+ - platform_count: ${techs_knowledge_paths.length}
186
+ - gap_count: ${categorized_gaps.total_count}
187
+ - framework_count: ${recommendations.length}
188
+ - capability_matrix: ${capability_matrix}
189
+ - categorized_gaps: ${categorized_gaps}
190
+ - recommendations: ${recommendations}
191
+ </field>
192
+ </block>
193
+ </branch>
194
+ </block>
195
+
196
+ <!-- Step 5: Output Task Completion Report -->
197
+ <block type="gateway" id="G3" mode="exclusive" desc="Output completion report">
198
+ <branch test="${categorized_gaps.critical_count} == 0 AND ${categorized_gaps.enhancement_count} == 0" name="No gaps success">
199
+ <block type="event" id="E2" action="log" level="info" desc="Output success report">
200
+ <field name="message">--- TASK COMPLETION REPORT ---
201
+ Task: Framework Evaluation
202
+ Status: SUCCESS
203
+ Output: ${output_path}
204
+ Gaps Found: 0
205
+ Frameworks Recommended: 0
206
+ --- END REPORT ---</field>
207
+ </block>
208
+ </branch>
209
+ <branch default="true" name="Gaps found success">
210
+ <block type="event" id="E3" action="log" level="info" desc="Output success report with gaps">
211
+ <field name="message">--- TASK COMPLETION REPORT ---
212
+ Task: Framework Evaluation
213
+ Status: SUCCESS
214
+ Output: ${output_path}
215
+ Gaps Found: ${categorized_gaps.total_count}
216
+ Frameworks Recommended: ${recommendations.length}
217
+ --- END REPORT ---</field>
218
+ </block>
219
+ </branch>
220
+ </block>
221
+
222
+ </sequence>
223
+
224
+ <!-- ============================================================
225
+ Output Results
226
+ ============================================================ -->
227
+ <block type="output" id="O1" desc="Workflow output results">
228
+ <field name="report_path" value="${output_path}" type="string" desc="Path to framework evaluation report"/>
229
+ <field name="gaps_found" from="${categorized_gaps.total_count}" type="number" desc="Number of capability gaps found"/>
230
+ <field name="frameworks_recommended" from="${recommendations.length}" type="number" desc="Number of frameworks recommended"/>
231
+ <field name="critical_gaps" from="${categorized_gaps.critical_count}" type="number" desc="Number of critical gaps"/>
232
+ <field name="enhancement_gaps" from="${categorized_gaps.enhancement_count}" type="number" desc="Number of enhancement gaps"/>
233
+ </block>
234
+
235
+ </workflow>
@@ -10,7 +10,13 @@ tools: Read, Write, Glob, Grep
10
10
  - Feature Spec has been confirmed, user requests frontend system design
11
11
  - User asks "Create frontend design for this platform" or "Generate frontend module design"
12
12
 
13
- # Workflow
13
+ ## AgentFlow Definition
14
+
15
+ <!-- @agentflow: workflow.agentflow.xml -->
16
+
17
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
18
+
19
+ ## Workflow
14
20
 
15
21
  ## Absolute Constraints
16
22