speccrew 0.5.3 → 0.5.5

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.
@@ -59,6 +59,7 @@ Phase 4: API Contract Generation
59
59
  | Phase 4 | HARD STOP | Joint Confirmation must be confirmed by user before finalizing |
60
60
  | ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT attempt to generate content manually as fallback |
61
61
  | ALL | SCRIPT ENFORCEMENT | All .checkpoints.json and WORKFLOW-PROGRESS.json updates via update-progress.js script. Manual JSON creation FORBIDDEN |
62
+ | ALL | NAME LOCK | After Phase 2 Feature Registry is confirmed, feature_name is immutable. All Skills MUST use the exact parameter value for output filenames. Name translation or substitution is FORBIDDEN |
62
63
 
63
64
  ## ABORT CONDITIONS
64
65
 
@@ -70,6 +71,14 @@ Phase 4: API Contract Generation
70
71
  4. **User Rejection**: User rejects Feature Registry, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
71
72
  5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
72
73
 
74
+ ## TIMESTAMP INTEGRITY
75
+
76
+ > **All timestamps in progress files (.checkpoints.json, DISPATCH-PROGRESS.json, WORKFLOW-PROGRESS.json) are generated exclusively by `update-progress.js` script.**
77
+
78
+ 1. **FORBIDDEN: Timestamp fabrication** — DO NOT generate, construct, or pass any timestamp string. The script's `getTimestamp()` function auto-generates accurate timestamps.
79
+ 2. **FORBIDDEN: Manual JSON creation** — DO NOT use `create_file` or `write` to create progress/checkpoint JSON files. ALWAYS use the appropriate `update-progress.js` command.
80
+ 3. **FORBIDDEN: Timestamp parameters** — DO NOT pass `--started-at`, `--completed-at`, or `--confirmed-at` parameters to `update-progress.js` commands. These parameters are deprecated.
81
+
73
82
  # Workflow
74
83
 
75
84
  ## Phase 0: Workflow Progress Management
@@ -284,6 +293,15 @@ After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
284
293
  - Feature Spec worker done → set `feature_spec_status` = `completed`
285
294
  - API Contract worker done → set `api_contract_status` = `completed`
286
295
 
296
+ ### 2.5a Feature Name Normalization
297
+
298
+ Before presenting the Feature Registry to user:
299
+
300
+ 1. **Extract exact names** from PRD Section 3.4 table — use the name column value verbatim
301
+ 2. **Store as-is** in `.checkpoints.json` `feature_name` field — no translation, no slug conversion
302
+ 3. **Validate uniqueness**: Ensure no two Features share the same `feature_name`
303
+ 4. **Language rule**: `feature_name` MUST preserve the PRD's original language (Chinese names stay Chinese)
304
+
287
305
  5. **Present Feature Registry to user for confirmation**:
288
306
 
289
307
  Display the full feature table:
@@ -304,8 +322,7 @@ After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
304
322
  - Any features to add, remove, or merge?
305
323
 
306
324
  IF user requests changes → update .checkpoints.json, then re-present.
307
- ONLY after user confirms → update function_decomposition.passed = true,
308
- set confirmed_at via: node -e "console.log(new Date().toISOString())"
325
+ ONLY after user confirms → update function_decomposition.passed = true.
309
326
  Then proceed to Phase 3.
310
327
  ```
311
328
 
@@ -328,6 +345,7 @@ When involving related business domains, read `speccrew-workspace/knowledges/biz
328
345
  > 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers.
329
346
  > 5. **Phase 3a → 3b → 3c is STRICTLY SERIAL.** Each phase must complete before the next begins.
330
347
  > 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b.
348
+ > 7. **Feature name is LOCKED after Phase 2 confirmation.** All Worker dispatch parameters MUST use the exact `feature_name` from `.checkpoints.json`. DO NOT derive, translate, or modify feature names at any point after the Feature Registry is confirmed.
331
349
 
332
350
  ---
333
351
 
@@ -366,7 +384,7 @@ If **2+ Features** in registry:
366
384
  - `context`:
367
385
  - `prd_path`: Path to Sub-PRD
368
386
  - `feature_id`: Feature ID
369
- - `feature_name`: Feature name
387
+ - `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
370
388
  - `feature_type`: `Page+API` or `API-only`
371
389
  - `iteration_id`: Current iteration
372
390
  - `frontend_platforms`: Platform list
@@ -420,7 +438,7 @@ If only **1 Feature** in registry:
420
438
  - `feature_analysis_path`: Path to `.feature-analysis.md`
421
439
  - `prd_path`: Path to Sub-PRD
422
440
  - `feature_id`: Feature ID
423
- - `feature_name`: Feature name
441
+ - `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
424
442
  - `feature_type`: `Page+API` or `API-only`
