speccrew 0.2.2 → 0.2.3

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.
@@ -21,25 +21,29 @@ Your core task is: based on the System Design (HOW to build), execute and coordi
21
21
 
22
22
  Before starting development, verify upstream stage completion:
23
23
 
24
- 1. **Read WORKFLOW-PROGRESS.json** from workspace root:
25
- - Path: `speccrew-workspace/WORKFLOW-PROGRESS.json`
24
+ 1. **Read WORKFLOW-PROGRESS.json overview**:
25
+ ```bash
26
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/WORKFLOW-PROGRESS.json --overview
27
+ ```
26
28
 
27
29
  2. **Verify System Design stage status**:
28
- - Check `stages.03_system_design.status == "confirmed"`
30
+ - Check that `stages.03_system_design.status == "confirmed"` in the output
29
31
  - If status is not "confirmed": **STOP** and report:
30
32
  > "System Design stage has not been confirmed. Please complete and confirm the System Design stage before proceeding to Development."
31
33
 
32
34
  3. **Update Development stage status**:
33
- - Set `stages.04_development.status` to `"in_progress"`
34
- - Record `started_at` with current timestamp (ISO 8601 format)
35
- - Write updated WORKFLOW-PROGRESS.json
35
+ ```bash
36
+ node .speccrew/scripts/update-progress.js update-workflow --file speccrew-workspace/WORKFLOW-PROGRESS.json --stage 04_development --status in_progress
37
+ ```
36
38
 
37
39
  ### Phase 0.2: Check Resume State
38
40
 
39
41
  Check for existing checkpoint state to support resume:
40
42
 
41
- 1. **Read .checkpoints.json** (if exists):
42
- - Path: `speccrew-workspace/iterations/{current}/04.development/.checkpoints.json`
43
+ 1. **Read checkpoints** (if file exists):
44
+ ```bash
45
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/iterations/{current}/04.development/.checkpoints.json --checkpoints
46
+ ```
43
47
 
44
48
  2. **Determine resume point based on passed checkpoints**:
45
49
 
@@ -49,20 +53,19 @@ Check for existing checkpoint state to support resume:
49
53
  | `task_list_review.passed == true` | Skip task list confirmation, proceed directly to dispatch |
50
54
  | `delivery_report.passed == true` | **STOP** — entire stage already completed |
51
55
 
52
- 3. **If .checkpoints.json does not exist**: Proceed with full workflow (no resume)
56
+ 3. **If file does not exist**: Proceed with full workflow (no resume)
53
57
 
54
58
  ### Phase 0.3: Check Dispatch Resume (Module-Level Resume)
55
59
 
56
60
  Check for existing dispatch progress to support module-level retry:
57
61
 
58
- 1. **Read DISPATCH-PROGRESS.json** (if exists):
59
- - Path: `speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json`
62
+ 1. **Read dispatch progress summary** (if file exists):
63
+ ```bash
64
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --summary
65
+ ```
60
66
 
61
- 2. **Calculate task statistics**:
62
- - Total tasks: `tasks.length`
63
- - Completed: `tasks.filter(t => t.status == "completed").length`
64
- - Failed: `tasks.filter(t => t.status == "failed").length`
65
- - Pending: `tasks.filter(t => t.status == "pending").length`
67
+ 2. **Parse the output** to get counts:
68
+ - `total`, `completed`, `failed`, `pending`, `in_progress`
66
69
 
67
70
  3. **Present resume summary to user**:
68
71
  ```
@@ -71,7 +74,7 @@ Check for existing dispatch progress to support module-level retry:
71
74
  - Completed: {completed}
72
75
  - Failed: {failed}
73
76
  - Pending: {pending}
74
-
77
+
75
78
  Will skip completed modules and only dispatch pending/failed tasks.
76
79
  ```
77
80
 
@@ -159,20 +162,10 @@ Verify required services are accessible:
159
162
  ### 3.4 Pre-check Success Handling
160
163
 
161
164
  If all pre-checks pass:
162
- 1. **Write checkpoint to .checkpoints.json**:
163
- ```json
164
- {
165
- "stage": "04_development",
166
- "checkpoints": {
167
- "environment_precheck": {
168
- "passed": true,
169
- "confirmed_at": "2026-01-15T10:30:00Z",
170
- "description": "Runtime environment verification"
171
- }
172
- }
173
- }
165
+ 1. **Write checkpoint**:
166
+ ```bash
167
+ node .speccrew/scripts/update-progress.js write-checkpoint --file speccrew-workspace/iterations/{current}/04.development/.checkpoints.json --stage 04_development --checkpoint environment_precheck --passed true --description "Runtime environment verification"
174
168
  ```
175
- 2. Create .checkpoints.json if it doesn't exist, or update existing file
176
169
 
177
170
  ### 3.5 Pre-check Failure Handling
178
171
 
@@ -192,35 +185,41 @@ Before dispatching tasks, create or read dispatch progress file:
192
185
 
193
186
  1. **Check if DISPATCH-PROGRESS.json exists**:
194
187
  - Path: `speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json`
188
+ - If exists, read summary to determine resume state
195
189
 
196
190
  2. **If not exists — Create fresh dispatch progress**:
191
+ ```bash
192
+ node .speccrew/scripts/update-progress.js init --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --stage 04_development --tasks-file <tasks_json_path>
193
+ ```
194
+ Where `<tasks_json_path>` contains the task list built from Step 1.3:
197
195
  ```json
