speccrew 0.2.7 → 0.3.0
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 +220 -27
- package/.speccrew/agents/speccrew-system-designer.md +237 -31
- package/.speccrew/agents/speccrew-system-developer.md +44 -10
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +15 -1
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +36 -7
- package/.speccrew/skills/speccrew-dev-review/SKILL.md +16 -7
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +150 -35
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +140 -18
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +4 -1
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +29 -15
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +51 -6
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +18 -20
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +7 -10
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +19 -23
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +151 -153
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +23 -63
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +32 -68
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +6 -2
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +32 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +16 -1
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +33 -6
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +25 -5
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +17 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +20 -3
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +8 -0
- package/package.json +1 -1
|
@@ -55,12 +55,48 @@ Orchestrate **bizs knowledge base generation** with a 5-stage pipeline: Feature
|
|
|
55
55
|
|
|
56
56
|
## Workflow Overview
|
|
57
57
|
|
|
58
|
+
**Execution Pseudocode:**
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
INPUT: source_path, language, sync_mode, max_concurrent_workers
|
|
62
|
+
|
|
63
|
+
STAGE 0: Platform Detection
|
|
64
|
+
FOR each detected platform:
|
|
65
|
+
Identify platform_type, platform_subtype, tech_stack
|
|
66
|
+
Present platform list for user confirmation
|
|
67
|
+
|
|
68
|
+
STAGE 1: Feature Inventory
|
|
69
|
+
Stage 1a: Entry Directory Recognition → Generate entry-dirs-{platform}.json
|
|
70
|
+
Stage 1b: Feature Inventory → Generate features-{platform}.json
|
|
71
|
+
Stage 1c (incremental only): Merge features with existing state
|
|
72
|
+
|
|
73
|
+
STAGE 2: Feature Analysis (REPEAT until all features processed)
|
|
74
|
+
Step 0: Ensure completed_dir exists
|
|
75
|
+
Step 1: Get next batch of pending features
|
|
76
|
+
Step 2: Launch parallel Workers (API or UI analysis)
|
|
77
|
+
Step 3: Process batch results, update features.json, write graph
|
|
78
|
+
|
|
79
|
+
STAGE 3: Module Summarize (parallel per module)
|
|
80
|
+
FOR each module:
|
|
81
|
+
Launch Worker with module-summarize skill
|
|
82
|
+
|
|
83
|
+
STAGE 3.5: UI Style Pattern Extract (parallel per frontend platform)
|
|
84
|
+
FOR each frontend platform:
|
|
85
|
+
Launch Worker with ui-style-extract skill
|
|
86
|
+
|
|
87
|
+
STAGE 4: System Summary
|
|
88
|
+
Launch Worker with system-summarize skill
|
|
89
|
+
|
|
90
|
+
OUTPUT: system-overview.md, graph data, module overviews
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Stage Sequence:**
|
|
94
|
+
|
|
58
95
|
```mermaid
|
|
59
96
|
flowchart TB
|
|
60
|
-
S0[
|
|
61
|
-
S0a --> S1a[Stage 1a: Entry Directory Recognition]
|
|
97
|
+
S0[Stage 0: Platform Detection] --> S1a[Stage 1a: Entry Directory Recognition]
|
|
62
98
|
S1a --> S1b[Stage 1b: Feature Inventory]
|
|
63
|
-
S1b --> S1c[Stage 1c: Feature Merge
|
|
99
|
+
S1b --> S1c[Stage 1c: Feature Merge]
|
|
64
100
|
S1c --> S2[Stage 2: Feature Analysis + Graph Write]
|
|
65
101
|
S2 --> S3[Stage 3: Module Summarize]
|
|
66
102
|
S3 --> S3_5[Stage 3.5: UI Style Pattern Extract]
|
|
@@ -330,6 +366,17 @@ After generating the entry-dirs JSON:
|
|
|
330
366
|
|
|
331
367
|
> **Script execution rule**: All script calls in Stage 2 are executed **directly by the dispatch agent** via `run_in_terminal`. Only the analysis tasks are delegated to Worker Agents.
|
|
332
368
|
|
|
369
|
+
**Skill Routing Table (by platformType):**
|
|
370
|
+
|
|
371
|
+
| platformType | skill_name | Description |
|
|
372
|
+
|--------------|------------|-------------|
|
|
373
|
+
| `web` | `speccrew-knowledge-bizs-ui-analyze` | Web frontend (Vue/React/Angular) |
|
|
374
|
+
| `mobile` | `speccrew-knowledge-bizs-ui-analyze` | Mobile apps (Flutter/React Native/UniApp) |
|
|
375
|
+
| `desktop` | `speccrew-knowledge-bizs-ui-analyze` | Desktop apps (Electron/WPF) |
|
|
376
|
+
| `backend` | `speccrew-knowledge-bizs-api-analyze` | Backend APIs (Java/Python/Node.js) |
|
|
377
|
+
|
|
378
|
+
> **CRITICAL**: Use this routing table to select the correct skill for each feature in Step 2.
|
|
379
|
+
|
|
333
380
|
#### Execution Flow
|
|
334
381
|
|
|
335
382
|
Repeat the following 3 steps until all features are processed:
|
|
@@ -366,9 +413,7 @@ node -e "require('fs').mkdirSync('{completed_dir}', {recursive: true}); console.
|
|
|
366
413
|
⚠️ **CRITICAL**: You MUST launch ALL features in the current batch SIMULTANEOUSLY as parallel Worker Tasks. **FORBIDDEN**: sequential launch (start one Worker, wait, then start next).
|
|
367
414
|
|
|
368
415
|
For each feature in the `batch` array, prepare a Worker Task:
|
|
369
|
-
- **
|
|
370
|
-
- `"web"`, `"mobile"`, `"desktop"` → `skill_name: speccrew-knowledge-bizs-ui-analyze`
|
|
371
|
-
- `"backend"` → `skill_name: speccrew-knowledge-bizs-api-analyze`
|
|
416
|
+
- **Select skill** using the routing table at Stage 2 start
|
|
372
417
|
- **Worker parameters**: Pass all feature fields plus `language`, `completed_dir`, `sourceFile`, `skill_path`
|
|
373
418
|
- **Behavior constraint**: Worker MUST NOT create any temporary scripts. If execution fails, STOP and report error.
|
|
374
419
|
|
|
@@ -55,20 +55,6 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
55
55
|
|
|
56
56
|
## Output
|
|
57
57
|
|
|
58
|
-
## 🚫 ABSOLUTE PROHIBITIONS (ZERO TOLERANCE)
|
|
59
|
-
|
|
60
|
-
> **These rules apply to ALL steps. Violation = task failure.**
|
|
61
|
-
|
|
62
|
-
1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write the analysis document (`{{documentPath}}`). Documents MUST be created by copying the template (Step 5a) then filling sections with `search_replace` (Step 5b). `create_file` produces truncated output on large files.
|
|
63
|
-
|
|
64
|
-
2. **FORBIDDEN: File deletion** — NEVER use `Remove-Item`, `del`, `rm`, `fs.unlinkSync`, or any delete command on generated files. If a file is malformed, fix it with `search_replace`.
|
|
65
|
-
|
|
66
|
-
3. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
67
|
-
|
|
68
|
-
4. **MANDATORY: Template-first workflow** — Step 5a (copy template) MUST execute before Step 5b (fill sections). Skipping Step 5a and writing content directly is FORBIDDEN.
|
|
69
|
-
|
|
70
|
-
## Output (Files)
|
|
71
|
-
|
|
72
58
|
**Generated Files (MANDATORY - Task is NOT complete until all files are written):**
|
|
73
59
|
1. `{{documentPath}}` - Feature documentation file
|
|
74
60
|
2. `{{completed_dir}}/{module}-{subpath}-{fileName}.done.json` - Completion status marker
|
|
@@ -94,6 +80,12 @@ The return value is used by dispatch to update the feature status in `features-{
|
|
|
94
80
|
|
|
95
81
|
## Workflow
|
|
96
82
|
|
|
83
|
+
> **⚠️ CRITICAL CONSTRAINTS (apply to ALL steps):**
|
|
84
|
+
> 1. **FORBIDDEN: `create_file` for documents** — Documents MUST be created by copying template (Step 5a) then filling with `search_replace` (Step 5b)
|
|
85
|
+
> 2. **FORBIDDEN: File deletion** — If a file is malformed, fix it with `search_replace`
|
|
86
|
+
> 3. **FORBIDDEN: Full-file rewrite** — Always use targeted `search_replace` on specific sections
|
|
87
|
+
> 4. **MANDATORY: Template-first workflow** — Step 5a MUST execute before Step 5b
|
|
88
|
+
|
|
97
89
|
```mermaid
|
|
98
90
|
graph TB
|
|
99
91
|
Start([Start]) --> Step1[Step 1 Read Analysis Template]
|
|
@@ -109,13 +101,19 @@ graph TB
|
|
|
109
101
|
|
|
110
102
|
---
|
|
111
103
|
|
|
112
|
-
### Step 1: Read Analysis Template
|
|
104
|
+
### Step 1: Read Analysis Template (Required before workflow starts)
|
|
113
105
|
|
|
114
106
|
**Step 1 Status: 🔄 IN PROGRESS**
|
|
115
107
|
|
|
116
108
|
1. **Check Analysis Status:**
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
```
|
|
110
|
+
IF {{analyzed}} == true THEN
|
|
111
|
+
Output "Step 1 Status: ⏭️ SKIPPED (already analyzed)"
|
|
112
|
+
Skip to Step 6 with status="skipped"
|
|
113
|
+
ELSE
|
|
114
|
+
Proceed to next step
|
|
115
|
+
END IF
|
|
116
|
+
```
|
|
119
117
|
|
|
120
118
|
2. **Read the appropriate template based on platform type:**
|
|
121
119
|
|
|
@@ -290,13 +288,13 @@ Each user interaction or page initialization in the feature file = one business
|
|
|
290
288
|
- **MUST analyze API call sequences**: identify serial vs parallel calls, try/catch/finally timing, race conditions
|
|
291
289
|
- **MUST document boundary scenarios**: empty data, error branches, state reset, concurrent operations
|
|
292
290
|
- For APIs and shared methods in flowcharts: show name, type, and main function only (no deep analysis)
|
|
293
|
-
- **
|
|
291
|
+
- **Read Configuration**: Read `speccrew-workspace/docs/rules/mermaid-rule.md` for Mermaid diagram guidelines
|
|
292
|
+
- **Generate Mermaid flowcharts** following the configuration:
|
|
294
293
|
- Use `graph TB` or `graph LR` syntax (not `flowchart`)
|
|
295
|
-
- No parentheses `()` in node text
|
|
294
|
+
- No parentheses `()` in node text
|
|
296
295
|
- No HTML tags like `<br/>`
|
|
297
296
|
- No `style` definitions
|
|
298
297
|
- No nested `subgraph`
|
|
299
|
-
- No special characters in node text
|
|
300
298
|
- Use `{{language}}` for all extracted content naming
|
|
301
299
|
|
|
302
300
|
4. **Build Graph Data** (per feature file):
|
|
@@ -35,6 +35,8 @@ Read all {{feature_name}}.md files of a specific module, extract and summarize i
|
|
|
35
35
|
## Output
|
|
36
36
|
|
|
37
37
|
- `{{module_path}}/{{module_name}}-overview.md` - Complete module overview (overwritten)
|
|
38
|
+
- Example: `speccrew-workspace/knowledges/bizs/backend-ai/chat/chat-overview.md`
|
|
39
|
+
- Example: `speccrew-workspace/knowledges/bizs/web-vue/order/order-overview.md`
|
|
38
40
|
|
|
39
41
|
## Workflow
|
|
40
42
|
|
|
@@ -49,16 +51,6 @@ flowchart TD
|
|
|
49
51
|
Step6 --> End([End])
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
### Absolute Constraints
|
|
53
|
-
|
|
54
|
-
> **These rules apply to ALL steps. Violation = task failure.**
|
|
55
|
-
|
|
56
|
-
1. **FORBIDDEN: `create_file` for overview document** — NEVER use `create_file` to write the module overview document. If the initial skeleton exists, use `search_replace` to fill sections. If no skeleton exists, copy the template first then fill with `search_replace`.
|
|
57
|
-
|
|
58
|
-
2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
59
|
-
|
|
60
|
-
3. **MANDATORY: Template-first workflow** — Template (or existing skeleton) MUST be in place before filling sections. Writing content without a template base is FORBIDDEN.
|
|
61
|
-
|
|
62
54
|
### Step 1: Read Prerequisites
|
|
63
55
|
|
|
64
56
|
Before processing, read all required files:
|
|
@@ -134,6 +126,11 @@ Collect all business rules from feature details:
|
|
|
134
126
|
|
|
135
127
|
### Step 5: Generate Complete MODULE-OVERVIEW.md
|
|
136
128
|
|
|
129
|
+
**⚠️ CRITICAL CONSTRAINTS (apply to this step):**
|
|
130
|
+
> 1. **FORBIDDEN: `create_file` for overview document** — If skeleton exists, use `search_replace`; if not, copy template first then fill with `search_replace`
|
|
131
|
+
> 2. **FORBIDDEN: Full-file rewrite** — Always use targeted `search_replace` on specific sections
|
|
132
|
+
> 3. **MANDATORY: Template-first workflow** — Template (or existing skeleton) MUST be in place before filling sections
|
|
133
|
+
|
|
137
134
|
**IMPORTANT**: ALL generated content (entity descriptions, business rules, flow descriptions, section headers, and narrative text) MUST be written in the language specified by the `language` parameter. Only code identifiers, file paths, and technical terms (class names, API endpoints) remain in their original language.
|
|
138
135
|
|
|
139
136
|
1. **Read Configuration**:
|
|
@@ -37,19 +37,11 @@ Worker Agent (speccrew-task-worker)
|
|
|
37
37
|
## Output
|
|
38
38
|
|
|
39
39
|
- `{{output_path}}/system-overview.md` - Complete system overview
|
|
40
|
+
- Example (single platform): `speccrew-workspace/knowledges/bizs/system-overview.md`
|
|
41
|
+
- Example (multi-platform): `speccrew-workspace/knowledges/bizs/system-overview.md` (aggregates all platforms)
|
|
40
42
|
|
|
41
43
|
## Workflow
|
|
42
44
|
|
|
43
|
-
### Absolute Constraints
|
|
44
|
-
|
|
45
|
-
> **These rules apply to ALL steps. Violation = task failure.**
|
|
46
|
-
|
|
47
|
-
1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write the system overview document. It MUST be created by copying the template (Step 7a) then filling sections with `search_replace` (Step 7b). `create_file` produces truncated output on large files.
|
|
48
|
-
|
|
49
|
-
2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
50
|
-
|
|
51
|
-
3. **MANDATORY: Template-first workflow** — Step 7a (copy template) MUST execute before Step 7b (fill sections). Skipping Step 7a and writing content directly is FORBIDDEN.
|
|
52
|
-
|
|
53
45
|
### Prerequisites
|
|
54
46
|
|
|
55
47
|
Before starting, verify:
|
|
@@ -216,32 +208,36 @@ Create flow-module mapping matrix:
|
|
|
216
208
|
|
|
217
209
|
### Step 7: Generate system-overview.md
|
|
218
210
|
|
|
211
|
+
**⚠️ CRITICAL CONSTRAINTS (apply to Step 7a and 7b):**
|
|
212
|
+
> 1. **FORBIDDEN: `create_file` for documents** — Document MUST be created by copying template (Step 7a) then filling with `search_replace` (Step 7b)
|
|
213
|
+
> 2. **FORBIDDEN: Full-file rewrite** — Always use targeted `search_replace` on specific sections
|
|
214
|
+
> 3. **MANDATORY: Template-first workflow** — Step 7a MUST execute before Step 7b
|
|
215
|
+
|
|
216
|
+
**Step 7a: Prepare Document**
|
|
217
|
+
|
|
219
218
|
1. **Read Configuration**:
|
|
220
219
|
- Read `speccrew-workspace/docs/configs/tech-stack-mappings.json` → system tech stacks and display names
|
|
221
220
|
- Read `speccrew-workspace/docs/rules/mermaid-rule.md` → Mermaid diagram guidelines
|
|
222
221
|
|
|
223
|
-
2. **
|
|
222
|
+
2. **Invoke** `speccrew-get-timestamp` using Skill tool:
|
|
223
|
+
- Parameters: none (uses default format `YYYY-MM-DD-HHmmss`)
|
|
224
|
+
- Returns: timestamp string (e.g., `2026-03-17-132645`)
|
|
225
|
+
- Use the returned timestamp as generation timestamp in document
|
|
226
|
+
|
|
227
|
+
3. **Determine Technology Stack**:
|
|
224
228
|
- Extract platform types from discovered module paths
|
|
225
229
|
- Map platform_type to display name via tech-stack-mappings.json
|
|
226
230
|
- Example: `web-vue` → `Vue 3 + TypeScript`; `backend-java` → `Java 17 + Spring Boot`
|
|
227
231
|
|
|
228
|
-
|
|
229
|
-
- **CRITICAL**: Use the Skill tool to invoke `speccrew-get-timestamp` (no parameters needed, uses default format `YYYY-MM-DD-HHmmss`, returns timestamp string e.g. `2026-03-17-132645`)
|
|
230
|
-
- Use the returned timestamp as generation timestamp in document
|
|
231
|
-
|
|
232
|
-
4. **Copy template to document path (Step 7a)**:
|
|
232
|
+
4. **Copy template to document path**:
|
|
233
233
|
- Read template: `templates/SYSTEM-OVERVIEW-TEMPLATE.md` (already loaded in Step 0)
|
|
234
234
|
- Replace top-level placeholders (system name, generation timestamp, tech stack info)
|
|
235
|
-
- Create document using `create_file` at: `output_path/system-overview.md`
|
|
235
|
+
- Create document using `create_file` at: `{{output_path}}/system-overview.md`
|
|
236
236
|
- Verify: Document has complete section structure ready for filling
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
**Step 7b: Fill Each Section Using search_replace**
|
|
239
239
|
|
|
240
|
-
> ⚠️ **CRITICAL
|
|
241
|
-
> - **FORBIDDEN: `create_file` to rewrite the entire document** — it destroys template structure
|
|
242
|
-
> - **MUST use `search_replace` to fill each section individually**
|
|
243
|
-
> - **All section titles MUST be preserved**
|
|
244
|
-
> - If a section has no applicable content, keep the section title and replace placeholder with "N/A"
|
|
240
|
+
> ⚠️ **CRITICAL**: Use `search_replace` to fill each section individually. If a section has no applicable content, keep the section title and replace placeholder with "N/A"
|
|
245
241
|
|
|
246
242
|
**Fill via `search_replace`:**
|
|
247
243
|
|
|
@@ -66,7 +66,10 @@ flowchart TB
|
|
|
66
66
|
|
|
67
67
|
**Goal**: Scan source code and identify all technology platforms.
|
|
68
68
|
|
|
69
|
-
**
|
|
69
|
+
**Step 1a: Read Configuration**
|
|
70
|
+
- Read `speccrew-workspace/docs/configs/platform-mapping.json` for standardized platform mapping rules
|
|
71
|
+
|
|
72
|
+
**Step 1b: Invoke Worker**
|
|
70
73
|
- Invoke 1 Worker Agent (`speccrew-task-worker.md`) with skill `speccrew-knowledge-techs-init/SKILL.md`
|
|
71
74
|
- Task: Analyze project structure, detect technology platforms
|
|
72
75
|
- Parameters to pass to skill:
|
|
@@ -79,55 +82,7 @@ flowchart TB
|
|
|
79
82
|
|
|
80
83
|
See [templates/techs-manifest-EXAMPLE.json](templates/techs-manifest-EXAMPLE.json) for complete example.
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Each platform entry in techs-manifest.json includes status tracking fields for monitoring the analysis pipeline progress:
|
|
85
|
-
|
|
86
|
-
| Field | Type | Values | Description |
|
|
87
|
-
|-------|------|--------|-------------|
|
|
88
|
-
| `status` | string | `pending` / `processing` / `completed` / `partial` / `failed` | Current analysis status |
|
|
89
|
-
| `startedAt` | string \| null | ISO 8601 timestamp | When the Worker started analyzing this platform |
|
|
90
|
-
| `completedAt` | string \| null | ISO 8601 timestamp | When the Worker finished analyzing this platform |
|
|
91
|
-
| `analysisLevel` | string \| null | `full` / `minimal` / `reference_only` | Depth of analysis achieved |
|
|
92
|
-
| `topicsCoverage` | number \| null | 0-100 | Percentage of domain topics covered (from analysis.json) |
|
|
93
|
-
| `workers` | object | See below | Per-worker status tracking |
|
|
94
|
-
|
|
95
|
-
**Workers Object Structure:**
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"platform_id": "web-vue",
|
|
99
|
-
"status": "completed",
|
|
100
|
-
"workers": {
|
|
101
|
-
"conventions": {
|
|
102
|
-
"status": "completed",
|
|
103
|
-
"skill": "speccrew-knowledge-techs-generate-conventions",
|
|
104
|
-
"done_file": "web-vue.done-conventions.json"
|
|
105
|
-
},
|
|
106
|
-
"ui_style": {
|
|
107
|
-
"status": "completed",
|
|
108
|
-
"skill": "speccrew-knowledge-techs-generate-ui-style",
|
|
109
|
-
"done_file": "web-vue.done-ui-style.json"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
For backend platforms, `ui_style.status` is set to `"skipped"`.
|
|
116
|
-
|
|
117
|
-
**Status Lifecycle:**
|
|
118
|
-
```
|
|
119
|
-
pending → processing → completed
|
|
120
|
-
→ partial (conventions OK, ui-style failed)
|
|
121
|
-
→ failed
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
**Stage 1 (techs-init)**: All platforms initialized with `status: "pending"`, other tracking fields set to `null`.
|
|
125
|
-
|
|
126
|
-
**Stage 2 (techs-generate)**:
|
|
127
|
-
- Before launching Workers: Set `status: "processing"`, `startedAt: "{now}"`, set both workers status to `"processing"`
|
|
128
|
-
- After all Workers complete successfully: Set `status: "completed"`, `completedAt: "{now}"`, populate `analysisLevel` and `topicsCoverage` from Worker output
|
|
129
|
-
- After conventions Worker fails: Set `status: "failed"`, `completedAt: "{now}"`
|
|
130
|
-
- After ui-style Worker fails (but conventions succeeded): Set `status: "partial"`, `completedAt: "{now}"`
|
|
85
|
+
See [Platform Status Tracking Fields](#platform-status-tracking-fields) for status field definitions.
|
|
131
86
|
|
|
132
87
|
---
|
|
133
88
|
|
|
@@ -157,102 +112,57 @@ When launching each platform Worker, the Workers will output:
|
|
|
157
112
|
- `{completed_dir}/{platform_id}.analysis-conventions.json` — conventions coverage report
|
|
158
113
|
- `{completed_dir}/{platform_id}.analysis-ui-style.json` — ui-style coverage report (frontend only)
|
|
159
114
|
|
|
160
|
-
**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
# Both workers run in PARALLEL for the same platform
|
|
204
|
-
|
|
205
|
-
WAIT_ALL workers complete
|
|
206
|
-
```
|
|
115
|
+
**Step 2a: Prepare Environment and Update Manifest**
|
|
116
|
+
|
|
117
|
+
1. Ensure completed_dir exists: `speccrew-workspace/knowledges/techs/.sync-status/`
|
|
118
|
+
2. For each platform in manifest:
|
|
119
|
+
- SET `platform.status = "processing"`
|
|
120
|
+
- SET `platform.startedAt = "{current_timestamp}"`
|
|
121
|
+
- SET `platform.workers.conventions.status = "processing"`
|
|
122
|
+
- IF platform.platform_type IN ["web", "mobile", "desktop"]: SET `platform.workers.ui_style.status = "processing"`
|
|
123
|
+
- WRITE manifest to techs-manifest.json
|
|
124
|
+
|
|
125
|
+
**Step 2b: Launch Conventions Worker (ALL Platforms)**
|
|
126
|
+
|
|
127
|
+
For each platform, invoke `speccrew-task-worker` with:
|
|
128
|
+
- skill_path: `speccrew-knowledge-techs-generate-conventions/SKILL.md`
|
|
129
|
+
- context:
|
|
130
|
+
- platform_id: platform.platform_id
|
|
131
|
+
- platform_type: platform.platform_type
|
|
132
|
+
- framework: platform.framework
|
|
133
|
+
- source_path: platform.source_path
|
|
134
|
+
- config_files: platform.config_files
|
|
135
|
+
- convention_files: platform.convention_files
|
|
136
|
+
- output_path: `speccrew-workspace/knowledges/techs/{platform.platform_id}/`
|
|
137
|
+
- completed_dir: completed_dir
|
|
138
|
+
- language: language
|
|
139
|
+
|
|
140
|
+
**Step 2c: Launch UI-Style Worker (Frontend Platforms ONLY)**
|
|
141
|
+
|
|
142
|
+
IF platform.platform_type IN ["web", "mobile", "desktop"]:
|
|
143
|
+
1. Invoke `speccrew-task-worker` with:
|
|
144
|
+
- skill_path: `speccrew-knowledge-techs-generate-ui-style/SKILL.md`
|
|
145
|
+
- context:
|
|
146
|
+
- platform_id: platform.platform_id
|
|
147
|
+
- platform_type: platform.platform_type
|
|
148
|
+
- framework: platform.framework
|
|
149
|
+
- source_path: platform.source_path
|
|
150
|
+
- output_path: `speccrew-workspace/knowledges/techs/{platform.platform_id}/`
|
|
151
|
+
- completed_dir: completed_dir
|
|
152
|
+
- language: language
|
|
153
|
+
|
|
154
|
+
**Step 2d: Wait for All Workers**
|
|
155
|
+
- WAIT_ALL workers complete
|
|
156
|
+
- Both workers run in PARALLEL for the same platform
|
|
207
157
|
|
|
208
158
|
### Worker Completion Marker (MANDATORY)
|
|
209
159
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
#### Conventions Worker Done File
|
|
213
|
-
|
|
214
|
-
**File**: `{completed_dir}/{platform_id}.done-conventions.json`
|
|
215
|
-
|
|
216
|
-
**Format**:
|
|
217
|
-
```json
|
|
218
|
-
{
|
|
219
|
-
"platform_id": "web-vue",
|
|
220
|
-
"worker_type": "conventions",
|
|
221
|
-
"status": "completed",
|
|
222
|
-
"documents_generated": [
|
|
223
|
-
"INDEX.md", "tech-stack.md", "architecture.md",
|
|
224
|
-
"conventions-dev.md", "conventions-design.md",
|
|
225
|
-
"conventions-unit-test.md", "conventions-build.md"
|
|
226
|
-
],
|
|
227
|
-
"analysis_file": "web-vue.analysis-conventions.json",
|
|
228
|
-
"completed_at": "2024-01-15T10:45:00Z"
|
|
229
|
-
}
|
|
230
|
-
```
|
|
160
|
+
Each Worker MUST create a completion marker file after generating documents. See [Worker Completion Marker Format](#worker-completion-marker-format) for details.
|
|
231
161
|
|
|
232
|
-
|
|
162
|
+
- Conventions Worker: `{completed_dir}/{platform_id}.done-conventions.json`
|
|
163
|
+
- UI-Style Worker: `{completed_dir}/{platform_id}.done-ui-style.json` (frontend only)
|
|
233
164
|
|
|
234
|
-
**
|
|
235
|
-
|
|
236
|
-
**Format**:
|
|
237
|
-
```json
|
|
238
|
-
{
|
|
239
|
-
"platform_id": "web-vue",
|
|
240
|
-
"worker_type": "ui-style",
|
|
241
|
-
"status": "completed",
|
|
242
|
-
"ui_analysis_level": "full",
|
|
243
|
-
"documents_generated": [
|
|
244
|
-
"ui-style/ui-style-guide.md"
|
|
245
|
-
],
|
|
246
|
-
"analysis_file": "web-vue.analysis-ui-style.json",
|
|
247
|
-
"completed_at": "2024-01-15T10:45:00Z"
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
**Status values**:
|
|
252
|
-
- `completed` — All required documents generated successfully
|
|
253
|
-
- `failed` — Critical failure, required documents not generated
|
|
254
|
-
|
|
255
|
-
If a Worker encounters a fatal error, it should still attempt to create the done file with `status: "failed"` and include error details in an `"error"` field.
|
|
165
|
+
**Status values**: `completed` | `failed`
|
|
256
166
|
|
|
257
167
|
**Output per Platform**:
|
|
258
168
|
```
|
|
@@ -301,14 +211,7 @@ speccrew-workspace/knowledges/techs/{platform_id}/
|
|
|
301
211
|
- `total_platforms`, `completed`, `failed` counts
|
|
302
212
|
- Per-platform: `documents_generated` list
|
|
303
213
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
## Stage 2 Post-Processing: Validate Worker Output
|
|
307
|
-
|
|
308
|
-
**Trigger**: After ALL platform Workers have completed (or timed out)
|
|
309
|
-
**Purpose**: Validate Worker output via completion markers and update manifest status
|
|
310
|
-
|
|
311
|
-
**Step 2a: Scan Completion Markers**
|
|
214
|
+
**Step 2e: Scan Completion Markers**
|
|
312
215
|
|
|
313
216
|
For each platform in the manifest:
|
|
314
217
|
1. Check for `{platform_id}.done-conventions.json` (REQUIRED for all platforms)
|
|
@@ -316,21 +219,21 @@ For each platform in the manifest:
|
|
|
316
219
|
3. A platform is "fully completed" only when ALL expected done files are present
|
|
317
220
|
4. If any expected done file is missing → mark platform as `failed` (Worker crashed without creating marker)
|
|
318
221
|
|
|
319
|
-
**Step
|
|
222
|
+
**Step 2f: Verify Document Output**
|
|
320
223
|
|
|
321
224
|
For each platform:
|
|
322
225
|
- **Conventions**: Check that INDEX.md, tech-stack.md, architecture.md, conventions-*.md exist
|
|
323
226
|
- **UI-Style** (frontend platforms only): Check that ui-style/ directory and required files exist
|
|
324
227
|
- If any required document is missing → downgrade status accordingly
|
|
325
228
|
|
|
326
|
-
**Step
|
|
229
|
+
**Step 2g: Read Coverage Reports**
|
|
327
230
|
|
|
328
231
|
For each platform:
|
|
329
232
|
1. Read `{platform_id}.analysis-conventions.json`
|
|
330
233
|
2. If frontend platform, also read `{platform_id}.analysis-ui-style.json`
|
|
331
234
|
3. Merge coverage data from both reports for manifest update
|
|
332
235
|
|
|
333
|
-
**Step
|
|
236
|
+
**Step 2h: Update Manifest Status**
|
|
334
237
|
|
|
335
238
|
Update `techs-manifest.json` for each platform:
|
|
336
239
|
- Set `status` based on worker results:
|
|
@@ -346,7 +249,7 @@ Update `techs-manifest.json` for each platform:
|
|
|
346
249
|
- `"reference_only"` if critical docs missing or Worker failed
|
|
347
250
|
- Set `topicsCoverage` from analysis-conventions.json coverage_percent
|
|
348
251
|
|
|
349
|
-
**Step
|
|
252
|
+
**Step 2i: Handle Failures**
|
|
350
253
|
|
|
351
254
|
For platforms with conventions worker `status: "failed"`:
|
|
352
255
|
- Mark platform as `failed`
|
|
@@ -681,3 +584,98 @@ After all 3 stages complete, return a summary object to the caller:
|
|
|
681
584
|
}
|
|
682
585
|
}
|
|
683
586
|
```
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## Reference Guides
|
|
591
|
+
|
|
592
|
+
### Worker Completion Marker Format
|
|
593
|
+
|
|
594
|
+
Each Worker MUST create a completion marker file after generating documents.
|
|
595
|
+
|
|
596
|
+
#### Conventions Worker Done File
|
|
597
|
+
|
|
598
|
+
**File**: `{completed_dir}/{platform_id}.done-conventions.json`
|
|
599
|
+
|
|
600
|
+
**Format**:
|
|
601
|
+
```json
|
|
602
|
+
{
|
|
603
|
+
"platform_id": "web-vue",
|
|
604
|
+
"worker_type": "conventions",
|
|
605
|
+
"status": "completed",
|
|
606
|
+
"documents_generated": [
|
|
607
|
+
"INDEX.md", "tech-stack.md", "architecture.md",
|
|
608
|
+
"conventions-dev.md", "conventions-design.md",
|
|
609
|
+
"conventions-unit-test.md", "conventions-build.md"
|
|
610
|
+
],
|
|
611
|
+
"analysis_file": "web-vue.analysis-conventions.json",
|
|
612
|
+
"completed_at": "2024-01-15T10:45:00Z"
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
#### UI-Style Worker Done File
|
|
617
|
+
|
|
618
|
+
**File**: `{completed_dir}/{platform_id}.done-ui-style.json`
|
|
619
|
+
|
|
620
|
+
**Format**:
|
|
621
|
+
```json
|
|
622
|
+
{
|
|
623
|
+
"platform_id": "web-vue",
|
|
624
|
+
"worker_type": "ui-style",
|
|
625
|
+
"status": "completed",
|
|
626
|
+
"ui_analysis_level": "full",
|
|
627
|
+
"documents_generated": [
|
|
628
|
+
"ui-style/ui-style-guide.md"
|
|
629
|
+
],
|
|
630
|
+
"analysis_file": "web-vue.analysis-ui-style.json",
|
|
631
|
+
"completed_at": "2024-01-15T10:45:00Z"
|
|
632
|
+
}
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
**Status values**:
|
|
636
|
+
- `completed` — All required documents generated successfully
|
|
637
|
+
- `failed` — Critical failure, required documents not generated
|
|
638
|
+
|
|
639
|
+
If a Worker encounters a fatal error, it should still attempt to create the done file with `status: "failed"` and include error details in an `"error"` field.
|
|
640
|
+
|
|
641
|
+
### Platform Status Tracking Fields
|
|
642
|
+
|
|
643
|
+
Each platform entry in techs-manifest.json includes status tracking fields for monitoring the analysis pipeline progress:
|
|
644
|
+
|
|
645
|
+
| Field | Type | Values | Description |
|
|
646
|
+
|-------|------|--------|-------------|
|
|
647
|
+
| `status` | string | `pending` / `processing` / `completed` / `partial` / `failed` | Current analysis status |
|
|
648
|
+
| `startedAt` | string \| null | ISO 8601 timestamp | When the Worker started analyzing this platform |
|
|
649
|
+
| `completedAt` | string \| null | ISO 8601 timestamp | When the Worker finished analyzing this platform |
|
|
650
|
+
| `analysisLevel` | string \| null | `full` / `minimal` / `reference_only` | Depth of analysis achieved |
|
|
651
|
+
| `topicsCoverage` | number \| null | 0-100 | Percentage of domain topics covered (from analysis.json) |
|
|
652
|
+
| `workers` | object | See below | Per-worker status tracking |
|
|
653
|
+
|
|
654
|
+
**Workers Object Structure:**
|
|
655
|
+
```json
|
|
656
|
+
{
|
|
657
|
+
"platform_id": "web-vue",
|
|
658
|
+
"status": "completed",
|
|
659
|
+
"workers": {
|
|
660
|
+
"conventions": {
|
|
661
|
+
"status": "completed",
|
|
662
|
+
"skill": "speccrew-knowledge-techs-generate-conventions",
|
|
663
|
+
"done_file": "web-vue.done-conventions.json"
|
|
664
|
+
},
|
|
665
|
+
"ui_style": {
|
|
666
|
+
"status": "completed",
|
|
667
|
+
"skill": "speccrew-knowledge-techs-generate-ui-style",
|
|
668
|
+
"done_file": "web-vue.done-ui-style.json"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
For backend platforms, `ui_style.status` is set to `"skipped"`.
|
|
675
|
+
|
|
676
|
+
**Status Lifecycle:**
|
|
677
|
+
```
|
|
678
|
+
pending → processing → completed
|
|
679
|
+
→ partial (conventions OK, ui-style failed)
|
|
680
|
+
→ failed
|
|
681
|
+
```
|