425
443
  - `frontend_platforms`: Platform list
426
444
  - `output_path`: Path for final spec
@@ -859,8 +859,7 @@ node speccrew-workspace/scripts/update-progress.js write-checkpoint \
859
859
  ```bash
860
860
  node speccrew-workspace/scripts/update-progress.js update-workflow \
861
861
  --file speccrew-workspace/iterations/{iteration}/WORKFLOW-PROGRESS.json \
862
- --stage 01_prd --status completed \
863
- --completed-at $(node -e "console.log(new Date().toISOString())")
862
+ --stage 01_prd --status completed
864
863
  ```
865
864
 
866
865
  **5.3.3 Update PRD Status**
@@ -944,6 +943,7 @@ Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 (if complex) → Phase 5
944
943
  - For complex requirements (3+ modules), dispatch Sub-PRD generation to parallel workers using `speccrew-pm-sub-prd-generate/SKILL.md`
945
944
 
946
945
  ### Must not do
946
+ - **FORBIDDEN: Timestamp fabrication** — DO NOT generate or pass timestamp strings. All timestamps are auto-generated by `update-progress.js` script.
947
947
  - Do not make technical solution decisions (that's speccrew-planner's responsibility)
948
948
  - Do not skip manual confirmation to directly start the next stage
949
949
  - Do not assume business rules on your own; clarify unclear requirements with the user
@@ -31,6 +31,7 @@ This skill applies ISA-95 Stages 1-3 as an internal thinking framework for analy
31
31
  1. **FORBIDDEN: Script execution failure** — If `update-progress.js` fails, HARD STOP and report error
32
32
  2. **FORBIDDEN: Hand-written `.checkpoints.json`** — ALWAYS use `update-progress.js` script
33
33
  3. **FORBIDDEN: Skip Checkpoint A** — User confirmation required before proceeding to design phase (unless `skip_checkpoint=true`)
34
+ 4. **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.
34
35
 
35
36
  ## Step 1: Read PRD Input
36
37
 
@@ -162,6 +163,11 @@ Write analysis results to `.feature-analysis.md`:
162
163
  | With feature_id | `{prd_parent}/02.feature-design/{feature-id}-{feature-name}.feature-analysis.md` |
163
164
  | Legacy mode | `{prd_parent}/02.feature-design/.feature-analysis.md` |
164
165
 
166
+ **CRITICAL — Filename Lock Rule:**
167
+ - `{feature-name}` in the output path MUST be the exact value of the `feature_name` parameter
168
+ - If PRD uses a different name for the same feature → use `feature_name` parameter for filename, note the discrepancy in the document header
169
+ - Example: parameter `feature_name = "店铺信息管理"` → filename MUST contain "店铺信息管理", NOT "shop-management" or "多店切换"
170
+
165
171
  ### Output Structure
166
172
 
