speccrew 0.6.43 → 0.6.45

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.
@@ -43,115 +43,217 @@ Worker Agent (speccrew-task-worker)
43
43
 
44
44
  > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
45
45
 
46
- <workflow>
46
+ <workflow id="techs-init-main" status="pending" version="1.0" desc="Technology platform detection and manifest generation">
47
+
48
+ <!-- ============================================================
49
+ Global Rules
50
+ ============================================================ -->
51
+ <block type="rule" id="GLOBAL-R1" level="mandatory" desc="Continuous Execution constraint">
52
+ <field name="text">Execute all steps in sequence without interruption. Worker must complete all steps before reporting results.</field>
53
+ </block>
54
+
55
+ <block type="rule" id="GLOBAL-R-TECHSTACK" level="mandatory" desc="Technology Stack constraint">
56
+ <field name="text">Detected platforms must align with standardized platform identifiers from platform-mapping.json.</field>
57
+ </block>
58
+
59
+ <!-- ============================================================
60
+ Input Parameters Definition
61
+ ============================================================ -->
62
+ <block type="input" id="I1" desc="techs-init input parameters">
63
+ <field name="source_path" required="false" type="string" default="project-root" desc="Source code root directory"/>
64
+ <field name="output_path" required="false" type="string" default="speccrew-workspace/knowledges/base/sync-state/knowledge-techs/" desc="Output directory for techs-manifest.json"/>
65
+ <field name="language" required="true" type="string" desc="Target language for generated content"/>
66
+ </block>
67
+
68
+ <!-- ============================================================
69
+ Step 1: Scan for Platform Indicators
70
+ ============================================================ -->
71
+ <sequence id="S1" name="Platform Detection" status="pending" desc="Analyze project structure to detect technology platforms">
47
72
 
48
- <!-- Global Rules -->
49
- <rule id="GLOBAL-R1" level="mandatory" description="Continuous Execution: Execute all steps in sequence without interruption. Worker must complete all steps before reporting results." />
50
- <rule id="GLOBAL-R-TECHSTACK" level="mandatory" description="Technology Stack Constraint: Detected platforms must align with standardized platform identifiers from platform-mapping.json." />
51
-
52
- <!-- Input Block -->
53
- <input name="source_path" type="string" required="false" default="project-root" description="Source code root directory" />
54
- <input name="output_path" type="string" required="false" default="speccrew-workspace/knowledges/base/sync-state/knowledge-techs/" description="Output directory for techs-manifest.json" />
55
- <input name="language" type="string" required="true" description="Target language for generated content" />
56
-
57
- <!-- Step 1: Scan for Platform Indicators -->
58
- <task id="step1-scan-platforms" action="scan" description="Analyze project structure to detect technology platforms">
59
-
60
73
  <!-- Step 1a: Read Platform Mapping Config -->
61
- <task id="step1a-read-config" action="read" description="Read platform-mapping.json for standardized identifiers">
62
- <read-file path="speccrew-workspace/docs/configs/platform-mapping.json" />
63
- </task>
74
+ <block type="task" id="S1-B1a" action="read-file" status="pending" desc="Read platform-mapping.json for standardized identifiers">
75
+ <field name="file_path">${workspace_path}/docs/configs/platform-mapping.json</field>
76
+ <field name="output" var="platform_mapping"/>
77
+ </block>
64
78
 
65
79
  <!-- Step 1b: Detect Web Platforms -->
