speccrew 0.3.12 → 0.3.14
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.
|
@@ -241,6 +241,13 @@ complexity_notes: <if complex, note affected modules>
|
|
|
241
241
|
|
|
242
242
|
## Phase 3: Invoke Skill
|
|
243
243
|
|
|
244
|
+
> ⚠️ **PM AGENT ORCHESTRATION PRINCIPLE (Phase 3-5)**
|
|
245
|
+
> You are the ORCHESTRATOR, NOT the WRITER:
|
|
246
|
+
> - Phase 3: DO NOT generate Master PRD yourself → Skill generates it
|
|
247
|
+
> - Phase 4: DO NOT generate Sub-PRD yourself → Workers generate them
|
|
248
|
+
> - Phase 5: DO NOT modify PRD content yourself → Only verify and present
|
|
249
|
+
> - **If Skill fails: STOP and report error to user. DO NOT generate content as fallback.**
|
|
250
|
+
|
|
244
251
|
Based on the complexity assessment in Phase 1, invoke the appropriate skill:
|
|
245
252
|
|
|
246
253
|
**For Simple Requirements:**
|
|
@@ -257,17 +264,69 @@ Pass the following context to the Skill:
|
|
|
257
264
|
|
|
258
265
|
### After Skill Completes
|
|
259
266
|
|
|
260
|
-
|
|
267
|
+
**Step A: Check Skill Execution Status**
|
|
268
|
+
|
|
269
|
+
- IF Skill FAILED or returned error → Go to **Phase 3a: Error Recovery**
|
|
270
|
+
- IF Skill SUCCEEDED → Go to **Phase 3b: Validate & Route**
|
|
261
271
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
### Phase 3a: Error Recovery (Skill Failed)
|
|
273
|
+
|
|
274
|
+
> ⚠️ **ABORT CONDITIONS — Execution MUST STOP:**
|
|
275
|
+
> - Skill reported execution failure or was interrupted
|
|
276
|
+
> - No PRD document was generated
|
|
277
|
+
> - PRD file exists but is incomplete or malformed
|
|
278
|
+
>
|
|
279
|
+
> **FORBIDDEN ACTIONS:**
|
|
280
|
+
> - DO NOT generate Master PRD as fallback
|
|
281
|
+
> - DO NOT generate Sub-PRDs as fallback
|
|
282
|
+
> - DO NOT create partial PRD documents
|
|
283
|
+
> - DO NOT proceed to Phase 4 or Phase 5
|
|
284
|
+
|
|
285
|
+
Actions:
|
|
286
|
+
1. Report error to user: "Skill execution failed: [specific reason]"
|
|
287
|
+
2. Ask user: "Retry with additional clarification?" or "Abort current workflow?"
|
|
288
|
+
3. IF retry → Return to Phase 2, gather more context, then retry Phase 3
|
|
289
|
+
4. IF abort → END workflow
|
|
290
|
+
|
|
291
|
+
### Phase 3b: Validate & Route (Skill Succeeded)
|
|
292
|
+
|
|
293
|
+
1. **Identify PRD structure type** (from Skill output):
|
|
294
|
+
- Master-Sub structure → Validate Dispatch Plan (Step 2)
|
|
295
|
+
- Single PRD → Skip to Phase 5
|
|
296
|
+
|
|
297
|
+
2. **Validate Dispatch Plan (Master-Sub only)**:
|
|
298
|
+
- [ ] Master PRD file exists and is readable
|
|
299
|
+
- [ ] Dispatch Plan contains module list (count ≥ 2)
|
|
300
|
+
- [ ] Each module has: module_name, module_key, module_scope, module_entities
|
|
301
|
+
- [ ] template_path and output_dir are defined
|
|
302
|
+
|
|
303
|
+
IF ANY validation fails:
|
|
304
|
+
→ STOP. Report: "Dispatch Plan incomplete: [missing items]"
|
|
305
|
+
→ Ask user to retry Skill execution
|
|
306
|
+
→ DO NOT proceed to Phase 4
|
|
307
|
+
|
|
308
|
+
3. **Route**:
|
|
309
|
+
- Master-Sub + Dispatch Plan valid → **MANDATORY: Execute Phase 4**
|
|
310
|
+
- Single PRD → **Skip Phase 4, go to Phase 5**
|
|
265
311
|
|
|
266
312
|
> ⚠️ **DO NOT present results to user before Phase 4 completes (for complex requirements).**
|
|
267
313
|
> The Master PRD alone is incomplete without Sub-PRDs.
|
|
268
314
|
|
|
269
315
|
---
|
|
270
316
|
|
|
317
|
+
> ⚠️ **MANDATORY RULES FOR PHASE 3:**
|
|
318
|
+
> 1. DO NOT generate Master PRD yourself — it MUST be generated by Skill
|
|
319
|
+
> 2. DO NOT generate any PRD content as fallback if Skill fails
|
|
320
|
+
> 3. DO NOT skip Skill failure validation
|
|
321
|
+
> 4. MUST validate Dispatch Plan completeness before entering Phase 4
|
|
322
|
+
>
|
|
323
|
+
> **ABORT CONDITIONS:**
|
|
324
|
+
> - IF Skill execution failed → STOP and report to user
|
|
325
|
+
> - IF PRD output is missing or incomplete → STOP and report to user
|
|
326
|
+
> - IF PM Agent attempts to generate PRD content itself → STOP (ORCHESTRATOR ONLY)
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
271
330
|
> ⚠️ **MANDATORY RULES FOR PHASE 4 (Sub-PRD Worker Dispatch):**
|
|
272
331
|
> These rules apply to ALL complex requirements (3+ modules). Violation = workflow failure.
|
|
273
332
|
>
|
|
@@ -318,6 +377,12 @@ node speccrew-workspace/scripts/update-progress.js init \
|
|
|
318
377
|
--tasks '[{"id":"module-key-1","name":"Module 1 Name"},{"id":"module-key-2","name":"Module 2 Name"}]'
|
|
319
378
|
```
|
|
320
379
|
|
|
380
|
+
> **PowerShell Compatibility Note:**
|
|
381
|
+
> PowerShell cannot properly parse JSON in command-line arguments. Use file-based approach:
|
|
382
|
+
> 1. Write tasks JSON to a temporary file (e.g., `tasks-temp.json`)
|
|
383
|
+
> 2. Read file content in the command: `node scripts/update-progress.js init --stage sub_prd_dispatch --tasks (Get-Content tasks-temp.json -Raw)`
|
|
384
|
+
> 3. Or use: `Get-Content tasks-temp.json | node scripts/update-progress.js init --stage sub_prd_dispatch --tasks -`
|
|
385
|
+
|
|
321
386
|
> ⚠️ DO NOT create DISPATCH-PROGRESS.json manually with PowerShell or any other method.
|
|
322
387
|
> If the script fails, STOP and report the error to the user.
|
|
323
388
|
|
package/package.json
CHANGED
|
@@ -67,6 +67,19 @@ graph TB
|
|
|
67
67
|
| `/` | File paths (`/pages/index`) | Remove leading `/` or use parentheses: `pages/index` |
|
|
68
68
|
| `(` `)` | Function calls (`handleQuery()`) | Remove parentheses: `handleQuery` |
|
|
69
69
|
|
|
70
|
+
**When Special Characters Must Be Preserved:**
|
|
71
|
+
|
|
72
|
+
If node text must contain parentheses `()`, curly braces `{}`, square brackets `[]`, or colons `:`, wrap the entire text in double quotes to prevent Mermaid from misinterpreting them as shape definitions or syntax elements.
|
|
73
|
+
|
|
74
|
+
| Wrong (Parse Error) | Correct (Quoted) |
|
|
75
|
+
|---------------------|------------------|
|
|
76
|
+
| `P1[选择对比组(如:面部左脸)]` | `P1["选择对比组(如:面部左脸)"]` |
|
|
77
|
+
| `P2[上传图片(1-N张)]` | `P2["上传图片(1-N张)"]` |
|
|
78
|
+
| `A[Task{ urgent }]` | `A["Task{ urgent }"]` |
|
|
79
|
+
| `B[Array[0]]` | `B["Array[0]"]` |
|
|
80
|
+
|
|
81
|
+
**Important:** The rule "Quoted node text [\"text\"]" in the Prohibited list refers to unnecessary quoting of plain text. When special characters are present, quoting becomes **required** for correct parsing.
|
|
82
|
+
|
|
70
83
|
### 5. Multi-line Text Handling
|
|
71
84
|
|
|
72
85
|
```
|