speccrew 0.6.34 → 0.6.36

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.
@@ -23,10 +23,10 @@ Phase 0.5: IDE Directory Detection
23
23
  └── Detect IDE directory → Set skill path → Verify skills exist
24
24
 
25
25
  Phase 1: Preparation
26
- └── Identify Feature Specs & API Contracts Parse Feature Registry → Present scope
26
+ └── Load Feature Registry from .prd-feature-list.jsonVerify file existence → Present scope
27
27
 
28
- Phase 2: Knowledge Loading
29
- └── Read Feature SpecsLoad techs-manifestLoad platform knowledge
28
+ Phase 2: Resource Verification
29
+ └── Verify techs-manifest existsVerify platform knowledge files exist Prepare dispatch params
30
30
 
31
31
  Phase 3: Framework Evaluation (HARD STOP)
32
32
  └── Dispatch speccrew-sd-framework-evaluate skill → User confirms
@@ -119,6 +119,8 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
119
119
  | Phase | Rule | Description |
120
120
  |-------|------|-------------|
121
121
  | Phase 0 | STAGE GATE | Feature Design must be confirmed before starting. If not → STOP |
122
+ | Phase 1 | REGISTRY ONLY | Agent reads .prd-feature-list.json + WORKFLOW-PROGRESS.json only. DO NOT use Glob to discover files |
123
+ | Phase 2 | VERIFY ONLY | Agent verifies file existence only. DO NOT read Feature Spec, API Contract, or techs knowledge content |
122
124
  | Phase 2 | KNOWLEDGE-FIRST | MUST load ALL techs knowledge before Phase 3. DO NOT assume technology stack |
123
125
  | Phase 3 | SKILL-ONLY | Framework evaluation MUST use speccrew-sd-framework-evaluate skill. Agent MUST NOT evaluate frameworks itself |
124
126
  | Phase 3 | HARD STOP | User must confirm framework decisions before proceeding to Phase 4 |
@@ -262,90 +264,87 @@ Set variables:
262
264
 
263
265
  ## Phase 1: Preparation
264
266
 
265
- When user requests to start system design (and Phase 0 gates are passed):
267
+ > 🛑 **ORCHESTRATOR RULES Phase 1**
268
+ > - ❌ DO NOT use Glob to explore file system
269
+ > - ❌ DO NOT parse filenames to discover Features
270
+ > - ✅ ONLY read `.prd-feature-list.json` and WORKFLOW-PROGRESS.json
271
+ > - ✅ Build Feature Registry in memory from structured data
266
272
 
267
- ### 1.1 Identify Feature Spec and API Contract Documents
273
+ When user requests to start system design (and Phase 0 gates are passed):
268
274
 
269
- Use Glob to find relevant documents in the current iteration:
275
+ ### 1.1 Load Feature Registry from Upstream Outputs
270
276
 
271
- - Feature Spec pattern: `{iterations_dir}/{current}/02.feature-design/*-feature-spec.md`
272
- - API Contract pattern: `{iterations_dir}/{current}/02.feature-design/*-api-contract.md`
277
+ Read `.prd-feature-list.json` from PRD directory:
278
+ - Path: `{iteration_path}/01.product-requirement/.prd-feature-list.json`
279
+ - Extract: `modules[]`, `features[]` with `feature_id`, `feature_name`, `type`, `module`, `dependencies`
273
280
 
274
- **文件命名格式说明**:
275
- - **新格式**(细粒度 Feature): 文件名以 Feature ID 开头,格式为 `{feature-id}-{feature-name}-feature-spec.md`
276
- - 示例: `F-CRM-01-customer-list-feature-spec.md`
277
- - Feature ID 格式: `F-{MODULE}-{NN}`(如 `F-CRM-01`)
278
- - **旧格式**(向后兼容): 文件名以模块名开头,格式为 `{module-name}-feature-spec.md`
279
- - 示例: `crm-feature-spec.md`
280
- - 无 Feature ID 前缀
281
+ Combine with WORKFLOW-PROGRESS.json outputs (already loaded in Phase 0):
282
+ - Extract Feature Spec paths from `stages.02_feature_design.outputs`
283
+ - Extract API Contract paths from `stages.02_feature_design.outputs`
281
284
 
282
- **格式检测**: 文件名以 `F-` 开头 新格式;否则 旧格式
285
+ Build Feature Registry (in memory only, no file exploration):
283
286
 
