speccrew 0.5.13 → 0.5.16

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 (21) hide show
  1. package/.speccrew/agents/speccrew-team-leader.md +60 -4
  2. package/.speccrew/agents/speccrew-test-manager.md +361 -37
  3. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +63 -626
  4. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +505 -0
  5. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +165 -31
  6. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +63 -728
  7. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +389 -0
  8. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +26 -0
  9. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +27 -0
  10. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +185 -21
  11. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +134 -883
  12. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +36 -0
  13. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +414 -0
  14. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +35 -0
  15. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +297 -0
  16. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/BUG-REPORT-TEMPLATE.md +24 -1
  17. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/TEST-REPORT-TEMPLATE.md +8 -1
  18. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-runner}/SKILL.md +142 -104
  19. package/.speccrew/skills/speccrew-test-runner/templates/TEST-EXECUTION-RESULT-TEMPLATE.md +80 -0
  20. package/lib/utils.js +1 -0
  21. package/package.json +1 -1
@@ -16,21 +16,6 @@ Generate comprehensive technology documentation for a specific platform by analy
16
16
 
17
17
  **CRITICAL**: Generate all content in the language specified by the `language` parameter.
18
18
 
19
- - `language: "zh"` → Generate all content in 中文
20
- - `language: "en"` → Generate all content in English
21
- - Other languages → Use the specified language
22
-
23
- ## Trigger Scenarios
24
-
25
- - "Generate technology documents for {platform}"
26
- - "Create tech stack documentation"
27
- - "Extract conventions from {platform}"
28
- - "Generate platform tech docs"
29
-
30
- ## User
31
-
32
- Worker Agent (speccrew-task-worker)
33
-
34
19
  ## Input
35
20
 
36
21
  - `platform_id`: Platform identifier (e.g., "web-react", "backend-nestjs")
@@ -39,27 +24,17 @@ Worker Agent (speccrew-task-worker)
39
24
  - `source_path`: Platform source directory
40
25
  - `config_files`: List of configuration file paths
41
26
  - `convention_files`: List of convention file paths (eslint, prettier, etc.)
42
- - `output_path`: Output directory for generated documents (e.g., `speccrew-workspace/knowledges/techs/{platform_id}/`)
27
+ - `output_path`: Output directory for generated documents
43
28
  - `language`: Target language (e.g., "zh", "en") - **REQUIRED**
44
- - `completed_dir`: (Optional) Directory for analysis coverage report output. If provided, the analysis JSON will be written here instead of the knowledges directory
29
+ - `completed_dir`: (Optional) Directory for analysis coverage report output
45
30
 
46
31
  ## Output
47
32
 
48
- Generate the following documents in `{output_path}/`:
33
+ **Required Documents (All Platforms)**: INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md
49
34
 
50
- **Required Documents (All Platforms)**:
51
- - `INDEX.md` - Platform technology index
52
- - `tech-stack.md` - Technology stack details
53
- - `architecture.md` - Architecture conventions
54
- - `conventions-design.md` - Design conventions
55
- - `conventions-dev.md` - Development conventions
56
- - `conventions-unit-test.md` - Unit testing conventions
57
- - `conventions-system-test.md` - System testing conventions
58
- - `conventions-build.md` - Build & Deployment conventions
35
+ **Optional Documents**: conventions-data.md (backend required), ui-style/ (frontend only)
59
36
 
60
- **Optional Documents**:
61
- - `conventions-data.md` - Data conventions (backend required; other platforms: only if ORM/data layer detected)
62
- - `ui-style/` - UI style analysis (frontend platforms only)
37
+ **Quality Assurance**: After document generation, quality checks are performed by `speccrew-knowledge-techs-generate-quality` skill.
63
38
 
64
39
  ## Workflow
65
40
 
@@ -79,435 +54,121 @@ flowchart TD
79
54
 
80
55
  ### Step 0: Read Document Templates
81
56
 
82
- Before processing, read all template files to understand the required content structure for each document type:
83
- - **Read**: `templates/INDEX-TEMPLATE.md` - Platform overview and navigation hub structure
84
- - **Read**: `templates/TECH-STACK-TEMPLATE.md` - Technology stack details structure
85
- - **Read**: `templates/ARCHITECTURE-TEMPLATE.md` - Architecture patterns and conventions structure
86
- - **Read**: `templates/CONVENTIONS-DESIGN-TEMPLATE.md` - Design principles and patterns structure
87
- - **Read**: `templates/CONVENTIONS-DEV-TEMPLATE.md` - Development conventions structure
88
- - **Read**: `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` - Unit testing conventions structure
89
- - **Read**: `templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md` - System testing conventions structure
90
- - **Read**: `templates/CONVENTIONS-BUILD-TEMPLATE.md` - Build and deployment conventions structure
91
- - **Read**: `templates/CONVENTIONS-DATA-TEMPLATE.md` - Data layer conventions structure (if applicable)
92
- - **Purpose**: Understand each template's chapters and example content requirements
93
- - **Key principle**: Extract information from source code according to template section requirements
57
+ Read all template files from `templates/` directory to understand required content structure for each document type.
94
58
 
95
59
  ### Step 1: Read Configuration Files
96
60
 
97
- Read and parse all configuration files for the platform:
98
-
99
- **Primary Config Files:**
100
- - package.json / pom.xml / requirements.txt / pubspec.yaml / go.mod
101
- - tsconfig.json / jsconfig.json
102
- - Build config: vite.config.* / webpack.config.* / next.config.* / nest-cli.json
61
+ **Primary Config Files:** package.json / pom.xml / requirements.txt / pubspec.yaml / go.mod, tsconfig.json, build configs
103
62
 
104
- **Convention Files:**
105
- - ESLint: .eslintrc.* / eslint.config.*
106
- - Prettier: .prettierrc.* / prettier.config.*
107
- - Testing: jest.config.* / vitest.config.* / pytest.ini
108
- - Git: .gitignore, .gitattributes
63
+ **Convention Files:** ESLint (.eslintrc.* / eslint.config.*), Prettier (.prettierrc.*), Testing configs, Git files
109
64
 
110
65
  ### Step 2: Extract Technology Stack
111
66
 
112
- Parse configuration files to extract:
113
-
114
- **Core Framework:**
115
- - Name and version from dependencies
116
- - Primary language (TypeScript, JavaScript, Dart, etc.)
117
-
118
- **Dependencies:**
119
- - Production dependencies (grouped by purpose)
120
- - Development dependencies
121
- - Key library versions
122
-
123
- **Build Tools:**
124
- - Bundler (Vite, Webpack, Rollup)
125
- - Transpiler (TypeScript, Babel)
126
- - Task runner (npm scripts, Gradle, Maven)
127
-
128
- **Example Extraction:**
129
- ```json
130
- {
131
- "framework": "React",
132
- "framework_version": "18.2.0",
133
- "language": "TypeScript",
134
- "language_version": "5.3.0",
135
- "build_tool": "Vite 5.0.0",
136
- "key_dependencies": [
137
- { "name": "react-router-dom", "version": "6.20.0", "purpose": "Routing" },
138
- { "name": "zustand", "version": "4.4.0", "purpose": "State Management" }
139
- ]
140
- }
141
- ```
67
+ Parse configuration files to extract: Core Framework (name, version, language), Dependencies (production, dev, key versions), Build Tools (bundler, transpiler, task runner)
142
68
 
143
69
  ### Step 3: Analyze Conventions
144
70
 
145
- 1. **Read Configuration**:
146
- - Read `speccrew-workspace/docs/rules/mermaid-rule.md` - Get Mermaid diagram compatibility guidelines
71
+ 1. Read `speccrew-workspace/docs/rules/mermaid-rule.md` for Mermaid compatibility guidelines
72
+ 2. Extract conventions from ESLint/Prettier configs
73
+ 3. Analyze project structure for directory conventions
147
74
 
