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,244 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="dev-mobile" status="pending" version="1.0" desc="Mobile Development SOP - Guide System Developer Agent to implement mobile app code">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="design_doc_path" required="true" type="string" desc="Path to single module design document"/>
9
+ <field name="platform_id" required="true" type="string" desc="Mobile platform identifier (mobile-uniapp, mobile-flutter, mobile-react-native)"/>
10
+ <field name="task_id" required="true" type="string" desc="Task identifier from dispatch context"/>
11
+ <field name="iteration_id" required="false" type="string" desc="Current iteration identifier"/>
12
+ <field name="source_root" required="true" type="string" desc="Root directory of mobile source code"/>
13
+ </block>
14
+
15
+ <!-- ============================================================
16
+ Global Constraints
17
+ ============================================================ -->
18
+ <block type="rule" id="R1" level="forbidden" desc="Task Record document constraints">
19
+ <field name="text">NEVER use create_file to write the Task Record document</field>
20
+ <field name="text">MUST create Task Record by copying template then filling sections with search_replace</field>
21
+ <field name="text">NEVER replace the entire Task Record content in a single operation</field>
22
+ </block>
23
+
24
+ <block type="rule" id="R2" level="mandatory" desc="Template-first workflow">
25
+ <field name="text">Copy template MUST execute before fill sections</field>
26
+ <field name="text">Source code is NOT template-filled - write directly based on design blueprints</field>
27
+ </block>
28
+
29
+ <!-- ============================================================
30
+ Main Processing Sequence
31
+ ============================================================ -->
32
+ <sequence id="S1" name="Mobile Development" status="pending" desc="Execute mobile development workflow">
33
+
34
+ <!-- Step 1: Read Design Documents -->
35
+ <block type="task" id="B1" action="read-file" desc="Read Module Design Document">
36
+ <field name="path" value="${design_doc_path}"/>
37
+ <field name="output" var="module_design"/>
38
+ </block>
39
+
40
+ <block type="task" id="B2" action="read-file" desc="Read API Contract">
41
+ <field name="path">speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-name}-api-contract.md</field>
42
+ <field name="output" var="api_contract"/>
43
+ </block>
44
+
45
+ <block type="task" id="B3" action="read-file" desc="Read Task Record Template">
46
+ <field name="path">speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md</field>
47
+ <field name="output" var="task_template"/>
48
+ </block>
49
+
50
+ <!-- Step 2: Read Techs Knowledge -->
51
+ <block type="task" id="B4" action="read-file" desc="Read Techs Knowledge - conventions-dev">
52
+ <field name="path">knowledges/techs/${platform_id}/conventions-dev.md</field>
53
+ <field name="output" var="conventions_dev"/>
54
+ </block>
55
+
56
+ <block type="task" id="B5" action="read-file" desc="Read Techs Knowledge - architecture">
57
+ <field name="path">knowledges/techs/${platform_id}/architecture.md</field>
58
+ <field name="output" var="architecture"/>
59
+ </block>
60
+
61
+ <block type="task" id="B6" action="read-file" desc="Read Techs Knowledge - tech-stack">
62
+ <field name="path">knowledges/techs/${platform_id}/tech-stack.md</field>
63
+ <field name="output" var="tech_stack"/>
64
+ </block>
65
+
66
+ <!-- Step 3: Extract Task List -->
67
+ <block type="task" id="B7" action="analyze" desc="Extract mobile-specific task list">
68
+ <field name="input" value="${module_design}"/>
69
+ <field name="extraction_rules">
70
+ - Screen/Page: Full screen UI implementation (LoginScreen, ProductDetailPage)
71
+ - Widget/Component: Reusable UI components (ProductCard, SearchBar)
72
+ - Navigation flow: Route configuration (GoRouter config, Stack navigator)
73
+ - State management: Store/provider setup (CartBloc, UserStore)
74
+ - API service: HTTP client integration (ProductService, AuthApi)
75
+ - Local storage: Persistence layer (Hive box, SQLite schema)
76
+ - Platform channel: Native module integration (BiometricAuth, CameraAccess)
77
+ - Asset management: Images, fonts, icons (pubspec.yaml, asset bundling)
78
+ </field>
79
+ <field name="output" var="extracted_items"/>
80
+ </block>
81
+
82
+ <block type="task" id="B8" action="analyze" desc="Generate Task Checklist Table">
83
+ <field name="input" value="${extracted_items}"/>
84
+ <field name="format">
85
+ | Task ID | Module | Description | Target Files | Platform Specific | Offline Support | Dependencies | Status |
86
+ | MB-001 | Auth | LoginScreen implementation | lib/screens/auth/ | iOS/Android | Yes | - | ⏳ Pending |
87
+ </field>
88
+ <field name="output" var="task_list"/>
89
+ </block>
90
+
91
+ <!-- Step 4: Create Task Record File -->
92
+ <block type="task" id="B9" action="create-file" desc="Copy template to Task Record path">
93
+ <field name="path">speccrew-workspace/iterations/{iteration}/04.development/${platform_id}/{module}-task.md</field>
94
+ <field name="content">${task_template} with top-level placeholders replaced</field>
95
+ <field name="output" var="task_record_path"/>
96
+ </block>
97
+
98
+ <block type="task" id="B10" action="edit-file" desc="Fill Task Record sections using search_replace">
99
+ <field name="path" value="${task_record_path}"/>
100
+ <field name="action">Fill each section with task checklist and design metadata</field>
101
+ <field name="output" var="task_record_filled"/>
102
+ </block>
103
+
104
+ <!-- Checkpoint: Task list extracted -->
105
+ <block type="checkpoint" id="CP1" name="task-list-extracted" desc="Verify task list extracted">
106
+ <field name="verify" value="${task_list.length} > 0"/>
107
+ </block>
108
+
109
+ <!-- Step 5: Execute Task by Task -->
110
+ <block type="loop" id="L1" over="${task_list}" as="task" desc="Execute tasks sequentially following dependencies">
111
+ <block type="task" id="B11" action="edit-file" desc="Mark task as In Progress">
112
+ <field name="path" value="${task_record_path}"/>
113
+ <field name="action">Update task status to 🔄 In Progress</field>
114
+ </block>
115
+
116
+ <block type="task" id="B12" action="generate" desc="Implement task following design blueprint">
117
+ <field name="task" value="${task}"/>
118
+ <field name="design" value="${module_design}"/>
119
+ <field name="conventions" value="${conventions_dev}"/>
120
+ <field name="rules">
121
+ - Follow design file paths, naming, structure exactly
122
+ - Write actual code directly (no template filling)
123
+ - Reuse existing code via Glob/Grep
124
+ - Follow techs knowledge for naming, patterns, directory structure
125
+ - Handle iOS/Android differences where specified
126
+ </field>
127
+ <field name="output" var="implementation_result"/>
128
+ </block>
129
+
130
+ <!-- Local Checks -->
131
+ <block type="gateway" id="G1" mode="exclusive" desc="Platform-specific checks">
132
+ <branch test="${platform_id} == 'mobile-flutter'" name="Flutter Checks">
133
+ <block type="task" id="B13" action="run-script" desc="Flutter static analysis">
134
+ <field name="command">flutter analyze</field>
135
+ <field name="output" var="analysis_result"/>
136
+ </block>
137
+ <block type="task" id="B14" action="run-script" desc="Flutter build verification">
138
+ <field name="command">flutter build [ios/android]</field>
139
+ <field name="output" var="build_result"/>
140
+ </block>
141
+ <block type="task" id="B15" action="run-script" desc="Flutter unit tests">
142
+ <field name="command">flutter test</field>
143
+ <field name="output" var="test_result"/>
144
+ </block>
145
+ </branch>
146
+ <branch test="${platform_id} == 'mobile-react-native'" name="React Native Checks">
147
+ <block type="task" id="B16" action="run-script" desc="React Native lint">
148
+ <field name="command">npx react-native lint</field>
149
+ <field name="output" var="analysis_result"/>
150
+ </block>
151
+ <block type="task" id="B17" action="run-script" desc="React Native build">
152
+ <field name="command">npx react-native build-ios/build-android</field>
153
+ <field name="output" var="build_result"/>
154
+ </block>
155
+ <block type="task" id="B18" action="run-script" desc="React Native tests">
156
+ <field name="command">npm test</field>
157
+ <field name="output" var="test_result"/>
158
+ </block>
159
+ </branch>
160
+ </block>
161
+
162
+ <block type="task" id="B19" action="analyze" desc="Quick verify">
163
+ <field name="checks">
164
+ - App launches on simulator/emulator without crash
165
+ </field>
166
+ <field name="output" var="verify_result"/>
167
+ </block>
168
+
169
+ <block type="gateway" id="G2" mode="guard" desc="Verify checks passed"
170
+ test="${analysis_result.status} == 'passed' AND ${build_result.status} == 'passed'"
171
+ fail-action="stop">
172
+ <field name="message">Local checks failed for task ${task.id}</field>
173
+ </block>
174
+
175
+ <block type="task" id="B20" action="edit-file" desc="Update status to Complete">
176
+ <field name="path" value="${task_record_path}"/>
177
+ <field name="action">Update task status to ✅ Complete</field>
178
+ </block>
179
+ </block>
180
+
181
+ <!-- Step 6: Record Deviations -->
182
+ <block type="gateway" id="G3" mode="exclusive" desc="Check if deviations exist">
183
+ <branch test="${deviations.length} > 0" name="Has Deviations">
184
+ <block type="task" id="B21" action="edit-file" desc="Record deviations in task file">
185
+ <field name="path" value="${task_record_path}"/>
186
+ <field name="action">Add Deviation Notes section with MB-XXX prefix</field>
187
+ </block>
188
+ </branch>
189
+ <branch default="true" name="No Deviations">
190
+ <block type="event" id="E1" action="log" level="info" desc="No deviations">
191
+ <field name="message">No deviations from design</field>
192
+ </block>
193
+ </branch>
194
+ </block>
195
+
196
+ <!-- Step 7: Record Technical Debt -->
197
+ <block type="gateway" id="G4" mode="exclusive" desc="Check if technical debt exists">
198
+ <branch test="${tech_debt.length} > 0" name="Has Tech Debt">
199
+ <block type="task" id="B22" action="create-file" desc="Write technical debt document">
200
+ <field name="path">speccrew-workspace/iterations/{iteration}/tech-debt/{feature-name}-tech-debt.md</field>
201
+ <field name="content">${tech_debt} with categories: Platform-specific workarounds, Offline sync, Error handling, Accessibility, Test coverage</field>
202
+ <field name="output" var="tech_debt_path"/>
203
+ </block>
204
+ </branch>
205
+ <branch default="true" name="No Tech Debt">
206
+ <block type="event" id="E2" action="log" level="info" desc="No tech debt">
207
+ <field name="message">No technical debt identified</field>
208
+ </block>
209
+ </branch>
210
+ </block>
211
+
212
+ <!-- Step 8: Completion Notification -->
213
+ <block type="task" id="B23" action="edit-file" desc="Update task record status to complete">
214
+ <field name="path" value="${task_record_path}"/>
215
+ <field name="action">Update final status</field>
216
+ </block>
217
+
218
+ <block type="task" id="B24" action="report" desc="Generate completion notification">
219
+ <field name="template">
220
+ Mobile Development Complete:
221
+ - Tasks implemented: [X]
222
+ - Deviation records: [Y] (see task file)
223
+ - Technical debt records: [Z] (see tech-debt file)
224
+ - Task record: speccrew-workspace/iterations/{iteration}/04.development/{platform_id}/{module}-task.md
225
+
226
+ Ready for QA Agent acceptance testing.
227
+ </field>
228
+ <field name="output" var="completion_report"/>
229
+ </block>
230
+
231
+ </sequence>
232
+
233
+ <!-- ============================================================
234
+ Output Results
235
+ ============================================================ -->
236
+ <block type="output" id="O1" desc="Workflow output results">
237
+ <field name="task_record_path" value="${task_record_path}" type="string" desc="Path to task record document"/>
238
+ <field name="task_count" from="${task_list.length}" type="number" desc="Number of tasks completed"/>
239
+ <field name="deviation_count" type="number" desc="Number of deviations recorded"/>
240
+ <field name="tech_debt_count" type="number" desc="Number of tech debt items"/>
241
+ <field name="completion_report" value="${completion_report}" type="string" desc="Completion notification text"/>
242
+ </block>
243
+
244
+ </workflow>
@@ -23,9 +23,17 @@ tools: Read, Glob, Grep
23
23
  | `task_id` | Yes | Task identifier from dispatch context |