198
- {
199
- "stage": "04_development",
200
- "total": 0,
201
- "completed": 0,
202
- "failed": 0,
203
- "pending": 0,
204
- "tasks": []
205
- }
196
+ [
197
+ {
198
+ "id": "dev-{platform_id}-{module-name}",
199
+ "platform": "{platform_id}",
200
+ "module": "{module_name}",
201
+ "skill": "{skill_name}",
202
+ "status": "pending"
203
+ }
204
+ ]
206
205
  ```
207
206
 
208
- 3. **Build task list from Step 1.3** and populate DISPATCH-PROGRESS.json:
209
- ```json
210
- {
211
- "id": "dev-{platform_id}-{module-name}",
212
- "platform": "{platform_id}",
213
- "module": "{module_name}",
214
- "skill": "{skill_name}",
215
- "status": "pending",
216
- "started_at": null,
217
- "completed_at": null,
218
- "output": null,
219
- "error": null
220
- }
207
+ 3. **Alternatively, pass tasks JSON directly**:
208
+ ```bash
209
+ node .speccrew/scripts/update-progress.js init --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --stage 04_development --tasks '[{"id":"dev-web-vue-crm","platform":"web-vue","module":"crm","skill":"speccrew-dev-frontend","status":"pending"}]'
221
210
  ```
222
211
 
223
- 4. **Update counts**: Set `total` to task list length, `pending` to same value
212
+ **Task Status Enumeration:**
213
+
214
+ | Status | Description |
215
+ |--------|-------------|
216
+ | `pending` | Task not yet started |
217
+ | `in_progress` | Dev worker currently executing |
218
+ | `in_review` | Dev worker completed, awaiting review verification |
219
+ | `completed` | Review passed, implementation verified |
220
+ | `partial` | Review found incomplete, awaiting re-dispatch |
221
+ | `failed` | Task failed after max re-dispatch attempts |
222
+ | `skipped` | Task explicitly skipped |
224
223
 
225
224
  ### 4.1 Determine Skill for Each Platform
226
225
 
@@ -233,6 +232,12 @@ Platform type mapping:
233
232
  | `mobile-*` | `speccrew-dev-mobile` |
234
233
  | `desktop-*` | `speccrew-dev-desktop` |
235
234
 
235
+ **Review Skill (All Platforms):**
236
+
237
+ | Phase | Skill | Purpose |
238
+ |-------|-------|---------|
239
+ | 4.4 | `speccrew-dev-review` | Validate dev output against design doc, API contract, and code conventions |
240
+
236
241
  ### 4.2 Build Module Task List
237
242
 
238
243
  From Step 1.3, flatten all module design documents into a unified task list:
@@ -269,17 +274,9 @@ for each platform_id:
269
274
  - Wait for user confirmation
270
275
 
271
276
  **After user confirms**:
272
- 1. **Write checkpoint to .checkpoints.json**:
273
- ```json
274
- {
275
- "checkpoints": {
276
- "task_list_review": {
277
- "passed": true,
278
- "confirmed_at": "2026-01-15T10:35:00Z",
279
- "description": "Development task list confirmed by user"
280
- }
281
- }
282
- }
277
+ 1. **Write checkpoint**:
278
+ ```bash
279
+ node .speccrew/scripts/update-progress.js write-checkpoint --file speccrew-workspace/iterations/{current}/04.development/.checkpoints.json --stage 04_development --checkpoint task_list_review --passed true --description "Development task list confirmed by user"
283
280
  ```
284
281
 
285
282
  ### 4.3 Dispatch Workers with Concurrency Limit
@@ -299,9 +296,9 @@ while pending is not empty or running is not empty:
299
296
  task = pending.pop()
300
297
 
301
298
  // Update task status to "in_progress"
302
- Update DISPATCH-PROGRESS.json:
303
- - Set task.status = "in_progress"
304
- - Set task.started_at = current timestamp
299
+ ```bash
300
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status in_progress
301
+ ```
305
302
 
306
303
  // Dispatch speccrew-task-worker agent (NOT Skill tool directly)
307
304
  Invoke `speccrew-task-worker` agent with:
@@ -322,18 +319,19 @@ while pending is not empty or running is not empty:
322
319
  for each finished worker in running:
323
320
  Parse Task Completion Report from worker output
324
321
 
322
+ // Dev worker completion triggers review phase (not final completion)
325
323
  if report.status == "SUCCESS":
326
- Update DISPATCH-PROGRESS.json:
327
- - Set task.status = "completed"
328
- - Set task.completed_at = current timestamp
329
- - Set task.output = report.output_files
330
- - Increment completed count, decrement pending count
324
+ // Mark as in_review pending review verification
325
+ ```bash
326
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status in_review --output "{report.output_files}"
327
+ ```
328
+ Add task to review_queue for Phase 4.4
331
329
  else:
332
- Update DISPATCH-PROGRESS.json:
333
- - Set task.status = "failed"
334
- - Set task.completed_at = current timestamp
335
- - Set task.error = report.error
336
- - Increment failed count, decrement pending count
330
+ // Even failed dev workers go to review for diagnosis
331
+ ```bash
332
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status in_review --error "{report.error}"
333
+ ```
334
+ Add task to review_queue for Phase 4.4
337
335
 
338
336
  move finished task from running to completed
339
337
  ```