148
- 2. **Extract conventions from configuration files:**
75
+ #### Domain-Specific Convention Extraction (MANDATORY)
149
76
 
150
- **From ESLint Config:**
151
- - Enabled rules
152
- - Code style preferences
153
- - Import/export patterns
77
+ **For Frontend Platforms (web-vue, mobile-uniapp, etc.):**
154
78
 
155
- **From Prettier Config:**
156
- - Formatting rules (semi, quotes, tabWidth)
157
- - Print width
79
+ | Topic | Where to Look |
80
+ |-------|---------------|
81
+ | i18n/Internationalization | `locales/`, `i18n/`, `lang/` |
82
+ | Authorization & Permissions | `permission/`, `router/`, `store/`, `utils/auth` |
83
+ | Menu Registration | `router/`, `store/`, `layout/` |
84
+ | Data Dictionary | `components/Dict`, `utils/dict`, `store/` |
85
+ | Logging | `utils/log`, `plugins/sentry` |
86
+ | API Request Layer | `utils/request`, `api/`, `config/` |
87
+ | Data Validation | `utils/validate`, form schemas |
88
+ | File Upload | `components/Upload`, `api/file` |
158
89
 
159
- **From Project Structure:**
160
- - Directory conventions (src/, components/, utils/)
161
- - File naming patterns
162
- - Module organization
90
+ **For Backend Platforms (backend-spring, etc.):**
163
91
 
