speccrew 0.6.68 → 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 -1071
  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
@@ -0,0 +1,265 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="test-code-gen-main" status="pending" version="1.0" desc="Generate executable test code from confirmed test case documents">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="test_cases_path" required="true" type="string" desc="Path to test cases document"/>
9
+ <field name="system_design_path" required="false" type="string" desc="Path to system design document"/>
10
+ <field name="output_dir" required="true" type="string" desc="Directory for test code output"/>
11
+ <field name="feature_name" required="true" type="string" desc="Feature name for output file naming"/>
12
+ <field name="platform_id" required="true" type="string" desc="Target platform identifier"/>
13
+ <field name="module" required="true" type="string" desc="Module name for file organization"/>
14
+ </block>
15
+
16
+ <!-- ============================================================
17
+ Global Constraints
18
+ ============================================================ -->
19
+ <block type="rule" id="R1" level="forbidden" desc="Document generation constraints">
20
+ <field name="text">NEVER use create_file to write the test code plan document directly</field>
21
+ <field name="text">MUST copy template first, then fill sections with search_replace for plan document</field>
22
+ <field name="text">NEVER replace entire document content in a single operation</field>
23
+ </block>
24
+
25
+ <block type="rule" id="R2" level="mandatory" desc="Template-first workflow for plan document">
26
+ <field name="text">Copy template MUST execute before filling sections for code plan document</field>
27
+ <field name="text">Test source code files are written directly (NOT template-filled)</field>
28
+ </block>
29
+
30
+ <block type="rule" id="R3" level="mandatory" desc="TC ID traceability">
31
+ <field name="text">Every test function MUST have a TC ID comment</field>
32
+ <field name="text">Format: // TC-{MODULE}-{SEQ}: {description}</field>
33
+ </block>
34
+
35
+ <!-- ============================================================
36
+ Main Processing Sequence
37
+ ============================================================ -->
38
+ <sequence id="S1" name="Test Code Generation" status="pending" desc="Generate test code from test cases">
39
+
40
+ <!-- Step 1: Read Test Cases -->
41
+ <block type="task" id="B1" action="read-file" desc="Read confirmed test case document">
42
+ <field name="path" value="${test_cases_path}"/>
43
+ <field name="output" var="test_cases"/>
44
+ </block>
45
+
46
+ <!-- Step 2: Read Technical Conventions -->
47
+ <block type="task" id="B2" action="read-file" desc="Read platform testing conventions">
48
+ <field name="path" value="speccrew-workspace/knowledges/techs/${platform_id}/conventions-system-test.md"/>
49
+ <field name="optional" value="true"/>
50
+ <field name="output" var="system_test_conventions"/>
51
+ </block>
52
+
53
+ <!-- Fallback: Read unit test conventions -->
54
+ <block type="gateway" id="G1" mode="exclusive" desc="Check if system test conventions found">
55
+ <branch test="${system_test_conventions} == null">
56
+ <block type="task" id="B3" action="read-file" desc="Read unit test conventions as fallback">
57
+ <field name="path" value="speccrew-workspace/knowledges/techs/${platform_id}/conventions-unit-test.md"/>
58
+ <field name="optional" value="true"/>
59
+ <field name="output" var="unit_test_conventions"/>
60
+ </block>
61
+ </branch>
62
+ <branch default="true" name="System conventions found">
63
+ <block type="event" id="E1" action="log" level="info" desc="Log conventions found">
64
+ <field name="message">System test conventions loaded successfully</field>
65
+ </block>
66
+ </branch>
67
+ </block>
68
+
69
+ <!-- Fallback: Read dev conventions -->
70
+ <block type="gateway" id="G2" mode="exclusive" desc="Check if any test conventions found">
71
+ <branch test="${system_test_conventions} == null AND ${unit_test_conventions} == null">
72
+ <block type="task" id="B4" action="read-file" desc="Read dev conventions for framework inference">
73
+ <field name="path" value="speccrew-workspace/knowledges/techs/${platform_id}/conventions-dev.md"/>
74
+ <field name="optional" value="true"/>
75
+ <field name="output" var="dev_conventions"/>
76
+ </block>
77
+ </branch>
78
+ <branch default="true" name="Test conventions found">
79
+ <block type="event" id="E2" action="log" level="info" desc="Log test conventions found">
80
+ <field name="message">Test conventions loaded successfully</field>
81
+ </block>
82
+ </branch>
83
+ </block>
84
+
85
+ <!-- Step 3: Read System Design (if provided) -->
86
+ <block type="gateway" id="G3" mode="exclusive" desc="Check if system design path is provided">
87
+ <branch test="${system_design_path} != null AND ${system_design_path} != ''">
88
+ <block type="task" id="B5" action="read-file" desc="Read system design document">
89
+ <field name="path" value="${system_design_path}"/>
90
+ <field name="output" var="system_design"/>
91
+ </block>
92
+ </branch>
93
+ <branch default="true" name="No System Design">
94
+ <block type="event" id="E3" action="log" level="info" desc="Log system design skip">
95
+ <field name="message">System design path not provided, proceeding without system design</field>
96
+ </block>
97
+ </branch>
98
+ </block>
99
+
100
+ <!-- Step 4: Generate Code Plan -->
101
+ <block type="task" id="B6" action="analyze" desc="Determine file grouping strategy">
102
+ <field name="input_test_cases" value="${test_cases}"/>
103
+ <field name="grouping_rules">
104
+ - IF test cases share same module/component THEN group into single test file
105
+ - IF test cases are independent THEN one test file per test case
106
+ - Maximum test cases per file: 10
107
+ - Naming convention: {module-name}.test.{ext} or {module-name}.spec.{ext}
108
+ </field>
109
+ <field name="output" var="file_grouping_strategy"/>
110
+ </block>
111
+
112
+ <block type="task" id="B7" action="analyze" desc="Plan test file structure">
113
+ <field name="input_grouping" value="${file_grouping_strategy}"/>
114
+ <field name="input_conventions" value="${system_test_conventions}"/>
115
+ <field name="input_unit_conventions" value="${unit_test_conventions}"/>
116
+ <field name="analysis_focus">
117
+ - Files per module
118
+ - Single vs multiple files
119
+ - Integration test separation
120
+ </field>
121
+ <field name="output" var="test_file_structure"/>
122
+ </block>
123
+
124
+ <block type="task" id="B8" action="analyze" desc="Plan shared resources">
125
+ <field name="input_test_cases" value="${test_cases}"/>
126
+ <field name="resource_types">
127
+ - Fixtures: Common test data
128
+ - Helpers: Reusable test utilities
129
+ - Mocks: Shared mock definitions
130
+ </field>
131
+ <field name="output" var="shared_resources_plan"/>
132
+ </block>
133
+
134
+ <block type="task" id="B9" action="analyze" desc="Plan mock/stub strategy">
135
+ <field name="input_system_design" value="${system_design}"/>
136
+ <field name="dependency_types">
137
+ - Database: Mock repository/DAO or use test database
138
+ - External API: Mock HTTP client or use stub server
139
+ - File System: Mock file operations or use temp directory
140
+ - Message Queue: Mock producer/consumer
141
+ - Cache: Mock cache client or use in-memory cache
142
+ </field>
143
+ <field name="output" var="mock_strategy"/>
144
+ </block>
145
+
146
+ <block type="task" id="B10" action="analyze" desc="Create file-to-testcase mapping">
147
+ <field name="input_grouping" value="${file_grouping_strategy}"/>
148
+ <field name="input_test_cases" value="${test_cases}"/>
149
+ <field name="output" var="file_case_mapping"/>
150
+ </block>
151
+
152
+ <!-- Step 5: Checkpoint - Present Code Plan for Confirmation -->
153
+ <block type="task" id="B11" action="generate" desc="Generate code plan summary">
154
+ <field name="file_structure" value="${test_file_structure}"/>
155
+ <field name="shared_resources" value="${shared_resources_plan}"/>
156
+ <field name="mock_strategy" value="${mock_strategy}"/>
157
+ <field name="file_mapping" value="${file_case_mapping}"/>
158
+ <field name="output" var="code_plan_summary"/>
159
+ </block>
160
+
161
+ <block type="event" id="E4" action="confirm" title="Confirm Test Code Plan" type="yesno" desc="Wait for user confirmation before generating code">
162
+ <field name="preview" value="${code_plan_summary}"/>
163
+ <on-confirm>
164
+ <field name="confirmed" value="true"/>
165
+ </on-confirm>
166
+ <on-cancel>
167
+ <field name="workflow.status" value="cancelled"/>
168
+ </on-cancel>
169
+ </block>
170
+
171
+ <!-- Step 6: Generate Test Code -->
172
+ <block type="task" id="B12" action="generate" desc="Generate fixtures">
173
+ <field name="input_resources" value="${shared_resources_plan.fixtures}"/>
174
+ <field name="output_dir" value="${output_dir}/__fixtures__"/>
175
+ <field name="output" var="fixtures_generated"/>
176
+ </block>
177
+
178
+ <block type="task" id="B13" action="generate" desc="Generate helpers">
179
+ <field name="input_resources" value="${shared_resources_plan.helpers}"/>
180
+ <field name="output_dir" value="${output_dir}/__helpers__"/>
181
+ <field name="output" var="helpers_generated"/>
182
+ </block>
183
+
184
+ <block type="task" id="B14" action="generate" desc="Generate mocks">
185
+ <field name="input_strategy" value="${mock_strategy}"/>
186
+ <field name="output_dir" value="${output_dir}/__mocks__"/>
187
+ <field name="output" var="mocks_generated"/>
188
+ </block>
189
+
190
+ <block type="loop" id="L1" over="${file_case_mapping.files}" as="file_mapping" desc="Generate test files">
191
+ <block type="task" id="B15" action="generate" desc="Generate test file ${file_mapping.file_name}">
192
+ <field name="file_mapping" value="${file_mapping}"/>
193
+ <field name="test_cases" value="${test_cases}"/>
194
+ <field name="conventions" value="${system_test_conventions}"/>
195
+ <field name="unit_conventions" value="${unit_test_conventions}"/>
196
+ <field name="tc_annotation_format">// TC-{MODULE}-{SEQ}: {description}</field>
197
+ <field name="test_structure">Arrange-Act-Assert</field>
198
+ <field name="output_path" value="${output_dir}/${file_mapping.file_name}"/>
199
+ <field name="output" var="test_file_generated"/>
200
+ </block>
201
+ </block>
202
+
203
+ <!-- Step 7: Write Code Plan Document -->
204
+ <block type="task" id="B16" action="read-file" desc="Read test code plan template">
205
+ <field name="path" value="speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md"/>
206
+ <field name="output" var="plan_template"/>
207
+ </block>
208
+
209
+ <block type="task" id="B17" action="write-file" desc="Create test code plan document">
210
+ <field name="path" value="${output_dir}/${feature_name}-test-code-plan.md"/>
211
+ <field name="template" value="${plan_template}"/>
212
+ <field name="placeholders">
213
+ - feature_name: ${feature_name}
214
+ - platform_id: ${platform_id}
215
+ - module: ${module}
216
+ - date: ${timestamp}
217
+ </field>
218
+ <field name="output" var="plan_document_created"/>
219
+ </block>
220
+
221
+ <block type="task" id="B18" action="edit-file" desc="Fill File-to-TestCase Mapping section">
222
+ <field name="path" value="${output_dir}/${feature_name}-test-code-plan.md"/>
223
+ <field name="section">File-to-TestCase Mapping</field>
224
+ <field name="content" value="${file_case_mapping}"/>
225
+ </block>
226
+
227
+ <block type="task" id="B19" action="edit-file" desc="Fill Mock Strategy section">
228
+ <field name="path" value="${output_dir}/${feature_name}-test-code-plan.md"/>
229
+ <field name="section">Mock Strategy</field>
230
+ <field name="content" value="${mock_strategy}"/>
231
+ </block>
232
+
233
+ <block type="task" id="B20" action="edit-file" desc="Fill Shared Resources section">
234
+ <field name="path" value="${output_dir}/${feature_name}-test-code-plan.md"/>
235
+ <field name="section">Shared Resources</field>
236
+ <field name="content" value="${shared_resources_plan}"/>
237
+ </block>
238
+
239
+ <block type="task" id="B21" action="edit-file" desc="Fill Test File Structure section">
240
+ <field name="path" value="${output_dir}/${feature_name}-test-code-plan.md"/>
241
+ <field name="section">Test File Structure</field>
242
+ <field name="content" value="${test_file_structure}"/>
243
+ </block>
244
+
245
+ <!-- Checkpoint: Verify outputs -->
246
+ <block type="checkpoint" id="CP1" name="code-generation-complete" desc="Verify test code generation complete">
247
+ <field name="file" value="${output_dir}/${feature_name}-test-code-plan.md"/>
248
+ <field name="verify" value="file_exists(${output_dir}/${feature_name}-test-code-plan.md)"/>
249
+ </block>
250
+
251
+ </sequence>
252
+
253
+ <!-- ============================================================
254
+ Output Results
255
+ ============================================================ -->
256
+ <block type="output" id="O1" desc="Workflow output results">
257
+ <field name="test_code_plan_path" value="${output_dir}/${feature_name}-test-code-plan.md" type="string" desc="Path to test code plan document"/>
258
+ <field name="test_files" from="${file_case_mapping.files}" type="array" desc="List of generated test files"/>
259
+ <field name="fixture_files" from="${fixtures_generated.files}" type="array" desc="List of generated fixture files"/>
260
+ <field name="helper_files" from="${helpers_generated.files}" type="array" desc="List of generated helper files"/>
261
+ <field name="mock_files" from="${mocks_generated.files}" type="array" desc="List of generated mock files"/>
262
+ <field name="total_test_cases" from="${test_cases.count}" type="number" desc="Total number of test cases implemented"/>
263
+ </block>
264
+
265
+ </workflow>