speccrew 0.6.53 → 0.6.54

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.
@@ -385,6 +385,34 @@ Before executing the workflow, verify the following inputs:
385
385
  <field name="message" value="Step 5a Status: COMPLETED - Template copied to ${documentPath}, ready for section filling"/>
386
386
  </block>
387
387
 
388
+ <!-- ==================== STEP 5-DYNAMIC: DYNAMIC SECTION GENERATION ==================== -->
389
+ <!-- Dynamic Section Generation Rule -->
390
+ <block type="rule" id="R-DYNAMIC-SECTIONS" level="mandatory" desc="Dynamic section generation rule">
391
+ <field name="text">BEFORE filling template sections, you MUST first count identified items (endpoints, components, etc.) and dynamically create the corresponding number of sections in the document.</field>
392
+ <field name="text">Step 1: Copy template skeleton to target path</field>
393
+ <field name="text">Step 2: For each identified endpoint/component, insert a new numbered sub-section (e.g., 2.1, 2.2, 2.3...) into the document</field>
394
+ <field name="text">Step 3: Fill each sub-section with the specific endpoint/component details</field>
395
+ <field name="text">NEVER rely on fixed template sections alone — the number of sections MUST match the number of identified items</field>
396
+ </block>
397
+
398
+ <!-- Dynamically Generate Endpoint Sections -->
399
+ <block type="loop" id="L-ENDPOINT-SECTIONS" over="${endpoints}" as="endpoint" desc="Dynamically generate a section for each API endpoint">
400
+ <block type="task" id="B-EP-SECTION" action="generate" desc="Insert endpoint sub-section into document">
401
+ <field name="target" value="${documentPath}"/>
402
+ <field name="content">For endpoint ${endpoint.method} ${endpoint.path}: insert a ## 2.X sub-section containing Endpoint Information table, Request Parameters, Response Data, Business Flow, and Error Codes</field>
403
+ <field name="output" var="section_${endpoint.index}"/>
404
+ </block>
405
+ </block>
406
+
407
+ <!-- Verify Section Count Matches Endpoint Count -->
408
+ <block type="checkpoint" id="CP-SECTIONS-COUNT" desc="Verify section count matches endpoint count">
409
+ <field name="verify" value="Number of generated 2.X sections == ${endpoints.length}"/>
410
+ </block>
411
+
412
+ <block type="event" id="E-DYNAMIC" action="log" level="info" desc="Log dynamic sections status">
413
+ <field name="message" value="Step 5-Dynamic Status: COMPLETED - Generated ${endpoints.length} endpoint sections dynamically"/>
414
+ </block>
415
+
388
416
  <!-- ==================== STEP 5B: FILL EACH SECTION USING SEARCH_REPLACE ==================== -->
389
417
  <!-- Calculate Dynamic Path Prefix -->
390
418
  <block type="task" id="B17" action="calculate-path-prefix" desc="Calculate path prefix">
@@ -306,7 +306,31 @@ Analyze one specific UI feature from source code, extract business functionality
306
306
  <field name="message">Step 5a Status: COMPLETED - Template copied to ${documentPath}</field>
307
307
  </block>
308
308
  </sequence>
309
-
309
+
310
+ <!-- ==================== STEP 5-MID: DYNAMIC SECTION GENERATION ==================== -->
311
+ <!-- Rule: Dynamic section generation before filling fixed sections -->
312
+ <block type="rule" id="R-DYNAMIC-SECTIONS" level="mandatory" desc="Dynamic section generation rule">
313
+ <field name="text">BEFORE filling template sections, you MUST first count identified UI components and dynamically create the corresponding number of sections in the document.</field>
314
+ <field name="text">Step 1: Copy template skeleton to target path</field>
315
+ <field name="text">Step 2: For each identified UI component/area, insert a new numbered sub-section (e.g., 2.1, 2.2, 2.3...) into the document</field>
316
+ <field name="text">Step 3: Fill each sub-section with the specific component details (wireframe, interactions, events)</field>
317
+ <field name="text">NEVER rely on fixed template sections alone — the number of sections MUST match the number of identified UI components</field>
318
+ </block>
319
+
320
+ <!-- Loop: Dynamically generate a section for each UI component -->
321
+ <block type="loop" id="L-COMPONENT-SECTIONS" over="${analysisResult.components}" as="component" desc="Dynamically generate a section for each UI component">
322
+ <block type="task" id="B-COMP-SECTION" action="generate" desc="Insert component sub-section into document">
323
+ <field name="target" value="${documentPath}"/>
324
+ <field name="content">For component ${component.name} (type: ${component.type}): insert a ## 2.X sub-section containing Component Wireframe, Props/Events table, Interaction Flow, and State Management</field>
325
+ <field name="output" var="section_${component.index}"/>
326
+ </block>
327
+ </block>
328
+
329
+ <!-- Checkpoint: Verify section count matches component count -->
330
+ <block type="checkpoint" id="CP-SECTIONS-COUNT" desc="Verify section count matches component count">
331
+ <field name="verify">Number of generated 2.X sections == ${analysisResult.components.length}</field>
332
+ </block>
333
+
310
334
  <!-- ==================== STEP 5B: FILL EACH SECTION USING SEARCH_REPLACE ==================== -->
311
335
  <sequence id="S5b" name="Step 5b: Fill Sections" status="pending" desc="Fill document sections">
312
336
  <!-- Section 1: Content Overview -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.6.53",
3
+ "version": "0.6.54",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {