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
@@ -0,0 +1,314 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="test-runner-main" status="pending" version="1.0" desc="Execute test code, parse results, and detect deviations between expected and actual outcomes">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="test_code_plan_path" required="true" type="string" desc="Path to test code plan document with test file mappings"/>
9
+ <field name="test_cases_path" required="true" type="string" desc="Path to test cases document with expected results"/>
10
+ <field name="output_dir" required="true" type="string" desc="Directory for execution results 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
+ </block>
14
+
15
+ <!-- ============================================================
16
+ Global Constraints
17
+ ============================================================ -->
18
+ <block type="rule" id="R1" level="mandatory" desc="Environment verification">
19
+ <field name="text">Always verify environment before running tests - never skip pre-checks</field>
20
+ <field name="text">Capture both stdout and stderr for diagnostics</field>
21
+ </block>
22
+
23
+ <block type="rule" id="R2" level="mandatory" desc="TC ID traceability">
24
+ <field name="text">Every test result must be traced back to its TC ID</field>
25
+ <field name="text">Extract TC IDs from test file comments</field>
26
+ </block>
27
+
28
+ <block type="rule" id="R3" level="forbidden" desc="Report generation restriction">
29
+ <field name="text">This skill does NOT generate human-readable reports or bug documents</field>
30
+ <field name="text">Output must be structured data for downstream consumption</field>
31
+ </block>
32
+
33
+ <!-- ============================================================
34
+ Main Processing Sequence
35
+ ============================================================ -->
36
+ <sequence id="S1" name="Test Execution" status="pending" desc="Execute tests and generate structured results">
37
+
38
+ <!-- Step 1: Read Inputs -->
39
+ <block type="task" id="B1" action="read-file" desc="Read test code plan document">
40
+ <field name="path" value="${test_code_plan_path}"/>
41
+ <field name="output" var="test_code_plan"/>
42
+ </block>
43
+
44
+ <block type="task" id="B2" action="read-file" desc="Read test cases document">
45
+ <field name="path" value="${test_cases_path}"/>
46
+ <field name="output" var="test_cases"/>
47
+ </block>
48
+
49
+ <!-- Step 2: Environment Pre-check -->
50
+ <block type="task" id="B3" action="run-script" desc="Check runtime availability">
51
+ <field name="command">
52
+ <platform id="frontend">node --version</platform>
53
+ <platform id="backend-node">node --version</platform>
54
+ <platform id="backend-python">python --version</platform>
55
+ <platform id="default">echo "Runtime check for ${platform_id}"</platform>
56
+ </field>
57
+ <field name="output" var="runtime_check"/>
58
+ </block>
59
+
60
+ <block type="task" id="B4" action="run-script" desc="Check test dependencies">
61
+ <field name="command">
62
+ <platform id="frontend">npm ls jest 2&gt;nul || npm ls vitest 2&gt;nul</platform>
63
+ <platform id="backend-node">npm ls jest 2&gt;nul || npm ls mocha 2&gt;nul</platform>
64
+ <platform id="backend-python">pip show pytest</platform>
65
+ <platform id="default">echo "Dependency check for ${platform_id}"</platform>
66
+ </field>
67
+ <field name="output" var="dependency_check"/>
68
+ </block>
69
+
70
+ <block type="task" id="B5" action="analyze" desc="Check test configuration files">
71
+ <field name="platform_id" value="${platform_id}"/>
72
+ <field name="framework" value="${test_code_plan.framework}"/>
73
+ <field name="config_files">
74
+ - Jest: jest.config.js, jest.config.ts, or jest field in package.json
75
+ - Vitest: vitest.config.ts or vite.config.ts with test section
76
+ - Pytest: pytest.ini, pyproject.toml, or setup.cfg
77
+ - JUnit: junit.xml or build tool configuration
78
+ </field>
79
+ <field name="output" var="config_check"/>
80
+ </block>
81
+
82
+ <block type="task" id="B6" action="analyze" desc="Check service dependencies">
83
+ <field name="test_code_plan" value="${test_code_plan}"/>
84
+ <field name="check_items">
85
+ - Database service running
86
+ - API server running
87
+ - Mock services configured
88
+ </field>
89
+ <field name="output" var="service_check"/>
90
+ </block>
91
+
92
+ <!-- Gateway: Stop if environment check fails -->
93
+ <block type="gateway" id="G1" mode="guard" desc="Validate environment pre-check"
94
+ test="${runtime_check.success} == true AND ${dependency_check.success} == true AND ${config_check.exists} == true"
95
+ fail-action="stop">
96
+ <field name="message">Environment pre-check failed. Runtime: ${runtime_check.success}, Dependencies: ${dependency_check.success}, Config: ${config_check.exists}</field>
97
+ </block>
98
+
99
+ <!-- Step 3: Execute Tests -->
100
+ <block type="task" id="B7" action="analyze" desc="Determine test command">
101
+ <field name="platform_id" value="${platform_id}"/>
102
+ <field name="framework" value="${test_code_plan.framework}"/>
103
+ <field name="command_mapping">
104
+ - Frontend/Jest: npm test -- --json --outputFile=test-results.json
105
+ - Frontend/Vitest: npx vitest run --reporter=json --outputFile=test-results.json
106
+ - Backend/Jest: npm test -- --json --outputFile=test-results.json
107
+ - Backend/Pytest: pytest --json-report --json-report-file=test-results.json
108
+ </field>
109
+ <field name="output" var="test_command"/>
110
+ </block>
111
+
112
+ <block type="task" id="B8" action="run-script" desc="Execute test command">
113
+ <field name="command" value="${test_command}"/>
114
+ <field name="capture_stdout" value="true"/>
115
+ <field name="capture_stderr" value="true"/>
116
+ <field name="capture_exit_code" value="true"/>
117
+ <field name="output" var="test_execution"/>
118
+ </block>
119
+
120
+ <!-- Gateway: Handle execution errors -->
121
+ <block type="gateway" id="G2" mode="exclusive" desc="Check test execution result">
122
+ <branch test="${test_execution.exit_code} != 0 AND ${test_execution.syntax_error} == true">
123
+ <block type="event" id="E1" action="log" level="error" desc="Log syntax error">
124
+ <field name="message">Test execution failed due to syntax errors: ${test_execution.stderr}</field>
125
+ </block>
126
+ <block type="error-handler" id="EH1" desc="Handle syntax error">
127
+ <catch error-type="syntax_error">
128
+ <field name="action">STOP - Fix syntax errors and retry</field>
129
+ </catch>
130
+ </block>
131
+ </branch>
132
+ <branch test="${test_execution.exit_code} != 0 AND ${test_execution.config_error} == true">
133
+ <block type="event" id="E2" action="log" level="error" desc="Log config error">
134
+ <field name="message">Test execution failed due to configuration errors: ${test_execution.stderr}</field>
135
+ </block>
136
+ <block type="error-handler" id="EH2" desc="Handle config error">
137
+ <catch error-type="config_error">
138
+ <field name="action">STOP - Fix configuration and retry</field>
139
+ </catch>
140
+ </block>
141
+ </branch>
142
+ </block>
143
+
144
+ <!-- Step 4: Parse Results -->
145
+ <block type="task" id="B9" action="analyze" desc="Extract test summary">
146
+ <field name="input_execution" value="${test_execution}"/>
147
+ <field name="extract_fields">
148
+ - total: Total number of test cases executed
149
+ - passed: Number of passed tests
150
+ - failed: Number of failed tests
151
+ - errors: Number of tests with runtime errors
152
+ - skipped: Number of skipped tests
153
+ - duration: Total execution time
154
+ </field>
155
+ <field name="output" var="test_summary"/>
156
+ </block>
157
+
158
+ <block type="task" id="B10" action="analyze" desc="Extract test details">
159
+ <field name="input_execution" value="${test_execution}"/>
160
+ <field name="input_test_files" value="${test_code_plan.test_files}"/>
161
+ <field name="extract_fields">
162
+ - test_function_name: Full test name/suite
163
+ - tc_id: Associated test case ID from comments
164
+ - status: PASS / FAIL / ERROR / SKIP
165
+ - error_message: Primary error description
166
+ - stack_trace: Call stack leading to failure
167
+ - assertion_details: Expected vs actual values
168
+ - duration: Individual test execution time
169
+ </field>
170
+ <field name="output" var="test_details"/>
171
+ </block>
172
+
173
+ <block type="task" id="B11" action="analyze" desc="Map tests to TC IDs">
174
+ <field name="input_test_details" value="${test_details}"/>
175
+ <field name="input_test_cases" value="${test_cases}"/>
176
+ <field name="tc_id_pattern">TC-{MODULE}-{SEQ}</field>
177
+ <field name="extraction_sources">
178
+ - Test file comments
179
+ - Test description patterns
180
+ - Test code plan mapping
181
+ </field>
182
+ <field name="output" var="tc_id_mapping"/>
183
+ </block>
184
+
185
+ <!-- Step 5: Deviation Detection -->
186
+ <block type="task" id="B12" action="analyze" desc="Compare expected vs actual results">
187
+ <field name="input_test_results" value="${test_details}"/>
188
+ <field name="input_expected_results" value="${test_cases}"/>
189
+ <field name="comparison_fields">
190
+ - expected_result: From test cases document
191
+ - actual_result: From test execution
192
+ - deviation_type: Classification of difference
193
+ </field>
194
+ <field name="output" var="deviation_comparison"/>
195
+ </block>
196
+
197
+ <block type="task" id="B13" action="analyze" desc="Classify deviation types">
198
+ <field name="input_deviations" value="${deviation_comparison}"/>
199
+ <field name="deviation_types">
200
+ - PASS: Test passed as expected
201
+ - FAIL: Test assertion failed - actual differs from expected (Severity: High)
202
+ - ERROR: Runtime error - code threw exception (Severity: Critical)
203
+ - SKIP: Test was skipped - preconditions not met (Severity: Medium)
204
+ - FLAKY: Intermittent failure - non-deterministic behavior (Severity: High)
205
+ </field>
206
+ <field name="output" var="deviation_classification"/>
207
+ </block>
208
+
209
+ <block type="task" id="B14" action="analyze" desc="Perform basic root cause analysis">
210
+ <field name="input_deviations" value="${deviation_classification}"/>
211
+ <field name="analysis_focus">
212
+ - Assertion Failure: Which specific assertion failed and why
213
+ - Runtime Error: Exception type and location
214
+ - Skip Reason: Why test could not execute
215
+ - Flaky Pattern: Conditions causing intermittent failure
216
+ </field>
217
+ <field name="output" var="root_cause_basic"/>
218
+ </block>
219
+
220
+ <!-- Step 6: Generate Execution Results -->
221
+ <block type="task" id="B15" action="read-file" desc="Read test execution results template">
222
+ <field name="path" value="speccrew-test-runner/templates/TEST-EXECUTION-RESULT-TEMPLATE.md"/>
223
+ <field name="output" var="results_template"/>
224
+ </block>
225
+
226
+ <block type="task" id="B16" action="write-file" desc="Create execution results document">
227
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
228
+ <field name="template" value="${results_template}"/>
229
+ <field name="placeholders">
230
+ - feature_name: ${feature_name}
231
+ - platform_id: ${platform_id}
232
+ - date: ${timestamp}
233
+ </field>
234
+ <field name="output" var="results_created"/>
235
+ </block>
236
+
237
+ <block type="task" id="B17" action="edit-file" desc="Fill Execution Summary section">
238
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
239
+ <field name="section">Execution Summary</field>
240
+ <field name="content">
241
+ Feature: ${feature_name}
242
+ Platform: ${platform_id}
243
+ Framework: ${test_code_plan.framework}
244
+ Execution Date: ${timestamp}
245
+ Duration: ${test_summary.duration}ms
246
+ Pass Rate: ${test_summary.pass_rate}%
247
+ </field>
248
+ </block>
249
+
250
+ <block type="task" id="B18" action="edit-file" desc="Fill Results Overview section">
251
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
252
+ <field name="section">Results Overview</field>
253
+ <field name="content" value="${test_summary}"/>
254
+ </block>
255
+
256
+ <block type="task" id="B19" action="edit-file" desc="Fill Test Results Detail section">
257
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
258
+ <field name="section">Test Results Detail</field>
259
+ <field name="content" value="${test_details}"/>
260
+ </block>
261
+
262
+ <block type="task" id="B20" action="edit-file" desc="Fill Deviation Analysis section">
263
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
264
+ <field name="section">Deviation Analysis</field>
265
+ <field name="content" value="${deviation_classification}"/>
266
+ </block>
267
+
268
+ <block type="task" id="B21" action="edit-file" desc="Fill Environment Information section">
269
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
270
+ <field name="section">Environment Information</field>
271
+ <field name="content">
272
+ OS: ${runtime_check.os}
273
+ Runtime Version: ${runtime_check.version}
274
+ Framework Version: ${dependency_check.version}
275
+ Dependencies: ${dependency_check.dependencies}
276
+ </field>
277
+ </block>
278
+
279
+ <block type="task" id="B22" action="edit-file" desc="Fill Raw Output section">
280
+ <field name="path" value="${output_dir}/${feature_name}-test-execution-results.md"/>
281
+ <field name="section">Raw Output</field>
282
+ <field name="content">
283
+ STDOUT:
284
+ ${test_execution.stdout}
285
+
286
+ STDERR:
287
+ ${test_execution.stderr}
288
+ </field>
289
+ </block>
290
+
291
+ <!-- Checkpoint: Verify output -->
292
+ <block type="checkpoint" id="CP1" name="execution-results-generated" desc="Verify execution results generated">
293
+ <field name="file" value="${output_dir}/${feature_name}-test-execution-results.md"/>
294
+ <field name="verify" value="file_exists(${output_dir}/${feature_name}-test-execution-results.md)"/>
295
+ </block>
296
+
297
+ </sequence>
298
+
299
+ <!-- ============================================================
300
+ Output Results
301
+ ============================================================ -->
302
+ <block type="output" id="O1" desc="Workflow output results">
303
+ <field name="execution_results_path" value="${output_dir}/${feature_name}-test-execution-results.md" type="string" desc="Path to structured test execution results"/>
304
+ <field name="total_tests" from="${test_summary.total}" type="number" desc="Total number of tests executed"/>
305
+ <field name="passed" from="${test_summary.passed}" type="number" desc="Number of passed tests"/>
306
+ <field name="failed" from="${test_summary.failed}" type="number" desc="Number of failed tests"/>
307
+ <field name="errors" from="${test_summary.errors}" type="number" desc="Number of tests with errors"/>
308
+ <field name="skipped" from="${test_summary.skipped}" type="number" desc="Number of skipped tests"/>
309
+ <field name="pass_rate" from="${test_summary.pass_rate}" type="string" desc="Overall pass rate percentage"/>
310
+ <field name="deviations" from="${deviation_classification}" type="array" desc="List of all deviations detected"/>
311
+ <field name="next_step" value="Dispatch to speccrew-test-reporter for report generation" type="string" desc="Recommended next step"/>
312
+ </block>
313
+
314
+ </workflow>
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const path = require('path');
4
4
  const command = process.argv[2];
@@ -15,6 +15,7 @@ Commands:
15
15
  init Initialize SpecCrew in the current project
16
16
  update Update SpecCrew agents and skills
17
17
  doctor Check environment and installation health
18
+ validate Validate AgentFlow XML files
18
19
  uninstall Remove SpecCrew from the current project
19
20
  list List installed agents and skills
20
21
 
@@ -39,6 +40,12 @@ switch (command) {
39
40
  case 'doctor':
40
41
  require('../lib/commands/doctor').run(projectRoot, args);
41
42
  break;
43
+ case 'validate':
44
+ const success = require('../lib/commands/validate').run(projectRoot, args);
45
+ if (!success) {
46
+ process.exit(1);
47
+ }
48
+ break;
42
49
  case 'uninstall':
43
50
  require('../lib/commands/uninstall').run(projectRoot, args).then((result) => {
44
51
  if (!result) {