speccrew 0.1.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.
Files changed (153) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +142 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +61 -0
  3. package/.speccrew/agents/speccrew-system-designer.md +200 -0
  4. package/.speccrew/agents/speccrew-system-developer.md +238 -0
  5. package/.speccrew/agents/speccrew-task-worker.md +80 -0
  6. package/.speccrew/agents/speccrew-team-leader.md +92 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +313 -0
  8. package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
  9. package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
  10. package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
  11. package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
  12. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
  13. package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
  14. package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
  15. package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
  16. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
  17. package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
  18. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
  19. package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
  20. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
  21. package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
  22. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
  23. package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
  24. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
  25. package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
  26. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
  27. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
  28. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
  29. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
  30. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
  31. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
  32. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
  33. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
  34. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
  35. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
  36. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
  37. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
  38. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
  40. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
  41. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
  42. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
  43. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
  44. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
  45. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
  46. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
  47. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
  48. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
  49. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
  50. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
  52. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
  54. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
  56. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
  57. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
  61. package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
  62. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
  63. package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
  64. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
  65. package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
  66. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
  67. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
  68. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
  70. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
  72. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
  74. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
  75. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
  76. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
  77. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
  78. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
  79. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
  80. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
  81. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
  82. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
  83. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
  84. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
  85. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
  86. package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
  87. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
  88. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
  89. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
  90. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
  91. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
  92. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
  93. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
  94. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
  95. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
  96. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
  97. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
  98. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
  99. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
  100. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
  101. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
  102. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
  103. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
  104. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
  105. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
  106. package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
  107. package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
  108. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
  109. package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
  110. package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
  111. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
  112. package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
  113. package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
  114. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
  115. package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
  116. package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
  117. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
  118. package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
  119. package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
  120. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
  121. package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
  122. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
  123. package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
  124. package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
  125. package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
  126. package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
  127. package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
  128. package/LICENSE +21 -0
  129. package/README.ar.md +318 -0
  130. package/README.en.md +318 -0
  131. package/README.es.md +318 -0
  132. package/README.md +340 -0
  133. package/bin/cli.js +62 -0
  134. package/lib/commands/doctor.js +138 -0
  135. package/lib/commands/init.js +231 -0
  136. package/lib/commands/list.js +114 -0
  137. package/lib/commands/uninstall.js +117 -0
  138. package/lib/commands/update.js +351 -0
  139. package/lib/ide-adapters.js +73 -0
  140. package/lib/utils.js +104 -0
  141. package/package.json +28 -0
  142. package/workspace-template/docs/configs/document-templates.json +667 -0
  143. package/workspace-template/docs/configs/platform-mapping.json +194 -0
  144. package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
  145. package/workspace-template/docs/configs/validation-rules.json +87 -0
  146. package/workspace-template/docs/rules/mermaid-rule.md +114 -0
  147. package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
  148. package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
  149. package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
  150. package/workspace-template/docs/solutions/harness.md +410 -0
  151. package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
  152. package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
  153. package/workspace-template/docs/solutions/workspace-structure.md +318 -0
@@ -0,0 +1,803 @@
1
+ # Technology Knowledge Generation Pipeline
2
+
3
+ > **Purpose**: Document the pipeline architecture for technology knowledge generation, facilitating maintenance and team collaboration
4
+ > **Last Updated**: 2025-03
5
+ > **Related Skills**: `speccrew-knowledge-dispatch`, `speccrew-knowledge-techs-init`, `speccrew-knowledge-techs-generate`, `speccrew-knowledge-techs-index`
6
+
7
+ ---
8
+
9
+ ## Architecture Overview
10
+
11
+ The technology knowledge generation adopts a **3-stage pipeline** architecture, orchestrated by `speccrew-knowledge-dispatch` to automate the transformation from source code configuration to technology documentation.
12
+
13
+ ```
14
+ ┌─────────────────────────────────────────────────────────────────────────┐
15
+ │ Techs Pipeline (3 Stages) │
16
+ ├─────────┬─────────┬─────────┬───────────────────────────────────────────│
17
+ │Stage 1 │Stage 2 │Stage 3 │Report │
18
+ │(Single) │(Parallel)│(Single)│(Single) │
19
+ ├─────────┼─────────┼─────────┼───────────────────────────────────────────│
20
+ │Detect │Generate │Generate │Generate │
21
+ │Platform │Platform │Root │Report │
22
+ │Manifest │Docs │Index │ │
23
+ └─────────┴─────────┴─────────┴───────────────────────────────────────────│
24
+ │ │ │
25
+ techs-manifest.json Parallel INDEX.md │
26
+ Worker │
27
+ └─────────────────────────────────────────────────────────────────────────┘
28
+ ```
29
+
30
+ ### Pipeline Orchestration
31
+
32
+ When `knowledge_types = "both"`, the techs pipeline runs in parallel with the bizs pipeline from Stage 1. Both pipelines proceed independently through their stages.
33
+
34
+ ---
35
+
36
+ ## Stage Details
37
+
38
+ ### Stage 1: Detect Platform Manifest
39
+
40
+ **Execution Mode**: Single Task (1 Worker)
41
+
42
+ **Responsible Skill**: `speccrew-knowledge-techs-init`
43
+
44
+ **Input**:
45
+ - `source_path`: Source code root directory (default: project root)
46
+ - `output_path`: Output directory for techs-manifest.json (default: `speccrew-workspace/knowledges/base/sync-state/knowledge-techs/`)
47
+ - `language`: Target language for generated content (e.g., "zh", "en") - **REQUIRED**
48
+
49
+ **Processing Logic**:
50
+ 1. **Scan for Platform Indicators**: Check for platform-specific files and configurations
51
+ 2. **Extract Platform Metadata**: platform_id, platform_type, framework, language, source_path
52
+ 3. **Identify Configuration Files**: package.json, tsconfig.json, build configs, etc.
53
+ 4. **Identify Convention Files**: ESLint, Prettier, testing configs, etc.
54
+ 5. **Generate techs-manifest.json**
55
+
56
+ **Platform Detection Rules**:
57
+
58
+ | Platform Type | Detection Signals | platform_id | Framework |
59
+ |---------------|-------------------|-------------|-----------|
60
+ | **Web** | package.json + react dependency | web-react | React |
61
+ | **Web** | package.json + vue dependency | web-vue | Vue |
62
+ | **Web** | package.json + next | web-nextjs | Next.js |
63
+ | **Mobile** | pubspec.yaml | mobile-flutter | Flutter |
64
+ | **Mobile** | package.json + react-native | mobile-react-native | React Native |
65
+ | **Mobile** | manifest.json + pages.json | mobile-uniapp | UniApp |
66
+ | **Backend** | package.json + @nestjs/core | backend-nestjs | NestJS |
67
+ | **Backend** | pom.xml + spring-boot | backend-spring | Spring Boot |
68
+ | **Backend** | go.mod | backend-go | Go |
69
+ | **Desktop** | package.json + electron | desktop-electron | Electron |
70
+ | **Desktop** | tauri.conf.json | desktop-tauri | Tauri |
71
+
72
+ **Platform Naming Convention**:
73
+
74
+ To ensure consistency between bizs and techs pipelines:
75
+
76
+ | Concept | techs-manifest.json | modules.json (bizs) | Example (UniApp) |
77
+ |---------|---------------------|---------------------|------------------|
78
+ | **Category** | `platform_type` | `platform_type` | `mobile` |
79
+ | **Technology** | `framework` | `platform_subtype` | `uniapp` |
80
+ | **Identifier** | `platform_id` | `{platform_type}/{platform_subtype}` | `mobile-uniapp` |
81
+
82
+ **Output**:
83
+ ```
84
+ speccrew-workspace/knowledges/base/sync-state/knowledge-techs/
85
+ └── techs-manifest.json
86
+ ```
87
+
88
+ **techs-manifest.json Structure**:
89
+ ```json
90
+ {
91
+ "generated_at": "2024-01-15T10:30:00Z",
92
+ "source_path": "/project",
93
+ "language": "zh",
94
+ "platforms": [
95
+ {
96
+ "platform_id": "web-react",
97
+ "platform_type": "web",
98
+ "framework": "react",
99
+ "language": "typescript",
100
+ "source_path": "src/web",
101
+ "config_files": [
102
+ "src/web/package.json",
103
+ "src/web/tsconfig.json",
104
+ "src/web/vite.config.ts"
105
+ ],
106
+ "convention_files": [
107
+ "src/web/.eslintrc.js",
108
+ "src/web/.prettierrc"
109
+ ]
110
+ },
111
+ {
112
+ "platform_id": "backend-nestjs",
113
+ "platform_type": "backend",
114
+ "framework": "nestjs",
115
+ "language": "typescript",
116
+ "source_path": "src/server",
117
+ "config_files": [
118
+ "src/server/package.json",
119
+ "src/server/nest-cli.json",
120
+ "src/server/tsconfig.json"
121
+ ],
122
+ "convention_files": [
123
+ "src/server/.eslintrc.js"
124
+ ]
125
+ }
126
+ ]
127
+ }
128
+ ```
129
+
130
+ ---
131
+
132
+ ### Stage 2: Generate Platform Documents
133
+
134
+ **Execution Mode**: Parallel (1 Worker per platform)
135
+
136
+ **Responsible Skill**: `speccrew-knowledge-techs-generate`
137
+
138
+ **Input**:
139
+ - `platform_id`: Platform identifier from manifest
140
+ - `platform_type`: Platform type (web, mobile, backend, desktop)
141
+ - `framework`: Primary framework
142
+ - `source_path`: Platform source directory
143
+ - `config_files`: List of configuration file paths
144
+ - `convention_files`: List of convention file paths (eslint, prettier, etc.)
145
+ - `output_path`: Output directory for platform docs (e.g., `speccrew-workspace/knowledges/techs/{platform_id}/`)
146
+ - `language`: Target language (e.g., "zh", "en") - **REQUIRED**
147
+
148
+ **Processing Logic**:
149
+ 1. **Read Configuration Files**: package.json, tsconfig.json, build configs, etc.
150
+ 2. **Extract Technology Stack**: Framework versions, dependencies, build tools
151
+ 3. **Analyze Conventions**: ESLint rules, Prettier config, project structure
152
+ 4. **Invoke UI Style Analysis** (frontend platforms only): Generate `ui-style-guide.md` and `styles/` directory
153
+ 5. **Generate Documents**: Based on platform type and detected data layer
154
+
155
+ **Output per Platform**:
156
+ ```
157
+ speccrew-workspace/knowledges/techs/{platform_id}/
158
+ ├── INDEX.md # Required - Platform tech index
159
+ ├── tech-stack.md # Required - Technology stack details
160
+ ├── architecture.md # Required - Architecture conventions
161
+ ├── conventions-design.md # Required - Design conventions
162
+ ├── conventions-dev.md # Required - Development conventions
163
+ ├── conventions-unit-test.md # Required - Unit testing conventions
164
+ ├── conventions-data.md # Optional - Data conventions (conditional)
165
+ ├── ui-style/ # Optional - UI style analysis (frontend only)
166
+ │ ├── ui-style-guide.md # techs Stage 2
167
+ │ ├── styles/ # techs Stage 2
168
+ │ ├── page-types/ # techs Stage 2
169
+ │ ├── components/ # techs Stage 2
170
+ │ └── layouts/ # techs Stage 2
171
+
172
+ └── ui-style-patterns/ # Optional - bizs Stage 3.5 (if executed)
173
+ ├── page-types/ # bizs Stage 3.5
174
+ ├── components/ # bizs Stage 3.5
175
+ └── layouts/ # bizs Stage 3.5
176
+ ```
177
+
178
+ **UI Style Directory Ownership**:
179
+
180
+ | 目录/子目录 | 管理方 | 生成来源 | 内容描述 |
181
+ |---------------------|-------------------------|---------------------------------------|---------------------------------------|
182
+ | `ui-style/` | techs pipeline | Stage 2 (techs-generate) | 框架级设计系统分析(技术视角) |
183
+ | ├─ ui-style-guide.md| techs pipeline | Stage 2 | 技术框架层面的样式指南 |
184
+ | ├─ styles/ | techs pipeline | Stage 2 | 颜色/字体/间距系统等基础变量 |
185
+ | ├─ page-types/ | techs pipeline | Stage 2 | 源码发现的页面类型 |
186
+ | ├─ components/ | techs pipeline | Stage 2 | 源码发现的组件库 |
187
+ | └─ layouts/ | techs pipeline | Stage 2 | 源码发现的布局模式 |
188
+ | `ui-style-patterns/`| bizs pipeline | Stage 3.5 (bizs-ui-style-extract) | 业务聚合的UI模式(业务视角) |
189
+ | ├─ page-types/ | bizs pipeline | Stage 3.5 | 业务聚合的页面类型模式 |
190
+ | ├─ components/ | bizs pipeline | Stage 3.5 | 业务聚合的组件复用模式 |
191
+ | └─ layouts/ | bizs pipeline | Stage 3.5 | 业务聚合的布局模式 |
192
+
193
+ > **注意**:
194
+ > - `ui-style-patterns/` 目录仅在 bizs pipeline Stage 3.5 执行后才存在
195
+ > - 两个目录的内容互补:techs 提供技术视角,bizs 提供业务视角
196
+ > - Designer Agent 应同时参考两个目录
197
+
198
+ **Document Generation Rules**:
199
+
200
+ | Platform Type | Required Documents | Optional Documents | Generate conventions-data.md? |
201
+ |---------------|-------------------|-------------------|------------------------------|
202
+ | `backend` | All 6 docs | - | ✅ **必须生成** - 包含 ORM、数据建模、缓存策略 |
203
+ | `web` | All 6 docs | conventions-data.md | ⚠️ **条件生成** - 仅当使用 ORM/数据层时(Prisma、TypeORM 等) |
204
+ | `mobile` | All 6 docs | conventions-data.md | ❌ **默认不生成** - 根据实际技术栈判断 |
205
+ | `desktop` | All 6 docs | conventions-data.md | ❌ **默认不生成** - 根据实际技术栈判断 |
206
+ | `api` | All 6 docs | conventions-data.md | ⚠️ **条件生成** - 根据是否有数据层 |
207
+
208
+ **Data Layer Detection** (for non-backend platforms):
209
+
210
+ | Indicator | Technology | Action |
211
+ |-----------|------------|--------|
212
+ | `prisma` in package.json | Prisma ORM | Generate conventions-data.md |
213
+ | `typeorm` in package.json | TypeORM | Generate conventions-data.md |
214
+ | `sequelize` in package.json | Sequelize | Generate conventions-data.md |
215
+ | `mongoose` in package.json | Mongoose | Generate conventions-data.md |
216
+ | `drizzle-orm` in package.json | Drizzle ORM | Generate conventions-data.md |
217
+ | `firebase` / `@react-native-firebase` | Firebase | Generate conventions-data.md (lightweight) |
218
+ | `sqlite` / `realm` | SQLite/Realm | Generate conventions-data.md (lightweight) |
219
+ | None detected | - | **Skip** conventions-data.md |
220
+
221
+ **Document Descriptions**:
222
+
223
+ | Document | Purpose | Primary Users |
224
+ |----------|---------|---------------|
225
+ | `INDEX.md` | Platform overview and navigation | All Agents |
226
+ | `tech-stack.md` | Frameworks, libraries, tools, versions | All Agents |
227
+ | `architecture.md` | Layering, components, patterns | Designer Agent |
228
+ | `conventions-design.md` | Design principles, patterns, UI conventions | Designer Agent |
229
+ | `conventions-dev.md` | Naming, directory structure, code style | Dev Agent |
230
+ | `conventions-unit-test.md` | Unit testing frameworks, coverage, patterns | Test Agent |
231
+ | `conventions-data.md` | ORM, database modeling, migrations | Designer/Dev Agent |
232
+
233
+ **Parallel Execution Example**:
234
+ ```yaml
235
+ # Worker 1 - Generate web-react tech docs
236
+ subagent_type: "speccrew-task-worker"
237
+ description: "Generate web-react technology documents"
238
+ prompt: |
239
+ skill_path: speccrew-knowledge-techs-generate/SKILL.md
240
+ context:
241
+ platform_id: web-react
242
+ platform_type: web
243
+ framework: react
244
+ source_path: src/web
245
+ config_files: ["src/web/package.json", "src/web/tsconfig.json", "src/web/vite.config.ts"]
246
+ convention_files: ["src/web/.eslintrc.js", "src/web/.prettierrc"]
247
+ output_path: speccrew-workspace/knowledges/techs/web-react/
248
+ language: zh
249
+
250
+ # Worker 2 - Generate backend-nestjs tech docs
251
+ subagent_type: "speccrew-task-worker"
252
+ description: "Generate backend-nestjs technology documents"
253
+ prompt: |
254
+ skill_path: speccrew-knowledge-techs-generate/SKILL.md
255
+ context:
256
+ platform_id: backend-nestjs
257
+ platform_type: backend
258
+ framework: nestjs
259
+ source_path: src/server
260
+ config_files: ["src/server/package.json", "src/server/nest-cli.json", "src/server/tsconfig.json"]
261
+ convention_files: ["src/server/.eslintrc.js"]
262
+ output_path: speccrew-workspace/knowledges/techs/backend-nestjs/
263
+ language: zh
264
+ ```
265
+
266
+ **Status Tracking**:
267
+ ```
268
+ speccrew-workspace/knowledges/base/sync-state/knowledge-techs/
269
+ └── stage2-status.json
270
+ ```
271
+
272
+ **stage2-status.json Format**:
273
+ ```json
274
+ {
275
+ "generated_at": "2024-01-15T10:30:00Z",
276
+ "stage": "platform-doc-generation",
277
+ "total_platforms": 3,
278
+ "completed": 3,
279
+ "failed": 0,
280
+ "platforms": [
281
+ {
282
+ "platform_id": "web-react",
283
+ "platform_type": "web",
284
+ "framework": "react",
285
+ "status": "completed",
286
+ "documents_generated": [
287
+ "INDEX.md",
288
+ "tech-stack.md",
289
+ "architecture.md",
290
+ "conventions-design.md",
291
+ "conventions-dev.md",
292
+ "conventions-unit-test.md"
293
+ ],
294
+ "output_path": "speccrew-workspace/knowledges/techs/web-react/"
295
+ },
296
+ {
297
+ "platform_id": "backend-nestjs",
298
+ "platform_type": "backend",
299
+ "framework": "nestjs",
300
+ "status": "completed",
301
+ "documents_generated": [
302
+ "INDEX.md",
303
+ "tech-stack.md",
304
+ "architecture.md",
305
+ "conventions-design.md",
306
+ "conventions-dev.md",
307
+ "conventions-unit-test.md",
308
+ "conventions-data.md"
309
+ ],
310
+ "output_path": "speccrew-workspace/knowledges/techs/backend-nestjs/"
311
+ }
312
+ ]
313
+ }
314
+ ```
315
+
316
+ ---
317
+
318
+ ### Stage 3: Generate Root Index
319
+
320
+ **Execution Mode**: Single Task (1 Worker)
321
+
322
+ **Responsible Skill**: `speccrew-knowledge-techs-index`
323
+
324
+ **Input**:
325
+ - `manifest_path`: Path to techs-manifest.json
326
+ - `techs_base_path`: Base path for techs documentation (default: `speccrew-workspace/knowledges/techs/`)
327
+ - `output_path`: Output path for root INDEX.md (default: `speccrew-workspace/knowledges/techs/`)
328
+ - `language`: Target language (e.g., "zh", "en") - **REQUIRED**
329
+
330
+ **Processing Logic**:
331
+ 1. **Read techs-manifest.json**: Get list of all platforms
332
+ 2. **Verify Platform Documents** (Dynamic Detection):
333
+ - Scan each platform directory to detect which documents actually exist
334
+ - Build document availability map for each platform
335
+ - Do NOT assume all platforms have the same document set
336
+ 3. **Extract Platform Summaries**: Read each platform's INDEX.md
337
+ 4. **Generate Root INDEX.md** with dynamic link generation
338
+
339
+ **Critical Requirements for Techs Index Generation**:
340
+
341
+ 1. **Dynamic Document Detection**:
342
+ - Must scan each platform directory to detect which documents actually exist
343
+ - Do NOT assume all platforms have the same document set
344
+ - `conventions-data.md` may not exist for all platforms
345
+
346
+ 2. **Dynamic Link Generation**:
347
+ - Only include links to documents that actually exist
348
+ - For missing optional documents, either omit the link or mark as "N/A"
349
+
350
+ 3. **Platform-Specific Document Recommendations**:
351
+ - Adjust "Agent 重点文档" recommendations based on actual available documents
352
+
353
+ **Output**:
354
+ ```
355
+ speccrew-workspace/knowledges/techs/
356
+ └── INDEX.md # Root technology knowledge index
357
+ ```
358
+
359
+ **Included Content**:
360
+ - Header with generation timestamp and source reference
361
+ - Platform Overview (list of all detected platforms with dynamic document links)
362
+ - Platform Summary Table (type, framework, language, documents)
363
+ - Quick Reference organized by document type
364
+ - Agent-to-Platform Mapping Guide (dynamically adjusted per platform)
365
+ - Document Guide explaining each document type
366
+ - Usage Guide for different Agent roles
367
+
368
+ **Status Tracking**:
369
+ ```
370
+ speccrew-workspace/knowledges/base/sync-state/knowledge-techs/
371
+ └── stage3-status.json
372
+ ```
373
+
374
+ **stage3-status.json Format**:
375
+ ```json
376
+ {
377
+ "generated_at": "2024-01-15T10:35:00Z",
378
+ "stage": "root-index-generation",
379
+ "status": "completed",
380
+ "platforms_indexed": 3,
381
+ "index_file": "speccrew-workspace/knowledges/techs/INDEX.md"
382
+ }
383
+ ```
384
+
385
+ ---
386
+
387
+ ### Final Report Generation
388
+
389
+ **Action**:
390
+ - Read all status files (stage2-status.json, stage3-status.json)
391
+ - Read techs-manifest.json
392
+ - Generate unified summary report (combined with bizs pipeline when `knowledge_types = "both"`)
393
+
394
+ **Output Format** (when `knowledge_types = "both"`):
395
+ ```
396
+ ╔══════════════════════════════════════════════════════════════════════╗
397
+ ║ Knowledge Base Initialization Completed ║
398
+ ╠══════════════════════════════════════════════════════════════════════╣
399
+ ║ ║
400
+ ║ [Techs Pipeline] ║
401
+ ║ ───────────────────────────────────────────────────────────────── ║
402
+ ║ Stage 1 (Platform Detection): ✅ Completed - 3 platforms detected ║
403
+ ║ Stage 2 (Doc Generation): ✅ Completed - 3/3 platforms ║
404
+ ║ Stage 3 (Index Generation): ✅ Completed ║
405
+ ║ ║
406
+ ║ Platform Breakdown: ║
407
+ ║ ───────────────────────────────────────────────────────────────── ║
408
+ ║ Techs: web-react, backend-nestjs, mobile-flutter ║
409
+ ║ ║
410
+ ║ Generated Documents: ║
411
+ ║ ───────────────────────────────────────────────────────────────── ║
412
+ ║ 📄 speccrew-workspace/knowledges/techs/INDEX.md ║
413
+ ║ 📄 speccrew-workspace/knowledges/techs/{platform}/... (3 platforms)║
414
+ ║ ║
415
+ ╚══════════════════════════════════════════════════════════════════════╝
416
+ ```
417
+
418
+ **Output Format** (when `knowledge_types = "techs"` only):
419
+ ```
420
+ Technology knowledge initialization completed:
421
+
422
+ Pipeline Summary:
423
+ - Stage 1 (Platform Detection): ✅ Completed - 3 platforms detected
424
+ - Stage 2 (Doc Generation): ✅ Completed - 3/3 platforms generated
425
+ - Stage 3 (Index Generation): ✅ Completed
426
+
427
+ Platform Breakdown:
428
+ - web-react: React 18.2.0, TypeScript 5.3.0, Vite 5.0.0
429
+ - backend-nestjs: NestJS 10.0.0, TypeScript 5.3.0
430
+ - mobile-flutter: Flutter 3.16.0, Dart 3.2.0
431
+
432
+ Generated Documents:
433
+ - speccrew-workspace/knowledges/techs/INDEX.md
434
+ - speccrew-workspace/knowledges/techs/web-react/INDEX.md
435
+ - speccrew-workspace/knowledges/techs/web-react/tech-stack.md
436
+ - speccrew-workspace/knowledges/techs/web-react/architecture.md
437
+ - speccrew-workspace/knowledges/techs/web-react/conventions-design.md
438
+ - speccrew-workspace/knowledges/techs/web-react/conventions-dev.md
439
+ - speccrew-workspace/knowledges/techs/web-react/conventions-unit-test.md
440
+ - [Other platforms...]
441
+
442
+ Agent Mapping:
443
+ - speccrew-sd-web-react → speccrew-workspace/knowledges/techs/web-react/
444
+ - speccrew-dev-web-react → speccrew-workspace/knowledges/techs/web-react/
445
+ - speccrew-test-web-react → speccrew-workspace/knowledges/techs/web-react/
446
+ - speccrew-sd-backend-nestjs → speccrew-workspace/knowledges/techs/backend-nestjs/
447
+ - [Other mappings...]
448
+
449
+ Next Steps:
450
+ - Review speccrew-workspace/knowledges/techs/INDEX.md for complete platform overview
451
+ - Use platform-specific conventions for Agent tasks
452
+ ```
453
+
454
+ ---
455
+
456
+ ## Directory Structure
457
+
458
+ ### Runtime Status Directory
459
+ ```
460
+ speccrew-workspace/
461
+ └── knowledges/
462
+ └── base/
463
+ └── sync-state/
464
+ └── knowledge-techs/
465
+ ├── techs-manifest.json # Stage 1 output
466
+ ├── stage2-status.json # Stage 2 status
467
+ ├── stage3-status.json # Stage 3 status
468
+ └── final-report.json # Final report
469
+ ```
470
+
471
+ ### Generated Documentation Directory
472
+ ```
473
+ speccrew-workspace/
474
+ └── knowledges/
475
+ └── techs/
476
+ ├── INDEX.md # Root index (Stage 3)
477
+ └── {platform-id}/ # One directory per platform
478
+ ├── INDEX.md # Platform index
479
+ ├── tech-stack.md # Technology stack
480
+ ├── architecture.md # Architecture conventions
481
+ ├── conventions-design.md # Design conventions
482
+ ├── conventions-dev.md # Development conventions
483
+ ├── conventions-unit-test.md # Unit testing conventions
484
+ ├── conventions-data.md # Data conventions (optional)
485
+ ├── ui-style/ # UI style (frontend only) - techs Stage 2
486
+ │ ├── ui-style-guide.md # 框架级设计系统指南
487
+ │ ├── styles/ # 颜色/字体/间距系统
488
+ │ ├── page-types/ # 源码发现的页面类型
489
+ │ ├── components/ # 源码发现的组件库
490
+ │ └── layouts/ # 源码发现的布局模式
491
+
492
+ └── ui-style-patterns/ # UI patterns (frontend only) - bizs Stage 3.5
493
+ ├── page-types/ # 业务聚合的页面类型模式
494
+ ├── components/ # 业务聚合的组件复用模式
495
+ └── layouts/ # 业务聚合的布局模式
496
+ ```
497
+
498
+ **UI Style Directory Separation**:
499
+
500
+ | 目录 | 管理 Pipeline | 内容来源 | 存在条件 |
501
+ |------|--------------|----------|----------|
502
+ | `ui-style/` | techs pipeline Stage 2 | 框架级设计系统分析 | 前端平台始终存在 |
503
+ | `ui-style-patterns/` | bizs pipeline Stage 3.5 | 业务 feature 文档聚合 | 仅当 bizs pipeline 执行后存在 |
504
+
505
+ 两个目录的内容互补:
506
+ - **techs pipeline** 提供技术视角:从源码分析得出的框架设计系统、组件库、布局模式
507
+ - **bizs pipeline** 提供业务视角:从业务 feature 文档聚合得出的可复用 UI 模式
508
+
509
+ Designer Agent 应同时参考两个目录以获得完整的 UI 设计指导。
510
+
511
+ ---
512
+
513
+ ## Worker Dispatch Mechanism
514
+
515
+ ### speccrew-task-worker Invocation
516
+
517
+ The pipeline uses `speccrew-task-worker` Agent for task execution. Leader Agent invokes Workers via the **Task tool** for parallel processing.
518
+
519
+ #### Task Tool Call Format
520
+
521
+ ```yaml
522
+ subagent_type: "speccrew-task-worker"
523
+ description: "Brief task description"
524
+ prompt: |
525
+ skill_path: .speccrew/skills/{skill-name}/SKILL.md
526
+ context:
527
+ param1: value1
528
+ param2: value2
529
+ ...
530
+ ```
531
+
532
+ #### Stage 2 Parallel Dispatch Example
533
+
534
+ ```yaml
535
+ # Worker 1 - Generate web-react tech docs
536
+ subagent_type: "speccrew-task-worker"
537
+ description: "Generate web-react technology documents"
538
+ prompt: |
539
+ skill_path: speccrew-knowledge-techs-generate/SKILL.md
540
+ context:
541
+ platform_id: web-react
542
+ platform_type: web
543
+ framework: react
544
+ source_path: src/web
545
+ config_files: ["src/web/package.json", "src/web/tsconfig.json", "src/web/vite.config.ts"]
546
+ convention_files: ["src/web/.eslintrc.js", "src/web/.prettierrc"]
547
+ output_path: speccrew-workspace/knowledges/techs/web-react/
548
+ language: zh
549
+
550
+ # Worker 2 - Generate backend-nestjs tech docs
551
+ subagent_type: "speccrew-task-worker"
552
+ description: "Generate backend-nestjs technology documents"
553
+ prompt: |
554
+ skill_path: speccrew-knowledge-techs-generate/SKILL.md
555
+ context:
556
+ platform_id: backend-nestjs
557
+ platform_type: backend
558
+ framework: nestjs
559
+ source_path: src/server
560
+ config_files: ["src/server/package.json", "src/server/nest-cli.json", "src/server/tsconfig.json"]
561
+ convention_files: ["src/server/.eslintrc.js"]
562
+ output_path: speccrew-workspace/knowledges/techs/backend-nestjs/
563
+ language: zh
564
+
565
+ # ... (more workers for other platforms)
566
+ ```
567
+
568
+ ---
569
+
570
+ ## Dispatcher Responsibilities
571
+
572
+ `speccrew-knowledge-dispatch` is responsible for orchestrating the entire pipeline:
573
+
574
+ ### Core Responsibilities
575
+ 1. **Stage Control**: Ensure stages execute in order (1→2→3)
576
+ 2. **Parallel Dispatch**: Stage 2 calls multiple Workers in parallel via Task tool
577
+ 3. **Status Tracking**: Record execution status of each task with timestamp
578
+ 4. **Error Handling**: Single platform failure does not affect other platforms
579
+ 5. **Result Aggregation**: Generate final execution report
580
+ 6. **Language Propagation**: Pass `language` parameter to all downstream skills
581
+
582
+ ### Dispatch Flow
583
+
584
+ ```
585
+ 1. Execute Stage 1 (Single Task)
586
+ └─ Invoke 1 Worker with speccrew-knowledge-techs-init
587
+ └─ Wait for completion ─┐
588
+
589
+ 2. Read techs-manifest.json│
590
+ └─ Launch Stage 2 in parallel (one Worker per platform)
591
+ └─ Invoke N Workers with speccrew-knowledge-techs-generate
592
+ └─ Wait for all Stage 2 Workers to complete ─┐
593
+
594
+ 3. Generate stage2-status.json with timestamp │
595
+ Execute Stage 3 (Single Task) │
596
+ └─ Invoke 1 Worker with speccrew-knowledge-techs-index
597
+ └─ Generate root INDEX.md ─┤
598
+
599
+ 4. Generate stage3-status.json │
600
+ Generate unified final report (when knowledge_types = "both")
601
+ ```
602
+
603
+ ### Parallel Execution with Bizs Pipeline
604
+
605
+ When `knowledge_types = "both"`:
606
+
607
+ ```
608
+ Time →
609
+ ─────────────────────────────────────────────────────────────────────────────
610
+
611
+ Bizs Pipeline: [Stage 1] →[Stage 2 Parallel] →[Stage 3 Parallel] →[Stage 4] →[Report]
612
+ │ │ │
613
+ Techs Pipeline: [Stage 1] →[Stage 2 Parallel] →[Stage 3] →[Report]
614
+ │ │
615
+ Both Stage 1s run in parallel
616
+ (independent tasks)
617
+
618
+ ─────────────────────────────────────────────────────────────────────────────
619
+ ```
620
+
621
+ **Execution Rules**:
622
+ 1. **Stage 1 Parallel**: Both bizs-init and techs-init Workers launch simultaneously
623
+ 2. **Independent Progress**: Each pipeline proceeds through its stages independently
624
+ 3. **No Cross-Dependencies**: Bizs and techs pipelines do not depend on each other
625
+ 4. **Unified Final Report**: Generate a combined report after both pipelines complete
626
+
627
+ ---
628
+
629
+ ## Error Handling Strategy
630
+
631
+ | Stage | Failure Impact | Handling Strategy |
632
+ |-------|---------------|-------------------|
633
+ | Stage 1 | Entire pipeline stops | Report error, do not continue (bizs pipeline continues if running) |
634
+ | Stage 2 | Single platform fails | Continue other platforms, record failed platform in stage2-status.json |
635
+ | Stage 3 | Index generation fails | Abort techs pipeline if Stage 2 had critical failures |
636
+
637
+ ### Cross-Pipeline Policy
638
+
639
+ - **Pipeline Independence**: Failure in one pipeline does NOT affect the other
640
+ - **Partial Success**: Report success for completed pipeline, failure for the other
641
+ - **Final Report**: Always generate report showing status of both pipelines (if requested)
642
+
643
+ ---
644
+
645
+ ## Usage
646
+
647
+ ### Input Parameters
648
+
649
+ | Parameter | Type | Required | Description |
650
+ |-----------|------|----------|-------------|
651
+ | `source_path` | string | No | Source code root path (default: project root) |
652
+ | `knowledge_types` | string | No | `"bizs"`, `"techs"`, or `"both"` (default: `"both"`) |
653
+ | `output_path` | string | No | Output directory (default: `speccrew-workspace/knowledges/`) |
654
+ | `sync_mode` | string | No | `"full"` or `"incremental"` (default: `"full"`) |
655
+ | `base_commit` | string | No | Git commit hash for incremental mode (comparison base) |
656
+ | `head_commit` | string | No | Git commit hash for incremental mode (current HEAD) |
657
+ | `changed_files` | array | No | Pre-computed list of changed files for incremental mode |
658
+
659
+ ### Trigger Methods
660
+ Invoke through Leader Agent:
661
+ ```
662
+ "Initialize knowledge base"
663
+ "Initialize bizs and techs knowledge base"
664
+ "Generate knowledge from source code"
665
+ "Dispatch knowledge generation tasks"
666
+ ```
667
+
668
+ ### Execution Flow
669
+ 1. Leader Agent identifies intent
670
+ 2. Calls `speccrew-knowledge-dispatch` Skill
671
+ 3. Dispatch executes 3-stage pipeline (or both pipelines if `knowledge_types = "both"`)
672
+ 4. Returns unified execution report with platform mapping
673
+
674
+ ---
675
+
676
+ ## Agent-to-Platform Mapping
677
+
678
+ Based on generated techs-manifest.json, Agents are dynamically created and mapped to their respective platform documentation:
679
+
680
+ | Agent Type | Platform ID | Documentation Path |
681
+ |------------|-------------|-------------------|
682
+ | speccrew-sd-{platform-id} | web-react | speccrew-workspace/knowledges/techs/web-react/ |
683
+ | speccrew-dev-{platform-id} | web-react | speccrew-workspace/knowledges/techs/web-react/ |
684
+ | speccrew-test-{platform-id} | web-react | speccrew-workspace/knowledges/techs/web-react/ |
685
+ | speccrew-sd-{platform-id} | backend-nestjs | speccrew-workspace/knowledges/techs/backend-nestjs/ |
686
+ | speccrew-dev-{platform-id} | backend-nestjs | speccrew-workspace/knowledges/techs/backend-nestjs/ |
687
+ | speccrew-test-{platform-id} | backend-nestjs | speccrew-workspace/knowledges/techs/backend-nestjs/ |
688
+
689
+ **Mapping Rule**: Agent name suffix matches `platform_id` from manifest.
690
+
691
+ **Key Documents per Agent Role**:
692
+
693
+ | Agent Role | Always Reference | Conditionally Reference |
694
+ |------------|-----------------|------------------------|
695
+ | Designer | architecture.md, conventions-design.md | conventions-data.md (if platform has data layer) |
696
+ | Developer | conventions-dev.md | conventions-data.md (if platform has data layer) |
697
+ | Tester | conventions-unit-test.md | - |
698
+
699
+ ---
700
+
701
+ ## Extensibility Design
702
+
703
+ ### New Platform Handling
704
+
705
+ When new platforms are added to source code:
706
+ 1. Stage 1 automatically recognizes new platforms
707
+ 2. Stage 2 automatically creates Workers for new platforms
708
+ 3. Stage 3 re-aggregates all platforms into root index
709
+
710
+ ### Platform Template System
711
+
712
+ Templates are organized by platform type and framework:
713
+
714
+ ```
715
+ .speccrew/skills/speccrew-knowledge-techs-generate/templates/
716
+ ├── web-react/
717
+ │ ├── INDEX-TEMPLATE.md
718
+ │ ├── tech-stack-TEMPLATE.md
719
+ │ ├── architecture-TEMPLATE.md
720
+ │ ├── conventions-design-TEMPLATE.md
721
+ │ ├── conventions-dev-TEMPLATE.md
722
+ │ ├── conventions-unit-test-TEMPLATE.md
723
+ │ └── conventions-data-TEMPLATE.md
724
+ ├── backend-nestjs/
725
+ │ └── [similar structure]
726
+ ├── mobile-flutter/
727
+ │ └── [similar structure]
728
+ └── generic/ # Fallback templates
729
+ └── [similar structure]
730
+ ```
731
+
732
+ Template selection logic:
733
+ 1. Look for `{platform-type}-{framework}/` directory
734
+ 2. If not found, use `generic/` templates
735
+ 3. Fill template variables with extracted configuration data
736
+
737
+ ### UI Style Analysis Integration
738
+
739
+ For frontend platforms (web, mobile, desktop), UI style documentation is generated across two separate directories with clear ownership:
740
+
741
+ **techs pipeline Stage 2 Responsibilities** (`ui-style/` directory):
742
+ - `ui-style-guide.md` - Main UI style guide (tech stack, design system overview)
743
+ - `styles/` - Style-related documentation (color system, typography, spacing, etc.)
744
+ - `page-types/` - Page types discovered from source code analysis
745
+ - `components/` - Component library discovered from source code
746
+ - `layouts/` - Layout patterns discovered from source code
747
+
748
+ ```
749
+ Stage 2 Worker (Frontend Platforms)
750
+
751
+ ├─> Extract tech stack
752
+ ├─> Analyze conventions
753
+ ├─> Generate UI Style (complete)
754
+ │ Output: ui-style/ (all subdirectories)
755
+
756
+ └─> Generate convention documents
757
+ ```
758
+
759
+ **bizs pipeline Stage 3.5 Responsibilities** (`ui-style-patterns/` directory):
760
+ The `ui-style-patterns/` directory and its subdirectories are created and managed by **bizs pipeline Stage 3.5** (`speccrew-knowledge-bizs-ui-style-extract` skill), which extracts UI style patterns from actual business feature documents:
761
+
762
+ | Directory/Subdirectory | Generated By | Content Description |
763
+ |------------------------|-------------------------------------------|---------------------|
764
+ | `ui-style-patterns/` | bizs Stage 3.5 (ui-style-extract) | Business pattern aggregation root |
765
+ | ├─ page-types/ | bizs Stage 3.5 | Page type patterns from business modules |
766
+ | ├─ components/ | bizs Stage 3.5 | Component reuse patterns from actual usage |
767
+ | └─ layouts/ | bizs Stage 3.5 | Layout patterns from business pages |
768
+
769
+ > **Important**:
770
+ > - `ui-style-patterns/` directory is **NOT** created by techs pipeline
771
+ > - It only exists if bizs pipeline Stage 3.5 has been executed
772
+ > - techs pipeline should never write to `ui-style-patterns/`
773
+ > - Refer to `bizs-knowledge-pipeline.md` for details on Stage 3.5
774
+
775
+ **Cross-Directory Usage for Designer Agent**:
776
+
777
+ Designer Agent should reference both directories for complete UI design guidance:
778
+
779
+ | Design Task | Primary Reference | Secondary Reference |
780
+ |-------------|-------------------|---------------------|
781
+ | Color/Typography/Spacing | `ui-style/styles/` | - |
782
+ | Component Selection | `ui-style/components/` | `ui-style-patterns/components/` (if exists) |
783
+ | Page Layout | `ui-style/layouts/` | `ui-style-patterns/layouts/` (if exists) |
784
+ | Page Type Pattern | `ui-style/page-types/` | `ui-style-patterns/page-types/` (if exists) |
785
+
786
+ ---
787
+
788
+ ## Related Documentation
789
+
790
+ | Document | Location | Description |
791
+ |----------|----------|-------------|
792
+ | agent-knowledge-map.md | `SpecCrew-workspace/docs/` | Agent knowledge requirements and paths |
793
+ | bizs-knowledge-pipeline.md | `SpecCrew-workspace/docs/` | Business knowledge pipeline reference |
794
+
795
+ ---
796
+
797
+ ## Maintenance Log
798
+
799
+ | Date | Changes | Owner |
800
+ |------|---------|-------|
801
+ | - | Initial version, techs pipeline design | - |
802
+
803
+