66
- <gateway id="detect-web" mode="parallel" description="Detect web platform indicators">
67
- <check signal="package.json + react dependency" platform-id="web-react" framework="react" />
68
- <check signal="package.json + vue dependency" platform-id="web-vue" framework="vue" />
69
- <check signal="package.json + @angular/core" platform-id="web-angular" framework="angular" />
70
- <check signal="package.json + next" platform-id="web-nextjs" framework="nextjs" />
71
- <check signal="package.json + nuxt" platform-id="web-nuxt" framework="nuxt" />
72
- <check signal="package.json + svelte" platform-id="web-svelte" framework="svelte" />
73
- </gateway>
80
+ <block type="gateway" id="S1-G1" mode="parallel" desc="Detect web platform indicators">
81
+ <branch test="package.json exists AND react dependency detected" name="web-react">
82
+ <field name="platform_id" value="web-react"/>
83
+ <field name="framework" value="react"/>
84
+ </branch>
85
+ <branch test="package.json exists AND vue dependency detected" name="web-vue">
86
+ <field name="platform_id" value="web-vue"/>
87
+ <field name="framework" value="vue"/>
88
+ </branch>
89
+ <branch test="package.json exists AND @angular/core detected" name="web-angular">
90
+ <field name="platform_id" value="web-angular"/>
91
+ <field name="framework" value="angular"/>
92
+ </branch>
93
+ <branch test="package.json exists AND next dependency detected" name="web-nextjs">
94
+ <field name="platform_id" value="web-nextjs"/>
95
+ <field name="framework" value="nextjs"/>
96
+ </branch>
97
+ <branch test="package.json exists AND nuxt dependency detected" name="web-nuxt">
98
+ <field name="platform_id" value="web-nuxt"/>
99
+ <field name="framework" value="nuxt"/>
100
+ </branch>
101
+ <branch test="package.json exists AND svelte dependency detected" name="web-svelte">
102
+ <field name="platform_id" value="web-svelte"/>
103
+ <field name="framework" value="svelte"/>
104
+ </branch>
105
+ </block>
74
106
 
75
107
  <!-- Step 1c: Detect Mobile Platforms -->
76
- <gateway id="detect-mobile" mode="parallel" description="Detect mobile platform indicators">
77
- <check signal="pubspec.yaml" platform-id="mobile-flutter" framework="flutter" />
78
- <check signal="package.json + react-native" platform-id="mobile-react-native" framework="react-native" />
79
- <check signal=".xcodeproj / Package.swift" platform-id="mobile-ios" framework="ios" />
80
- <check signal="build.gradle + AndroidManifest.xml" platform-id="mobile-android" framework="android" />
81
- <check signal="manifest.json + pages.json" platform-id="mobile-uniapp" framework="uniapp" />
82
- <check signal="project.config.json + app.json" platform-id="mobile-miniprogram" framework="miniprogram" />
83
- </gateway>
108
+ <block type="gateway" id="S1-G2" mode="parallel" desc="Detect mobile platform indicators">
109
+ <branch test="pubspec.yaml exists" name="mobile-flutter">
110
+ <field name="platform_id" value="mobile-flutter"/>
111
+ <field name="framework" value="flutter"/>
112
+ </branch>
113
+ <branch test="package.json exists AND react-native dependency detected" name="mobile-react-native">
114
+ <field name="platform_id" value="mobile-react-native"/>
115
+ <field name="framework" value="react-native"/>
116
+ </branch>
117
+ <branch test=".xcodeproj OR Package.swift exists" name="mobile-ios">
118
+ <field name="platform_id" value="mobile-ios"/>
119
+ <field name="framework" value="ios"/>
120
+ </branch>
121
+ <branch test="build.gradle exists AND AndroidManifest.xml exists" name="mobile-android">
122
+ <field name="platform_id" value="mobile-android"/>
123
+ <field name="framework" value="android"/>
124
+ </branch>
125
+ <branch test="manifest.json exists AND pages.json exists" name="mobile-uniapp">
126
+ <field name="platform_id" value="mobile-uniapp"/>
127
+ <field name="framework" value="uniapp"/>
128
+ </branch>
129
+ <branch test="project.config.json exists AND app.json exists" name="mobile-miniprogram">
130
+ <field name="platform_id" value="mobile-miniprogram"/>
131
+ <field name="framework" value="miniprogram"/>
132
+ </branch>
133
+ </block>
84
134
 
85
135
  <!-- Step 1d: Detect Backend Platforms -->
