speccrew 0.7.31 → 0.7.33
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-feature-designer.md +13 -2
- package/.speccrew/agents/speccrew-task-worker.md +20 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +45 -6
- package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +8 -0
- package/package.json +1 -1
- package/workspace-template/scripts/update-progress.js +17 -1
|
@@ -171,10 +171,21 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
171
171
|
> **If ANY of the following conditions occur, the Feature Designer Agent MUST immediately STOP the workflow and report to user.**
|
|
172
172
|
|
|
173
173
|
1. **Skill Invocation Failure**: Any skill call returns error → STOP. Do NOT generate content manually.
|
|
174
|
-
2. **Script Execution Failure**: `node ... update-progress.js`
|
|
174
|
+
2. **Script Execution Failure**: `node ... update-progress.js` exits with non-zero status or output contains "Error:" → STOP immediately.
|
|
175
|
+
- Do NOT attempt to continue batch processing
|
|
176
|
+
- Do NOT ask user for alternative options (A/B/C)
|
|
177
|
+
- Do NOT suggest "skip to next phase" or "process only some features"
|
|
178
|
+
- Report exact error message, failed task ID, and failed command
|
|
175
179
|
3. **Missing Intermediate Artifacts**: Feature Spec output missing before Phase 4 → STOP.
|
|
176
180
|
4. **User Rejection**: User rejects Feature List, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
|
|
177
181
|
5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
|
|
182
|
+
6. **Progress File Read Failure**: Cannot read DISPATCH-PROGRESS.json → STOP.
|
|
183
|
+
|
|
184
|
+
> 🛑 **FORBIDDEN ON SCRIPT FAILURE**:
|
|
185
|
+
> - ❌ "Due to script errors, I suggest we..."
|
|
186
|
+
> - ❌ "Let me offer you options: 1. Continue 2. Skip 3. ..."
|
|
187
|
+
> - ❌ "进度更新脚本频繁失败,建议..."
|
|
188
|
+
> - ✅ ONLY correct response: "STOP: update-progress.js failed with [error]. Task: [id]. Command: [cmd]."
|
|
178
189
|
|
|
179
190
|
## TIMESTAMP INTEGRITY
|
|
180
191
|
|
|
@@ -208,7 +219,7 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
208
219
|
## Phase 0: Workflow Progress Management
|
|
209
220
|
|
|
210
221
|
> **Path Variables** (provided by caller as absolute paths):
|
|
211
|
-
> - `workspace_path`:
|
|
222
|
+
> - `workspace_path`: **MANDATORY absolute path** — Worker MUST use this for ALL script calls. Example: `D:\dev\RuoYi-Vue3-FastAPI\speccrew-workspace`
|
|
212
223
|
> - `update_progress_script`: `{workspace_path}/scripts/update-progress.js`
|
|
213
224
|
> - `iterations_dir`: `{workspace_path}/iterations`
|
|
214
225
|
|
|
@@ -57,6 +57,26 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
57
57
|
- DO NOT wait for confirmation before writing output files
|
|
58
58
|
- If skill execution fails, report failure with details — do not ask user what to do
|
|
59
59
|
|
|
60
|
+
### OUTPUT EFFICIENCY
|
|
61
|
+
|
|
62
|
+
When executing design or document generation skills:
|
|
63
|
+
- Generate content directly into the output file
|
|
64
|
+
- DO NOT display full document sections in conversation
|
|
65
|
+
- Only output brief block execution announcements
|
|
66
|
+
- This is especially critical in batch mode where multiple Workers run simultaneously
|
|
67
|
+
|
|
68
|
+
**FORBIDDEN output in conversation during design tasks:**
|
|
69
|
+
- ASCII wireframes / UI prototypes
|
|
70
|
+
- Mermaid diagrams (these go in the file only)
|
|
71
|
+
- API endpoint lists
|
|
72
|
+
- Data model tables
|
|
73
|
+
- Full section content
|
|
74
|
+
|
|
75
|
+
**Allowed output:**
|
|
76
|
+
- Block execution announcements: "[Block B1] Designing UI prototypes..."
|
|
77
|
+
- Error messages
|
|
78
|
+
- Final completion summary (1-2 lines)
|
|
79
|
+
|
|
60
80
|
## Workflow
|
|
61
81
|
|
|
62
82
|
### 1. Receive Task
|
|
@@ -52,6 +52,14 @@ This skill applies ISA-95 Stages 1-6 as an internal thinking framework:
|
|
|
52
52
|
4. **FORBIDDEN: Skip Checkpoint B** — User confirmation required before generating documents (unless `skip_checkpoint=true`)
|
|
53
53
|
5. **FORBIDDEN: Rename features** — Output filename MUST use the exact `feature_name` parameter value. DO NOT translate, abbreviate, paraphrase, or substitute with alternative names found in PRD content. The `feature_name` parameter is the SINGLE SOURCE OF TRUTH for file naming.
|
|
54
54
|
|
|
55
|
+
> **CRITICAL: Script Path Rule**
|
|
56
|
+
> ALL update-progress.js commands MUST use absolute paths with `{workspace_path}`:
|
|
57
|
+
> ```
|
|
58
|
+
> node "{workspace_path}/scripts/update-progress.js" update-task --file "{workspace_path}/iterations/..." ...
|
|
59
|
+
> ```
|
|
60
|
+
> NEVER use relative paths like `node scripts/update-progress.js` or `cd ... ; node scripts/...`
|
|
61
|
+
> The Worker may execute from project root directory, NOT from speccrew-workspace directory.
|
|
62
|
+
|
|
55
63
|
⛔ **ABSOLUTE PROHIBITION — Phase B Content Filling:**
|
|
56
64
|
- NEVER use `create_file` to rewrite or recreate the document after Step 5 skeleton creation
|
|
57
65
|
- NEVER abandon `search_replace` mid-way and switch to `create_file`
|
|
@@ -178,8 +186,8 @@ If `skip_analysis_checkpoint=false` (default):
|
|
|
178
186
|
After user confirms (or if skipped):
|
|
179
187
|
|
|
180
188
|
```bash
|
|
181
|
-
node
|
|
182
|
-
--file
|
|
189
|
+
node "{workspace_path}/scripts/update-progress.js" write-checkpoint \
|
|
190
|
+
--file "{workspace_path}/iterations/{iteration_id}/02.feature-design/.checkpoints.json" \
|
|
183
191
|
--stage 02_feature_design \
|
|
184
192
|
--checkpoint function_decomposition \
|
|
185
193
|
--passed true
|
|
@@ -187,8 +195,35 @@ node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
|
187
195
|
|
|
188
196
|
Log: "✅ Checkpoint A (function_decomposition) passed and recorded"
|
|
189
197
|
|
|
198
|
+
### OUTPUT EFFICIENCY RULES
|
|
199
|
+
|
|
200
|
+
> **MANDATORY: Direct-to-File Output**
|
|
201
|
+
>
|
|
202
|
+
> When generating Feature Spec content:
|
|
203
|
+
> - **DO NOT** display design content (wireframes, interaction flows, API specs, data models) in the conversation
|
|
204
|
+
> - **DO NOT** output intermediate design results as chat messages
|
|
205
|
+
> - **DO** think through the design internally, then write directly to the output file
|
|
206
|
+
> - **DO** only report brief status messages: "[Block X] Designing frontend for Function N..."
|
|
207
|
+
>
|
|
208
|
+
> **Rationale**: In batch mode, multiple Workers run simultaneously. Displaying full design content in chat wastes context window and creates confusion.
|
|
209
|
+
>
|
|
210
|
+
> **Allowed output in conversation**:
|
|
211
|
+
> - Block execution announcements (1 line each)
|
|
212
|
+
> - Error messages
|
|
213
|
+
> - Checkpoint confirmation requests (when not skipped)
|
|
214
|
+
> - Final completion summary (1-2 lines)
|
|
215
|
+
>
|
|
216
|
+
> **FORBIDDEN output in conversation**:
|
|
217
|
+
> - ASCII wireframes / UI prototypes
|
|
218
|
+
> - Mermaid diagrams (these go in the file only)
|
|
219
|
+
> - API endpoint lists
|
|
220
|
+
> - Data model tables
|
|
221
|
+
> - Full section content
|
|
222
|
+
|
|
190
223
|
## Step 1: Frontend Design
|
|
191
224
|
|
|
225
|
+
> ⚠️ **OUTPUT REMINDER**: Design content goes directly into the output file. DO NOT display wireframes or UI elements in conversation.
|
|
226
|
+
|
|
192
227
|
### 1.0 Conditional Execution
|
|
193
228
|
|
|
194
229
|
`feature_type = "Page+API"` → Execute design; `feature_type = "API-only"` → Skip; Not provided → Execute (backward compatibility)
|
|
@@ -296,6 +331,8 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
296
331
|
|
|
297
332
|
## Step 2: Backend Design
|
|
298
333
|
|
|
334
|
+
> ⚠️ **OUTPUT REMINDER**: Backend API designs go directly into the output file. DO NOT display API lists or processing logic in conversation.
|
|
335
|
+
|
|
299
336
|
> **CRITICAL CONSTRAINT**: Backend design in Feature Spec must remain at the BUSINESS API level:
|
|
300
337
|
> - Describe API endpoints as business operations (e.g., "Create Shop" operation with business parameters)
|
|
301
338
|
> - Describe business validation rules in plain language (e.g., "Shop name must be unique within tenant")
|
|
@@ -334,6 +371,8 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
334
371
|
|
|
335
372
|
## Step 3: Data Model & Business Rules
|
|
336
373
|
|
|
374
|
+
> ⚠️ **OUTPUT REMINDER**: Data models and business rules go directly into the output file. DO NOT display tables or validation rules in conversation.
|
|
375
|
+
|
|
337
376
|
### 3.1 New Data Structures
|
|
338
377
|
|
|
339
378
|
| Field | Type | Constraints | Description |
|
|
@@ -462,8 +501,8 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
462
501
|
After user confirms (or if skipped):
|
|
463
502
|
|
|
464
503
|
```bash
|
|
465
|
-
node
|
|
466
|
-
--file
|
|
504
|
+
node "{workspace_path}/scripts/update-progress.js" write-checkpoint \
|
|
505
|
+
--file "{workspace_path}/iterations/{iteration_id}/02.feature-design/.checkpoints.json" \
|
|
467
506
|
--stage 02_feature_design \
|
|
468
507
|
--checkpoint feature_design_review \
|
|
469
508
|
--passed true
|
|
@@ -623,8 +662,8 @@ Verify all Mermaid diagrams follow compliance rules:
|
|
|
623
662
|
Set final checkpoint status:
|
|
624
663
|
|
|
625
664
|
```bash
|
|
626
|
-
node
|
|
627
|
-
--file
|
|
665
|
+
node "{workspace_path}/scripts/update-progress.js" write-checkpoint \
|
|
666
|
+
--file "{workspace_path}/iterations/{iteration_id}/02.feature-design/.checkpoints.json" \
|
|
628
667
|
--stage 02_feature_design \
|
|
629
668
|
--checkpoint feature_spec_review \
|
|
630
669
|
--passed true
|
|
@@ -202,6 +202,14 @@ Does this function breakdown align with your understanding of the requirements?<
|
|
|
202
202
|
============================================================ -->
|
|
203
203
|
<sequence id="S1" name="Feature Design" status="pending" desc="Generate Feature Spec from analysis results">
|
|
204
204
|
|
|
205
|
+
<!-- Output Efficiency Rule -->
|
|
206
|
+
<block type="rule" id="R-OUTPUT-EFFICIENCY" level="mandatory" desc="Direct-to-file output only">
|
|
207
|
+
<field name="text">DO NOT display design content in conversation</field>
|
|
208
|
+
<field name="text">Think internally, write directly to output file</field>
|
|
209
|
+
<field name="text">Only output brief status messages and block announcements</field>
|
|
210
|
+
<field name="text">FORBIDDEN: wireframes, API lists, data tables in chat</field>
|
|
211
|
+
</block>
|
|
212
|
+
|
|
205
213
|
<!-- Step 1.0: Prepare analysis results for design -->
|
|
206
214
|
<block type="task" id="B1_0" action="analyze" desc="Prepare analysis data for design phase">
|
|
207
215
|
<field name="input" value="${analyzed_functions}">${prd_content}${feature_id}${feature_name}${feature_type}${frontend_platforms}</field>
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
* --output <text> Task output (used when completed)
|
|
36
36
|
* --error <text> Error message (used when failed)
|
|
37
37
|
* --error-category <cat> Error category (used when failed)
|
|
38
|
+
* --metadata <json> Metadata JSON string to merge into task
|
|
38
39
|
*
|
|
39
40
|
* 4. update-counts - Force recalculate counts
|
|
40
41
|
* node update-progress.js update-counts --file <path>
|
|
@@ -252,7 +253,8 @@ function parseArgs() {
|
|
|
252
253
|
confirmedAt: null,
|
|
253
254
|
featuresDir: null,
|
|
254
255
|
platforms: null,
|
|
255
|
-
force: false
|
|
256
|
+
force: false,
|
|
257
|
+
metadata: null
|
|
256
258
|
};
|
|
257
259
|
|
|
258
260
|
// First argument is the command
|
|
@@ -357,6 +359,10 @@ function parseArgs() {
|
|
|
357
359
|
case '-Matcher-Result':
|
|
358
360
|
result.matcherResult = args[++i];
|
|
359
361
|
break;
|
|
362
|
+
case '--metadata':
|
|
363
|
+
case '-Metadata':
|
|
364
|
+
result.metadata = args[++i];
|
|
365
|
+
break;
|
|
360
366
|
}
|
|
361
367
|
}
|
|
362
368
|
|
|
@@ -619,6 +625,16 @@ function cmdUpdateTask(args) {
|
|
|
619
625
|
}
|
|
620
626
|
}
|
|
621
627
|
|
|
628
|
+
// Handle metadata (merge into task)
|
|
629
|
+
if (args.metadata) {
|
|
630
|
+
try {
|
|
631
|
+
const metadataObj = JSON.parse(args.metadata);
|
|
632
|
+
task.metadata = { ...task.metadata, ...metadataObj };
|
|
633
|
+
} catch (e) {
|
|
634
|
+
outputError(`Failed to parse metadata JSON: ${e.message}`);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
622
638
|
// Update task
|
|
623
639
|
data.tasks[taskIndex] = task;
|
|
624
640
|
data.updated_at = now;
|