167
173
  ```markdown
@@ -192,6 +198,12 @@ Write analysis results to `.feature-analysis.md`:
192
198
  - **Data Changes**: {description}
193
199
  - **System Relationship**: [EXISTING]/[MODIFIED]/[NEW] — {explanation}
194
200
 
201
+ ## Name Discrepancy Notice (if applicable)
202
+ - Parameter feature_name: {feature_name}
203
+ - PRD actual feature name: {prd_name}
204
+ - Discrepancy: {description}
205
+ - File naming follows: parameter value (as per Filename Lock Rule)
206
+
195
207
  ## Decomposition Status
196
208
  - Checkpoint A: {passed/pending}
197
209
  - Confirmed at: {timestamp or null}
@@ -39,6 +39,8 @@ ISA-95 Stages 4-6 as internal thinking framework:
39
39
 
40
40
  **NOTE:** Design process is internal — no intermediate design-data files are produced.
41
41
 
42
+ **FORBIDDEN: Rename features** — Output filename MUST use the exact `feature_name` parameter value. DO NOT translate, abbreviate, paraphrase, or substitute with names derived from analysis content. The `feature_name` parameter is the SINGLE SOURCE OF TRUTH for file naming.
43
+
42
44
  ## Step 0: Precondition Check
43
45
 
44
46
  ### Step 0 Input Parameters
@@ -66,6 +68,15 @@ ISA-95 Stages 4-6 as internal thinking framework:
66
68
  - `functions[]`: Function breakdown list
67
69
  - `platforms[]`: Frontend platforms list
68
70
 
71
+ ### 0.3 Verify Feature Name Consistency
72
+
73
+ 1. Read the `Feature Name` field from `.feature-analysis.md` header
74
+ 2. Compare with `feature_name` parameter
75
+ 3. If different:
76
+ - Log: "⚠️ Name discrepancy: parameter='{feature_name}', analysis='{analysis_name}'"
77
+ - Continue with `feature_name` parameter value for all file naming
78
+ - Use the analysis file's actual content (not its filename) for design work
79
+
69
80
  ## Step 1: Frontend Design
70
81
 
71
82
  ### 1.0 Conditional Execution
@@ -350,6 +361,11 @@ Log: "✅ Checkpoint B (feature_design_review) passed and recorded"
350
361
  - Master Spec: `{iteration_path}/02.feature-design/[master-name]-feature-spec.md`
351
362
  - Sub Specs: `{iteration_path}/02.feature-design/[sub-name]-feature-spec.md` (one per sub-feature)
352
363
 
364
+ **CRITICAL — Filename Lock Rule:**
365
+ - `{feature_name}` in the output path MUST be the exact value of the `feature_name` parameter
366
+ - If analysis file uses a different name → use `feature_name` parameter for filename
367
+ - Example: parameter `feature_name = "店铺信息管理"` → filename MUST contain "店铺信息管理", NOT "shop-management" or "多店切换"
368
+
353
369
  ### 5.2 Copy Template
354
370
 
355
371
  1. Read template: `templates/FEATURE-SPEC-TEMPLATE.md` (relative path from skill directory)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -34,8 +34,6 @@
34
34
  * --output <text> 任务输出(completed 时使用)
35
35
  * --error <text> 错误信息(failed 时使用)
36
36
  * --error-category <cat> 错误类别(failed 时使用)
37
- * --started-at <iso> 覆盖 started_at 时间戳
38
- * --completed-at <iso> 覆盖 completed_at 时间戳
39
37
  *
40
38
  * 4. update-counts - 强制重算计数
41
39
  * node update-progress.js update-counts --file <path>
@@ -56,9 +54,6 @@
56
54
  * --stage <name> 阶段名称(必需)
57
55
  * --status <status> 状态:pending/in_progress/completed/confirmed(必需)
58
56
  * --output <text> 输出信息(可选)
59
- * --started-at <iso> 覆盖 started_at 时间戳
60
- * --completed-at <iso> 覆盖 completed_at 时间戳
61
- * --confirmed-at <iso> 覆盖 confirmed_at 时间戳
62
57
  *
63
58
  * 输出格式:
64
59
  * 成功:{"success": true, "message": "...", "data": {...}}
@@ -555,24 +550,24 @@ function cmdUpdateTask(args) {
555
550
  task.status = args.status;
556
551
  task.updated_at = now;
557
552
 
558
- // 根据状态自动设置时间戳
553
+ // 根据状态自动设置时间戳(始终使用脚本生成的真实时间,不接受外部参数)
559
554
  if (args.status === 'in_progress') {
560
- task.started_at = args.startedAt || now;
555
+ task.started_at = now;
561
556
  } else if (args.status === 'partial') {
562
557
  // partial 状态:部分完成,可能已有 started_at,可选设置 completed_at
563
558
  if (!task.started_at) {
564
- task.started_at = args.startedAt || now;
559
+ task.started_at = now;
565
560
  }
566
561
  if (args.output) {
567
562
  task.output = args.output;
568
563
  }
569
564
  } else if (args.status === 'completed') {
570
- task.completed_at = args.completedAt || now;
565
+ task.completed_at = now;
571
566
  if (args.output) {
572
567
  task.output = args.output;
573
568
  }
574
569
  } else if (args.status === 'failed') {
575
- task.completed_at = args.completedAt || now;
570
+ task.completed_at = now;
576
571
  if (args.error) {
577
572
  task.error = args.error;
578
573
  }
@@ -750,16 +745,16 @@ function cmdUpdateWorkflow(args) {
750
745
  // 更新状态
751
746
  stage.status = args.status;
752
747
 
753
- // 根据状态自动设置时间戳
748
+ // 根据状态自动设置时间戳(始终使用脚本生成的真实时间,不接受外部参数)
754
749
  if (args.status === 'in_progress') {
755
750
  // 如 started_at 已有值则不覆盖
756
751
  if (!stage.started_at) {
757
- stage.started_at = args.startedAt || now;
752
+ stage.started_at = now;
758
753
  }
759
754
  } else if (args.status === 'completed') {
760
- stage.completed_at = args.completedAt || now;
755
+ stage.completed_at = now;
761
756
  } else if (args.status === 'confirmed') {
762
- stage.confirmed_at = args.confirmedAt || now;
757
+ stage.confirmed_at = now;
763
758
  }
764
759
 
765
760
  // 更新输出