86
- <gateway id="detect-backend" mode="parallel" description="Detect backend platform indicators">
87
- <check signal="package.json + @nestjs/core" platform-id="backend-nestjs" framework="nestjs" />
88
- <check signal="package.json + express" platform-id="backend-express" framework="express" />
89
- <check signal="package.json + fastify" platform-id="backend-fastify" framework="fastify" />
90
- <check signal="pom.xml + spring-boot" platform-id="backend-spring" framework="spring" />
91
- <check signal="requirements.txt + django" platform-id="backend-django" framework="django" />
92
- <check signal="requirements.txt + fastapi" platform-id="backend-fastapi" framework="fastapi" />
93
- <check signal="go.mod" platform-id="backend-go" framework="go" />
94
- <check signal="Cargo.toml" platform-id="backend-rust" framework="rust" />
95
- </gateway>
136
+ <block type="gateway" id="S1-G3" mode="parallel" desc="Detect backend platform indicators">
137
+ <branch test="package.json exists AND @nestjs/core detected" name="backend-nestjs">
138
+ <field name="platform_id" value="backend-nestjs"/>
139
+ <field name="framework" value="nestjs"/>
140
+ </branch>
141
+ <branch test="package.json exists AND express detected" name="backend-express">
142
+ <field name="platform_id" value="backend-express"/>
143
+ <field name="framework" value="express"/>
144
+ </branch>
145
+ <branch test="package.json exists AND fastify detected" name="backend-fastify">
146
+ <field name="platform_id" value="backend-fastify"/>
147
+ <field name="framework" value="fastify"/>
148
+ </branch>
149
+ <branch test="pom.xml exists AND spring-boot detected" name="backend-spring">
150
+ <field name="platform_id" value="backend-spring"/>
151
+ <field name="framework" value="spring"/>
152
+ </branch>
153
+ <branch test="requirements.txt exists AND django detected" name="backend-django">
154
+ <field name="platform_id" value="backend-django"/>
155
+ <field name="framework" value="django"/>
156
+ </branch>
157
+ <branch test="requirements.txt exists AND fastapi detected" name="backend-fastapi">
158
+ <field name="platform_id" value="backend-fastapi"/>
159
+ <field name="framework" value="fastapi"/>
160
+ </branch>
161
+ <branch test="go.mod exists" name="backend-go">
162
+ <field name="platform_id" value="backend-go"/>
163
+ <field name="framework" value="go"/>
164
+ </branch>
165
+ <branch test="Cargo.toml exists" name="backend-rust">
166
+ <field name="platform_id" value="backend-rust"/>
167
+ <field name="framework" value="rust"/>
168
+ </branch>
169
+ </block>
96
170
 
97
171
  <!-- Step 1e: Detect Desktop Platforms -->