@@ -343,25 +341,142 @@ while pending is not empty or running is not empty:
343
341
  - Pass complete context including `design_doc_path`, `skill_name`, platform info, and `task_id`
344
342
  - Up to 10 workers execute simultaneously (concurrency limit)
345
343
  - Update DISPATCH-PROGRESS.json **before** dispatch (status → "in_progress")
346
- - Update DISPATCH-PROGRESS.json **after** completion based on Task Completion Report
347
- - Track all dispatched tasks: completed / failed / pending counts
348
- - If a worker fails, log the failure and continue with remaining tasks
349
- - Wait for all workers to complete before proceeding to Step 5 (Integration Check)
344
+ - After dev worker completes, mark as "in_review" (NOT "completed") and queue for review
345
+ - Track all dispatched tasks: in_review / failed / pending counts
346
+ - If a worker fails, still mark as "in_review" for review diagnosis
347
+ - After all dev workers complete, proceed to Phase 4.4 (Review Dispatch)
350
348
 
351
349
  **Progress Update After Each Batch:**
352
350
  After processing a batch of completed workers:
353
- 1. Read current DISPATCH-PROGRESS.json
354
- 2. Update counts: `completed`, `failed`, `pending`
355
- 3. Write updated DISPATCH-PROGRESS.json
356
- 4. Present progress summary to user:
351
+ 1. **Read current progress summary**:
352
+ ```bash
353
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --summary
354
+ ```
355
+ 2. Present progress summary to user:
357
356
  ```
358
357
  Development Progress Update:
359
- - Completed: {completed}/{total}
358
+ - In Review: {in_review}/{total}
360
359
  - Failed: {failed}
361
360
  - Pending: {pending}
362
361
  - In Progress: {running.size}
363
362
  ```
364
363
 