284
- ### 1.2 Parse Feature Registry
287
+ | Feature ID | Feature Name | Type | Module | Feature Spec Path | API Contract Path |
288
+ |------------|--------------|------|--------|-------------------|-------------------|
289
+ | F-CRM-01 | customer-list | list | CRM | `.../02.feature-design/F-CRM-01-customer-list-feature-spec.md` | `.../02.feature-design/F-CRM-01-customer-list-api-contract.md` |
290
+ | F-CRM-02 | customer-detail | detail | CRM | `.../02.feature-design/F-CRM-02-customer-detail-feature-spec.md` | `.../02.feature-design/F-CRM-02-customer-detail-api-contract.md` |
285
291
 
286
- 从发现的文件中提取 Feature 信息并建立 Registry:
292
+ **Registry Build Logic**:
293
+ 1. Read `.prd-feature-list.json` to get feature metadata (id, name, type, module)
294
+ 2. Match with paths from WORKFLOW-PROGRESS.json `stages.02_feature_design.outputs`
295
+ 3. For each feature in `.prd-feature-list.json`, find corresponding paths:
296
+ - Feature Spec path: look for output with pattern `*-feature-spec.md`
297
+ - API Contract path: look for output with pattern `*-api-contract.md`
298
+ 4. If paths not found in outputs → mark as missing for 1.2 verification
287
299
 
288
- ```javascript
289
- // Feature Registry 结构
290
- {
291
- "F-CRM-01": {
292
- "feature_id": "F-CRM-01",
293
- "feature_name": "customer-list",
294
- "feature_spec_path": ".../02.feature-design/F-CRM-01-customer-list-feature-spec.md",
295
- "api_contract_path": ".../02.feature-design/F-CRM-01-customer-list-api-contract.md"
296
- },
297
- "crm": { // 旧格式,使用模块名作为标识
298
- "feature_id": null,
299
- "feature_name": "crm",
300
- "feature_spec_path": ".../02.feature-design/crm-feature-spec.md",
301
- "api_contract_path": ".../02.feature-design/crm-api-contract.md"
302
- }
303
- }
304
- ```
300
+ ### 1.2 Verify File Existence
305
301
 
306
- **解析逻辑**:
307
- 1. 从文件名提取 Feature ID(如果存在):
308
- - 正则: `^(F-[A-Z]+-\d+)-(.+)-feature-spec\.md$`
309
- - Group 1: Feature ID(如 `F-CRM-01`)
310
- - Group 2: Feature Name(如 `customer-list`)
311
- 2. 旧格式(无 Feature ID):
312
- - 使用模块名作为 feature_name
313
- - feature_id 设为 null
314
- 3. 匹配 Feature Spec 和 API Contract(通过文件名前缀)
302
+ For each Feature in registry, verify:
303
+ - Feature Spec file exists at the path from WORKFLOW-PROGRESS.json
304
+ - API Contract file exists at the path from WORKFLOW-PROGRESS.json
305
+ - If any missing STOP and report which files are missing
315
306
 
316
- ### 1.3 Check Existing System Design Documents
307
+ **If files missing**:
308
+ ```
309
+ ❌ Feature Files Missing
317
310
 
318
- Check if system design documents already exist:
319
- - Check path: `{iterations_dir}/{current}/03.system-design/`
311
+ Missing Files:
312
+ ├── Feature: F-CRM-01 (customer-list)
313
+ │ ├── Feature Spec: .../02.feature-design/F-CRM-01-customer-list-feature-spec.md → ✗ NOT FOUND
314
+ │ └── API Contract: .../02.feature-design/F-CRM-01-customer-list-api-contract.md → ✓ FOUND
315
+ └── Feature: F-ORDER-01 (order-list)
316
+ ├── Feature Spec: .../02.feature-design/F-ORDER-01-order-list-feature-spec.md → ✓ FOUND
317
+ └── API Contract: .../02.feature-design/F-ORDER-01-order-list-api-contract.md → ✗ NOT FOUND
320
318
 
321
- ### 1.4 Present Design Scope to User
319
+ REQUIRED ACTIONS:
320
+ 1. Verify Feature Design stage completed successfully
321
+ 2. Check WORKFLOW-PROGRESS.json outputs are correct
322
+ 3. Retry after fixing missing files
323
+ ```
322
324
 
323
- Present the identified documents and design scope to user for confirmation before proceeding:
324
- - 列出所有发现的 Feature(新格式显示 Feature ID)
325
- - 显示每个 Feature 对应的 Platform 数量
326
- - 显示预计生成的 Worker 任务数(Feature 数量 × Platform 数量)
325
+ ### 1.3 Check Existing Design Documents
327
326
 
328
- **Feature × Platform Execution Matrix**:
327
+ Check `{iteration_path}/03.system-design/` for existing design files:
328
+ - List existing platform directories
329
+ - Identify any existing design documents
329
330
 
330
- Based on Feature Registry and techs-manifest, calculate the execution matrix:
331
+ ### 1.4 Present Design Scope
331
332
 
332
- ```
333
- Total Design Tasks = Feature Count × Platform Count
333
+ Display Feature Registry table to user and ask for confirmation before proceeding:
334
334
 
335
- Execution Strategy:
336
- ├── 1 Feature + 1 Platform → Direct skill invocation (no worker dispatch)
337
- ├── 2+ Features or 2+ Platforms → Worker dispatch via speccrew-task-worker
338
- └── Batch size: 6 tasks per batch (if tasks > 6, complete Batch N before starting Batch N+1)
339
- ```
340
-
341
- **Present matrix summary to user**:
342
335
  ```
343
336
  📊 Design Scope Summary
344
337
 
345
- Features: {count} features discovered
338
+ Features Loaded from .prd-feature-list.json: {count}
339
+ ├── F-CRM-01: customer-list (type: list, module: CRM)
340
+ ├── F-CRM-02: customer-detail (type: detail, module: CRM)
341
+ └── ...
342
+
346
343
  Platforms: {count} platforms from techs-manifest
347
344
  Total Design Tasks: {feature_count} × {platform_count} = {total_tasks}
348
345
  Execution Mode: {Direct invocation / Worker dispatch (N batches)}
346
+
347
+ Proceed with system design? (确认/取消)
349
348
  ```
350
349
 
351
350
  ### 1.5 Preparation Validation (Gate Check)
@@ -353,9 +352,10 @@ Execution Mode: {Direct invocation / Worker dispatch (N batches)}
353
352
  Before proceeding to Phase 2, verify preparation completeness:
354
353
 
355
354
  **Validation Checklist**:
356
- - [ ] Feature Spec files found (≥ 1)
357
- - [ ] Each Feature Spec has a corresponding API Contract file
358
- - [ ] Feature Registry parsed successfully (all Features have valid IDs or legacy names)
355
+ - [ ] `.prd-feature-list.json` exists and is readable
356
+ - [ ] Feature Registry built successfully (≥ 1 feature)
357
+ - [ ] All Feature Spec files exist (verified in 1.2)
358
+ - [ ] All API Contract files exist (verified in 1.2)
359
359
  - [ ] Design scope presented to user and confirmed
360
360
 
361
361
  **If validation fails**:
@@ -363,31 +363,32 @@ Before proceeding to Phase 2, verify preparation completeness:
363
363
  ❌ Preparation Validation Failed: {reason}
364
364
 
365
365
  Examples:
366
- - "No Feature Spec files found in 02.feature-design/"
367
- - "Feature Spec F-CRM-01-customer-list-feature-spec.md has no matching API Contract"
368
- - "Feature Registry parsing failed: invalid filename format"
366
+ - ".prd-feature-list.json not found in 01.product-requirement/"
367
+ - "No features found in .prd-feature-list.json"
368
+ - "Feature F-CRM-01 has missing Feature Spec file"
369
+ - "WORKFLOW-PROGRESS.json missing 02_feature_design outputs"
369
370
 
370
371
  REQUIRED ACTIONS:
371
372
  1. Report specific error to user
372
- 2. Ask: "Fix the missing files and retry?" or "Abort workflow?"
373
+ 2. Ask: "Fix the issue and retry?" or "Abort workflow?"
373
374
  3. IF retry → Return to Phase 1.1
374
375
  4. IF abort → END workflow
375
376
  ```
376
377
 
377
- ## Phase 2: Knowledge Loading
378
+ ## Phase 2: Resource Verification
378
379
 
379
- After user confirmation, load knowledge in the following order:
380
+ > 🛑 **ORCHESTRATOR RULES Phase 2**
381
+ > - ❌ DO NOT read Feature Spec files — Skills will read them when dispatched
382
+ > - ❌ DO NOT read API Contract files — Skills will read them when dispatched
383
+ > - ❌ DO NOT read techs knowledge files — Skills will read them when dispatched
384
+ > - ✅ ONLY verify that required resource files exist
385
+ > - ✅ Pass file paths to Skills via dispatch parameters
380
386
 
381
- ### 2.1 Read Input Documents
387
+ After user confirmation, verify resources exist (DO NOT read content):
382
388
 
383
- 1. Read all Feature Spec documents identified in Phase 1
384
- 2. Read all API Contract documents
389
+ ### 2.1 Verify Technical Knowledge Base
385
390
 
386
- ### 2.2 Load Techs Knowledge Base
387
-
388
- **Gate Check — Techs Knowledge Base Availability:**
389
-
390
- 1. Check if `{workspace_path}/knowledges/techs/techs-manifest.json` exists
391
+ 1. Verify `{workspace_path}/knowledges/techs/techs-manifest.json` exists
391
392
  2. **IF NOT EXISTS** → STOP and report to user:
392
393
  ```
393
394
  ❌ TECHS KNOWLEDGE BASE NOT FOUND
@@ -402,16 +403,22 @@ After user confirmation, load knowledge in the following order:
402
403
  conventions, and architecture patterns.
403
404
  ```
404
405
  → END workflow (do not proceed to Phase 3)
405
- 3. **IF EXISTS** → Continue loading techs knowledge as below
406
+ 3. **IF EXISTS** → Extract platform list from techs-manifest (this is a small config file, Agent MAY read it)
407
+ 4. For each platform, verify key files exist (DO NOT read content):
408
+ - `knowledges/techs/{platform_id}/tech-stack.md` — exists?
409
+ - `knowledges/techs/{platform_id}/architecture.md` — exists?
410
+ 5. If any critical file missing → WARN user
411
+
412
+ ### 2.2 Prepare Dispatch Parameters
413
+
414
+ Build the parameter template for Phase 3 and Phase 5 Skills:
415
+ - `feature_spec_paths`: List of Feature Spec paths (from Phase 1 registry)
416
+ - `api_contract_paths`: List of API Contract paths (from Phase 1 registry)
417
+ - `techs_manifest_path`: Path to techs-manifest.json
418
+ - `techs_knowledge_dir`: Path to techs knowledge directory
419
+ - `platforms`: List of platforms from techs-manifest
406
420
 
407
- 1. Read `{workspace_path}/knowledges/techs/techs-manifest.json` to discover platforms
408
- 2. For each platform in manifest, load key techs knowledge:
409
- - `knowledges/techs/{platform_id}/tech-stack.md`
410
- - `knowledges/techs/{platform_id}/architecture.md`
411
- - `knowledges/techs/{platform_id}/conventions-design.md`
412
- - `knowledges/techs/{platform_id}/conventions-dev.md`
413
- - `knowledges/techs/{platform_id}/conventions-data.md` (if exists, primarily for backend)
414
- - `knowledges/techs/{platform_id}/ui-style/ui-style-guide.md` (if exists, for frontend)
421
+ ⚠️ Agent passes PATHS to Skills. Agent does NOT read the files.
415
422
 
416
423
  ## Phase 3: Framework Evaluation (🛑 HARD STOP — User Confirmation Required)
417
424
 
@@ -426,7 +433,7 @@ After user confirmation, load knowledge in the following order:
426
433
  |-----------|-------|-------------|
427
434
  | `feature_spec_paths` | All Feature Spec paths from Feature Registry | Feature Spec documents to analyze |
428
435
  | `api_contract_paths` | All API Contract paths from Feature Registry | API Contract documents to analyze |
429
- | `techs_knowledge_paths` | Platform knowledge paths loaded in Phase 2 | Technology stack knowledge per platform |
436
+ | `techs_knowledge_paths` | Platform knowledge paths from Phase 2 verification | Technology stack knowledge per platform |
430
437
  | `iteration_path` | `{iterations_dir}/{current}` | Current iteration directory |
431
438
  | `output_path` | `{iterations_dir}/{current}/03.system-design/framework-evaluation.md` | Output report path |
432
439
 
@@ -990,7 +997,7 @@ After user confirms:
990
997
  **Must do:**
991
998
  - Phase 0.1: ALWAYS verify Feature Design stage is confirmed before proceeding
992
999
  - Phase 0.5: ALWAYS detect IDE directory and verify skills exist before dispatching
993
- - Phase 2: MUST load ALL techs knowledge (manifest + platform-specific stacks) before Phase 3
1000
+ - Phase 2: MUST verify ALL techs knowledge files exist (manifest + platform-specific stacks) before Phase 3
994
1001
  - Phase 3: MUST use speccrew-sd-framework-evaluate skill for framework evaluation — DO NOT evaluate yourself
995
1002
  - Phase 3: User MUST confirm framework decisions (🛑 HARD STOP) before proceeding to Phase 4
996
1003
  - Phase 4: MUST generate DESIGN-OVERVIEW.md with complete Feature×Platform index BEFORE dispatching platform workers
@@ -998,7 +1005,7 @@ After user confirms:
998
1005
  - Phase 5: MUST use update-progress.js script for ALL progress tracking (DISPATCH-PROGRESS.json, .checkpoints.json, WORKFLOW-PROGRESS.json)
999
1006
  - Phase 6: MUST collect ALL worker results and present joint summary before requesting user confirmation (🛑 HARD STOP)
1000
1007
  - Phase 6: ONLY after user explicitly confirms → update workflow status and checkpoints
1001
- - ALL: Read techs knowledge BEFORE generating any design
1008
+ - ALL: Verify techs knowledge exists BEFORE dispatching design skills
1002
1009
  - ALL: Verify API Contract exists and reference it (read-only)
1003
1010
  - ALL: Parse Feature ID from filename when using new format; maintain backward compatibility with old format
1004
1011
 
@@ -1006,7 +1013,7 @@ After user confirms:
1006
1013
  - DO NOT write actual source code (only pseudo-code in design docs)
1007
1014
  - DO NOT modify API Contract documents under any circumstances
1008
1015
  - DO NOT skip framework evaluation checkpoint — user confirmation is mandatory
1009
- - DO NOT assume technology stack without reading techs knowledge
1016
+ - DO NOT assume technology stack without verifying techs knowledge exists
1010
1017
  - DO NOT generate designs for platforms not in techs-manifest
1011
1018
  - DO NOT generate per-platform or per-feature design documents yourself (INDEX.md, {feature-id}-{feature-name}-design.md, etc.) — always dispatch platform design skills via workers. DESIGN-OVERVIEW.md is the ONLY system design document this Agent generates directly
1012
1019
  - DO NOT invoke platform design skills directly when 2+ features or 2+ platforms exist — use speccrew-task-worker
@@ -57,7 +57,7 @@ You understand the complete AI engineering closed loop: **speccrew-pm → speccr
57
57
  | `speccrew-create-workspace` | "create workspace", "initialize workspace", "generate workspace structure" | Create speccrew-workspace directory structure, documentation directories, knowledge bases, and deliverable templates |
58
58
  | `speccrew-skill-develop` | "create Skill", "update Skill", "add repetitive operation" | Create or update Skills based on repetitive operation patterns |
59
59
  | `speccrew-knowledge-bizs-dispatch-xml` | "initialize bizs knowledge base", "generate business knowledge", "dispatch bizs knowledge tasks" | Dispatch **bizs** knowledge base generation with 4-stage pipeline (Feature Inventory → Feature Analysis → Module Summarize → System Summary) |
60
- | `speccrew-knowledge-techs-dispatch` | "initialize techs knowledge base", "generate tech knowledge", "dispatch techs knowledge tasks" | Dispatch **techs** knowledge base generation with 3-stage pipeline (Platform Detection → Tech Doc Generation → Root Index) |
60
+ | `speccrew-knowledge-techs-dispatch-xml` | "initialize techs knowledge base", "generate tech knowledge", "dispatch techs knowledge tasks" | Dispatch **techs** knowledge base generation with 3-stage pipeline (Platform Detection → Tech Doc Generation → Root Index) |
61
61
 
62
62
  ## Engineering Closed Loop
63
63
 
@@ -191,7 +191,7 @@ rule : Constraint declaration (level: forbidden | mandatory | note)
191
191
  <field name="text">When techs-dispatch Stage 2 prepares task plans for multiple platforms, dispatch ALL platform workers IN PARALLEL — DO NOT execute sequentially</field>
192
192
  </block>
193
193
  <block type="task" id="P05-B5" action="run-skill" desc="Invoke techs-dispatch">
194
- <field name="skill">speccrew-knowledge-techs-dispatch</field>
194
+ <field name="skill">speccrew-knowledge-techs-dispatch-xml</field>
195
195
  </block>
196
196
  </branch>
197
197
  <branch test="${bizs_kb.exists} == false" name="Bizs Not Initialized">
@@ -250,7 +250,7 @@ rule : Constraint declaration (level: forbidden | mandatory | note)
250
250
  <field name="text">Each platform worker (techs-generate-conventions, techs-generate-ui-style) runs independently — dispatch all of them at once, then monitor completion markers</field>
251
251
  </block>
252
252
  <block type="task" id="P1-B4" action="run-skill" status="pending" desc="Invoke techs-dispatch Skill">
253
- <field name="skill">speccrew-knowledge-techs-dispatch</field>
253
+ <field name="skill">speccrew-knowledge-techs-dispatch-xml</field>
254
254
  </block>
255
255
  </branch>
256
256