24
24
  | `previous_review_path` | No | Path to previous review report for incremental review |
25
25
 
26
- # Workflow
26
+ ## AgentFlow Definition
27
27
 
28
- ## Absolute Constraints
28
+ <!-- @agentflow: workflow.agentflow.xml -->
29
+
30
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ ### Absolute Constraints
29
37
 
30
38
  > **Violation = review failure.**
31
39
 
@@ -0,0 +1,251 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="dev-review-backend" status="pending" version="1.0" desc="Backend Code Review - Reviews backend implementation against design documents and standards">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="design_doc_path" required="true" type="string" desc="Path to backend module design document"/>
9
+ <field name="implementation_report_path" required="true" type="string" desc="Path to backend development report"/>
10
+ <field name="source_root" required="true" type="string" desc="Root directory of backend source code"/>
11
+ <field name="platform_id" required="true" type="string" desc="Backend platform (backend-spring, backend-nodejs)"/>
12
+ <field name="task_id" required="true" type="string" desc="Task identifier from dispatch context"/>
13
+ <field name="api_contract_path" required="false" type="string" desc="Path to API contract file for endpoint validation"/>
14
+ <field name="previous_review_path" required="false" type="string" desc="Path to previous review report for incremental review"/>
15
+ </block>
16
+
17
+ <!-- ============================================================
18
+ Global Constraints
19
+ ============================================================ -->
20
+ <block type="rule" id="R1" level="forbidden" desc="Review operation constraints">
21
+ <field name="text">NEVER modify source code files - read-only operation</field>
22
+ <field name="text">Do NOT attempt to fix issues - only document them</field>
23
+ </block>
24
+
25
+ <block type="rule" id="R2" level="mandatory" desc="Output requirements">
26
+ <field name="text">PARTIAL/FAIL results MUST include specific Re-dispatch Guidance</field>
27
+ <field name="text">If previous_review_path provided, skip items already marked as passed</field>
28
+ </block>
29
+
30
+ <!-- ============================================================
31
+ Main Processing Sequence
32
+ ============================================================ -->
33
+ <sequence id="S1" name="Backend Code Review" status="pending" desc="Execute backend code review workflow">
34
+
35
+ <!-- Step 1: Load Documents -->
36
+ <block type="task" id="B1" action="validate" desc="Validate Inputs">
37
+ <field name="checks">Verify all required parameters provided</field>
38
+ <field name="on_fail">Report error and stop</field>
39
+ <field name="output" var="validation_result"/>
40
+ </block>
41
+
42
+ <block type="task" id="B2" action="read-file" desc="Read Design Document">
43
+ <field name="path" value="${design_doc_path}"/>
44
+ <field name="output" var="design_doc"/>
45
+ </block>
46
+
47
+ <block type="task" id="B3" action="analyze" desc="Extract from Design Document">
48
+ <field name="input" value="${design_doc}"/>
49
+ <field name="extraction">
50
+ - Module Overview: Module name, responsibilities
51
+ - File Structure: Required files (DO, VO, Mapper, Service, Controller, Convert, Enums)
52
+ - Class Specifications: Class names, inheritance requirements, annotations
53
+ - API Endpoints: Endpoint definitions, HTTP methods, paths
54
+ - Business Logic: Service methods, transaction requirements
55
+ </field>
56
+ <field name="output" var="design_specs"/>
57
+ </block>
58
+
59
+ <block type="task" id="B4" action="read-file" desc="Read Implementation Report">
60
+ <field name="path" value="${implementation_report_path}"/>
61
+ <field name="output" var="impl_report"/>
62
+ </block>
63
+
64
+ <block type="task" id="B5" action="analyze" desc="Extract from Implementation Report">
65
+ <field name="input" value="${impl_report}"/>
66
+ <field name="extraction">Completed Files, Implementation Status, Known Issues</field>
67
+ <field name="output" var="impl_status"/>
68
+ </block>
69
+
70
+ <!-- Conditional: Read API Contract -->
71
+ <block type="gateway" id="G1" mode="exclusive" desc="Check if API contract provided">
72
+ <branch test="${api_contract_path} != null" name="Has API Contract">
73
+ <block type="task" id="B6" action="read-file" desc="Read API Contract">
74
+ <field name="path" value="${api_contract_path}"/>
75
+ <field name="output" var="api_contract"/>
76
+ </block>
77
+ <block type="task" id="B7" action="analyze" desc="Extract API Contract specs">
78
+ <field name="input" value="${api_contract}"/>
79
+ <field name="extraction">Endpoint Definitions, Request/Response Schemas, HTTP Methods, Error Codes</field>
80
+ <field name="output" var="api_specs"/>
81
+ </block>
82
+ </branch>
83
+ <branch default="true" name="No API Contract">
84
+ <block type="event" id="E1" action="log" level="info" desc="Skip API validation">
85
+ <field name="message">API contract not provided - skipping API validation</field>
86
+ </block>
87
+ </branch>
88
+ </block>
89
+
90
+ <!-- Conditional: Read Previous Review -->
91
+ <block type="gateway" id="G2" mode="exclusive" desc="Check if previous review provided">
92
+ <branch test="${previous_review_path} != null" name="Has Previous Review">
93
+ <block type="task" id="B8" action="read-file" desc="Read Previous Review">
94
+ <field name="path" value="${previous_review_path}"/>
95
+ <field name="output" var="previous_review"/>
96
+ </block>
97
+ </branch>
98
+ <branch default="true" name="No Previous Review">
99
+ <block type="event" id="E2" action="log" level="info" desc="Full review">
100
+ <field name="message">No previous review - performing full review</field>
101
+ </block>
102
+ </branch>
103
+ </block>
104
+
105
+ <!-- Step 2: File Completeness Check -->
106
+ <block type="task" id="B9" action="analyze" desc="Build Expected File List">
107
+ <field name="categories">
108
+ - Enums: enums/*.java (e.g., enums/ErrorCodeConstants.java)
109
+ - DO: dal/dataobject/**/*.java (e.g., dal/dataobject/employee/EmployeeDO.java)
110
+ - VO: controller/admin/vo/**/*.java (e.g., controller/admin/vo/EmployeeRespVO.java)
111
+ - Mapper: dal/mapper/**/*.java (e.g., dal/mapper/employee/EmployeeMapper.java)
112
+ - Service: service/**/*.java (e.g., service/employee/EmployeeService.java)
113
+ - Controller: controller/admin/**/*.java (e.g., controller/admin/employee/EmployeeController.java)
114
+ - Convert: convert/**/*.java (e.g., convert/employee/EmployeeConvert.java)
115
+ </field>
116
+ <field name="output" var="expected_files"/>
117
+ </block>
118
+
119
+ <block type="task" id="B10" action="analyze" desc="Scan Actual Files">
120
+ <field name="source_root" value="${source_root}"/>
121
+ <field name="action">Use Glob to scan for implemented files</field>
122
+ <field name="output" var="actual_files"/>
123
+ </block>
124
+
125
+ <block type="task" id="B11" action="analyze" desc="Calculate Completeness">
126
+ <field name="formula">completeness_pct = (created / required) * 100</field>
127
+ <field name="output" var="completeness_result"/>
128
+ </block>
129
+
130
+ <!-- Step 3: Backend-Specific Compliance Check -->
131
+ <block type="task" id="B12" action="analyze" desc="DO/VO/DTO Compliance Check">
132
+ <field name="checks">
133
+ - Base Class: Must extend correct base class (e.g., TenantBaseDO) - Severity: ERROR
134
+ - @TableName: Must have @TableName with correct table name - Severity: ERROR
135
+ - @Schema: Must have @Schema for documentation - Severity: WARN
136
+ - Validation: Required fields must have @NotNull or similar - Severity: ERROR
137
+ - Desensitization: Sensitive fields must have desensitization - Severity: ERROR
138
+ </field>
139
+ <field name="output" var="do_vo_check"/>
140
+ </block>
141
+
142
+ <block type="task" id="B13" action="analyze" desc="Service Layer Check">
143
+ <field name="checks">
144
+ - Interface: Must have Service interface and implementation separation - Severity: WARN
145
+ - @Service: Implementation must have @Service annotation - Severity: ERROR
146
+ - @Transactional: DB write methods must have @Transactional - Severity: ERROR
147
+ - Method Coverage: All methods in design must be implemented - Severity: ERROR
148
+ - Data Permission: Must check data permissions where required - Severity: ERROR
149
+ </field>
150
+ <field name="output" var="service_check"/>
151
+ </block>
152
+
153
+ <block type="task" id="B14" action="analyze" desc="Controller Layer Check">
154
+ <field name="checks">
155
+ - @RestController: Must have @RestController annotation - Severity: ERROR
156
+ - @RequestMapping: Must have base @RequestMapping annotation - Severity: ERROR
157
+ - @Operation: Endpoints should have @Operation for documentation - Severity: WARN
158
+ - @PreAuthorize: Must have permission annotations where required - Severity: ERROR
159
+ - @Valid: Request VO parameters must have @Valid - Severity: ERROR
160
+ </field>
161
+ <field name="output" var="controller_check"/>
162
+ </block>
163
+
164
+ <block type="task" id="B15" action="analyze" desc="Database Mapping Validation">
165
+ <field name="checks">
166
+ - Verify Entity fields match design document
167
+ - Check MyBatis XML mappers exist alongside Mapper interfaces
168
+ - Validate Lombok @Data or similar on DO/VO classes
169
+ </field>
170
+ <field name="output" var="db_mapping_check"/>
171
+ </block>
172
+
173
+ <!-- Step 4: API Consistency Check -->
174
+ <block type="gateway" id="G3" mode="exclusive" desc="Check if API contract validation needed">
175
+ <branch test="${api_contract_path} != null" name="Validate API">
176
+ <block type="task" id="B16" action="analyze" desc="API Consistency Check">
177
+ <field name="checks">
178
+ - Endpoint Coverage: All contract endpoints exist in Controller - Severity: ERROR
179
+ - HTTP Method: Methods match contract - Severity: ERROR
180
+ - Path Match: URL paths match contract exactly - Severity: ERROR
181
+ - VO Fields: All contract fields present in VO - Severity: ERROR
182
+ - Field Types: Data types match contract - Severity: ERROR
183
+ </field>
184
+ <field name="output" var="api_check"/>
185
+ </block>
186
+ </branch>
187
+ <branch default="true" name="Skip API Check">
188
+ <block type="event" id="E3" action="log" level="info" desc="Skip API validation">
189
+ <field name="message">Skipping API consistency check</field>
190
+ </block>
191
+ </branch>
192
+ </block>
193
+
194
+ <!-- Step 5: Generate Review Report -->
195
+ <block type="task" id="B17" action="analyze" desc="Determine Result">
196
+ <field name="criteria">
197
+ - PASS: 100% files created, 0 ERROR-level issues
198
+ - PARTIAL: 70-99% files created, or non-critical ERROR issues
199
+ - FAIL: &lt;70% files created, or critical blockers present
200
+ </field>
201
+ <field name="output" var="review_result"/>
202
+ </block>
203
+
204
+ <block type="task" id="B18" action="read-file" desc="Read Review Report Template">
205
+ <field name="path">templates/REVIEW-REPORT-TEMPLATE.md</field>
206
+ <field name="output" var="report_template"/>
207
+ </block>
208
+
209
+ <block type="task" id="B19" action="generate" desc="Write Review Report">
210
+ <field name="path">speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/[module]-review-report.md</field>
211
+ <field name="template" value="${report_template}"/>
212
+ <field name="content">
213
+ - Completeness: ${completeness_result}
214
+ - DO/VO Check: ${do_vo_check}
215
+ - Service Check: ${service_check}
216
+ - Controller Check: ${controller_check}
217
+ - DB Mapping Check: ${db_mapping_check}
218
+ - API Check: ${api_check}
219
+ - Final Result: ${review_result}
220
+ </field>
221
+ <field name="output" var="review_report_path"/>
222
+ </block>
223
+
224
+ <!-- Step 6: Task Completion Report -->
225
+ <block type="task" id="B20" action="report" desc="Generate Task Completion Report">
226
+ <field name="template">
227
+ ## Task Completion Report
228
+ - **Status**: SUCCESS
229
+ - **Task ID**: review-{original_task_id}
230
+ - **Platform**: {platform_id}
231
+ - **Module**: {module_name}
232
+ - **Output Files**: {review_report_path}
233
+ - **Summary**: Review {result}: {completed}/{total} files, {error_count} errors
234
+ </field>
235
+ <field name="output" var="completion_report"/>
236
+ </block>
237
+
238
+ </sequence>
239
+
240
+ <!-- ============================================================
241
+ Output Results
242
+ ============================================================ -->
243
+ <block type="output" id="O1" desc="Workflow output results">
244
+ <field name="review_report_path" value="${review_report_path}" type="string" desc="Path to review report"/>
245
+ <field name="review_result" value="${review_result}" type="string" desc="PASS/PARTIAL/FAIL verdict"/>
246
+ <field name="completeness_pct" from="${completeness_result.percentage}" type="number" desc="File completeness percentage"/>
247
+ <field name="error_count" type="number" desc="Number of ERROR-level issues"/>
248
+ <field name="completion_report" value="${completion_report}" type="string" desc="Task completion report"/>
249
+ </block>
250
+
251
+ </workflow>
@@ -23,9 +23,17 @@ tools: Read, Glob, Grep
23
23
  | `task_id` | Yes | Task identifier from dispatch context |
24
24
  | `previous_review_path` | No | Path to previous review report |
25
25
 
26
- # Workflow
26
+ ## AgentFlow Definition
27
27
 
28
- ## Absolute Constraints
28
+ <!-- @agentflow: workflow.agentflow.xml -->
29
+
30
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ ### Absolute Constraints
29
37
 
30
38
  > **Violation = review failure.**
31
39