speccrew 0.7.42 → 0.7.44

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.
@@ -32,6 +32,15 @@ tools: Read, Write, Glob, Grep
32
32
  - API Contract template file does not exist → STOP
33
33
  - `node ... update-progress.js` script execution fails → **HARD STOP**: Do NOT manually create or edit JSON progress files. Report the script error and wait for user resolution.
34
34
 
35
+ ### Error Categories
36
+
37
+ | Category | Condition | Recovery |
38
+ |----------|-----------|----------|
39
+ | `DEPENDENCY_MISSING` | Feature Spec document not found or empty | Ensure feature design phase completed for this feature |
40
+ | `DEPENDENCY_MISSING` | API Contract template not found | Verify skill installation integrity |
41
+ | `VALIDATION_ERROR` | Feature Spec missing required API sections | Review and fix feature spec content |
42
+ | `RUNTIME_ERROR` | update-progress.js script execution failed | Check script errors; do NOT manually edit JSON |
43
+
35
44
  > **NOTE**: This skill does NOT include user confirmation. Confirmation is handled at the orchestrator/dispatcher level after all features are processed. This enables continuous batch execution.
36
45
 
37
46
  ## Step 1: Read Input
@@ -44,7 +44,7 @@
44
44
 
45
45
  <!-- Gateway: Validate Feature Spec exists -->
46
46
  <block type="gateway" id="G1" mode="guard" desc="Verify Feature Spec exists"
47
- test="${feature_spec} != null" fail-action="stop">
47
+ test="${feature_spec} != null" fail-action="goto:E1">
48
48
  <field name="message">Feature Spec document not found. Check path: ${iteration_path}/02.feature-design/</field>
49
49
  </block>
50
50
 
@@ -56,7 +56,7 @@
56
56
 
57
57
  <!-- Gateway: Validate template exists -->
58
58
  <block type="gateway" id="G2" mode="guard" desc="Verify template exists"
59
- test="${template_content} != null" fail-action="stop">
59
+ test="${template_content} != null" fail-action="goto:E2">
60
60
  <field name="message">API Contract template not found at speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md</field>
61
61
  </block>
62
62
 
@@ -172,6 +172,19 @@ ${api_list.error_codes}</field>
172
172
 
173
173
  </sequence>
174
174
 
175
+ <!-- ============================================================
176
+ Error Handling Blocks
177
+ ============================================================ -->
178
+ <block type="task" id="E1" action="run-script" desc="Record error for missing Feature Spec">
179
+ <field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${dispatch_progress_path}" --task-id "${feature_id}" --status failed --error "Feature Spec document not found at: ${feature_spec_path}" --error-category "DEPENDENCY_MISSING"</field>
180
+ <field name="on-complete">abort</field>
181
+ </block>
182
+
183
+ <block type="task" id="E2" action="run-script" desc="Record error for missing API Contract template">
184
+ <field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${dispatch_progress_path}" --task-id "${feature_id}" --status failed --error "API Contract template not found at: speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md" --error-category "DEPENDENCY_MISSING"</field>
185
+ <field name="on-complete">abort</field>
186
+ </block>
187
+
175
188
  <!-- ============================================================
176
189
  Output Results
177
190
  ============================================================ -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.42",
3
+ "version": "0.7.44",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -727,15 +727,20 @@ function cmdUpdateTask(args) {
727
727
  }
728
728
  }
729
729
 
730
- // Update task
731
- taskArray[taskIndex] = task;
730
+ // Update task (only needed for array mode; object mode is updated by reference)
731
+ if (taskArray && taskIndex >= 0) {
732
+ taskArray[taskIndex] = task;
733
+ }
732
734
  data.updated_at = now;
733
735
 
734
736
  // Recalculate counts
735
737
  if (isStageMode && targetStage.counts) {
736
738
  // Update stage-level counts
737
- targetStage.counts = calculateCounts(taskArray);
738
- } else {
739
+ const countSource = Array.isArray(targetStage.features)
740
+ ? targetStage.features
741
+ : Object.values(targetStage.features);
742
+ targetStage.counts = calculateCounts(countSource);
743
+ } else if (data.tasks) {
739
744
  // Update global counts
740
745
  data.counts = calculateCounts(data.tasks);
741
746
  }