98
- <gateway id="detect-desktop" mode="parallel" description="Detect desktop platform indicators">
99
- <check signal="package.json + electron" platform-id="desktop-electron" framework="electron" />
100
- <check signal="tauri.conf.json" platform-id="desktop-tauri" framework="tauri" />
101
- <check signal=".csproj + WPF references" platform-id="desktop-wpf" framework="wpf" />
102
- <check signal=".csproj + WinForms" platform-id="desktop-winforms" framework="winforms" />
103
- <check signal=".pro file + Qt" platform-id="desktop-qt" framework="qt" />
104
- </gateway>
105
-
106
- </task>
107
-
108
- <!-- Step 2: Extract Platform Metadata -->
109
- <loop id="step2-extract-metadata" over="detected_platforms" as="platform" description="Extract metadata for each detected platform">
110
- <task action="extract" description="Extract platform metadata fields">
111
- <extract-fields>
112
- <field name="platform_id" value="{platform_type}-{framework}" />
113
- <field name="platform_type" from="detected_type" />
114
- <field name="framework" from="detected_framework" />
115
- <field name="language" from="config_file_analysis" />
116
- <field name="source_path" from="directory_location" />
117
- <field name="config_files" from="file_list" />
118
- <field name="convention_files" from="lint_format_configs" />
119
- </extract-fields>
120
- </task>
121
- </loop>
122
-
123
- <!-- Step 3: Get Timestamp -->
124
- <task id="step3-get-timestamp" action="run-script" description="Get current timestamp for generated_at field">
125
- <run-script script="scripts/get-timestamp.js" output="timestamp" />
126
- </task>
127
-
128
- <!-- Step 4: Generate techs-manifest.json -->
129
- <task id="step4-generate-manifest" action="generate" description="Generate techs-manifest.json with detected platforms">
130
- <generate-json output="{output_path}/techs-manifest.json">
131
- <field name="generated_at" value="{timestamp}" />
132
- <field name="source_path" value="{source_path}" />
133
- <field name="language" value="{language}" />
134
- <array name="platforms" from="detected_platforms_metadata" />
135
- </generate-json>
136
- </task>
137
-
138
- <!-- Step 5: Report Results -->
139
- <event id="step5-report" action="log" description="Report detection results">
140
- <report format="structured">
141
- Stage 1 completed: Technology Platform Detection
142
- - Platforms Detected: {platform_count}
143
- - web-react: React 18.2.0, TypeScript 5.3.0
144
- - backend-nestjs: NestJS 10.0.0, TypeScript 5.3.0
145
- - Configuration Files Found: {config_file_count}
146
- - Output: {output_path}/techs-manifest.json
147
- - Next: Dispatch parallel tasks for Stage 2 (Tech Document Generation)
148
- </report>
149
- </event>
150
-
151
- <!-- Output Block -->
152
- <output name="status" from="detection_status" />
153
- <output name="platforms_detected" from="detected_platforms_list" />
154
- <output name="manifest_path" from="manifest_file_path" />
172
+ <block type="gateway" id="S1-G4" mode="parallel" desc="Detect desktop platform indicators">
173
+ <branch test="package.json exists AND electron detected" name="desktop-electron">
174
+ <field name="platform_id" value="desktop-electron"/>
175
+ <field name="framework" value="electron"/>
176
+ </branch>
177
+ <branch test="tauri.conf.json exists" name="desktop-tauri">
178
+ <field name="platform_id" value="desktop-tauri"/>
179
+ <field name="framework" value="tauri"/>
180
+ </branch>
181
+ <branch test=".csproj exists AND WPF references detected" name="desktop-wpf">
182
+ <field name="platform_id" value="desktop-wpf"/>
183
+ <field name="framework" value="wpf"/>
184
+ </branch>
185
+ <branch test=".csproj exists AND WinForms detected" name="desktop-winforms">
186
+ <field name="platform_id" value="desktop-winforms"/>
187
+ <field name="framework" value="winforms"/>
188
+ </branch>
189
+ <branch test=".pro file exists AND Qt detected" name="desktop-qt">
190
+ <field name="platform_id" value="desktop-qt"/>
191
+ <field name="framework" value="qt"/>
192
+ </branch>
193
+ </block>
194
+
195
+ </sequence>
196
+
197
+ <!-- ============================================================
198
+ Step 2: Extract Platform Metadata
199
+ ============================================================ -->
200
+ <sequence id="S2" name="Metadata Extraction" status="pending" desc="Extract metadata for each detected platform">
201
+
202
+ <block type="loop" id="S2-L1" over="${detected_platforms}" as="platform" desc="Extract metadata for each detected platform">
203
+ <block type="task" id="S2-B1" action="analyze" status="pending" desc="Extract platform metadata fields">
204
+ <field name="platform_id" value="${platform.platform_type}-${platform.framework}"/>
205
+ <field name="platform_type" from="${platform.detected_type}"/>
206
+ <field name="framework" from="${platform.detected_framework}"/>
207
+ <field name="language" from="${platform.config_file_analysis}"/>
208
+ <field name="source_path" from="${platform.directory_location}"/>
209
+ <field name="config_files" from="${platform.file_list}"/>
210
+ <field name="convention_files" from="${platform.lint_format_configs}"/>
211
+ <field name="output" var="platform_metadata"/>
212
+ </block>
213
+ </block>
214
+
215
+ </sequence>
216
+
217
+ <!-- ============================================================
218
+ Step 3: Get Timestamp
219
+ ============================================================ -->
220
+ <block type="task" id="S3-B1" action="run-script" status="pending" desc="Get current timestamp for generated_at field">
221
+ <field name="command">node scripts/get-timestamp.js</field>
222
+ <field name="output" var="timestamp"/>
223
+ </block>
224
+
225
+ <!-- ============================================================
226
+ Step 4: Generate techs-manifest.json
227
+ ============================================================ -->
228
+ <block type="task" id="S4-B1" action="generate" status="pending" desc="Generate techs-manifest.json with detected platforms">
229
+ <field name="output_path">${output_path}/techs-manifest.json</field>
230
+ <field name="generated_at" value="${timestamp}"/>
231
+ <field name="source_path" value="${source_path}"/>
232
+ <field name="language" value="${language}"/>
233
+ <field name="platforms" from="${detected_platforms_metadata}"/>
234
+ </block>
235
+
236
+ <!-- ============================================================
237
+ Step 5: Report Results
238
+ ============================================================ -->
239
+ <block type="event" id="S5-E1" action="log" level="info" desc="Report detection results">
240
+ Stage 1 completed: Technology Platform Detection
241
+ - Platforms Detected: ${platform_count}
242
+ - web-react: React 18.2.0, TypeScript 5.3.0
243
+ - backend-nestjs: NestJS 10.0.0, TypeScript 5.3.0
244
+ - Configuration Files Found: ${config_file_count}
245
+ - Output: ${output_path}/techs-manifest.json
246
+ - Next: Dispatch parallel tasks for Stage 2 (Tech Document Generation)
247
+ </block>
248
+
249
+ <!-- ============================================================
250
+ Output Definition
251
+ ============================================================ -->
252
+ <block type="output" id="O1" desc="Workflow output results">
253
+ <field name="status" from="${detection_status}"/>
254
+ <field name="platforms_detected" from="${detected_platforms_list}"/>
255
+ <field name="manifest_path" from="${manifest_file_path}"/>
256
+ </block>
155
257
 
156
258
  </workflow>
157
259
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.6.43",
3
+ "version": "0.6.45",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -329,6 +329,27 @@ Use `${variable_name}` syntax throughout block attributes and content.
329
329
  </block>
330
330
  ```
331
331
 
332
+ ## Action to IDE Tool Mapping
333
+
334
+ When executing `<block type="task">` blocks, the `action` attribute determines which **IDE tool** to invoke. Do NOT interpret actions freely — use the exact tool specified below:
335
+
336
+ | Action | IDE Tool to Use | How to Invoke |
337
+ |--------|----------------|---------------|
338
+ | `run-skill` | **Skill tool** | Call the IDE Skill tool with the skill name from `<field name="skill">`. Do NOT manually browse directories or read SKILL.md files — the Skill tool resolves paths automatically. |
339
+ | `dispatch-to-worker` | **Task tool** | Create a new Task via the IDE Task tool, assigning it to the worker agent specified in `<field name="agent">`. Pass all context fields as task parameters. For `<loop parallel="true">`, create ALL tasks in a single batch. |
340
+ | `run-script` | **Bash / Terminal tool** | Execute the command from `<field name="command">` using the terminal tool. Use PowerShell syntax on Windows, Bash on Unix. |
341
+ | `read-file` | **Read tool** | Read the file at the path specified in `<field name="path">`. |
342
+ | `write-file` | **Write / Edit tool** | Write content to the file at `<field name="path">`. For new files use create_file; for modifications use search_replace. |
343
+ | `analyze` | **Direct execution** | Perform the analysis described in the block's `desc` attribute. Read relevant source files, extract information, and store results in the specified output variables. |
344
+ | `generate` | **Direct execution** | Generate the content described in the block. Use templates when specified, write output to the target path. |
345
+
346
+ ### Critical Rules
347
+
348
+ 1. **`run-skill` MUST use the Skill tool** — NEVER manually search for or read SKILL.md files. The IDE Skill tool handles path resolution across different IDE directories (.qoder/, .cursor/, .claude/).
349
+ 2. **`dispatch-to-worker` MUST use the Task tool** — NEVER execute worker tasks yourself. Create a Task and let the worker agent handle it.
350
+ 3. **`<loop parallel="true">` with `dispatch-to-worker`** — Create ALL worker tasks in ONE batch call, not sequentially. This enables true parallel execution.
351
+ 4. **Variable binding** — After a tool call completes, bind the result to the variable specified in `<field name="output" var="..."/>` for use in subsequent blocks.
352
+
332
353
  ## Execution Rules
333
354
 
334
355
  1. **NEVER skip a block** — execute every block in document order