364
+ ### 4.4: Review Verification
365
+
366
+ After each dev worker completes (status = "in_review"), dispatch a **separate** `speccrew-task-worker` agent to run the `speccrew-dev-review` skill:
367
+
368
+ Invoke `speccrew-task-worker` agent with:
369
+ - skill_name: `speccrew-dev-review`
370
+ - context:
371
+ - design_doc_path: {task.module_design_path}
372
+ - implementation_report_path: {dev_worker_report_path}
373
+ - source_root: {project_source_root}
374
+ - platform_id: {task.platform_id}
375
+ - api_contract_path: {task.api_contract_path}
376
+ - task_id: review-{task.id}
377
+
378
+ **Review Result Handling:**
379
+
380
+ | Review Verdict | Action |
381
+ |---|---|
382
+ | PASS | Update task status to "completed" via `update-progress.js update-task --status completed` |
383
+ | PARTIAL | Update task status to "partial" via `update-progress.js update-task --status partial --output "<review_summary>"`. Add to re-dispatch queue with review's "Re-dispatch Guidance" as supplemental instructions. |
384
+ | FAIL | Update task status to "failed" via `update-progress.js update-task --status failed --error "<review_summary>" --error-category VALIDATION_ERROR` |
385
+
386
+ **Review Dispatch Pattern:**
387
+
388
+ ```
389
+ review_queue = [tasks with status == "in_review"]
390
+
391
+ for each task in review_queue:
392
+ // Dispatch review worker
393
+ Invoke `speccrew-task-worker` agent with:
394
+ - skill_name: speccrew-dev-review
395
+ - context: (as specified above)
396
+
397
+ wait for review worker completion
398
+
399
+ // Parse review result
400
+ Parse Review Report from worker output
401
+
402
+ if review.verdict == "PASS":
403
+ ```bash
404
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status completed --output "{review_report_path}"
405
+ ```
406
+ elif review.verdict == "PARTIAL":
407
+ ```bash
408
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status partial --output "{review_report_path}" --metadata "{review.redispatch_guidance}"
409
+ ```
410
+ Add task to redispatch_queue
411
+ else: // FAIL
412
+ ```bash
413
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status failed --error "{review.summary}" --error-category VALIDATION_ERROR
414
+ ```
415
+ ```
416
+
417
+ ### 4.5: Re-dispatch Partial/Failed Tasks
418
+
419
+ After all initial dev + review cycles complete for the current batch:
420
+
421
+ 1. **Query partial/failed tasks:**
422
+ ```bash
423
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --status partial
424
+ node .speccrew/scripts/update-progress.js read --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --status failed
425
+ ```
426
+
427
+ 2. **For each partial/failed task, re-dispatch a dev worker with:**
428
+ - Original design doc + API contract
429
+ - Previous implementation report (so worker knows what's already done)
430
+ - Review report's "Re-dispatch Guidance" (specific list of what to fix/complete)
431
+ - Instruction: "Continue from previous implementation. Focus on missing items listed in review guidance."
432
+
433
+ 3. **After re-dispatch dev worker completes, run review again (Phase 4.4)**
434
+
435
+ 4. **Maximum re-dispatch attempts: 2** (total 3 attempts including initial)
436
+ - Track attempt count in task metadata: `attempts`
437
+ - After 3 attempts, mark as "failed" with accumulated error info
438
+
439
+ 5. **Update counts after each cycle:**
440
+ ```bash
441
+ node .speccrew/scripts/update-progress.js update-counts --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json
442
+ ```
443
+
444
+ **Re-dispatch Flow:**
445
+
446
+ ```
447
+ redispatch_queue = [tasks with status == "partial" or (status == "failed" and attempts < 3)]
448
+
449
+ for each task in redispatch_queue:
450
+ // Increment attempt counter
451
+ attempts = task.attempts + 1
452
+
453
+ if attempts > 3:
454
+ // Max attempts reached - mark as permanently failed
455
+ ```bash
456
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status failed --error "Max re-dispatch attempts (3) exceeded" --metadata "{accumulated_errors}"
457
+ ```
458
+ continue
459
+
460
+ // Update attempt count and reset to in_progress
461
+ ```bash
462
+ node .speccrew/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --task-id {task.id} --status in_progress --metadata "{attempts: attempts, previous_review: review_report_path}"
463
+ ```
464
+
465
+ // Dispatch dev worker with supplemental context
466
+ Invoke `speccrew-task-worker` agent with:
467
+ - skill_name: {task.skill_name}
468
+ - context:
469
+ - (original context)
470
+ - previous_review_path: {review_report_path}
471
+ - supplemental_instructions: {review.redispatch_guidance}
472
+ - is_redispatch: true
473
+
474
+ wait for dev worker completion
475
+
476
+ // Run review again (Phase 4.4)
477
+ goto Phase 4.4
478
+ ```
479
+
365
480
  ## Step 5: Integration Check
366
481
 
367
482
  After all platform dev skills complete:
@@ -473,38 +588,14 @@ Assess readiness for test phase:
473
588
 
474
589
  **After user confirms delivery**:
475
590
 
476
- 1. **Update .checkpoints.json**:
477
- ```json
478
- {
479
- "checkpoints": {
480
- "delivery_report": {
481
- "passed": true,
482
- "confirmed_at": "2026-01-15T14:00:00Z",
483
- "description": "Final delivery report"
484
- }
485
- }
486
- }
591
+ 1. **Update checkpoint**:
592
+ ```bash
593
+ node .speccrew/scripts/update-progress.js write-checkpoint --file speccrew-workspace/iterations/{current}/04.development/.checkpoints.json --stage 04_development --checkpoint delivery_report --passed true --description "Final delivery report"
487
594
  ```
488
595
 
489
596
  2. **Update WORKFLOW-PROGRESS.json**:
490
- ```json
491
- {
492
- "current_stage": "05_system_test",
493
- "stages": {
494
- "04_development": {
495
- "status": "confirmed",
496
- "started_at": "...",
497
- "completed_at": "2026-01-15T14:00:00Z",
498
- "confirmed_at": "2026-01-15T14:00:00Z",
499
- "outputs": [
500
- "04.development/{platform_id}/{module}/"
501
- ]
502
- },
503
- "05_system_test": {
504
- "status": "pending"
505
- }
506
- }
507
- }
597
+ ```bash
598
+ node .speccrew/scripts/update-progress.js update-workflow --file speccrew-workspace/WORKFLOW-PROGRESS.json --stage 04_development --status confirmed --output "04.development/{platform_id}/{module}/"
508
599
  ```
509
600
 
510
601
  3. **Confirm stage transition**: Report to user that development stage is complete and system is ready for testing phase.