speccrew 0.6.40 → 0.6.42
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.
- package/.speccrew/agents/speccrew-team-leader-xml.md +10 -49
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch-xml/SKILL.md +22 -21
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-module-summarize-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-system-summarize-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch-xml/SKILL.md +23 -21
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality-xml/SKILL.md +1 -14
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md +1 -14
- package/.speccrew/skills/speccrew-knowledge-techs-generate-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-techs-index-xml/SKILL.md +1 -12
- package/.speccrew/skills/speccrew-knowledge-techs-init-xml/SKILL.md +1 -12
- package/package.json +1 -1
- package/workspace-template/docs/rules/xml-workflow-spec.md +340 -0
|
@@ -75,18 +75,7 @@ You understand the complete AI engineering closed loop: **speccrew-pm → speccr
|
|
|
75
75
|
|
|
76
76
|
# Workflow (XML Block Definition)
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
== Block Types ==
|
|
80
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
81
|
-
output : Workflow output results (from=data source variable)
|
|
82
|
-
task : Execution action (action: run-skill | run-script | dispatch-to-worker)
|
|
83
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
84
|
-
loop : Iterate collection (over=collection, as=current item)
|
|
85
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
86
|
-
error-handler : Exception handling (try > catch > finally)
|
|
87
|
-
checkpoint : Persistence milestone (name=checkpoint name, verify=verification condition)
|
|
88
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
89
|
-
-->
|
|
78
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
90
79
|
|
|
91
80
|
```xml
|
|
92
81
|
<workflow id="team-leader-main" status="pending">
|
|
@@ -190,16 +179,9 @@ rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
|
190
179
|
<block type="rule" id="P05-R-TECHS" level="mandatory" desc="Parallel worker dispatch for techs">
|
|
191
180
|
<field name="text">When techs-dispatch Stage 2 prepares task plans for multiple platforms, dispatch ALL platform workers IN PARALLEL — DO NOT execute sequentially</field>
|
|
192
181
|
</block>
|
|
193
|
-
<block type="task" id="P05-B5" action="
|
|
194
|
-
<field name="worker">speccrew-task-worker</field>
|
|
182
|
+
<block type="task" id="P05-B5" action="run-skill" desc="Leader directly invokes techs-dispatch as orchestration playbook">
|
|
195
183
|
<field name="skill">speccrew-knowledge-techs-dispatch-xml</field>
|
|
196
|
-
<field name="
|
|
197
|
-
CRITICAL: This skill MUST be invoked via Task tool creating a Worker Agent (speccrew-task-worker), NOT via direct Skill tool call.
|
|
198
|
-
|
|
199
|
-
Use the Task tool to create a Worker Agent with the skill speccrew-knowledge-techs-dispatch-xml.
|
|
200
|
-
The Worker Agent will load and execute the dispatch workflow autonomously.
|
|
201
|
-
DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
202
|
-
</field>
|
|
184
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
203
185
|
</block>
|
|
204
186
|
</branch>
|
|
205
187
|
<branch test="${bizs_kb.exists} == false" name="Bizs Not Initialized">
|
|
@@ -207,16 +189,9 @@ DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
|
207
189
|
<block type="rule" id="P05-R-BIZS" level="mandatory" desc="Parallel worker dispatch for bizs">
|
|
208
190
|
<field name="text">When bizs-dispatch prepares worker task plans, dispatch ALL workers IN PARALLEL per stage — DO NOT execute sequentially</field>
|
|
209
191
|
</block>
|
|
210
|
-
<block type="task" id="P05-B6" action="
|
|
211
|
-
<field name="worker">speccrew-task-worker</field>
|
|
192
|
+
<block type="task" id="P05-B6" action="run-skill" desc="Leader directly invokes bizs-dispatch as orchestration playbook">
|
|
212
193
|
<field name="skill">speccrew-knowledge-bizs-dispatch-xml</field>
|
|
213
|
-
<field name="
|
|
214
|
-
CRITICAL: This skill MUST be invoked via Task tool creating a Worker Agent (speccrew-task-worker), NOT via direct Skill tool call.
|
|
215
|
-
|
|
216
|
-
Use the Task tool to create a Worker Agent with the skill speccrew-knowledge-bizs-dispatch-xml.
|
|
217
|
-
The Worker Agent will load and execute the dispatch workflow autonomously.
|
|
218
|
-
DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
219
|
-
</field>
|
|
194
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
220
195
|
</block>
|
|
221
196
|
</branch>
|
|
222
197
|
<branch default="true" name="Knowledge Base Ready">
|
|
@@ -237,7 +212,7 @@ DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
|
237
212
|
<field name="text">DO NOT trigger business process Skills (PRD, Solution, Design, Dev) — these are loaded by corresponding role Agents</field>
|
|
238
213
|
<field name="text">DO NOT handle business development requests (feature requirements, code modifications, bug fixes) — prompt user to talk directly to Qoder</field>
|
|
239
214
|
<field name="text">DO NOT delete or modify WORKFLOW-PROGRESS.json (read-only)</field>
|
|
240
|
-
<field name="text">
|
|
215
|
+
<field name="text">dispatch skills (bizs-dispatch-xml, techs-dispatch-xml) MUST be called directly by Leader via Skill tool as orchestration playbooks. Downstream worker skills (identify-entries, init-features, ui-analyze, etc.) MUST be dispatched via Task tool → speccrew-task-worker.</field>
|
|
241
216
|
</block>
|
|
242
217
|
|
|
243
218
|
<block type="gateway" id="P1-G1" mode="exclusive" desc="Intent Recognition Routing">
|
|
@@ -257,16 +232,9 @@ DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
|
257
232
|
<field name="text">When bizs-dispatch prepares worker task plans for multiple features or platforms, dispatch ALL workers IN PARALLEL — DO NOT execute features or platforms sequentially one by one</field>
|
|
258
233
|
<field name="text">Each Worker (analysis, graph, summarize) runs independently — dispatch all of them at once per stage, then monitor completion markers</field>
|
|
259
234
|
</block>
|
|
260
|
-
<block type="task" id="P1-B3" action="
|
|
261
|
-
<field name="worker">speccrew-task-worker</field>
|
|
235
|
+
<block type="task" id="P1-B3" action="run-skill" status="pending" desc="Leader directly invokes bizs-dispatch as orchestration playbook">
|
|
262
236
|
<field name="skill">speccrew-knowledge-bizs-dispatch-xml</field>
|
|
263
|
-
<field name="
|
|
264
|
-
CRITICAL: This skill MUST be invoked via Task tool creating a Worker Agent (speccrew-task-worker), NOT via direct Skill tool call.
|
|
265
|
-
|
|
266
|
-
Use the Task tool to create a Worker Agent with the skill speccrew-knowledge-bizs-dispatch-xml.
|
|
267
|
-
The Worker Agent will load and execute the dispatch workflow autonomously.
|
|
268
|
-
DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
269
|
-
</field>
|
|
237
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
270
238
|
</block>
|
|
271
239
|
</branch>
|
|
272
240
|
<branch test="${intent} == 'knowledge_techs'" name="Techs Knowledge Base">
|
|
@@ -274,16 +242,9 @@ DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
|
274
242
|
<field name="text">When techs-dispatch Stage 2 prepares task plans for multiple platforms, dispatch ALL platform workers IN PARALLEL using concurrent task dispatch — DO NOT execute platforms sequentially one by one</field>
|
|
275
243
|
<field name="text">Each platform worker (techs-generate-conventions, techs-generate-ui-style) runs independently — dispatch all of them at once, then monitor completion markers</field>
|
|
276
244
|
</block>
|
|
277
|
-
<block type="task" id="P1-B4" action="
|
|
278
|
-
<field name="worker">speccrew-task-worker</field>
|
|
245
|
+
<block type="task" id="P1-B4" action="run-skill" status="pending" desc="Leader directly invokes techs-dispatch as orchestration playbook">
|
|
279
246
|
<field name="skill">speccrew-knowledge-techs-dispatch-xml</field>
|
|
280
|
-
<field name="
|
|
281
|
-
CRITICAL: This skill MUST be invoked via Task tool creating a Worker Agent (speccrew-task-worker), NOT via direct Skill tool call.
|
|
282
|
-
|
|
283
|
-
Use the Task tool to create a Worker Agent with the skill speccrew-knowledge-techs-dispatch-xml.
|
|
284
|
-
The Worker Agent will load and execute the dispatch workflow autonomously.
|
|
285
|
-
DO NOT call the Skill tool directly for speccrew-knowledge-* skills.
|
|
286
|
-
</field>
|
|
247
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
287
248
|
</block>
|
|
288
249
|
</branch>
|
|
289
250
|
|
|
@@ -105,18 +105,7 @@ Before executing the workflow, verify the following inputs:
|
|
|
105
105
|
|
|
106
106
|
## Workflow
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
== Block Types ==
|
|
110
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
111
|
-
output : Workflow output results (from=data source variable)
|
|
112
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
113
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
114
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
115
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
116
|
-
error-handler : Exception handling (try > catch > finally)
|
|
117
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
118
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
119
|
-
-->
|
|
108
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
120
109
|
|
|
121
110
|
```xml
|
|
122
111
|
<workflow name="api-controller-analysis" version="1.0">
|
|
@@ -71,18 +71,7 @@ This skill operates in **strict sequential execution mode**:
|
|
|
71
71
|
|
|
72
72
|
## Workflow
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
== Block Types ==
|
|
76
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
77
|
-
output : Workflow output results (from=data source variable)
|
|
78
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
79
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
80
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
81
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
82
|
-
error-handler : Exception handling (try > catch > finally)
|
|
83
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
84
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
85
|
-
-->
|
|
74
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
86
75
|
|
|
87
76
|
```xml
|
|
88
77
|
<workflow name="api-knowledge-graph-construction" version="1.0">
|
|
@@ -10,24 +10,29 @@ Orchestrate **bizs knowledge base generation** with a 5-stage pipeline using **X
|
|
|
10
10
|
|
|
11
11
|
## Invocation Method
|
|
12
12
|
|
|
13
|
-
**CRITICAL**: This skill MUST be
|
|
13
|
+
**CRITICAL**: This skill is an **orchestration playbook** — it MUST be loaded directly by Team Leader via Skill tool (NOT via Worker Agent).
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
Correct:
|
|
17
|
-
Incorrect:
|
|
16
|
+
Correct: Leader uses Skill tool to load this playbook directly
|
|
17
|
+
Incorrect: Dispatch this skill to speccrew-task-worker
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
**Why?** This skill
|
|
20
|
+
**Why?** This skill defines the orchestration workflow and prepares task plans for downstream workers. The Team Leader reads this playbook and dispatches individual worker tasks via Task tool → speccrew-task-worker for each stage.
|
|
21
21
|
|
|
22
22
|
**Correct Invocation Pattern**:
|
|
23
23
|
```xml
|
|
24
|
-
<block type="task" action="
|
|
25
|
-
<field name="worker">speccrew-task-worker</field>
|
|
24
|
+
<block type="task" action="run-skill" desc="Leader directly invokes bizs-dispatch as orchestration playbook">
|
|
26
25
|
<field name="skill">speccrew-knowledge-bizs-dispatch-xml</field>
|
|
27
|
-
<field name="
|
|
26
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
28
27
|
</block>
|
|
29
28
|
```
|
|
30
29
|
|
|
30
|
+
**Worker Dispatch Rule**:
|
|
31
|
+
- Dispatch skills (bizs-dispatch-xml, techs-dispatch-xml): Leader calls directly via Skill tool
|
|
32
|
+
- Downstream worker skills (identify-entries, init-features, ui-analyze, module-summarize, etc.): Leader dispatches via Task tool → speccrew-task-worker
|
|
33
|
+
|
|
34
|
+
**FORBIDDEN**: Worker Agents MUST NOT execute this dispatch skill. If a Worker Agent loads this skill, it must report error and abort.
|
|
35
|
+
|
|
31
36
|
## Quick Reference — Execution Flow
|
|
32
37
|
|
|
33
38
|
```
|
|
@@ -80,20 +85,7 @@ Stage 4: System Summary
|
|
|
80
85
|
## XML Workflow Definition
|
|
81
86
|
|
|
82
87
|
<workflow id="bizs-dispatch-main" status="pending" version="1.0" desc="bizs knowledge base generation 5-stage pipeline">
|
|
83
|
-
|
|
84
|
-
== Block Types ==
|
|
85
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
86
|
-
output : Workflow output results (from=data source variable)
|
|
87
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
88
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
89
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
90
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
91
|
-
error-handler : Exception handling (try > catch > finally)
|
|
92
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
93
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
94
|
-
== Field ==
|
|
95
|
-
field : Parameter/variable/output (name=param name, var=bind variable, value=value)
|
|
96
|
-
-->
|
|
88
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
97
89
|
|
|
98
90
|
<!-- ============================================================
|
|
99
91
|
Input Parameters Definition
|
|
@@ -114,6 +106,15 @@ Stage 4: System Summary
|
|
|
114
106
|
<field name="completed_dir" required="true" type="string" desc="Marker file output directory for Worker results (absolute path required)"/>
|
|
115
107
|
</block>
|
|
116
108
|
|
|
109
|
+
<!-- ============================================================
|
|
110
|
+
Global Invocation Rules
|
|
111
|
+
============================================================ -->
|
|
112
|
+
<block type="rule" id="GLOBAL-R-INVOCATION" level="forbidden" desc="Invocation constraints — NEVER violate">
|
|
113
|
+
<field name="text">This skill is an ORCHESTRATION PLAYBOOK — it MUST be loaded directly by Team Leader via Skill tool</field>
|
|
114
|
+
<field name="text">Worker Agents MUST NOT execute this dispatch skill — if loaded by a Worker, report error and abort</field>
|
|
115
|
+
<field name="text">Downstream worker skills (identify-entries, init-features, ui-analyze, module-summarize, etc.) MUST be dispatched via Task tool → speccrew-task-worker</field>
|
|
116
|
+
</block>
|
|
117
|
+
|
|
117
118
|
<!-- ============================================================
|
|
118
119
|
Global Continuous Execution Rules
|
|
119
120
|
============================================================ -->
|
|
@@ -38,18 +38,7 @@ For each platform, generates:
|
|
|
38
38
|
|
|
39
39
|
## Workflow
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
== Block Types ==
|
|
43
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
44
|
-
output : Workflow output results (from=data source variable)
|
|
45
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
46
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
47
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
48
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
49
|
-
error-handler : Exception handling (try > catch > finally)
|
|
50
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
51
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
52
|
-
-->
|
|
41
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
53
42
|
|
|
54
43
|
<workflow>
|
|
55
44
|
|
|
@@ -76,18 +76,7 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
76
76
|
|
|
77
77
|
## Workflow
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
== Block Types ==
|
|
81
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
82
|
-
output : Workflow output results (from=data source variable)
|
|
83
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
84
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
85
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
86
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
87
|
-
error-handler : Exception handling (try > catch > finally)
|
|
88
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
89
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
90
|
-
-->
|
|
79
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
91
80
|
|
|
92
81
|
```xml
|
|
93
82
|
<workflow name="ui-feature-analysis" version="1.0">
|
|
@@ -44,18 +44,7 @@ This skill automatically adapts to the user's input language. All documentation
|
|
|
44
44
|
|
|
45
45
|
## Workflow
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
== Block Types ==
|
|
49
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
50
|
-
output : Workflow output results (from=data source variable)
|
|
51
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
52
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
53
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
54
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
55
|
-
error-handler : Exception handling (try > catch > finally)
|
|
56
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
57
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
58
|
-
-->
|
|
47
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
59
48
|
|
|
60
49
|
```xml
|
|
61
50
|
<workflow name="ui-knowledge-graph-construction" version="1.0">
|
|
@@ -68,18 +68,7 @@ Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature
|
|
|
68
68
|
|
|
69
69
|
## Workflow
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
== Block Types ==
|
|
73
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
74
|
-
output : Workflow output results (from=data source variable)
|
|
75
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
76
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
77
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
78
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
79
|
-
error-handler : Exception handling (try > catch > finally)
|
|
80
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
81
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
82
|
-
-->
|
|
71
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
83
72
|
|
|
84
73
|
<workflow>
|
|
85
74
|
|
|
@@ -51,18 +51,7 @@ flowchart TD
|
|
|
51
51
|
Step6 --> End([End])
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
== Block Types ==
|
|
56
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
57
|
-
output : Workflow output results (from=data source variable)
|
|
58
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
59
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
60
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
61
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
62
|
-
error-handler : Exception handling (try > catch > finally)
|
|
63
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
64
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
65
|
-
-->
|
|
54
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
66
55
|
|
|
67
56
|
<workflow>
|
|
68
57
|
<!-- Input Block: Define workflow inputs -->
|
|
@@ -58,18 +58,7 @@ flowchart TD
|
|
|
58
58
|
Step8 --> End([End])
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
== Block Types ==
|
|
63
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
64
|
-
output : Workflow output results (from=data source variable)
|
|
65
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
66
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
67
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
68
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
69
|
-
error-handler : Exception handling (try > catch > finally)
|
|
70
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
71
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
72
|
-
-->
|
|
61
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
73
62
|
|
|
74
63
|
<workflow>
|
|
75
64
|
<!-- Input Block: Define workflow inputs -->
|
|
@@ -10,24 +10,29 @@ Orchestrate **techs knowledge base generation** with a 3-stage pipeline using **
|
|
|
10
10
|
|
|
11
11
|
## Invocation Method
|
|
12
12
|
|
|
13
|
-
**CRITICAL**: This skill MUST be
|
|
13
|
+
**CRITICAL**: This skill is an **orchestration playbook** — it MUST be loaded directly by Team Leader via Skill tool (NOT via Worker Agent).
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
Correct:
|
|
17
|
-
Incorrect:
|
|
16
|
+
Correct: Leader uses Skill tool to load this playbook directly
|
|
17
|
+
Incorrect: Dispatch this skill to speccrew-task-worker
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
**Why?** This skill
|
|
20
|
+
**Why?** This skill defines the orchestration workflow and prepares task plans for downstream workers. The Team Leader reads this playbook and dispatches individual worker tasks via Task tool → speccrew-task-worker for each stage.
|
|
21
21
|
|
|
22
22
|
**Correct Invocation Pattern**:
|
|
23
23
|
```xml
|
|
24
|
-
<block type="task" action="
|
|
25
|
-
<field name="worker">speccrew-task-worker</field>
|
|
24
|
+
<block type="task" action="run-skill" desc="Leader directly invokes techs-dispatch as orchestration playbook">
|
|
26
25
|
<field name="skill">speccrew-knowledge-techs-dispatch-xml</field>
|
|
27
|
-
<field name="
|
|
26
|
+
<field name="note">Leader directly calls this dispatch skill as an orchestration playbook. The dispatch skill defines the workflow; Leader dispatches downstream workers via Task tool → speccrew-task-worker for each stage.</field>
|
|
28
27
|
</block>
|
|
29
28
|
```
|
|
30
29
|
|
|
30
|
+
**Worker Dispatch Rule**:
|
|
31
|
+
- Dispatch skills (bizs-dispatch-xml, techs-dispatch-xml): Leader calls directly via Skill tool
|
|
32
|
+
- Downstream worker skills (techs-init, techs-generate-conventions, techs-generate-ui-style, etc.): Leader dispatches via Task tool → speccrew-task-worker
|
|
33
|
+
|
|
34
|
+
**FORBIDDEN**: Worker Agents MUST NOT execute this dispatch skill. If a Worker Agent loads this skill, it must report error and abort.
|
|
35
|
+
|
|
31
36
|
## Quick Reference — Execution Flow
|
|
32
37
|
|
|
33
38
|
```
|
|
@@ -99,21 +104,9 @@ Read `speccrew-workspace/docs/configs/platform-mapping.json` for standardized pl
|
|
|
99
104
|
|
|
100
105
|
## XML Workflow Definition
|
|
101
106
|
|
|
107
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
108
|
+
|
|
102
109
|
<workflow id="techs-dispatch-main" status="pending" version="1.0" desc="techs knowledge base generation 3-stage pipeline">
|
|
103
|
-
<!--
|
|
104
|
-
== Block Types ==
|
|
105
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
106
|
-
output : Workflow output results (from=data source variable)
|
|
107
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
108
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
109
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
110
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
111
|
-
error-handler : Exception handling (try > catch > finally)
|
|
112
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
113
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
114
|
-
== Field ==
|
|
115
|
-
field : Parameter/variable/output (name=param name, var=bind variable, value=value)
|
|
116
|
-
-->
|
|
117
110
|
|
|
118
111
|
<!-- ============================================================
|
|
119
112
|
Input Parameters Definition
|
|
@@ -127,6 +120,15 @@ Read `speccrew-workspace/docs/configs/platform-mapping.json` for standardized pl
|
|
|
127
120
|
<field name="ide_skills_dir" required="true" type="string" desc="Absolute path to IDE skills directory (e.g., .qoder/skills, .cursor/skills)"/>
|
|
128
121
|
</block>
|
|
129
122
|
|
|
123
|
+
<!-- ============================================================
|
|
124
|
+
Global Invocation Rules
|
|
125
|
+
============================================================ -->
|
|
126
|
+
<block type="rule" id="GLOBAL-R-INVOCATION" level="forbidden" desc="Invocation constraints — NEVER violate">
|
|
127
|
+
<field name="text">This skill is an ORCHESTRATION PLAYBOOK — it MUST be loaded directly by Team Leader via Skill tool</field>
|
|
128
|
+
<field name="text">Worker Agents MUST NOT execute this dispatch skill — if loaded by a Worker, report error and abort</field>
|
|
129
|
+
<field name="text">Downstream worker skills (techs-init, techs-generate-conventions, techs-generate-ui-style, etc.) MUST be dispatched via Task tool → speccrew-task-worker</field>
|
|
130
|
+
</block>
|
|
131
|
+
|
|
130
132
|
<!-- ============================================================
|
|
131
133
|
Global Continuous Execution Rules
|
|
132
134
|
============================================================ -->
|
|
@@ -72,18 +72,7 @@ Generate the following documents in `{{output_path}}/`:
|
|
|
72
72
|
|
|
73
73
|
## Workflow
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
== Block Types Schema ==
|
|
77
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
78
|
-
output : Workflow output results (from=data source variable)
|
|
79
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
80
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
81
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
82
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
83
|
-
error-handler : Exception handling (try > catch > finally)
|
|
84
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
85
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
86
|
-
-->
|
|
75
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
87
76
|
|
|
88
77
|
```xml
|
|
89
78
|
<workflow name="platform-conventions-generation" version="1.0">
|
|
@@ -34,20 +34,7 @@ Worker Agent (speccrew-task-worker)
|
|
|
34
34
|
## XML Workflow Definition
|
|
35
35
|
|
|
36
36
|
<workflow id="techs-quality-check" status="pending" version="1.0" desc="Quality assurance for tech documentation">
|
|
37
|
-
|
|
38
|
-
== Block Types ==
|
|
39
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
40
|
-
output : Workflow output results (from=data source variable)
|
|
41
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
42
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
43
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
44
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
45
|
-
error-handler : Exception handling (try > catch > finally)
|
|
46
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
47
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
48
|
-
== Field ==
|
|
49
|
-
field : Parameter/variable/output (name=param name, var=bind variable, value=value)
|
|
50
|
-
-->
|
|
37
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
51
38
|
|
|
52
39
|
<!-- ============================================================
|
|
53
40
|
Input Parameters Definition
|
|
@@ -41,20 +41,7 @@ Worker Agent (speccrew-task-worker)
|
|
|
41
41
|
## XML Workflow Definition
|
|
42
42
|
|
|
43
43
|
<workflow id="techs-ui-style-generate" status="pending" version="1.0" desc="Generate UI style documents for frontend platform">
|
|
44
|
-
|
|
45
|
-
== Block Types ==
|
|
46
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
47
|
-
output : Workflow output results (from=data source variable)
|
|
48
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
49
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
50
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
51
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
52
|
-
error-handler : Exception handling (try > catch > finally)
|
|
53
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
54
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
55
|
-
== Field ==
|
|
56
|
-
field : Parameter/variable/output (name=param name, var=bind variable, value=value)
|
|
57
|
-
-->
|
|
44
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
58
45
|
|
|
59
46
|
<!-- ============================================================
|
|
60
47
|
Input Parameters Definition
|
|
@@ -38,18 +38,7 @@ Generate comprehensive technology documentation for a specific platform by analy
|
|
|
38
38
|
|
|
39
39
|
## Workflow
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
== Block Types ==
|
|
43
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
44
|
-
output : Workflow output results (from=data source variable)
|
|
45
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
46
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
47
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
48
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
49
|
-
error-handler : Exception handling (try > catch > finally)
|
|
50
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
51
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
52
|
-
-->
|
|
41
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
53
42
|
|
|
54
43
|
<workflow>
|
|
55
44
|
|
|
@@ -48,18 +48,7 @@ Worker Agent (speccrew-task-worker)
|
|
|
48
48
|
|
|
49
49
|
## Workflow
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
== Block Types ==
|
|
53
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
54
|
-
output : Workflow output results (from=data source variable)
|
|
55
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
56
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
57
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
58
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
59
|
-
error-handler : Exception handling (try > catch > finally)
|
|
60
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
61
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
62
|
-
-->
|
|
51
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
63
52
|
|
|
64
53
|
<workflow>
|
|
65
54
|
|
|
@@ -41,18 +41,7 @@ Worker Agent (speccrew-task-worker)
|
|
|
41
41
|
|
|
42
42
|
## Workflow
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
== Block Types ==
|
|
46
|
-
input : Workflow input parameters (required=mandatory, default=default value)
|
|
47
|
-
output : Workflow output results (from=data source variable)
|
|
48
|
-
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
49
|
-
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
50
|
-
loop : Iterate over collection (over=collection, as=current item)
|
|
51
|
-
event : Log/confirm/signal (action: log | confirm | signal)
|
|
52
|
-
error-handler : Exception handling (try > catch > finally)
|
|
53
|
-
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
54
|
-
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
55
|
-
-->
|
|
44
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
|
|
56
45
|
|
|
57
46
|
<workflow>
|
|
58
47
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# XML Workflow Specification
|
|
2
|
+
|
|
3
|
+
> This document defines the XML Block workflow format used in SpecCrew skill and agent definitions.
|
|
4
|
+
> **MANDATORY**: Any agent or worker that encounters XML `<workflow>` blocks MUST read and understand this specification before execution.
|
|
5
|
+
|
|
6
|
+
## Execution Model
|
|
7
|
+
|
|
8
|
+
This is a **Blockly-style sequential workflow definition**:
|
|
9
|
+
|
|
10
|
+
- Execute blocks **top-to-bottom in document order** within each `<sequence>`
|
|
11
|
+
- Each `<block>` is one atomic execution unit — complete it fully before moving to the next
|
|
12
|
+
- Do NOT skip, reorder, or selectively execute blocks unless a `<gateway>` directs otherwise
|
|
13
|
+
- Nested blocks within a parent block execute in document order
|
|
14
|
+
|
|
15
|
+
## Block Types
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
Defines workflow input parameters. MUST be the first block in a workflow.
|
|
20
|
+
|
|
21
|
+
```xml
|
|
22
|
+
<block type="input" id="I1" desc="Workflow input parameters">
|
|
23
|
+
<field name="source_path" required="true" type="string" desc="Source code root directory"/>
|
|
24
|
+
<field name="platform_id" required="true" type="string" desc="Platform identifier, e.g. web-vue"/>
|
|
25
|
+
<field name="output_dir" required="false" type="string" default="${workspace}/output" desc="Output directory"/>
|
|
26
|
+
</block>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- `required="true"`: Caller MUST provide this parameter
|
|
30
|
+
- `default`: Used when `required="false"` and caller omits the value
|
|
31
|
+
- Input fields automatically become workflow-scoped variables
|
|
32
|
+
|
|
33
|
+
### output
|
|
34
|
+
|
|
35
|
+
Defines workflow output results. MUST be the last block in a workflow.
|
|
36
|
+
|
|
37
|
+
```xml
|
|
38
|
+
<block type="output" id="O1" desc="Workflow output results">
|
|
39
|
+
<field name="matched_modules" from="${matcherResult.matched_modules}" type="array" desc="Matched module list"/>
|
|
40
|
+
<field name="execution_path" from="${executionPath}" type="string" desc="Execution path A or B"/>
|
|
41
|
+
</block>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- `from`: Reference to the variable containing the output value
|
|
45
|
+
|
|
46
|
+
### task
|
|
47
|
+
|
|
48
|
+
Executes an action. The primary execution block.
|
|
49
|
+
|
|
50
|
+
**Action Types:**
|
|
51
|
+
|
|
52
|
+
| Action | Purpose | Required Fields |
|
|
53
|
+
|--------|---------|-----------------|
|
|
54
|
+
| `run-skill` | Invoke a skill | `<field name="skill">` |
|
|
55
|
+
| `run-script` | Execute a command | `<field name="command">` |
|
|
56
|
+
| `dispatch-to-worker` | Delegate to a worker agent | `<field name="agent">` |
|
|
57
|
+
| `analyze` | Perform analysis | Context fields |
|
|
58
|
+
| `generate` | Generate content | Output path |
|
|
59
|
+
| `read-file` | Read file content | `<field name="path">` |
|
|
60
|
+
| `write-file` | Write file content | `<field name="path">`, content |
|
|
61
|
+
|
|
62
|
+
**Examples:**
|
|
63
|
+
|
|
64
|
+
```xml
|
|
65
|
+
<!-- Run a skill -->
|
|
66
|
+
<block type="task" id="B1" action="run-skill" desc="Execute module matcher skill">
|
|
67
|
+
<field name="skill">speccrew-knowledge-module-matcher</field>
|
|
68
|
+
<field name="source_path" value="${source_path}"/>
|
|
69
|
+
<field name="output" var="matcherResult"/>
|
|
70
|
+
</block>
|
|
71
|
+
|
|
72
|
+
<!-- Run a script -->
|
|
73
|
+
<block type="task" id="B2" action="run-script" desc="Check knowledge directory">
|
|
74
|
+
<field name="command">node scripts/check-knowledge.js --dir ${knowledgeDir}</field>
|
|
75
|
+
<field name="output" var="checkResult"/>
|
|
76
|
+
</block>
|
|
77
|
+
|
|
78
|
+
<!-- Dispatch to worker -->
|
|
79
|
+
<block type="task" id="B3" action="dispatch-to-worker" desc="Dispatch worker for analysis">
|
|
80
|
+
<field name="agent">speccrew-task-worker</field>
|
|
81
|
+
<field name="skill_path">${task.skill_path}/SKILL.md</field>
|
|
82
|
+
<field name="context">{"module": "${task.module}"}</field>
|
|
83
|
+
</block>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### gateway
|
|
87
|
+
|
|
88
|
+
Conditional branching and guard checks.
|
|
89
|
+
|
|
90
|
+
**Modes:**
|
|
91
|
+
|
|
92
|
+
| Mode | Behavior |
|
|
93
|
+
|------|----------|
|
|
94
|
+
| `exclusive` | Execute ONLY the first matching `<branch>` |
|
|
95
|
+
| `guard` | Continue if `test` passes, otherwise execute `fail-action` |
|
|
96
|
+
| `parallel` | Execute ALL branches concurrently |
|
|
97
|
+
|
|
98
|
+
**Exclusive Gateway:**
|
|
99
|
+
|
|
100
|
+
```xml
|
|
101
|
+
<block type="gateway" id="G1" mode="exclusive" desc="Select execution path">
|
|
102
|
+
<branch test="${knowledgeStatus.exists} == true" name="Incremental Update">
|
|
103
|
+
<block type="task" action="run-skill" desc="Run incremental sync">...</block>
|
|
104
|
+
</branch>
|
|
105
|
+
<branch test="${knowledgeStatus.exists} == false" name="Full Init">
|
|
106
|
+
<block type="task" action="run-skill" desc="Run full initialization">...</block>
|
|
107
|
+
</branch>
|
|
108
|
+
<branch default="true" name="Fallback">
|
|
109
|
+
<block type="event" action="log" level="error">Unknown state</block>
|
|
110
|
+
</branch>
|
|
111
|
+
</block>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Guard Gateway:**
|
|
115
|
+
|
|
116
|
+
```xml
|
|
117
|
+
<block type="gateway" id="G2" mode="guard"
|
|
118
|
+
test="${matcherResult.matched_modules.length} > 0"
|
|
119
|
+
fail-action="stop"
|
|
120
|
+
desc="Validate at least one module matched">
|
|
121
|
+
<field name="message">No modules matched. Check source path and platform config.</field>
|
|
122
|
+
</block>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- `fail-action`: `stop` | `retry` | `skip` | `fallback`
|
|
126
|
+
|
|
127
|
+
**Parallel Gateway:**
|
|
128
|
+
|
|
129
|
+
```xml
|
|
130
|
+
<block type="gateway" id="G3" mode="parallel" desc="Execute all branches concurrently">
|
|
131
|
+
<branch name="Analyze users">
|
|
132
|
+
<block type="task" action="dispatch-to-worker">...</block>
|
|
133
|
+
</branch>
|
|
134
|
+
<branch name="Analyze orders">
|
|
135
|
+
<block type="task" action="dispatch-to-worker">...</block>
|
|
136
|
+
</branch>
|
|
137
|
+
</block>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### loop
|
|
141
|
+
|
|
142
|
+
Iterate over a collection.
|
|
143
|
+
|
|
144
|
+
```xml
|
|
145
|
+
<block type="loop" id="L1" over="${tasks}" as="task"
|
|
146
|
+
parallel="true" max-concurrency="5"
|
|
147
|
+
desc="Process each task">
|
|
148
|
+
<block type="task" action="dispatch-to-worker" desc="Dispatch worker for ${task.name}">
|
|
149
|
+
<field name="agent">speccrew-task-worker</field>
|
|
150
|
+
<field name="skill_path">${task.skill_path}/SKILL.md</field>
|
|
151
|
+
</block>
|
|
152
|
+
</block>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- `over`: Collection variable to iterate (e.g., `${tasks}`)
|
|
156
|
+
- `as`: Variable name for current item (e.g., `task` → use as `${task}`)
|
|
157
|
+
- `parallel="true"`: Execute all iterations concurrently
|
|
158
|
+
- `max-concurrency`: Limit concurrent executions
|
|
159
|
+
|
|
160
|
+
### event
|
|
161
|
+
|
|
162
|
+
Logging, confirmation, and signaling.
|
|
163
|
+
|
|
164
|
+
```xml
|
|
165
|
+
<!-- Log event -->
|
|
166
|
+
<block type="event" action="log" level="info" desc="Log progress">
|
|
167
|
+
Processing ${tasks.length} tasks
|
|
168
|
+
</block>
|
|
169
|
+
|
|
170
|
+
<!-- Confirm event (pauses for user input) -->
|
|
171
|
+
<block type="event" action="confirm" title="Confirm modules" type="yesno" desc="Wait for user confirmation">
|
|
172
|
+
<field name="preview">Matched ${matcherResult.matched_modules.length} modules. Continue?</field>
|
|
173
|
+
<on-confirm>
|
|
174
|
+
<field name="confirmed" value="true"/>
|
|
175
|
+
</on-confirm>
|
|
176
|
+
<on-cancel>
|
|
177
|
+
<field name="workflow.status" value="cancelled"/>
|
|
178
|
+
</on-cancel>
|
|
179
|
+
</block>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
- `action`: `log` | `confirm` | `signal`
|
|
183
|
+
- `level` (for log): `debug` | `info` | `warn` | `error`
|
|
184
|
+
|
|
185
|
+
### error-handler
|
|
186
|
+
|
|
187
|
+
Try/catch/finally error handling.
|
|
188
|
+
|
|
189
|
+
```xml
|
|
190
|
+
<block type="error-handler" id="EH1" desc="Handle worker dispatch errors">
|
|
191
|
+
<try>
|
|
192
|
+
<block type="loop" over="${tasks}" as="task">
|
|
193
|
+
<block type="task" action="dispatch-to-worker">...</block>
|
|
194
|
+
</block>
|
|
195
|
+
</try>
|
|
196
|
+
<catch error-type="timeout">
|
|
197
|
+
<block type="event" action="log" level="error">Timeout: ${error.taskId}</block>
|
|
198
|
+
</catch>
|
|
199
|
+
<catch>
|
|
200
|
+
<block type="event" action="log" level="error">Unexpected: ${error.message}</block>
|
|
201
|
+
</catch>
|
|
202
|
+
<finally>
|
|
203
|
+
<block type="event" action="log" level="info">Batch completed</block>
|
|
204
|
+
</finally>
|
|
205
|
+
</block>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### checkpoint
|
|
209
|
+
|
|
210
|
+
Persist progress milestone. Supports resume-from-checkpoint.
|
|
211
|
+
|
|
212
|
+
```xml
|
|
213
|
+
<block type="checkpoint" id="CP1" name="matcher_completed" desc="Module matching done">
|
|
214
|
+
<field name="file" value="${progressFile}"/>
|
|
215
|
+
<field name="verify" value="${matcherResult.matched_modules.length} > 0"/>
|
|
216
|
+
</block>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- `name`: Unique checkpoint identifier for the progress file
|
|
220
|
+
- `verify`: Condition to evaluate; if true, checkpoint is marked as `passed`
|
|
221
|
+
- During resume, skip all blocks until the first non-passed checkpoint
|
|
222
|
+
|
|
223
|
+
### rule
|
|
224
|
+
|
|
225
|
+
Declare constraints. NOT an action block — these are enforced continuously.
|
|
226
|
+
|
|
227
|
+
**Levels:**
|
|
228
|
+
|
|
229
|
+
| Level | Meaning |
|
|
230
|
+
|-------|---------|
|
|
231
|
+
| `forbidden` | MUST NOT do this. Violation causes immediate stop. |
|
|
232
|
+
| `mandatory` | MUST do this. Required for correctness. |
|
|
233
|
+
| `note` | Guidance hint. Recommended but not enforced. |
|
|
234
|
+
|
|
235
|
+
```xml
|
|
236
|
+
<!-- FORBIDDEN rules -->
|
|
237
|
+
<block type="rule" id="R1" level="forbidden" desc="Phase 4 constraints">
|
|
238
|
+
<field name="text">DO NOT generate Sub-PRDs yourself — MUST dispatch Workers</field>
|
|
239
|
+
<field name="text">DO NOT use create_file to manually create progress JSON</field>
|
|
240
|
+
<field name="text">DO NOT fabricate timestamps — let scripts generate them</field>
|
|
241
|
+
</block>
|
|
242
|
+
|
|
243
|
+
<!-- MANDATORY rules -->
|
|
244
|
+
<block type="rule" id="R2" level="mandatory" desc="Execution sequence gate">
|
|
245
|
+
<field name="text">MUST execute B2→B3→B4→B5 in order, no skipping</field>
|
|
246
|
+
</block>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Placement**: Put `<rule>` blocks directly before the steps they govern. This ensures the LLM "sees" the constraint when executing those steps.
|
|
250
|
+
|
|
251
|
+
## Variable References
|
|
252
|
+
|
|
253
|
+
Use `${variable_name}` syntax throughout block attributes and content.
|
|
254
|
+
|
|
255
|
+
```xml
|
|
256
|
+
<!-- Simple variable -->
|
|
257
|
+
<field name="platform" value="${platform_id}"/>
|
|
258
|
+
|
|
259
|
+
<!-- Object property -->
|
|
260
|
+
<field name="count" value="${matcherResult.matched_modules.length}"/>
|
|
261
|
+
|
|
262
|
+
<!-- Array index -->
|
|
263
|
+
<field name="first" value="${matcherResult.matched_modules[0].name}"/>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Built-in Variables:**
|
|
267
|
+
|
|
268
|
+
| Variable | Description |
|
|
269
|
+
|----------|-------------|
|
|
270
|
+
| `${workspace}` | Workspace root directory |
|
|
271
|
+
| `${platform}` | Current platform identifier |
|
|
272
|
+
| `${timestamp}` | Current ISO timestamp |
|
|
273
|
+
| `${workflow.id}` | Current workflow ID |
|
|
274
|
+
| `${workflow.status}` | Current workflow status |
|
|
275
|
+
|
|
276
|
+
## Common Patterns
|
|
277
|
+
|
|
278
|
+
### Sequential Pipeline
|
|
279
|
+
|
|
280
|
+
```xml
|
|
281
|
+
<workflow id="pipeline" status="pending">
|
|
282
|
+
<block type="input" id="I1">...</block>
|
|
283
|
+
<sequence id="S1">
|
|
284
|
+
<block type="task" id="B1" action="run-skill">...</block>
|
|
285
|
+
<block type="task" id="B2" action="run-script">...</block>
|
|
286
|
+
<block type="task" id="B3" action="dispatch-to-worker">...</block>
|
|
287
|
+
</sequence>
|
|
288
|
+
<block type="output" id="O1">...</block>
|
|
289
|
+
</workflow>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Conditional Branching
|
|
293
|
+
|
|
294
|
+
```xml
|
|
295
|
+
<block type="gateway" mode="exclusive" desc="Route based on result">
|
|
296
|
+
<branch test="${result.count} > 10" name="Many items">
|
|
297
|
+
<block type="task" action="run-skill" desc="Batch process">...</block>
|
|
298
|
+
</branch>
|
|
299
|
+
<branch default="true" name="Few items">
|
|
300
|
+
<block type="task" action="run-skill" desc="Single process">...</block>
|
|
301
|
+
</branch>
|
|
302
|
+
</block>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Parallel Worker Dispatch
|
|
306
|
+
|
|
307
|
+
```xml
|
|
308
|
+
<block type="loop" over="${modules}" as="module" parallel="true" max-concurrency="5">
|
|
309
|
+
<block type="task" action="dispatch-to-worker" desc="Analyze ${module.name}">
|
|
310
|
+
<field name="agent">speccrew-analyzer</field>
|
|
311
|
+
<field name="context">{"module": "${module.name}"}</field>
|
|
312
|
+
</block>
|
|
313
|
+
</block>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Error Recovery
|
|
317
|
+
|
|
318
|
+
```xml
|
|
319
|
+
<block type="error-handler" desc="Robust processing">
|
|
320
|
+
<try>
|
|
321
|
+
<block type="task" action="run-skill" desc="Primary operation">...</block>
|
|
322
|
+
</try>
|
|
323
|
+
<catch error-type="timeout">
|
|
324
|
+
<block type="task" action="run-skill" desc="Fallback operation">...</block>
|
|
325
|
+
</catch>
|
|
326
|
+
<finally>
|
|
327
|
+
<block type="checkpoint" name="done" desc="Mark complete">...</block>
|
|
328
|
+
</finally>
|
|
329
|
+
</block>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## Execution Rules
|
|
333
|
+
|
|
334
|
+
1. **NEVER skip a block** — execute every block in document order
|
|
335
|
+
2. **Read `rule` blocks as constraints** — check them continuously during execution
|
|
336
|
+
3. **`checkpoint` blocks** = persist progress before continuing
|
|
337
|
+
4. **`gateway mode="exclusive"`** = only execute the first matching branch
|
|
338
|
+
5. **`loop parallel="true"`** = dispatch all iterations concurrently
|
|
339
|
+
6. **`rule level="forbidden"`** = immediate stop if violated
|
|
340
|
+
7. **Input/Output blocks** define the contract — respect required parameters
|