164
- 3. **Apply Mermaid Rules**:
165
- - Follow compatibility guidelines from `mermaid-rule.md`
166
- - See: [Mermaid Diagram Guide](#mermaid-diagram-guide)
92
+ | Topic | Where to Look |
93
+ |-------|---------------|
94
+ | Authorization & Permissions | Security config, controller annotations |
95
+ | Data Dictionary | `dict/`, `system/` module |
96
+ | Multi-tenancy | MyBatis plugins, framework config |
97
+ | Backend i18n | `resources/i18n/`, `messages*.properties` |
98
+ | Logging | `logback*.xml`, `@OperateLog` |
99
+ | Exception Handling | `handler/`, `exception/`, `GlobalExceptionHandler` |
100
+ | Caching | `cache/`, `redis/`, `@Cacheable` annotations |
101
+ | Data Validation | DTO classes, `validator/` |
102
+ | Scheduled Jobs | `job/`, `task/`, `@Scheduled` methods |
103
+ | File Storage | `file/`, `infra/file/` |
167
104
 
168
- ### Domain-Specific Convention Extraction (MANDATORY)
105
+ **If a topic is not found**, explicitly state "Not applicable" in the corresponding section.
169
106
 
170
- In addition to the general conventions above, you MUST actively search for and extract the following domain-specific topics. These are critical for downstream Agents (solution, design, development, testing).
107
+ #### Analysis Tracking (MANDATORY)
171
108
 
172
- **For Frontend Platforms (web-vue, mobile-uniapp, etc.):**
109
+ For every topic, record: `found` / `not_found` / `partial`, and list all files analyzed. This tracking data is used in Step 7.
173
110
 
174
- | Topic | What to Search For | Where to Look |
175
- |-------|-------------------|---------------|
176
- | **i18n/Internationalization** | i18n framework config, locale files, translation key patterns | `locales/`, `i18n/`, `lang/`, package.json deps |
177
- | **Authorization & Permissions** | Permission directives (`v-hasPermi`), route guards, permission stores | `permission/`, `router/`, `store/`, `utils/auth` |
178
- | **Menu Registration** | Menu config, dynamic menu loading, menu-to-route mapping | `router/`, `store/`, `layout/`, API calls for menus |
179
- | **Data Dictionary** | Dict components (`DictTag`), dict stores, dict API calls | `components/Dict`, `utils/dict`, `store/` |
180
- | **Logging** | Error reporting service, console policy, error boundaries | `utils/log`, `plugins/sentry`, error handling config |
181
- | **API Request Layer** | Axios/fetch instance, interceptors, token refresh, base URL config | `utils/request`, `api/`, `config/`, `interceptors/` |
182
- | **Data Validation** | Form validation rules, custom validators, validation timing | `utils/validate`, form schemas, component props validation |
183
- | **File Upload** | Upload components, upload API calls, file size limits | `components/Upload`, `api/file`, `utils/upload` |
184
-
185
- **For Backend Platforms (backend-spring, etc.):**
186
-
187
- | Topic | What to Search For | Where to Look |
188
- |-------|-------------------|---------------|
189
- | **Authorization & Permissions** | `@PreAuthorize`, `@DataPermission`, security config, permission enums | Security config, controller annotations, framework modules |
190
- | **Data Dictionary** | Dict entity, dict service, dict cache, dict enum patterns | `dict/`, `system/` module, enum classes |
191
- | **Multi-tenancy** | Tenant interceptor/plugin, tenant column, tenant context, `@TenantIgnore` | MyBatis plugins, framework config, base entity |
192
- | **Backend i18n** | messages.properties, MessageSource, i18n config, ValidationMessages | `resources/i18n/`, `messages*.properties`, i18n config beans |
193
- | **Logging** | Logger usage, log config (logback.xml/log4j2), operation log annotation, audit trail | `logback*.xml`, `log4j2*.xml`, `@OperateLog`, `operatelog/` module |
194
- | **Exception Handling** | GlobalExceptionHandler, business exceptions, error codes, error response format | `handler/`, `exception/`, `enums/ErrorCode`, `GlobalExceptionHandler` |
195
- | **Caching** | @Cacheable, RedisTemplate, cache key patterns, cache config | `cache/`, `redis/`, `CacheConfig`, `@Cacheable` annotations |
196
- | **Data Validation** | @Valid, @Validated, custom validators, validation groups | DTO classes, `validator/`, `@NotNull/@Size` patterns |
197
- | **Scheduled Jobs** | @Scheduled, Quartz config, XXL-Job handler, cron expressions | `job/`, `task/`, `schedule/`, `@Scheduled` methods |
198
- | **File Storage** | FileService, upload API, OSS/S3 config, file path patterns | `file/`, `infra/file/`, `FileClient`, storage config |
199
-
200
- **If a topic is not found in the source code**, explicitly state "Not applicable" in the corresponding template section. Do NOT leave the section empty or skip it silently.
201
-
202
- ### Analysis Tracking (MANDATORY)
203
-
204
- During Step 3, you MUST maintain an internal tracking record for each topic you search. For every topic in the tables above:
205
-
206
- 1. **Search** the source code using the "Where to Look" paths
207
- 2. **Record** the result:
208
- - `found` — Topic implementation found, relevant files identified
209
- - `not_found` — Searched all suggested paths, no implementation exists
210
- - `partial` — Some aspects found but incomplete
211
- 3. **List** all files you actually read/analyzed for that topic
212
-
213
- This tracking data will be used in Step 8 to generate the analysis coverage report. Do NOT skip any topic — if a topic is not applicable to this platform type, record it as `not_found` with a note.
214
-
215
- **Topic Checklist by Platform Type:**
216
-
217
- **Frontend Topics (web, mobile, desktop):**
218
- 1. i18n / Internationalization
219
- 2. Authorization & Permissions
220
- 3. Menu Registration & Routing
221
- 4. Data Dictionary Usage
222
- 5. Logging & Error Reporting
223
- 6. API Request Layer (Axios/fetch)
224
- 7. Data Validation
225
- 8. File Upload & Storage
226
- 9. UI Style System (handled in Step 4)
227
-
228
- **Backend Topics (backend):**
229
- 1. Backend Internationalization
230
- 2. Authorization & Permissions (annotations, data permission)
231
- 3. Data Dictionary Management
232
- 4. Logging & Audit Trail
233
- 5. Exception Handling & Error Codes
234
- 6. Caching Strategy
235
- 7. Data Validation (JSR 380, custom validators)
236
- 8. Scheduled Jobs & Task Scheduling
237
- 9. File Storage
238
- 10. Multi-tenancy
239
-
240
- ### Step 4: UI Style Analysis (Frontend Platforms Only) - WITH FALLBACK
111
+ ### Step 4: UI Style Analysis (Frontend Platforms Only)
241
112
 
242
113
  If `platform_type` is `web`, `mobile`, or `desktop`:
243
114
 
244
- **Directory Ownership**:
245
- - `ui-style/` — Fully managed by techs pipeline (this skill)
246
- - Contains: ui-style-guide.md, styles/, page-types/, components/, layouts/
247
- - Source: Framework-level design system analysis from source code
248
- - `ui-style-patterns/` — Managed by bizs pipeline (Stage 3.5: bizs-ui-style-extract)
249
- - Contains: Business pattern aggregation from feature documents
250
- - NOT created or written by this skill
251
- - May not exist if bizs pipeline has not been executed
252
-
253
- **Primary Path (UI Analyzer Available and Succeeds)**:
254
- 1. **CRITICAL**: Use the Skill tool to invoke `speccrew-knowledge-techs-ui-analyze` with these exact parameters:
255
- ```
256
- skill: "speccrew-knowledge-techs-ui-analyze"
257
- args: "source_path={source_path};platform_id={platform_id};platform_type={platform_type};framework={framework};output_path={output_path}/ui-style/;language={language}"
258
- ```
259
-
260
- 2. **Wait for completion** and verify output files exist:
261
- - `{output_path}/ui-style/ui-style-guide.md` ✓
262
- - `{output_path}/ui-style/page-types/page-type-summary.md` ✓
263
- - `{output_path}/ui-style/page-types/[type]-pages.md` (one per discovered type) ✓
264
- - `{output_path}/ui-style/components/component-library.md` ✓
265
- - `{output_path}/ui-style/components/common-components.md` ✓
266
- - `{output_path}/ui-style/components/business-components.md` ✓
267
- - `{output_path}/ui-style/layouts/page-layouts.md` ✓
268
- - `{output_path}/ui-style/layouts/navigation-patterns.md` ✓
269
- - `{output_path}/ui-style/styles/color-system.md` ✓
270
- - `{output_path}/ui-style/styles/typography.md` ✓
271
- - `{output_path}/ui-style/styles/spacing-system.md` ✓
272
-
273
- 3. If all outputs verified → proceed to next step
274
- 4. Record: `ui_style_analysis_level = "full"`
275
-
276
- **Secondary Path (UI Analyzer Fails or Partial Output)**:
277
-
278
- **MANDATORY: UI Style Fallback Path - Complete Directory Structure**
279
-
280
- When UI Style Analyzer fails or produces incomplete output, you MUST create ALL of the following directories and files. Skipping ANY item is FORBIDDEN.
281
-
282
- **Required Directory Structure (MANDATORY - ALL items must be created):**
115
+ **Primary Path**: Invoke `speccrew-knowledge-techs-ui-analyze` skill:
283
116
  ```
284
- ui-style/
285
- ├── ui-style-guide.md ← MANDATORY
286
- ├── page-types/
287
- │ └── page-type-summary.md ← MANDATORY
288
- ├── components/
289
- │ └── component-library.md ← MANDATORY
290
- ├── layouts/
291
- │ └── page-layouts.md ← MANDATORY
292
- └── styles/
293
- └── color-system.md ← MANDATORY
117
+ skill: "speccrew-knowledge-techs-ui-analyze"
118
+ args: "source_path={source_path};platform_id={platform_id};platform_type={platform_type};framework={framework};output_path={output_path}/ui-style/;language={language}"
294
119
  ```
295
120
 
296
- **Self-Verification Checklist (MUST complete before reporting success):**
297
- - [ ] ui-style/ui-style-guide.md exists and has content
298
- - [ ] ui-style/page-types/page-type-summary.md exists and has content
299
- - [ ] ui-style/components/component-library.md exists and has content
300
- - [ ] ui-style/layouts/page-layouts.md exists and has content
301
- - [ ] ui-style/styles/color-system.md exists and has content
302
-
303
- If ANY file in the checklist is missing, you MUST create it before proceeding to the next step. Do NOT report "completed" with missing files.
304
-
305
- **Execution Steps:**
306
-
307
- 1. Create ui-style directory structure:
308
- `{output_path}/ui-style/`, `{output_path}/ui-style/page-types/`, `{output_path}/ui-style/components/`, `{output_path}/ui-style/layouts/`, `{output_path}/ui-style/styles/`
309
-
310
- 2. Generate minimal ui-style-guide.md by manually scanning source code:
311
- - Design system: identify UI framework from dependencies (Material UI, Ant Design, Tailwind, etc.)
312
- - Color system: scan for CSS variables, theme files, or color constants in `{source_path}/src/styles/` or `{source_path}/src/theme/`
313
- - Typography: scan for font-family declarations
314
- - Component library: list directories under `{source_path}/src/components/`
315
- - Page types: list directories/files under `{source_path}/src/pages/` or `{source_path}/src/views/`
316
-
317
- 3. Content structure for minimal ui-style-guide.md:
318
- ```markdown
319
- # UI Style Guide - {platform_id}
320
-
321
- > Note: Generated from manual source code inspection. Automated UI analysis was unavailable.
322
-
323
- ## Design System
324
- - UI Framework: {detected from package.json}
325
- - CSS Approach: {CSS Modules / Tailwind / styled-components / SCSS - detected from config}
326
-
327
- ## Component Library Overview
328
- {list component directories found}
329
-
330
- ## Page Types Identified
331
- {list page directories/files found}
332
-
333
- ## Styling Configuration
334
- {extract from tailwind.config / theme file / CSS variables file}
335
- ```
336
-
337
- 4. **MANDATORY: UI Style Fallback - Copy Template + Fill Workflow**
338
-
339
- For each ui-style sub-document, copy the template and use search_replace to fill:
340
-
341
- **4.1 component-library.md**:
342
- - Copy `templates/COMPONENT-LIBRARY-TEMPLATE.md` to `{output_path}/ui-style/components/component-library.md`
343
- - Use search_replace to fill each AI-TAG section with data extracted from source code
344
- - MUST include props tables for at least the top 5 most-used components
345
- - Fill: COMPONENT_CATEGORIES, API_REFERENCE, COMPOSITION_PATTERNS, AGENT_GUIDE sections
346
-
347
- **4.2 page-layouts.md**:
348
- - Copy `templates/PAGE-LAYOUTS-TEMPLATE.md` to `{output_path}/ui-style/layouts/page-layouts.md`
349
- - Fill layout types, slots, responsive behavior from source analysis
350
- - Fill: LAYOUT_TYPES, LAYOUT_DETAILS, NAVIGATION sections
351
-
352
- **4.3 page-type-summary.md**:
353
- - Copy `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` to `{output_path}/ui-style/page-types/page-type-summary.md`
354
- - Fill page classifications and routing conventions
355
- - Fill: PAGE_TYPES, PAGE_TYPE_DETAILS, ROUTING sections
356
-
357
- **4.4 color-system.md**:
358
- - Copy `templates/COLOR-SYSTEM-TEMPLATE.md` to `{output_path}/ui-style/styles/color-system.md`
359
- - Fill theme colors, functional colors, typography from CSS/SCSS variables
360
- - Fill: THEME_COLORS, FUNCTIONAL_COLORS, SEMANTIC_TOKENS, TYPOGRAPHY, SPACING sections
361
-
362
- 5. Record: `ui_style_analysis_level = "minimal"`
363
-
364
- **Tertiary Path (No UI Analysis Possible)**:
365
- If source code scanning also fails (e.g., non-standard structure):
366
- 1. Create `{output_path}/ui-style/ui-style-guide.md` with references only:
367
- ```markdown
368
- # UI Style Guide - {platform_id}
369
-
370
- > Note: Automated and manual UI analysis were not possible for this platform.
371
- > Manual inspection of source code is required.
372
-
373
- ## References
374
- - Source components: {source_path}/src/components/ (if exists)
375
- - Source pages: {source_path}/src/pages/ (if exists)
376
- - Style files: {source_path}/src/styles/ (if exists)
377
- - Package dependencies: {source_path}/package.json
378
- ```
379
- 2. Record: `ui_style_analysis_level = "reference_only"`
380
-
381
- **In conventions-design.md, ALWAYS include UI reference section**:
382
- Regardless of analysis level, conventions-design.md MUST contain:
383
- ```markdown
384
- ## UI Design Conventions
385
-
386
- Refer to [UI Style Guide](ui-style/ui-style-guide.md) for design system details.
387
-
388
- Analysis completeness: {ui_style_analysis_level}
389
- - full: Complete automated analysis available
390
- - minimal: Manual inspection results only
391
- - reference_only: Source file references only - manual review needed
392
- ```
121
+ **Fallback Path** (if analyzer fails): Create minimal ui-style/ directory with:
122
+ - ui-style/ui-style-guide.md
123
+ - ui-style/page-types/page-type-summary.md
124
+ - ui-style/components/component-library.md
125
+ - ui-style/layouts/page-layouts.md
126
+ - ui-style/styles/color-system.md
393
127
 
394
- ### Step 5: Generate Documents (MANDATORY: Copy Template + Fill)
128
+ Record: `ui_style_analysis_level = "full" | "minimal" | "reference_only"`
395
129
 
396
- **CRITICAL**: This step MUST follow the template fill workflow - copy template first, then fill sections.
130
+ **In conventions-design.md, include UI reference section** linking to ui-style/ui-style-guide.md.
131
+
132
+ ### Step 5: Generate Documents (MANDATORY: Copy Template + Fill)
397
133
 
398
134
  **Decision Logic for conventions-data.md**:
135
+ - Backend → Always generate
136
+ - Other platforms → Generate only if data layer detected (prisma/typeorm/sequelize/mongoose/drizzle-orm/firebase)
137
+
138
+ **Workflow for Each Document**:
139
+ 1. Copy template file to output path
140
+ 2. Use `search_replace` to fill sections with analyzed data
141
+ 3. Preserve all template section headers and structure
399
142
 
400
- IF `platform_type` == `backend`:
401
- - Generate conventions-data.md (REQUIRED)
402
- ELSE IF `platform_type` IN [`web`, `mobile`, `desktop`, `api`]:
403
- - Check package.json dependencies for data layer indicators:
404
- - IF `prisma` / `typeorm` / `sequelize` / `mongoose` / `drizzle-orm` found → Generate conventions-data.md
405
- - IF `firebase` / `sqlite` / `realm` found → Generate conventions-data.md (lightweight)
406
- - ELSE → Skip conventions-data.md
407
-
408
- 1. **For Each Document, Follow This Workflow**:
409
-
410
- **Step 5.1: Copy Template File**
411
- - Copy the corresponding template file to the output path:
412
- - `templates/INDEX-TEMPLATE.md` → `{output_path}/INDEX.md`
413
- - `templates/TECH-STACK-TEMPLATE.md` → `{output_path}/tech-stack.md`
414
- - `templates/ARCHITECTURE-TEMPLATE.md` → `{output_path}/architecture.md`
415
- - `templates/CONVENTIONS-DESIGN-TEMPLATE.md` → `{output_path}/conventions-design.md`
416
- - `templates/CONVENTIONS-DEV-TEMPLATE.md` → `{output_path}/conventions-dev.md`
417
- - `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` → `{output_path}/conventions-unit-test.md`
418
- - `templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md` → `{output_path}/conventions-system-test.md`
419
- - `templates/CONVENTIONS-BUILD-TEMPLATE.md` → `{output_path}/conventions-build.md`
420
- - `templates/CONVENTIONS-DATA-TEMPLATE.md` → `{output_path}/conventions-data.md` (if applicable)
421
-
422
- **Step 5.2: Fill Template Sections with search_replace**
423
- - Use `search_replace` tool to fill each section of the template
424
- - Replace placeholder content with actual analyzed data
425
- - Follow [Document Structure Standard](#document-structure-standard)
426
- - Apply [Source Traceability Requirements](#source-traceability-requirements)
427
-
428
- **MANDATORY RULES**:
429
- - **Do NOT use create_file to rewrite the entire document**
430
- - **Do NOT delete or skip any template section**
431
- - Only replace the placeholder content within each section
432
- - Preserve all template section headers and structure
433
-
434
- 2. **Document Generation Order**:
435
- - Generate: INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md, conventions-data.md (if applicable)
143
+ **MANDATORY RULES**:
144
+ - Do NOT use create_file to rewrite entire document
145
+ - Do NOT delete or skip any template section
146
+ - Apply Source Traceability Requirements (see below)
436
147
 
437
148
  ### Step 6: Write Output Files
438
149
 
439
- Create output directory if not exists, then write all generated documents.
150
+ Create output directory if not exists, write all generated documents.
440
151
 
441
152
  ### Step 7: Generate Analysis Coverage Report (MANDATORY)
442
153
 
443
- After completing all document generation, you MUST create an analysis coverage report as a JSON file.
444
-
445
154
  **Output file**: `{completed_dir}/{platform_id}.analysis.json`
446
155
 
447
- Where `{completed_dir}` is the directory passed via the `completed_dir` parameter (if provided). If `completed_dir` is not provided, output to the platform's knowledges directory.
448
-
449
156
  **Report Format**:
450
-
451
157
  ```json
452
158
  {
453
159
  "platform_id": "{platform_id}",
454
160
  "platform_type": "{platform_type}",
455
161
  "analyzed_at": "{ISO 8601 timestamp}",
456
162
  "topics": {
457
- "i18n": {
458
- "status": "found",
459
- "files_analyzed": ["src/i18n/index.ts", "locales/zh-CN.ts"],
460
- "notes": "Vue I18n with 2 locale files"
461
- },
462
- "authorization": {
463
- "status": "found",
464
- "files_analyzed": ["src/permission/index.ts", "src/router/guard.ts"],
465
- "notes": "RBAC with route guards and v-hasPermi directive"
466
- },
467
- "data_dictionary": {
468
- "status": "not_found",
469
- "files_analyzed": [],
470
- "notes": "No dictionary implementation found in suggested paths"
471
- }
163
+ "i18n": { "status": "found|not_found|partial", "files_analyzed": [], "notes": "" }
472
164
  },
473
- "config_files_analyzed": [
474
- "package.json",
475
- "vite.config.ts",
476
- "tsconfig.json"
477
- ],
478
- "source_dirs_scanned": [
479
- "src/components/",
480
- "src/views/",
481
- "src/utils/",
482
- "src/store/"
483
- ],
484
- "documents_generated": [
485
- "INDEX.md",
486
- "tech-stack.md",
487
- "architecture.md",
488
- "conventions-dev.md",
489
- "conventions-design.md",
490
- "conventions-unit-test.md",
491
- "conventions-build.md"
492
- ],
493
- "coverage_summary": {
494
- "topics_found": 7,
495
- "topics_partial": 1,
496
- "topics_not_found": 1,
497
- "topics_total": 9,
498
- "coverage_percent": 78
499
- }
165
+ "config_files_analyzed": [],
166
+ "source_dirs_scanned": [],
167
+ "documents_generated": [],
168
+ "coverage_summary": { "topics_found": 0, "topics_partial": 0, "topics_not_found": 0, "topics_total": 0, "coverage_percent": 0 }
500
169
  }
501
170
  ```
502
171
 
503
- **Rules**:
504
- - Every topic from the Topic Checklist in Step 3 MUST appear in the `topics` object
505
- - `files_analyzed` MUST list the actual file paths you read (relative to source_path)
506
- - `status` MUST be one of: `found`, `not_found`, `partial`
507
- - `coverage_percent` = (topics_found + topics_partial) / topics_total * 100, rounded to integer
508
- - `documents_generated` MUST list all .md files actually created
509
- - Use `create_file` to write this JSON file (this is the ONE exception where create_file is allowed — for JSON output files)
510
-
511
172
  ### Step 8: Report Results
512
173
 
513
174
  ```
@@ -520,11 +181,9 @@ Platform Technology Documents Generated: {{platform_id}}
520
181
  - conventions-unit-test.md: ✓
521
182
  - conventions-system-test.md: ✓
522
183
  - conventions-build.md: ✓
523
- - conventions-data.md: ✓ (or skipped if not applicable)
524
- - ui-style-guide.md: ✓ (frontend platforms only, analysis level: {{ui_style_analysis_level}})
525
- - {{platform_id}}.analysis.json: ✓ (analysis coverage report)
184
+ - conventions-data.md: ✓ (or skipped)
185
+ - ui-style-guide.md: ✓ (frontend only, level: {{ui_style_analysis_level}})
526
186
  - Output Directory: {{output_path}}
527
- - Analysis Report: {{completed_dir}}/{{platform_id}}.analysis.json (or knowledges dir if completed_dir not provided)
528
187
  ```
529
188
 
530
189
  ---
@@ -533,465 +192,64 @@ Platform Technology Documents Generated: {{platform_id}}
533
192
 
534
193
  ### Mermaid Diagram Guide
535
194
 
536
- When generating Mermaid diagrams, follow these compatibility guidelines:
537
-
538
- **Key Requirements:**
539
- - Use only basic node definitions: `A[text content]`
540
- - No HTML tags (e.g., `<br/>`)
541
- - No nested subgraphs
542
- - No `direction` keyword
543
- - No `style` definitions
544
- - Use standard `graph TB/LR` syntax only
545
-
546
- **Diagram Types:**
195
+ **Key Requirements:** Use basic node definitions only. No HTML tags, no nested subgraphs, no `direction` keyword, no `style` definitions.
547
196
 
548
- | Diagram Type | Use Case | Example Scenario |
549
- |--------------|----------|------------------|
550
- | `graph TB/LR` | Structure & Dependency | Module relationships, component hierarchy |
551
- | `flowchart TD` | Business Logic Flow | Request processing, decision trees |
552
- | `sequenceDiagram` | Interaction Flow | API calls, service communication |
553
- | `classDiagram` | Class Structure | Entity relationships, inheritance |
554
- | `erDiagram` | Database Schema | Table relationships, data model |
555
- | `stateDiagram-v2` | State Machine | Order status, workflow states |
197
+ **Diagram Types**: `graph TB/LR` (structure), `flowchart TD` (logic), `sequenceDiagram` (interactions), `classDiagram` (classes), `erDiagram` (database), `stateDiagram-v2` (states)
556
198
 
557
199
  ### Source Traceability Requirements
558
200
 
559
- **CRITICAL: All source file links MUST use RELATIVE PATHS. Absolute paths and `file://` protocol are STRICTLY FORBIDDEN.**
560
-
561
- **FORBIDDEN:**
562
- - ❌ Do NOT use absolute paths (e.g., `d:/dev/ruoyi-vue-pro/...`)
563
- - ❌ Do NOT use `file://` protocol (e.g., `file://d:/dev/...`)
564
- - ❌ Do NOT hardcode machine-specific paths
565
- - ✅ ALWAYS use relative paths calculated from the document's location
566
-
567
- **Dynamic Relative Path Calculation:**
568
-
569
- Documents are located at: `speccrew-workspace/knowledges/techs/{platform_id}/{document}.md`
570
- This is 4 levels deep from the project root:
571
- - speccrew-workspace (1)
572
- - knowledges (2)
573
- - techs (3)
574
- - {platform_id} (4)
575
-
576
- Therefore, to reference a source file from the project root, use `../../../../` as the prefix.
577
-
578
- Example calculation:
579
- - Document: `speccrew-workspace/knowledges/techs/backend-spring/architecture.md`
580
- - Source file: `yudao-server/src/main/java/.../YudaoServerApplication.java`
581
- - Relative path: `../../../../yudao-server/src/main/java/.../YudaoServerApplication.java`
582
-
583
- For root INDEX.md (one level less deep):
584
- - Document: `speccrew-workspace/knowledges/techs/INDEX.md`
585
- - Prefix: `../../../` (3 levels)
586
-
587
- **1. File Reference Block (`<cite>`)**
588
-
589
- Place at the beginning of each document:
590
-
591
- ```markdown
592
- <cite>
593
- **Files Referenced in This Document**
594
- - [package.json](../../../../yudao-ui/yudao-ui-admin-vue3/package.json)
595
- - [tsconfig.json](../../../../yudao-ui/yudao-ui-admin-vue3/tsconfig.json)
596
- </cite>
597
- ```
598
-
599
- **2. Diagram Source Annotation**
201
+ **CRITICAL: All source file links MUST use RELATIVE PATHS.** No absolute paths, no `file://` protocol.
600
202
 
601
- After each Mermaid diagram:
203
+ **Relative Path Calculation**: Documents at `speccrew-workspace/knowledges/techs/{platform_id}/` are 4 levels deep. Use `../../../../` prefix to reference project root files.
602
204
 
603
- ```markdown
604
- **Diagram Source**
605
- - [file-name.ext](../../../../yudao-server/src/main/java/...#L10-L50)
606
- ```
607
-
608
- **3. Section Source Annotation**
609
-
610
- At the end of each major section:
611
-
612
- ```markdown
613
- **Section Source**
614
- - [file-name.ext](../../../../yudao-server/src/main/java/...#L10-L50)
615
- ```
616
-
617
- For generic guidance sections without specific file references:
618
-
619
- ```markdown
620
- [This section provides general guidance, no specific file reference required]
621
- ```
622
-
623
- ### Document Structure Standard
624
-
625
- All generated documents must follow this structure:
626
-
627
- ```markdown
628
- # {{platform_name}} {{document_type}}
629
-
630
- <cite>
631
- **Files Referenced in This Document**
632
- {{source_files}}
633
- </cite>
634
-
635
- > **Target Audience**: devcrew-designer-{{platform_id}}, devcrew-dev-{{platform_id}}, devcrew-test-{{platform_id}}
636
-
637
- ## Table of Contents
638
- 1. [Introduction](#introduction)
639
- 2. [Project Structure](#project-structure)
640
- 3. [Core Components](#core-components)
641
- 4. [Architecture Overview](#architecture-overview)
642
- 5. [Detailed Component Analysis](#detailed-component-analysis)
643
- 6. [Dependency Analysis](#dependency-analysis)
644
- 7. [Performance Considerations](#performance-considerations)
645
- 8. [Troubleshooting Guide](#troubleshooting-guide)
646
- 9. [Conclusion](#conclusion)
647
- 10. [Appendix](#appendix)
648
-
649
- ... content sections ...
650
-
651
- **Section Source**
652
- - [file.ext](../../../../path/to/file#Lstart-Lend)
653
- ```
205
+ **Required Elements**:
206
+ 1. `<cite>` block at document beginning listing referenced files
207
+ 2. `**Diagram Source**` annotation after each Mermaid diagram
208
+ 3. `**Section Source**` annotation at end of major sections
654
209
 
655
210
  ### Document Content Specifications
656
211
 
657
212
  #### INDEX.md
658
-
659
- Platform overview and navigation hub.
660
-
661
- **Content:**
662
- - Platform summary (type, framework, language)
663
- - Technology stack overview
664
- - Quick links to all convention documents
665
- - Agent usage guide
213
+ Platform summary, technology stack overview, navigation links, agent usage guide.
666
214
 
667
215
  #### tech-stack.md
668
-
669
- Detailed technology stack information.
670
-
671
- **Sections:**
672
- - Overview (framework, language, build tool)
673
- - Core Technologies (table with versions)
674
- - Dependencies (grouped by category)
675
- - UI/Framework
676
- - State Management
677
- - Routing
678
- - HTTP/API
679
- - Utilities
680
- - Development Tools
681
- - Configuration Files (list with paths)
216
+ Overview, Core Technologies table, Dependencies (grouped), Development Tools, Configuration Files.
682
217
 
683
218
  #### architecture.md
684
-
685
- Architecture patterns and conventions.
686
-
687
- **Sections (Platform-Specific):**
688
-
689
- **For Web (React/Vue/Angular):**
690
- - Component Architecture (Atomic Design, Container/Presentational)
691
- - State Management Patterns
692
- - Routing Conventions
693
- - API Integration Patterns
694
- - Styling Approach
695
-
696
- **For Backend (NestJS/Spring/Express):**
697
- - Layered Architecture (Controller/Service/Repository)
698
- - Dependency Injection
699
- - Module Organization
700
- - API Design Patterns
701
- - Middleware/Interceptor Usage
702
-
703
- **For Mobile (Flutter/React Native):**
704
- - Widget/Component Structure
705
- - State Management
706
- - Navigation Patterns
707
- - Platform-Specific Considerations
219
+ **Web**: Component Architecture, State Management, Routing, API Integration, Styling. **Backend**: Layered Architecture, DI, Module Organization, API Design, Middleware. **Mobile**: Widget Structure, State Management, Navigation, Platform considerations.
708
220
 
709
221
  #### conventions-design.md
710
-
711
- Design principles and patterns for detailed design.
712
-
713
- **Sections:**
714
- - Design Principles (SOLID, DRY, etc.)
715
- - Component/Module Design Patterns
716
- - **UI Design Conventions** (frontend platforms - reference ui-style analysis)
717
- - Link to `ui-style/ui-style-guide.md`
718
- - Link to `ui-style/page-types/page-type-summary.md`
719
- - Data Flow Design
720
- - Error Handling Patterns
721
- - Security Considerations
722
- - Performance Guidelines
222
+ Design Principles (SOLID, DRY), Design Patterns, UI Design Conventions (reference ui-style/), Data Flow, Error Handling, Security, Performance.
723
223
 
724
224
  #### conventions-dev.md
225
+ Naming Conventions, Directory Structure, Code Style (from ESLint/Prettier), Import/Export Patterns, Git Commit Conventions, Pre-Development Checklist, Code Review Checklist.
725
226
 
726
- Development conventions for coding.
727
-
728
- **Sections (MUST INCLUDE)**:
729
-
730
- 1. Naming Conventions
731
- - File naming (with actual examples from project: e.g., UserProfile.tsx, userProfile.utils.ts)
732
- - Variable/function naming with GOOD/BAD examples
733
- - Class/component naming for platform
734
- - Constants naming (SCREAMING_SNAKE_CASE or UPPER_CAMEL_CASE - which does project use?)
735
-
736
- 2. Directory Structure
737
- - Visual tree (actual from src/ - scan and present real structure)
738
- - What goes where guide:
739
- | Directory | Purpose | Naming Pattern |
740
- |-----------|---------|---------------|
741
- | components/ | Reusable UI components | PascalCase.tsx |
742
- | pages/ | Page-level components | PascalCase.tsx |
743
- | hooks/ | Custom hooks | useXxx.ts |
744
- | utils/ | Utility functions | camelCase.ts |
745
- | services/ | API services | xxxService.ts |
746
- - Module-level organization patterns
747
-
748
- 3. Code Style (Extracted from ESLint/Prettier configs)
749
-
750
- MUST extract these specific fields:
751
-
752
- **From Prettier/EditorConfig**:
753
- | Setting | Value | Example |
754
- |---------|-------|---------|
755
- | Indentation | {tabs/spaces} {width} | (extract from .prettierrc or .editorconfig) |
756
- | Quote style | {single/double} | ✓ const s = 'hello' |
757
- | Semicolons | {always/never} | ✓ const x = 1; |
758
- | Line width | {number} | Max {n} characters per line |
759
- | Trailing comma | {all/es5/none} | ✓ [a, b, c,] |
760
- | Arrow parens | {always/avoid} | ✓ (x) => x |
761
-
762
- **From ESLint**:
763
- - Key enabled rules (no-unused-vars, no-console, etc.)
764
- - Parser settings (ecmaVersion, sourceType)
765
- - Environment settings (node, browser, es6)
766
-
767
- **GOOD vs BAD Code Examples** (generate 3-5 examples based on actual rules):
768
- ```
769
- ✓ GOOD: const userName = 'Alice';
770
- ✗ BAD: var user_name = "Alice";
771
- Reason: Use const, camelCase naming, single quotes (from .prettierrc)
772
- ```
773
-
774
- 4. Import/Export Patterns
775
- - ES Modules vs CommonJS (which does project use?)
776
- - Barrel exports rules (index.ts patterns - does project use them?)
777
- - Relative vs absolute imports (path aliases from tsconfig/vite.config?)
778
- - Import ordering rules (from eslint-plugin-import config if present)
779
-
780
- 5. Git Commit Conventions
781
- - Message format (Conventional Commits? Semantic? Custom? - detect from commitlint config or .commitlintrc)
782
- - Commit scope examples relevant to this project
783
- - Branch naming convention (if detected from git hooks or CI config)
784
-
785
- 6. Pre-Development Checklist (NEW - critical for Dev Agent onboarding)
786
- - [ ] Runtime version check: extract from .nvmrc / .node-version / package.json engines / .python-version / .java-version
787
- - [ ] Dependency installation command: npm install / yarn / pnpm install / mvn install / pip install -r requirements.txt
788
- - [ ] Local dev server startup command: extract from package.json scripts.dev / scripts.start / Makefile
789
- - [ ] Environment variables needed: list .env.local template variables (from .env.example if exists)
790
- - [ ] Pre-commit hooks check: detect husky / lint-staged / pre-commit config
791
- - [ ] IDE plugins recommended: based on tech stack (ESLint plugin, Prettier plugin, etc.)
792
-
793
- 7. Code Review Checklist
794
- - [ ] Linting passed: {actual lint command from package.json}
795
- - [ ] Formatting consistent: {actual format command}
796
- - [ ] Type safety: {TypeScript strict mode / type checking command}
797
- - [ ] Tests written and passing: {actual test command}
798
- - [ ] Naming follows conventions (Section 1)
799
- - [ ] No hardcoded secrets or sensitive data
800
- - [ ] Documentation updated for public APIs
801
-
802
- **Source extraction rules**:
803
- - Prettier config: .prettierrc, .prettierrc.js, .prettierrc.json, prettier.config.js
804
- - ESLint config: .eslintrc.js, .eslintrc.json, eslint.config.js (flat config)
805
- - EditorConfig: .editorconfig
806
- - Git hooks: .husky/, .git/hooks/, .pre-commit-config.yaml, lint-staged config in package.json
807
- - Commit conventions: .commitlintrc, commitlint.config.js
808
- - Runtime version: .nvmrc, .node-version, package.json engines, .tool-versions
809
- - IDE config: .vscode/extensions.json, .idea/ settings
810
-
811
- #### conventions-test.md
812
-
813
- Testing conventions and requirements.
814
-
815
- **Sections (MUST INCLUDE)**:
816
-
817
- 1. Unit Testing
818
- - Framework (Jest/Vitest/pytest/JUnit/Go testing/etc.)
819
- - Test file naming convention (*.test.ts vs *.spec.ts - extract from config)
820
- - Test file location (co-located vs __tests__/ directory)
821
- - Minimal test template with assertions (provide actual code example)
822
- - Run command: extract from package.json scripts or project config
823
-
824
- 2. Integration Testing
825
- - When to write integration tests (API integration, module boundaries)
826
- - Test data management:
827
- - Fixtures location and format
828
- - Seeding approach (factory functions, JSON fixtures, SQL scripts)
829
- - Mock external services strategy:
830
- - HTTP mocking tool (nock/msw/WireMock/mockito)
831
- - When to mock vs when to use real services
832
-
833
- 3. E2E Testing (CONDITIONAL: frontend/mobile platforms ONLY)
834
- - E2E framework (Cypress/Playwright/Appium/Detox - detect from dependencies)
835
- - Browser/device compatibility matrix:
836
- | Browser/Device | Required | Notes |
837
- |--------|----------|-------|
838
- - Critical user flow scenarios to cover
839
- - Run command (e.g., npm run test:e2e)
840
- - CI environment considerations (headless mode, timeouts)
841
- - If NO E2E framework detected: note "E2E framework not configured. Recommend: [Playwright/Cypress] based on {framework}"
842
-
843
- 4. Database Testing (CONDITIONAL: backend platforms ONLY)
844
- - Database isolation strategy (transaction rollback / separate test DB / in-memory DB)
845
- - Migration testing (schema upgrade verification)
846
- - Fixture management (location, format, seeding commands)
847
- - Query verification approach (EXPLAIN PLAN usage)
848
- - If NO database detected: SKIP this section
849
-
850
- 5. Performance Testing
851
- - Key metrics to monitor:
852
- - Frontend: FCP, LCP, TTI, bundle size
853
- - Backend: API response time (p50/p95/p99), throughput
854
- - Load testing tool (k6/Artillery/JMeter/wrk - detect from dependencies or note recommendation)
855
- - Baseline expectations (document actual values if found in config, else recommend defaults)
856
- - When to run (pre-release, nightly, on-demand)
857
-
858
- 6. Coverage Requirements
859
- - Target coverage percentage (extract from jest.config/vitest.config/pytest.ini/.coveragerc)
860
- - If not configured: recommend industry defaults (80% statements, 70% branches)
861
- - Critical paths priority list
862
- - Local coverage check command (e.g., npm run test:coverage)
863
- - Coverage reporting tool (istanbul/c8/coverage.py/JaCoCo)
864
-
865
- 7. Testing Troubleshooting
866
- - Common failure scenarios and resolutions (platform-specific)
867
- - Debugging test failures (breakpoint setup, verbose logging)
868
- - Flaky test detection and investigation approach
869
- - Test environment reset procedures
870
-
871
- **Source extraction rules**:
872
- - Test framework: from package.json devDependencies / pom.xml test scope / requirements-dev.txt
873
- - E2E framework: from cypress.config.*, playwright.config.*, detox config
874
- - Coverage config: from jest.config (coverageThreshold), vitest.config, .coveragerc, jacoco-maven-plugin
875
- - Performance tools: from package.json devDependencies (k6, artillery, lighthouse)
876
- - Database test config: from test configuration files, docker-compose.test.yml
227
+ **Source extraction**: Prettier (.prettierrc), ESLint (.eslintrc), EditorConfig (.editorconfig), Git hooks (.husky/), Commit conventions (.commitlintrc), Runtime version (.nvmrc), IDE config (.vscode/).
877
228
 
878
- #### conventions-build.md
229
+ #### conventions-unit-test.md / conventions-system-test.md
230
+ Unit Testing (framework, naming, location, template, run command), Integration Testing, E2E Testing (frontend only), Database Testing (backend only), Performance Testing, Coverage Requirements, Troubleshooting.
879
231
 
880
- Build & Deployment Conventions.
881
-
882
- **Required**: YES (all platform types)
883
-
884
- **Sections (MUST INCLUDE)**:
885
-
886
- 1. Build Tool & Configuration
887
- - Primary build tool (Vite/Webpack/Rollup/Maven/Gradle/Go build/Cargo etc.)
888
- - Main config file path and key settings
889
- - Build commands reference table:
890
- | Command | Purpose | Example |
891
- |---------|---------|---------|
892
- | dev | Start development server | npm run dev |
893
- | build | Production build | npm run build |
894
- | preview | Preview production build | npm run preview |
895
-
896
- 2. Environment Management
897
- - Environment files (.env, .env.local, .env.production, application.yml, application-dev.yml)
898
- - Environment variable naming conventions (VITE_ prefix / NEXT_PUBLIC_ prefix / spring profiles)
899
- - Environment differences table:
900
- | Setting | Development | Staging | Production |
901
- |---------|-------------|---------|------------|
902
- | API URL | localhost | staging-api | prod-api |
903
- - Sensitive config handling (secrets, API keys - what NOT to commit)
904
-
905
- 3. Build Profiles & Outputs
906
- - Build modes (development/production/test)
907
- - Output directory and structure (dist/, build/, target/)
908
- - Optimization strategies (code splitting, tree shaking, minification, source maps)
909
- - Bundle size considerations (if frontend)
910
-
911
- 4. CI/CD Pipeline Conventions (conditional: if CI config files detected)
912
- - CI config file paths (.github/workflows/, Jenkinsfile, .gitlab-ci.yml)
913
- - Pipeline stages definition (lint → test → build → deploy)
914
- - Deployment targets and trigger conditions
915
- - If NO CI config detected: note "CI/CD pipeline not configured in repository"
916
-
917
- 5. Docker & Container (conditional: if Dockerfile detected)
918
- - Dockerfile path and build command
919
- - Image naming convention
920
- - docker-compose configuration (if exists)
921
- - If NO Dockerfile detected: SKIP this section entirely
922
-
923
- 6. Dependency Management
924
- - Package manager (npm/yarn/pnpm/maven/gradle/pip/go mod)
925
- - Lock file strategy (committed? .gitignore'd?)
926
- - Dependency upgrade workflow
927
- - Compatibility checking approach
928
-
929
- **Source extraction rules**:
930
- - Build tool: from package.json scripts / pom.xml plugins / build.gradle / Makefile / Cargo.toml
931
- - Environment files: scan for .env*, application*.yml, application*.properties
932
- - CI config: scan for .github/workflows/*.yml, Jenkinsfile, .gitlab-ci.yml, .circleci/config.yml
933
- - Docker: scan for Dockerfile, docker-compose*.yml
934
- - Package manager: detect from lock files (package-lock.json → npm, yarn.lock → yarn, pnpm-lock.yaml → pnpm)
232
+ #### conventions-build.md
233
+ Build Tool & Configuration, Environment Management, Build Profiles & Outputs, CI/CD (if detected), Docker (if detected), Dependency Management.
935
234
 
936
235
  #### conventions-data.md (Optional)
937
-
938
- Data layer conventions (if applicable).
939
-
940
- **Sections:**
941
- - ORM/Database Tool
942
- - Data Modeling Conventions
943
- - Migration Patterns
944
- - Query Optimization
945
- - Caching Strategies
236
+ ORM/Database Tool, Data Modeling, Migrations, Query Optimization, Caching.
946
237
 
947
238
  ---
948
239
 
949
240
  ## Template Usage
950
241
 
951
- ### Template Reference
952
-
953
- All templates are unified and located in `templates/` directory:
954
-
955
242
  | Template File | Purpose |
956
243
  |---------------|---------|
957
- | `templates/INDEX-TEMPLATE.md` | Platform overview and navigation hub |
958
- | `templates/TECH-STACK-TEMPLATE.md` | Technology stack details |
959
- | `templates/ARCHITECTURE-TEMPLATE.md` | Architecture patterns and conventions |
960
- | `templates/CONVENTIONS-DESIGN-TEMPLATE.md` | Design principles and patterns |
961
- | `templates/CONVENTIONS-DEV-TEMPLATE.md` | Development conventions |
962
- | `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` | Unit testing conventions |
963
- | `templates/CONVENTIONS-BUILD-TEMPLATE.md` | Build and deployment conventions |
964
- | `templates/CONVENTIONS-DATA-TEMPLATE.md` | Data layer conventions |
965
-
966
- Platform-specific content is generated dynamically based on:
967
- - Platform type (web, mobile, backend, desktop)
968
- - Framework (react, vue, springboot, etc.)
969
- - Analyzed configuration files
970
-
971
- ## Document Generation Guidelines
972
-
973
- ### Be Specific
974
-
975
- Extract actual values from config files:
976
- - ✓ "React 18.2.0" (from package.json)
977
- - ✗ "React (version varies)"
978
-
979
- ### Be Concise
980
-
981
- Focus on actionable conventions:
982
- - ✓ "Use PascalCase for component files: UserProfile.tsx"
983
- - ✗ "There are many naming conventions to consider..."
984
-
985
- ### Include Examples
986
-
987
- Wherever possible, include concrete examples:
988
- ```markdown
989
- ### Component Naming
990
- - ✓ UserProfile.tsx
991
- - ✓ OrderList.tsx
992
- - ✗ userProfile.tsx
993
- - ✗ order-list.tsx
994
- ```
244
+ | INDEX-TEMPLATE.md | Platform overview |
245
+ | TECH-STACK-TEMPLATE.md | Technology stack |
246
+ | ARCHITECTURE-TEMPLATE.md | Architecture patterns |
247
+ | CONVENTIONS-DESIGN-TEMPLATE.md | Design principles |
248
+ | CONVENTIONS-DEV-TEMPLATE.md | Development conventions |
249
+ | CONVENTIONS-UNIT-TEST-TEMPLATE.md | Unit testing |
250
+ | CONVENTIONS-SYSTEM-TEST-TEMPLATE.md | System testing |
251
+ | CONVENTIONS-BUILD-TEMPLATE.md | Build/deployment |
252
+ | CONVENTIONS-DATA-TEMPLATE.md | Data layer |
995
253
 
996
254
  ## Checklist
997
255
 
@@ -999,49 +257,42 @@ Wherever possible, include concrete examples:
999
257
  - [ ] All configuration files read and parsed
1000
258
  - [ ] Technology stack extracted accurately
1001
259
  - [ ] Conventions analyzed from config files
1002
-
1003
- ### Document Generation Decision
1004
- - [ ] Platform type identified (web/mobile/backend/desktop/api)
260
+ - [ ] Platform type identified
1005
261
  - [ ] Data layer detection completed for non-backend platforms
1006
- - [ ] Decision made on whether to generate conventions-data.md
1007
- - [ ] Backend platform → Always generate
1008
- - [ ] Other platforms → Generate only if data layer detected
1009
262
 
1010
263
  ### Required Documents (All Platforms)
1011
- - [ ] INDEX.md generated with navigation
1012
- - [ ] tech-stack.md generated with dependency tables
1013
- - [ ] architecture.md generated with platform-specific patterns
1014
- - [ ] conventions-design.md generated with design principles
1015
- - [ ] conventions-dev.md generated with naming and style rules
1016
- - [ ] conventions-unit-test.md generated with unit testing requirements
1017
- - [ ] conventions-system-test.md generated with system testing requirements
1018
- - [ ] conventions-build.md generated with build and deployment conventions
264
+ - [ ] INDEX.md, tech-stack.md, architecture.md
265
+ - [ ] conventions-design.md, conventions-dev.md
266
+ - [ ] conventions-unit-test.md, conventions-system-test.md, conventions-build.md
1019
267
 
1020
268
  ### Optional Document
1021
- - [ ] conventions-data.md generated (only if applicable per platform type mapping)
1022
-
1023
- ### UI Style Analysis (Frontend Platforms - web/mobile/desktop)
1024
- - [ ] For web/mobile/desktop platforms: `speccrew-knowledge-techs-ui-analyze` skill invoked with correct parameters
1025
- - [ ] `ui-style/ui-style-guide.md` generated
1026
- - [ ] `ui-style/page-types/page-type-summary.md` generated
1027
- - [ ] `ui-style/page-types/[type]-pages.md` generated (one per discovered page type)
1028
- - [ ] `ui-style/components/component-library.md` generated
1029
- - [ ] `ui-style/components/common-components.md` generated
1030
- - [ ] `ui-style/components/business-components.md` generated
1031
- - [ ] `ui-style/layouts/page-layouts.md` generated
1032
- - [ ] `ui-style/layouts/navigation-patterns.md` generated
1033
- - [ ] `ui-style/styles/color-system.md` generated
1034
- - [ ] `ui-style/styles/typography.md` generated
1035
- - [ ] `ui-style/styles/spacing-system.md` generated
1036
- - [ ] UI conventions properly referenced in `conventions-design.md`
1037
-
1038
- ### Quality Checks
1039
- - [ ] All files written to output_path
1040
- - [ ] **Source traceability**: `<cite>` block added to each document
1041
- - [ ] **Source traceability**: Diagram Source annotations added after each Mermaid diagram
1042
- - [ ] **Source traceability**: Section Source annotations added at end of major sections
1043
- - [ ] **Mermaid compatibility**: No `style`, `direction`, `<br/>`, or nested subgraphs
1044
- - [ ] **Document completeness**: Verify all 8 required documents exist (INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md)
1045
- - [ ] **Analysis Coverage Report**: `{platform_id}.analysis.json` generated with all topics tracked
1046
- - [ ] Results reported with conventions-data.md and ui-style-guide.md generation status (including ui_style_analysis_level)
269
+ - [ ] conventions-data.md (if applicable)
270
+
271
+ ### UI Style Analysis (Frontend Platforms)
272
+ - [ ] ui-analyze skill invoked
273
+ - [ ] ui-style-guide.md generated
274
+ - [ ] UI conventions referenced in conventions-design.md
1047
275
 
276
+ ## Task Completion Report
277
+
278
+ Upon completion, output the following structured report:
279
+
280
+ ```json
281
+ {
282
+ "status": "success | partial | failed",
283
+ "skill": "speccrew-knowledge-techs-generate",
284
+ "output_files": [
285
+ "{output_path}/INDEX.md",
286
+ "{output_path}/tech-stack.md",
287
+ "{output_path}/architecture.md"
288
+ ],
289
+ "summary": "Tech documentation generated for {platform_id}",
290
+ "metrics": {
291
+ "documents_generated": 0,
292
+ "sections_filled": 0,
293
+ "code_examples_included": 0
294
+ },
295
+ "errors": [],
296
+ "next_steps": ["Run quality check via speccrew-knowledge-techs-generate-quality"]
297
+ }
298
+ ```